Populate free variables
Populate free variables
Is it possible for a check to populate a hosts free variables? i.e a check pull back the latest software version for instance and populate the hosts free variable for the software version.
Re: Populate free variables
Not exactly. One way to do that sort of thing would be to leverage the back-end API of Nagios XI. Documentation regarding usage of the back-end API can be found in the "Help" section of your Nagios XI installation.
The gist of the API calls in script form might look like:
The gist of the API calls in script form might look like:
- Get the current host object you want to check the software version of
- Delete it (because updates aren't implemented yet, we start fresh using the previously grabbed copy)
- Get the software version from whatever remote system
- Add it to your host object, maybe under something like _softwareversion
- Re-create the host
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/