check_radius

Simon Kitching simon at ecnetwork.co.nz
Mon Mar 8 04:18:08 CET 2004


On Mon, 2004-03-08 at 16:05, Rabbie Zalaf wrote:
> Hi All,
> 
> This is my first post so my appologies if I state anything stupid.
> 
> I wrote the following script and placed it into libexec.
> 
> #!/bin/bash
> PREFIX=/usr/bin
> 
> set `$PREFIX/radpwtst -trace 4 $USER1$/check_radius -s $1 -secret $2
> -noacct -auth_port $3 -user $4 -password $5 -called_station_id $6 |
> tail -1`
> 
> if [ $1 = OK ] ; then
>   echo "OK"
> else
>   echo "CRITICAL - No reply"
> fi

> My web interface in nagios shows a green light and says that
> everything is ok... even when the response is CRITICAL...
> 
> How do I make nagios alarm when the script returns a CRITICAL error?

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

Regards,

Simon



-------------------------------------------------------
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