Page 1 of 1

NRPE: Command 'check_snapshots' not defined

Posted: Fri Mar 23, 2012 2:48 am
by MWP
Hi all,

Ive written a check_snapshots nagios plugin bash script to check up on our rsnapshot backups.
The plugin is located on the backup server which is monitored from the nagios server via NRPE.

Running the plugin via check_nrpe works perfectly:
root@nagios:/etc/nagios3# /usr/lib/nagios/plugins/check_nrpe -H backup.us.com -c check_snapshots
SNAPSHOT STATUS: OK
For some reason the Nagios web interface reports an error though:
NRPE: Command 'check_snapshots' not defined
The Nagios conf.d/servers.cfg has the following, which seems to be correct:
define service {
use isp-service
host_name backup.us.com
service_description NRPE_SNAPSHOTS
check_command check_nrpe_1arg!check_snapshots
}
Anyone know whats going on here??

Thanks in advance!!

Re: NRPE: Command 'check_snapshots' not defined

Posted: Sat Mar 24, 2012 2:33 am
by MWP
Anyone??

I still cant work out what the problem is :(

Re: NRPE: Command 'check_snapshots' not defined

Posted: Mon Mar 26, 2012 8:17 pm
by jsmurphy
I had the same thing happen to me the other day but it was something really obvious and silly once I worked it out... I just can't remember what it was I did off the top of my head. can you post your command definition as well?

Re: NRPE: Command 'check_snapshots' not defined

Posted: Mon Mar 26, 2012 8:52 pm
by MWP
I have two identical backup (backup1 and backup2) servers to monitor, so i copied the *exact same* NRPE configs across to the backup2 server.
Its works perfectly.

So for some weird reason its working on backup2 but not backup1.
NRPE works for other plugins on backup1, just not my check_snapshots script.

Re: NRPE: Command 'check_snapshots' not defined

Posted: Tue Mar 27, 2012 9:50 am
by scottwilkerson
The error you are getting is that the nrpe.cfg or the files that it includes doesn't have your
command[check_snapshots]=
defined.

This could be for several reasons, check the config and make sure you see the line that starts like above. Make sure you restarted NRPE (or xinetd if running under that) after you copied the config.

Re: NRPE: Command 'check_snapshots' not defined

Posted: Tue Mar 27, 2012 10:15 pm
by jsmurphy
I would recommend turning on debug mode in the nrpe config and restart xinetd (assuming it's running as an inetd service)... run the check against the server and see if NRPE has anything to say in /var/log/messages. Assuming you didn't find anything after verifying as Scott described.