<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 [[ &quot;$2&quot; == &quot;&quot; ]]<br>then<br>echo NO INPUT!!! Usage ./$ME -c N<br>else<br>typeset -i ASCALLS;<br>ASCALLS=`asterisk -rx &quot;core show channels&quot; | grep active | grep call | awk &#39;{print $1}&#39;`<br>
#echo $ASCALLS;<br>#mload=`echo &quot;$ASCALLS&quot; | $BC`;<br>#echo $((num+1))<br><br>        if [[ &quot;$ASCALLS&quot; -lt &quot;$CRITICAL&quot; ]]<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 &quot;core show channels&quot; | grep active | grep call | awk &#39;{print $1}&#39;`<br>
<br></div><div>Please let me know if anyone help me in regard<br></div><div><br>Farooq Hussain
</div></div></div></div>