I have written a custom nagios plugin which is returning a command not defined error. I have not yet placed the command in nrpe.cfg or defined the service, etc as this is controlled by puppet and any failure sends an sms to all the tech staff every 5 minutes.
I think I should be able to test it from the command line before doing so. Here is output from terminal on ubuntu 14.04 which illustrates my problem.
nagios@myserver:/usr/lib/nagios/plugins$ ./check_nrpe -H localhost -c check_users
USERS OK - 2 users currently logged in |users=2;5;5;0
nagios@myserver:/usr/lib/nagios/plugins$ ./check_nrpe -H localhost -c disk_usage.rb
NRPE: Command 'disk_usage.rb' not defined
nagios@myserver:/usr/lib/nagios/plugins$ ./disk_usage.rb
OK - '/backups' 84% of disk space used | '/'=37% '/tmp'=1% '/srv'=62% '/backups'=84%
For any custom NRPE command to work, you need to add an additional command definition for it in your local NRPE config (usually
/etc/nagios/nrpe_local.cfg
), like:Then restart NRPE and try again with: