Page 1 of 1
Auto Register a server running nrpe
Posted: Mon Oct 13, 2014 12:52 pm
by aschiefe
The best way that I have seen to auto register a server is to drop a valid configuration into the import directory & run nagios_reconfigure.sh. Is this the correct way to do it or is there a better way to do this possibly through an api or any other automated fashion? Any help is appreciated.
Re: Auto Register a server running nrpe
Posted: Mon Oct 13, 2014 2:18 pm
by lmiltchev
If you need to scan for new hosts, you could just run the Auto-Discovery Wizard in Nagios XI. If your goal is to manage hosts/services from the CLI, you could following the steps, outlined in our "Automated Host Management" document.
http://assets.nagios.com/downloads/nagi ... gement.pdf
This this is not what you want to do, could you please, explain in more details? I am not sure what" nrpe" has to do with the host management in XI...
Re: Auto Register a server running nrpe
Posted: Mon Oct 13, 2014 2:30 pm
by aschiefe
Thanks for the response, the particular situation we're trying to solve is ephemeral hosts coming up on a software defined network that can reach the nagios server but the nagios server cannot reach, which means that auto discovery, unless we can have a satellite node inside of the software defined network that can proxy connections back to the main server, will not work for us.
The hack that we've done is to setup a small web service that sits on the nagios host, which creates a .cfg file, puts it into the import directory and runs the reconfigure_nagios. This causes a nagios restart (something that I was hoping to avoid) and as we can't determine when these hosts are going to register or delete themselves we're looking for a 100% end to end automated way to do this. I'm not sure if that's any clearer or not but that is our goal.
Re: Auto Register a server running nrpe
Posted: Tue Oct 14, 2014 5:15 pm
by sreinhardt
You're in a pretty tricky situation with this one, but most of it should be possible. The web server and reconfigure is not a bad way to go, but as you found is less than ideal with the restarting of core. You might try issuing a reload instead. It should repoll your configs and keep monitoring. Otherwise have you considered using passive checks or something like snmp traps and nsti?
Re: Auto Register a server running nrpe
Posted: Thu Oct 23, 2014 1:41 pm
by aschiefe
Thanks we're working now with NSCA and are attempting NRDS now
Re: Auto Register a server running nrpe
Posted: Thu Oct 23, 2014 1:54 pm
by slansing
Well, let us know if you have questions/run into issues with them!