Icinga Director and monitoring agents based on os, distro etc

Hi,

I have a director setup which I manage with Saltstack.
For my agents I’d like to set a variable for example vars.host.distro = “Debian” etc.
The simple question is, where do I define that on the agent so I can use it in an apply rule in Director?

Thanks!

hi,

you have to create a new custom var an assign them to your host template which you are using for your agents.

Thanks @stevie-sy for your time.

Would you mind elaborating that?
I think I need to create a Data Field, but how do I fill it via a configuration manager like Saltstack or Ansible?
I don’t want to go and do this by hand.

Or do you mean a separate Host Template called “Ubuntu” and assign this to hosts which have Ubuntu installed?

Let me know if I understand you correctly.

ok, you didn’t write that the information come from the SaltStack or better that informations what the salt minion knows about the server should be shipped to the director.

After you created the base with the data field for the custom var and assigned it to a template, you can pass the information through the cli (https://icinga.com/docs/icinga-director/latest/doc/60-CLI/) or the api (https://icinga.com/docs/icinga-director/latest/doc/70-REST-API/) from the director.

I never tried this with Salt. Maybe you have to write script where you

  1. catch the data from salt pillar and/or the salt grains
  2. process the data
  3. send the data to the directors cli/api.

Hi,

My apologies it’s still a bit unclear to me. Can I only assign variables to a host in Director via the API or Icingaweb?
Is it in any way possible to define this in the Agent on the client?

Thank you!

Hi,

as I wrote you send the information to the api to the director. You cound include this in the highstate process with the SaltStack.

Ah yeah, like that. I’ll give that a try, thank you very much!

1 Like