Nagios not executing sms script

John Longland jlongland at grintek.com
Fri Jan 12 10:16:41 CET 2007


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

John

-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net]On Behalf Of edalB
Sent: 12 January 2007 10:53
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Nagios not executing sms script


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070112/5973d47e/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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