Nagios not executing sms script

edalB edalb1979 at gmail.com
Fri Jan 12 09:52:40 CET 2007


Hi all I have written my own sms script for notifications

The script works 100%

When I execute it manualy.
But when I ask nagios to execute the script I get the following error
in my log file.

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

The script does exist.

nagios-0 ~ # ls -la /root/sms.rb
-rwxrwxrwx  1 nobody nobody     750 Jan 11 16:52 sms.rb

This is how I also added the script into the commands.cfg file

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

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

Thank you

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





More information about the Users mailing list