[asterisk-users] Nagios Asterisk

Carlos Ruiz Diaz carlos.ruizdiaz at gmail.com
Wed Jun 17 13:53:49 CDT 2009


*FAILS= "UP"*
should be
*FAILS="UP"*

(without the space)

it is a syntax error and if you test the script in console you will notice
it immediately.


On Wed, Jun 17, 2009 at 2:34 PM, Sriram <d_r_sriram at hotmail.com> wrote:

>  Hi
> I am trying to implement monitoring of asterisk (all 4 spans-i want to show
> them line by line Up or down) using nagios using below script, but i always
> get the status as down and red..can anyone let me know how to read an output
> from nagios plugin ? nagios etc is configured already and is working
>
> PATH=/bin:/sbin:/usr/bin:/usr/sbin
> FAILS=""
> SPANS=$(asterisk -rnx "pri show span
> 1" | grep -a PRI | awk '{print $3;}' | cut -d"/" -f1)
>
>
>        STATUS=$(asterisk -rnx "pri show span 1" | grep -a Status | awk '{print $3;}' | cut -d, -f1)
>
>        if [ $STATUS == "Up" ]; then
>                FAILS= "UP"
>
>         else
>                 FAILS="Down"
>         fi
>
>        if [ $FAILS != "UP" ]; then
>                echo "ISDN Lines down"
>                 exit 2
>        fi
>
> echo "ISDN OK "
> exit 0
> If anyone can share the above script for asterisk monitoring then i wud be
> grateful
>
> rgds
> Sriram
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090617/f14bcc1f/attachment.htm 


More information about the asterisk-users mailing list