Page 1 of 1

Script for sms notification

Posted: Thu Sep 15, 2011 4:18 am
by Lewis
hello all,

i have a shell script which takes two arguments, the mobile phone number and the text message, which sends sms notifications.
for example /usr/local/bin/sendsms 6944444444 "host problem"

when i debug Nagios, i can see this into the log file

[1316012199.774170] [256.1] [pid=17625] Running command '/usr/lib/nagios/plugins/sendsms 6944420xxx "Type:PROBLEM, Host: 00-dummy_2, State: DOWN, Address: 194.145.127.44, Info: Unknown ping number, Date/Time: 14-09-2011"'...
but script is not run...

when i run it from a terminal the command
/usr/lib/nagios/plugins/sendsms 6944420xxx "Type:PROBLEM, Host: 00-dummy_2, State: DOWN, Address: 194.145.127.44, Info: Unknown ping number, Date/Time: 14-09-2011"
sms message arrives normally....

Re: Script for sms notification

Posted: Wed Sep 21, 2011 11:52 am
by agriffin
Does the script require root permissions? Try running the command from a terminal as the nagios user:

Code: Select all

# su nagios
$ /usr/lib/nagios/plugins/sendsms 6944420xxx "Type:PROBLEM, Host: 00-dummy_2, State: DOWN, Address: 194.145.127.44, Info: Unknown ping number, Date/Time: 14-09-2011"