Fill DataField with command result


i want to fill a datafield with the result of a service.
To differentiate in host groups.

Thank you!

Best regards,

Use saved searches in navigation and dashboards for this.
IMHO, hostgroups are defined at config load and not at runtime.

Can you better describe your use case?

We have a couple of Linux servers which differnet operating systems.
So i made host groups to select them better.
To do this i wrote the OS in a datafield manual.

But i get the OS with a service too. So i thougt it would be better wenn the result of the service writes the OS in a datafield automaticly.

Thank you so much!

Do you use the director?

If so, you could use the common minimal set of host variables and checks for discovery. then use the director automation to enrich host variables with the discovered values.

In a ideal world you would use a “CMDB” to generate the config from so you wouldn’t need to build a snake that eats it’s own tail :wink:

Also a event handler on the service that checks for the OS, could set the variable immediately via REST-API but be careful as it would trigger a config reload.

Hi Dominik,

sorry i didn’t get a message that you answered.
That’s why I only read it now.

Thank you for your help.
With ower windows ad-servers (ldap) we use director automation. It works very well.

I’m thinking about something.

Best regards,

We also join our Linux servers to the AD, maybe you could too and then import all hosts from the same source?

I will try to solve it via the CMDB.
Thank you for your help!