<div dir="ltr"><div><div>Hello Everyone,<br><br></div>I have write a script following script for nagios </div><br clear="all"><div><div><div><br>-- typeset -i CRITICAL;<br><br>#Positional parameter<br>CRITICAL=`echo $2`;<br>
ME=`basename $0`;<br>#echo $CRITICAL<br><br>if [[ "$2" == "" ]]<br>then<br>echo NO INPUT!!! Usage ./$ME -c N<br>else<br>typeset -i ASCALLS;<br>ASCALLS=`asterisk -rx "core show channels" | grep active | grep call | awk '{print $1}'`<br>
#echo $ASCALLS;<br>#mload=`echo "$ASCALLS" | $BC`;<br>#echo $((num+1))<br><br> if [[ "$ASCALLS" -lt "$CRITICAL" ]]<br> then<br> echo OK!!! Total Active Calls:$ASCALLS;<br>
exit 0<br> else<br> echo CRITICAL!!! Total Active Calls:$ASCALLS;<br> exit 2<br> fi<br>fi<br>Thanks<br><br><br></div><div>But following in not return int value <br><br>`asterisk -rx "core show channels" | grep active | grep call | awk '{print $1}'`<br>
<br></div><div>Please let me know if anyone help me in regard<br></div><div><br>Farooq Hussain
</div></div></div></div>