<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>RE: [Nagios-users] Nagios not executing sms script</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>I would suggest you put the script in /usr/local/nagios/libexec.</FONT>
<BR><FONT SIZE=2>This is where I put my script ( I also wrote my own script</FONT>
<BR><FONT SIZE=2>to do the SMS-ing ).</FONT>
<BR><FONT SIZE=2>Nagios dopes not have permissions into the /root -DIR.</FONT>
</P>

<P><FONT SIZE=2>John</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: nagios-users-bounces@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:nagios-users-bounces@lists.sourceforge.net">mailto:nagios-users-bounces@lists.sourceforge.net</A>]On Behalf Of edalB</FONT>
<BR><FONT SIZE=2>Sent: 12 January 2007 10:53</FONT>
<BR><FONT SIZE=2>To: nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2>Subject: [Nagios-users] Nagios not executing sms script</FONT>
</P>
<BR>

<P><FONT SIZE=2>Hi all I have written my own sms script for notifications</FONT>
</P>

<P><FONT SIZE=2>The script works 100%</FONT>
</P>

<P><FONT SIZE=2>When I execute it manualy.</FONT>
<BR><FONT SIZE=2>But when I ask nagios to execute the script I get the following error</FONT>
<BR><FONT SIZE=2>in my log file.</FONT>
</P>

<P><FONT SIZE=2>Jan 11 17:09:06 nagios-0 nagios: Warning: Attempting to execute the</FONT>
<BR><FONT SIZE=2>command "/root/sms.rb -m "***** Nagios 2.6 *****\n\nNotification Type:</FONT>
<BR><FONT SIZE=2>RECOVERY\n\nService: HTTP\nHost: 196.23.28.207\nAddress:</FONT>
<BR><FONT SIZE=2>10.0.4.19\nState: OK\n\nDate/Time: Thu Jan 11 17:09:06 SAST</FONT>
<BR><FONT SIZE=2>2007\n\nAdditional Info:\n\nHTTP OK HTTP/1.1 200 OK - 235 bytes in</FONT>
<BR><FONT SIZE=2>0.002 seconds"" resulted in a return code of 126.  Make sure the</FONT>
<BR><FONT SIZE=2>script or binary you are trying to execute actually exists...</FONT>
</P>

<P><FONT SIZE=2>The script does exist.</FONT>
</P>

<P><FONT SIZE=2>nagios-0 ~ # ls -la /root/sms.rb</FONT>
<BR><FONT SIZE=2>-rwxrwxrwx  1 nobody nobody     750 Jan 11 16:52 sms.rb</FONT>
</P>

<P><FONT SIZE=2>This is how I also added the script into the commands.cfg file</FONT>
</P>

<P><FONT SIZE=2># 'notify-by-sms' command definition</FONT>
<BR><FONT SIZE=2>define command{</FONT>
<BR><FONT SIZE=2>        command_name    notify-by-sms</FONT>
<BR><FONT SIZE=2>        command_line    /root/sms.rb -m "***** Nagios 2.6</FONT>
<BR><FONT SIZE=2>*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:</FONT>
<BR><FONT SIZE=2>$SERVICEDESC</FONT>
<BR><FONT SIZE=2>$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:</FONT>
<BR><FONT SIZE=2>$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional</FONT>
<BR><FONT SIZE=2>Info:\n\n$SERVICEOUTP</FONT>
<BR><FONT SIZE=2>UT$"</FONT>
<BR><FONT SIZE=2>        }</FONT>
</P>

<P><FONT SIZE=2># 'notify-by-sms' command definition</FONT>
<BR><FONT SIZE=2>define command{</FONT>
<BR><FONT SIZE=2>        command_name    host-notify-by-sms</FONT>
<BR><FONT SIZE=2>        command_line    /usr/bin/sms.rb -m "***** Nagios 2.6</FONT>
<BR><FONT SIZE=2>*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost:</FONT>
<BR><FONT SIZE=2>$HOSTNAME$\nState</FONT>
<BR><FONT SIZE=2>: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:</FONT>
<BR><FONT SIZE=2>$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"</FONT>
<BR><FONT SIZE=2>       }</FONT>
</P>

<P><FONT SIZE=2>Thank you</FONT>
</P>

<P><FONT SIZE=2>-------------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2>Take Surveys. Earn Cash. Influence the Future of IT</FONT>
<BR><FONT SIZE=2>Join SourceForge.net's Techsay panel and you'll get the chance to share your</FONT>
<BR><FONT SIZE=2>opinions on IT & business topics through brief surveys - and earn cash</FONT>
<BR><FONT SIZE=2><A HREF="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV" TARGET="_blank">http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV</A></FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>Nagios-users mailing list</FONT>
<BR><FONT SIZE=2>Nagios-users@lists.sourceforge.net</FONT>
<BR><FONT SIZE=2><A HREF="https://lists.sourceforge.net/lists/listinfo/nagios-users" TARGET="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</A></FONT>
<BR><FONT SIZE=2>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. </FONT>
<BR><FONT SIZE=2>::: Messages without supporting info will risk being sent to /dev/null</FONT>
</P>

</BODY>
</HTML>