running an external script for sms notification

Metron 6 (six) metron6 at gmail.com
Thu Sep 15 11:35:47 CEST 2011


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"'...

when i run 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....

this is how i include the command into nagios conf files..

define command{
       command_name                    host-notify-by-sms
       command_line                    /usr/lib/nagios/plugins/sendsms
$CONTACTPAGER$ "Type:$NOTIFICATIONTYPE$, Host: $HOSTNAME$, State:
$HOSTSTATE$, Address: $HOSTADDRESS$, Info: $HOSTOUTPUT$, Date/Time:
$DATE$"
}

any help/suggestions ?

-- 

regards,
Metron 6 (six)

Metron6 at gmail.com

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
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