[Nagiosplug-devel] Help needed with simple BASH plugin - Nagiosgetting (null)
Bret Cason
Bret_Cason at symantec.com
Mon May 24 21:05:44 CEST 2010
Maybe the command definition isn't passing an $ARG1$ value.
The associated service command should say something like ".... -a
$ARG1$"
-----Original Message-----
From: Alan Johnson [mailto:aj at okesit.net]
Sent: Monday, May 24, 2010 11:27 AM
To: nagiosplug-devel at lists.sourceforge.net
Subject: [Nagiosplug-devel] Help needed with simple BASH plugin -
Nagiosgetting (null)
Hi everyone,
I am writing a plugin to be used internally to monitor the status of my
Amazon S3 backups.
Its very simple in that it telnets to a port on my backup server thats
backs up to S3, then either gets a 0,1 or 2 depending on exit code of
the S3 synchronisation. That part work perfectly.
The problem is the plugin on the Nagios box. If I run it from the
command line, I get everything as expected, plus the correct exit code.
When I run it in Nagios, I get (null) and thats it.
My Nagios plugin is:
#!/bin/bash
STATUS=`/bin/nc $1 65530`
if [ "$STATUS" = "0" ] ;
then
/bin/echo "OK: S3 synchronisation okay"
exit 0
fi
if [ "$STATUS" = "1" ] ;
then
/bin/echo "OK: S3 synchronisation currently running"
exit 1
fi
if [ "$STATUS" = "2" ] ;
then
/bin/echo "CRITICAL: S3 synchronisation failed"
exit 2
fi
Any ideas on what may be wrong? Haven't seen any solution on other
lists that help.
------------------------------------------------------------------------
------
_______________________________________________________
Nagios Plugin Development Mailing List
Nagiosplug-devel at lists.sourceforge.net
Unsubscribe at
https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Devel
mailing list