Label existing host with label from CSV

Hello Forum,

I would like to create labels for existing hosts that describe the location in the data center. So something like “locate:RZ9-X-X-X”.
For this I have created a CSV file and use the Exchange tool “fileconnector” and “Dynamic host management”.

CSV file has this structure:

host;host_labels
hostxyz.network.local;locate:RZ9-X-X

It looks like “Dynamic host management” also detects the host in the File but the labels are not entered for the hosts? What am I doing wrong? Does it work like this at all?

Hi,
this is the perfect question for @gstolz

Karl

Hi,

You would not name the column host_labels but instead use the name of the label directly, in your case locate.

Please try this:

host;locate
hostxyz.network.local;RZ9-X-X

Please keep in mind that for using a different character then a comma you have to set the CSV delimiter to ; for proper line parsing.

Does this help you?

Cheers

Niko

Hello @okin
sorry i try it, but it does not work.

Hi,

you wrote that the host is already existing. Did you allow the fileconnector to overtake the host?

You can check by opening the host details and go to the bottom. At my test site it looks like this:
grafik

Important is that the locked by field references your site and the name of your dcd connection. If it does not mention this you will have to allow the fileconnector to take over hosts by editing your connection and then activate Take over existing hosts.
After that please save and re-run the connection.

If this does not help I’d suggest increasing the DCD log level (in WATO go to Setup → Dynamic configuration logging and set general messages to Debug) and then having a look at the log of your connection.
If you see a message like Host 'data19' already exists as an unrelated host it is an indicator that the host is currently not managed by the plugin and it will not attempt to alter it.

Please let me know if this helps you!

Cheers

Niko

@okin I am facing similar issue as mentioned above.I am trying to create a label ( not tag ) for the hostname at the time of csv import however dont seem to get it in the properties of the host and rather inherits the one at the folder level.

My goal ultimately is to add the custom information in the email , tried asking it in Custom attribute in notification email - #2 by atulchadha24

Also, is there a setting to allow overwriting the existing hosts. I am on version 2.0.11 CRE. Thanks in advance.

CSV Data

host;SERIAL
dummy_host;XYXYXYXYX

Hi,

When you edit your DCD connection make use of the setting Take over existing hosts in order to transfer the management to the DCD connection.
It will take over manually created hosts but not those managed by other connections to avoid problems with different connections updating the same host.

Please make sure the set the CSV delimiter to ; so that your CSV file is correctly parsed.

Cheers

Niko

Please excuse my lack of knowledge but i am not sure what DCD is, it this available in CRE edition ?

I double checked the delimiter, the import goes fine however the label doesnt appear.

Hi,
you are correct. There is no DCD in CRE, so if you install the file connector mkp in a CRE, I don’t think you will see anything of the functionality it adds. (I’m not aware of any way for an mkp developer to stop a CEE only mkp to be installed in a CRE instance).
So I’m afraid with CRE, you either need to write REST-API code yourself or try if you can get First Steps and Hands-on to the CMDB Syncer - YouTube to work (haven’t tested it, but @bkuhn said it would work with CRE :slight_smile:

Cheers,
Gerd

Yes, CMDB Syncer should work with the RAW Edition. And will even get a massive update the next days (at least from internal respective) which boosts the flexibility of his rules. The change (which is in testing) will enable to create a multiple level folder tree structure based on as many rules you want. Plan is to push that tomorrow.

Also, a native Source CSV Plugin will follow soon, since this was requested by one of my consumers. There needs just then to be a column hostname, and all other columns can be used as labels (which are base for the syncer rules) and therefore also can be shown in CMK. That would cover your initial request.

1 Like

Hello,
Have you any information of progress on this topic ?

Hi, yes this works for ages now :slight_smile:
https://cmdbsyncer.readthedocs.io/en/latest/csv/

Thanks but where does that checkmk plugin can be found?
(already tried on Checkmk Exchange )

That’s no plugin, it’s a standalone system which handels a kind of Checkmk Jobs (Groups, Rule, Host Management, Folders, Labels) based of a CMDB or JSON, CSV, MYSQL sources

Oh sorry, I didn’t’ correctly interpreted the “native Source CSV Plugin” description
Looks like that require many prerequisites.
I’ll check it out anyway.
Thanks

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.