Dynamic Host Creation


#1

I’m using nagios to monitor cable modem networks. Currently I just monitor the support equipment, but would like to begin monitoring the actual modems as well. The problem is that I don’t want to have to go into nagios and add a new host every time we add a new sub, especially since it is all stored in a db already. I could script it to add the host then restart nagios, but that seems like a kludge.

What I’d like to be able to do is have a host to represent the head of the cable network. On this host would be a service that would check the DB for current subs and report back that number. It would also fetch the IP of the modem and dynamically create or update a host definition in nagios. Since I retain state information, if I restarted nagios, nothing would be lost, and it’s not a big deal if it was, since running the plugin would update it again.

I didn’t see a way to do this through the command file. I’m assuming nagios works off of flat file databases. is there a way to manually edit those files?


#2

To my knowledge, nagios doesn’t really work that way. Hourly, have a perl script dump your DB of cable modems…into a ca ble_modem.cfg, then have the perl script check nagios… /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg have it watch for errors… if none, reload nagios… if errors… email you…

As far as I know, it’s your best bet right now.