Hi everyone,
I’m monitor some Proxmox virtual machines with Icinga and I wish to add the information about the virtual machine ID and the node name which is serving it.
As these info can change I’m thinking about adding two services with a custom check script which get these info from the Proxmox API.
Anyway I would also like to have these info as host var in order to use them as search filter on hosts.
Is there any possibility to have the output of a check command ad host var?
If not, do you have any other ideas to achieve what I want? Maybe some custom Icingaweb2 plugin?
Not so frequently, but the change is not predictable and can happen in any moment.
It sounds like a job for the Director automation.
Unfortunately I’m not using the Director yet…
Yes I know, I really need to upgrade to Director, but unfortunately my custom Ansible roles do not support Director yet and this is a task I want to achieve during the current year…
I don’t want to reload config when that change, this is because I asked if it would be possible to have an host var which takes is value from the output of a service check.
you can use icinga api to add these variables to the host.
having a script that knows the icinga vm hosts, get information via proxmox api and write it directly to the icinga host via icinga api on a specified interval.
yes
these changes are stored in /var/lib/icinga2/modified-attributes.conf
It also survives a director redeploy so be careful with that.
Keep in mind that you need an api user (not icignaweb2 user) configurable in /etc/icinga2/conf.d/api-users.conf