Script for sms notification

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Lewis
Posts: 1
Joined: Thu Sep 15, 2011 4:13 am

Script for sms notification

Post 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....
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Script for sms notification

Post 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"
Locked