NRPE: Command 'check_snapshots' not defined

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
MWP
Posts: 3
Joined: Fri Mar 23, 2012 2:39 am

NRPE: Command 'check_snapshots' not defined

Post 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!!
MWP
Posts: 3
Joined: Fri Mar 23, 2012 2:39 am

Re: NRPE: Command 'check_snapshots' not defined

Post by MWP »

Anyone??

I still cant work out what the problem is :(
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: NRPE: Command 'check_snapshots' not defined

Post 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?
MWP
Posts: 3
Joined: Fri Mar 23, 2012 2:39 am

Re: NRPE: Command 'check_snapshots' not defined

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NRPE: Command 'check_snapshots' not defined

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: NRPE: Command 'check_snapshots' not defined

Post 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.
Locked