Custom perl plugin doesn't work

Zach La Celle lacelle at roboticresearch.com
Tue Dec 13 19:55:53 CET 2011


I'm not sure exactly what you mean.  On the monitor machine, there's 
only the blah.cfg file in '/etc/nagios-plugins/config/blah.cfg'.  I 
didn't even think that this was necessary, since it's really just 
running check_nrpe_1arg (which is defined in 
/etc/nagios-plugins/config/check_nrpe.cfg) and passing in the name of 
the command to the remote host.

On the remote host, it has the "blah" command defined in 
/etc/nagios/nrpe.cfg, as such:
command[blah]=/usr/lib/nagios/plugins/blah.pl

So, it should call check_nrpe on the monitoring host, which uses the 
nrpe-server to attempt to run the command through the remote host.  
Since the command is listed in nrpe.cfg on the remote host, it should 
see it there, run the actual perl script listed there, and return the 
output.

On 12/13/2011 12:53 PM, mail at catsnest.co.uk wrote:
>
>
>
> On Tue, Dec 13, 2011 at 4:46 PM, Zach La Celle 
> <lacelle at roboticresearch.com <mailto:lacelle at roboticresearch.com>> wrote:
>
>     The error, when I attempt to run it from the monitoring machine, is:
>     NRPE: Command 'blah' not defined
>
>     The command IS defined in /etc/nagios/nrpe.cfg on the target machine.
>     The command is ALSO defined in /etc/nagios-plugins/config/blah.cfg on
>     the target machine.
>
>
> Is '/etc/nagios-plugins/config/blah.cfg' linked in your Nrpe commands 
> config?
>
> Can you run the command via check_nrpe on the local (target) machine?
>
> Only time I saw a command not getting picked up by nrpe was when I had 
> started nrpe twice!
> and as such was only restarting the second one which had not bound to 
> the interface of course.
>
> Ritchie
>  --
> <-- http://23.me.uk/2 -->
> <--Time flies like an arrow; fruit flies like a banana.  -->
>
>     I restarted nagios-nrpe-server after adding the command.
>
>     I'm calling it from my monitoring server with
>     /usr/lib/nagios/plugins/check_nrpe -H <hostaddress> -c blah
>
>     When I run the perl script myself, it works fine.
>
>     Any ideas?  All of my other checks for this host work.
>
>     ------------------------------------------------------------------------------
>     Systems Optimization Self Assessment
>     Improve efficiency and utilization of IT resources. Drive out cost and
>     improve service delivery. Take 5 minutes to use this Systems
>     Optimization
>     Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
>     _______________________________________________
>     Nagios-users mailing list
>     Nagios-users at lists.sourceforge.net
>     <mailto:Nagios-users at lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/nagios-users
>     ::: Please include Nagios version, plugin version (-v) and OS when
>     reporting any issue.
>     ::: Messages without supporting info will risk being sent to /dev/null
>
>
>
>
> ------------------------------------------------------------------------------
> Systems Optimization Self Assessment
> Improve efficiency and utilization of IT resources. Drive out cost and
> improve service delivery. Take 5 minutes to use this Systems Optimization
> Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
>
>
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111213/d2f0c718/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list