Scripting host config updates using CMDB CI Parent Info
Posted: Thu Apr 21, 2016 6:05 pm
Hello. I have searched the forum and Nagios documentation and I haven''t found an explanation for how to update host configuration information. If it is already covered, please point out the topic or docs.
We are running Nagios XI 5.2.7 on Red Hat Enterprise 6.7; Gnome is not installed; PHP 5.3.3; No Proxy; API v1;
We want to leverage Nagios XI's ability to suppress downstream/sympathetic (I think you call them upstream) alerts using the "parents" feature. Our parent/child relationship information is in our CMDB. We want to insert the parents directive into the host configuration for each CI managed with Nagios.
Are there recommendations that are consistent with Nagios XI's internal processing methods? Looking at the API, it appears that we should iterate with:
Or can we do the updates in the nagios MySQL database?
There are tables in the nagios database instance in the MySQL database that appear to contain variables/fields that would hold that information. Does Nagios XI process host information from the MySQL data or does it use the host config files in ../nagios/etc/hosts? Why do both of them exist?
Thanks!
Alan
We are running Nagios XI 5.2.7 on Red Hat Enterprise 6.7; Gnome is not installed; PHP 5.3.3; No Proxy; API v1;
We want to leverage Nagios XI's ability to suppress downstream/sympathetic (I think you call them upstream) alerts using the "parents" feature. Our parent/child relationship information is in our CMDB. We want to insert the parents directive into the host configuration for each CI managed with Nagios.
Are there recommendations that are consistent with Nagios XI's internal processing methods? Looking at the API, it appears that we should iterate with:
- GET the host config (back it up)
DELETE the host config
POST the updated host config
clean up
Or can we do the updates in the nagios MySQL database?
There are tables in the nagios database instance in the MySQL database that appear to contain variables/fields that would hold that information. Does Nagios XI process host information from the MySQL data or does it use the host config files in ../nagios/etc/hosts? Why do both of them exist?
Thanks!
Alan