<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18783">
<STYLE></STYLE>
</HEAD>
<BODY 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> </DIV></FONT>
<DIV><FONT size=2>rgds</FONT></DIV>
<DIV><FONT size=2>Sriram</DIV></FONT></BODY></HTML>