Setting status of returned plugin output
Wood, Thomas H. (UNIX)
ThomasH.Wood at zcsterling.com
Mon Jul 12 22:11:54 CEST 2004
Ok, so I wrote myself a little wrapper for the process I was trying to
check just to see how it would work. I've been calling this via
check_by_ssh and it works about half the time. The rest of the time
Nagios reads it as unknown (even though it's returning exit 0) and trips
status unknown.
Here's the code. Please no flaming; this isn't production quality. The
only difference I've seen between when Nagios reads the status code and
doesn't is that it picks up the status ok first time. Whenever it
reports status unknown the service reports 3/3 tries. Also, I've been
watching the actual process all day in another window. It really is
running :)
Any comments or thoughts on this interesting problem would be
appreciated.
Thomas Wood
process_to_check="/usr/openv/netbackup/bin/bprd"
output=`/usr/bin/ps -ef | /usr/bin/grep $process_to_check |
/usr/bin/grep -v grep | /usr/bin/cut -f28 -d ' '`
if [ $output == $process_to_check ]; then
echo "Ok: BPRD found."
exit 0;
else
echo "BPRD NOT FOUND!"
exit 3;
fi
-----Original Message-----
From: Marc Powell [mailto:marc at ena.com]
Sent: Friday, July 09, 2004 2:04 PM
To: Wood, Thomas H. (UNIX); nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Setting status of returned plugin output
You'll need to create a wrapper for bssp.
http://nagiosplug.sourceforge.net/developer-guidelines.html
--
Marc
________________________________
From: Wood, Thomas H. (UNIX) [mailto:ThomasH.Wood at zcsterling.com]
Sent: Friday, July 09, 2004 12:23 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Setting status of returned plugin output
I've been looking through the nagios and nagios plugin doc trying to
determine how to configure nagios such that output returned by a plugin
is good. Here's the rub:
I'm trying to determine whether a process on a remote Solaris box is
running. I haven't messed around with nrpe on that system yet and have
access already in place via key exchange. So I use check_by_ssh to
connect and run bssp -a | grep bprd (it's a netbackup thing). If I get
back something like "root 2676 1 0 Jul 07 ? 0:03
/usr/openv/netbackup/bin/bprd" then I know the process is running and my
backups won't fail. Right now Nagios flags that as unknown status and
clutters up my pristine tactical view with a flag. So how do I get
Nagios to recognize this an OK state?
Thanks
Thomas Wood
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
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