Auto Register host.cfg ore service cfg to Nagios XI
Posted: Tue Aug 03, 2010 3:48 pm
HI,
We want to implement a mechanism to register host.cfg to Nagios XI automatically without human interference as soon as server been built. This mechanism will be triggered after new server has been built, all the necessary plugins and nrpe are installed and config properly. Basically, the procedure we want to do is something like followings,
1) Receiving server info from server team
2) Verify if ip, host name,... valid
3) Verify if NRPE is up and running
4) parsing info from server team and create hostname.cfg
5) update Nagios XI database
However, we encounter difficulty in step 5). We found there are many tables have been updated after I manually add 1 new hosts thru Core Config Manager.
After introduce my situation, here are the questions.
a) How can accomplish 5) by using the existing php script from Nagios XI?
or b) How can mimic the "Import Config File" function from "Core Config Manager" in command mode?
or c) How many tables in database NagiosQL and NDOUtils need to be updated? and who are they?
Nagiosql: tbl_host tbl_lnkHostToContact tbl_lnkHostToHosttemplate tbl_lnkHostToVariabledefinition
tbl_logbook
NDOUtils: 14+ tables has been updated
Thanks
We want to implement a mechanism to register host.cfg to Nagios XI automatically without human interference as soon as server been built. This mechanism will be triggered after new server has been built, all the necessary plugins and nrpe are installed and config properly. Basically, the procedure we want to do is something like followings,
1) Receiving server info from server team
2) Verify if ip, host name,... valid
3) Verify if NRPE is up and running
4) parsing info from server team and create hostname.cfg
5) update Nagios XI database
However, we encounter difficulty in step 5). We found there are many tables have been updated after I manually add 1 new hosts thru Core Config Manager.
After introduce my situation, here are the questions.
a) How can accomplish 5) by using the existing php script from Nagios XI?
or b) How can mimic the "Import Config File" function from "Core Config Manager" in command mode?
or c) How many tables in database NagiosQL and NDOUtils need to be updated? and who are they?
Nagiosql: tbl_host tbl_lnkHostToContact tbl_lnkHostToHosttemplate tbl_lnkHostToVariabledefinition
tbl_logbook
NDOUtils: 14+ tables has been updated
Thanks