check_radius
Rabbie Zalaf
ZalafR at Leadingedgegroup.com.au
Mon Mar 8 06:13:14 CET 2004
Sorry guy's,
I just write crap code cause I'm not a programmer..
I just learn as I go. Thanks for the advice.
Rabbie.
-----Original Message-----
From: Stanley Hopcroft [mailto:Stanley.Hopcroft at IPAustralia.Gov.AU]
Sent: Monday, March 08, 2004 3:43 PM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] check_radius
Dear Ladies and Gentlemen,
I am writing to thank you for your letter and say,
On Sun, Mar 07, 2004 at 08:02:56PM -0800,
nagios-users-request at lists.sourceforge.net wrote:
>
> Nagios inspects the exit status of its commands.
> 0 ==> ok
> 1 ==> warn
> 2 ==> error (aka critical)
> 3 ==> unknown
>
> So change your script to:
> if [ $1 = OK ] ; then
> echo "OK"
> exit 0
> else
> echo "oops - no reply"
> exit 2
> fi
>
or source utils.sh (in the plugin-scripts dir of the plugins distro) so
that you can say
if [ $1 = $STATE_OK ] ; then
echo | printf "OK"
exit $STATE_OK
else
echo | printf foo
exit $STATE_CRITICAL
fi
The moral of the story is that the plugin developers want to maximise
reuse and minimise code duplication by factoring out common definitions
(common constants such as return code values; default timeouts etc) for
plugin authors to take advantage of (the Perl equivalent is utils.pm).
Anyone writing their own plugins should have a look at the source of the
standard plugins.
> Regards,
>
> Simon
>
Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------
'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea, Europe
is the less, as well as if a promontory were, as well as if a manor of thy
friend's or of thine own were. Any man's death diminishes me, because I am
involved in mankind; and therefore never send to know for whom the bell
tolls; it tolls for thee...'
from Meditation 17, J Donne.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo
technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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