<font size="2"><span style="font-family: monospace;"><b>FAILS= "UP"</b><br>should be<br></span></font><b><font size="2"><span style="font-family: monospace;">FAILS="UP"</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"><<a href="mailto:d_r_sriram@hotmail.com">d_r_sriram@hotmail.com</a>></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="" </span><br><span style="font-family: monospace;">SPANS=$(asterisk -rnx "pri show span
1" | grep -a PRI | awk '{print $3;}' | cut -d"/" -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 "pri show span 1" | grep -a Status | awk '{print $3;}' | cut -d, -f1)
</span><br><span style="font-family: monospace;"> if [
$STATUS == "Up" ]; then </span><br><span style="font-family: monospace;"> FAILS= "UP" </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="Down"</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 != "UP" ]; then </span><br><span style="font-family: monospace;"> echo
"ISDN Lines down"</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 "ISDN OK " </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>