My own plugin isn't working


#1

I wrote my own plugin and placed it in the plugins directory on the server that will be using the plugin. Running it from the command line works. However, running check_nrpe to check the plugin yeilds the error: “CHECK_NRPE: No output returned from daemon.”

Here’s my service definition on the server that runs check_nrpe:

define service{ use all-services
   host_name                        server1
   service_description        TW
   check_command             check_nrpe!tw_check
   }

Here’s my command definition on the server in nrpe.cfg:

command[tw_check]=/usr/lib/nagios/plugins/tripwire.sh -D /var/lib/tripwire/report

Anyone have any ideas?


#2

Also, here are the version of nagios that I"m running.

Local host server (check_nrpe):
nagios-plugins-1.4-2.1.el3.rf
nagios-plugins-nrpe-2.0-3.rhel3.dag
nagios-2.0-0

Remote server (my plugin)
nagios-plugins-1.4-2
nagios-nrpe-2.0-3

Both servers are RHEL 3.0es


#3

Sounds like you didn’t follow the nrpe README file, to allow connections on the remote host. That’s why you get “no output”


#4

Sorry I didn’t specify earlier but yes, I did read the README file. I currently have the nrpe daemon running on the remote host and other plugins that came with nagios are working fine.
However, the plugin I wrote isn’t working and gives the error I gave above.


#5

Ahh,
Try running the command by hand when logged in as the user that runs nagios.


#6

Thanks! You pointed me in the right direction.
The problem was the nagios user didn’t have the correct permissions on the files that were accessed in the script.


#7

Who’s da man now!!! Hooah!!! Finally got one right.