<!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>Hi Steve</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks for all your help, i followed your answers
and found on that nagios was being run as user nagios....and if i executed the
last command it asked for a password [i tried nagios password,root password etc]
but it did not work..it the end i opened nagios.cfg and changed the NAGIOS_USER
to root and changed the ownership permissons on the script also to root..I now
get the correct status on the Nagios interface..</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>thanks for all your help - Sriram</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>) What PATH does the script have when run by the Nagios process?<BR><BR>)
Are there any permissions issues on the directories in the path to the
<BR>script?<BR><BR>Not having ever run Nagios, I'm shooting from the hip a bit.
I'm guessing <BR>these commands may shed some light:<BR><BR>) Get the username
running Nagios.<BR><BR>         ps -aef | grep --ignore-case nagios<BR><BR>) What
output do you get from a command like:<BR><BR>         cd /tmp/<BR>         sudo -u
<username-running-Nagios> <full-path-of-script><BR><BR></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message -----
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A
title=d_r_sriram@hotmail.com href="mailto:d_r_sriram@hotmail.com">Sriram</A>
</DIV>
<DIV><B>To:</B> <A title=asterisk-users@lists.digium.com
href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</A>
</DIV>
<DIV><B>Sent:</B> Friday, June 19, 2009 11:51 PM</DIV>
<DIV><B>Subject:</B> RE:Nagios under *</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT size=2 face=Arial>Hi Steve</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I tried your script :</FONT></DIV>
<DIV> </DIV>
<DIV> STATUS=$(sudo asterisk -rnx "pri
show span
1"\<BR>
| awk '/Status/ {print
$3}'\<BR>
)<BR><BR>
if [ "Up," == "${STATUS}"
]<BR> then
echo "PRI
UP"<BR>
exit 0<BR>
else echo "PRI
DOWN"<BR>
exit 2<BR> fi<BR><BR><FONT
size=2 face=Arial>but still i get PRI down in the Nagios web interface while if
i execute this command from command line i get PRI UP...i m really going
mad..did a clean install again but still same problem.. Iv;e also given
permission of 777 to the script and saved it under /usr/local/nagios and given
the same path in commands.cfg under objects folder of /usr/local/nagios/etc ...
can anyone please help me out ?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks Sriram</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2> </DIV></FONT></BODY></HTML>