Page 1 of 1

Nagios NRPE

Posted: Wed Jul 18, 2012 11:06 am
by alceryes
I'm trying to get NRPE checks going but I'm running into difficulties. We have Nagios (on Ubuntu) up and running and checking servers just fine.
The steps I've followed so far -

Installed NRPE plugin (and dependencies) on our Nagios server
Modified NSC.ini in the NSClient++ directory on the target server, allowing the NRPEListener.dll, changed the allow arguments part under [NRPE], and added check_adhealth=C:\Program Files\NSClient++\scripts\Check_AD.exe to the [NRPE Client Handlers] section
Put the Check_AD.exe in the proper scripts folder
Added this to commands.cfg:
define command{
command_name check_nrpe
command_line /$USER1$/check_nrpe -n -H $HOSTADDRESS$ -c $ARG1$
}
Added this to windows.cfg
define service{
use generic-service
host_name <server name>
service_description Check AD Health
check_command check_nrpe!check_adhealth
}
Restarted nagios services and NSClient++ service on target server

Getting error "CHECK_NRPE: Error receiving data from daemon." in Nagios

...I'm not sure what else needs to be done as there is a plethora of different instructions on the WWW. Do I need to install an NRPE program on the windows server? Also is there a way to test whether NRPE is installed correctly on the Nagios server?

TIA!

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 11:11 am
by agriffin
Did you add your Nagios server's IP address to the allowed hosts in NSC.ini?

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 12:54 pm
by alceryes
Yes, the allowed hosts line is there.
We've had Nagios monitoring this server for a while now. It's just the check_adhealth NRPE part that isn't working.

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 2:09 pm
by slansing
Could you please show how you are entering the check into the Nagios terminal to test it?

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 2:11 pm
by agriffin
Did you define check_adhealth as an NRPE command on the remote host?

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 2:26 pm
by alceryes
slansing - I am not testing manually (not sure how). I have the check defined in the Nagios commands.cfg and am trying to check a server listed in the windows.cfg. Those two commands are in my original post. If you could tell me how to manually test that'd be great, thx!

agriffin - Are you referring to the check_adhealth=C:\Program Files\NSClient++\scripts\Check_AD.exe in the NSC.ini or the commands.cfg entry?


Thanks for your help guys!

Re: Nagios NRPE

Posted: Wed Jul 18, 2012 3:09 pm
by slansing
It seems as if the daemon is not connecting properly to Nagios. Under etc/xinetd.d/nrpe make sure that under USER, it is set as nagios

Code: Select all

user              =nagios
and that only_from is set to your Nagios server's IP

Code: Select all

only from       =your.nagios.ip.address
Assuming NSClient++ is set up properly on the Windows host's side, you can view log messages from the INSTALLDIRECTORY/nsclient.txt

Once here it is easy to see if the connection is being disrupted on the Windows side, or if it does not show up at all, the Nagios side.