<!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><FONT size=2 face=Arial></FONT> </DIV>
<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>PATH=/bin:/sbin:/usr/bin:/usr/sbin<BR>FAILS=""</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN style="FONT-FAMILY: monospace"><FONT
size=2> STATUS=$(asterisk -rnx "pri show
span 1" | grep -a Status | awk '{print $3;}' | cut -d,
-f1)<BR> if [ "${STATUS}" == "Up" ];
then<BR> echo "PRI
UP"<BR>
exit 0<BR> else<BR> echo
"PRI
DOWN"<BR>
exit 2<BR> fi</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN style="FONT-FAMILY: monospace"><FONT size=2>if i execute the script
from command line i get the correct output i.e OK for span 1 but on nagios web
interface i get it as down...</FONT></SPAN></DIV>
<DIV><FONT size=2></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>