[asterisk-users] Asterisk not return int value

Bakko asannucci at gmail.com
Sat Feb 16 07:17:47 CST 2013


Hello,

you can use SNMP Asterisk integration to monitoring  the actives calls 
(Total calls, SIP calls, IAX2 calls, DAHDI calls)

Regards


El 16/02/2013 08:04, Farooq Hussain escribió:
> Hello Everyone,
>
> I have write a script following script for nagios
>
>
> -- typeset -i CRITICAL;
>
> #Positional parameter
> CRITICAL=`echo $2`;
> ME=`basename $0`;
> #echo $CRITICAL
>
> if [[ "$2" == "" ]]
> then
> echo NO INPUT!!! Usage ./$ME -c N
> else
> typeset -i ASCALLS;
> ASCALLS=`asterisk -rx "core show channels" | grep active | grep call | 
> awk '{print $1}'`
> #echo $ASCALLS;
> #mload=`echo "$ASCALLS" | $BC`;
> #echo $((num+1))
>
>         if [[ "$ASCALLS" -lt "$CRITICAL" ]]
>         then
>         echo OK!!! Total Active Calls:$ASCALLS;
>         exit 0
>         else
>         echo CRITICAL!!! Total Active Calls:$ASCALLS;
>         exit 2
>         fi
> fi
> Thanks
>
>
> But following in not return int value
>
> `asterisk -rx "core show channels" | grep active | grep call | awk 
> '{print $1}'`
>
> Please let me know if anyone help me in regard
>
> Farooq Hussain
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                 http://www.asterisk.org/hello
>
> 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/20130216/a62d1aa6/attachment.htm>


More information about the asterisk-users mailing list