Auto Register a server running nrpe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
aschiefe
Posts: 5
Joined: Mon Oct 13, 2014 12:40 pm

Auto Register a server running nrpe

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Auto Register a server running nrpe

Post 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...
Be sure to check out our Knowledgebase for helpful articles and solutions!
aschiefe
Posts: 5
Joined: Mon Oct 13, 2014 12:40 pm

Re: Auto Register a server running nrpe

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Auto Register a server running nrpe

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
aschiefe
Posts: 5
Joined: Mon Oct 13, 2014 12:40 pm

Re: Auto Register a server running nrpe

Post by aschiefe »

Thanks we're working now with NSCA and are attempting NRDS now
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Auto Register a server running nrpe

Post by slansing »

Well, let us know if you have questions/run into issues with them!
Locked