nrpe custom command problems

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Tue Dec 17 22:29:58 CET 2002


What user do you normally run nrpe from?  When you tested the plugin, did
you test it under that user?  Can you kick off your command from your Nagios
server using check_by_ssh?  (You'll need to set up a null passphrase in
order for this to work.)

What's the plugin written in?  If it's a /bin/bash script, try changing that
to /bin/sh .

Will the plugin run if invoked using 'at' or 'cron'?

Food for thought.

jc

> -----Original Message-----
> From: Jeff McKeon [mailto:jsm at inpro.net]
> Sent: Tuesday, December 17, 2002 11:54 AM
> To: Nagios List
> Subject: [Nagios-users] nrpe custom command problems
> 
> 
> Hey all,
> 
> I've written a plugin for nrpe to check the records in a 
> database table
> and then report warning or critical based on how many records are
> returned.  The table is basically a mailserver pending message queue. 
> The plugin, check_msgcount works fine if invoked by itself.  However
> when I try to run it with check_nrpe localhost -c check_msgcount it
> crashes out..  any ideas why?
> 
> nrpe is working fine with the standard plugins, check_disk etc...
> Also, I did restart xinetd after adding the command line to the
> nrpe.cfg.
> 
> *******************
> 
> nrpe.cfg file:
> 
> command[check_pendingmail]=/usr/local/nagios/libexec/check_msgcount
> 
> ******************
> 
> if I run /usr/local/nagios/libexec/check_msgcount by itself 
> it all runs
> fine.  
> 
> If I run /usr/local/nagios/libexec//check_nrpe localhost -c
> check_pendingmail as in below, the following happens...
> 
> [root at db02tc07927 libexec]# ./check_nrpe localhost -c 
> check_pendingmail
> s/libexec/check_msgcount: mysql: command not found
> /usr/local/nagios/libexec/check_msgcount: [: -ge: unary operator
> expected
> /usr/local/nagios/libexec/check_msgcount: [: -ge: unary operator
> expected
> 
> 
> the check_msgcount file is this:
> 
> ******************************************************************
> 
> #! /bin/sh
> mysql telaurus -u nagios < /usr/local/nagios/libexec/messages.sql >
> /usr/local/nagios/libexec/msg_count
> 
> numqueued=`grep -v COUNT /usr/local/nagios/libexec/msg_count`
> 
> if [    $numqueued -ge 2 ]; then
>         echo "CRITICAL: $numqueued waiting messages in seaCOMM"
>         exit 2;
> fi
> 
> if [    $numqueued -ge 10 ]; then
>         echo "WARNING: $numqueued waiting messages in seaCOMM"
>         exit 1;
> fi
> 
> echo "OK: $numqueued waiting messages in seaCOMM"
> exit 0;
> 
> *********************************************************
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility 
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/




More information about the Users mailing list