<font size="2"><span style="font-family: monospace;"><b>FAILS= &quot;UP&quot;</b><br>should be<br></span></font><b><font size="2"><span style="font-family: monospace;">FAILS=&quot;UP&quot;</span></font></b><br><br>(without the space)<br>
<br>it is a syntax error and if you test the script in console you will notice it immediately.<br><font size="2"><span style="font-family: monospace;"><br></span></font><br><div class="gmail_quote">On Wed, Jun 17, 2009 at 2:34 PM, Sriram <span dir="ltr">&lt;<a href="mailto:d_r_sriram@hotmail.com">d_r_sriram@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">





<div bgcolor="#ffffff">
<div><span style="font-family: monospace;"><font size="2">Hi </font></span></div>
<div><span style="font-family: monospace;"><font size="2">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 </font></span></div>
<div><span style="font-family: monospace;"><font size="2"></font></span> </div>
<div><font size="2"><span style="font-family: monospace;">PATH=/bin:/sbin:/usr/bin:/usr/sbin 
</span><br><span style="font-family: monospace;">FAILS=&quot;&quot; </span><br><span style="font-family: monospace;">SPANS=$(asterisk -rnx &quot;pri show span 
1&quot; | grep -a PRI | awk &#39;{print $3;}&#39; | cut -d&quot;/&quot; -f1) </span><br><span style="font-family: monospace;"></span><br><span style="font-family: monospace;"> </span><br><span style="font-family: monospace;">       STATUS=$(asterisk -rnx &quot;pri show span 1&quot; | grep -a Status | awk &#39;{print $3;}&#39; | cut -d, -f1) 
</span><br><span style="font-family: monospace;">       if [ 
$STATUS == &quot;Up&quot; ]; then </span><br><span style="font-family: monospace;">               FAILS= &quot;UP&quot; </span><br><span style="font-family: monospace;">       </span></font></div>
<div><span style="font-family: monospace;"><font size="2">    
    else</font></span></div>
<div><span style="font-family: monospace;"><font size="2">    
            
FAILS=&quot;Down&quot;</font></span></div>
<div><font size="2"><span style="font-family: monospace;">    
    fi </span><br><span style="font-family: monospace;"></span><br><span style="font-family: monospace;">       if [ 
$FAILS != &quot;UP&quot; ]; then </span><br><span style="font-family: monospace;">               echo 
&quot;ISDN Lines down&quot;</span></font></div>
<div><font size="2"><span style="font-family: monospace;">    
            exit 
2 </span><br><span style="font-family: monospace;">       fi 
</span><br><br><span style="font-family: monospace;">echo &quot;ISDN OK &quot; </span><br><span style="font-family: monospace;">exit 0 </span><br></font></div>
<div><font size="2">If anyone can share the above script for asterisk monitoring 
then i wud be grateful</font></div>
<div><font size="2"><font face="Arial"></font> </font></div>
<div><font size="2">rgds</font></div>
<div><font size="2">Sriram</font></div></div>
<br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>