running an external script for sms notification

Jim Avery jim at jimavery.me.uk
Thu Sep 15 18:24:41 CEST 2011


On 15 September 2011 10:35, Metron 6 (six) <metron6 at gmail.com> wrote:
> 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 ?

Looks ok to me.  Am I right in assuming that when Nagios runs the
command you receive no SMS at all?  Or do you receive something but in
the wrong format?

When you run the command from the command-line, are you logged in as
'nagios'?  If not it could be a simple permissions problem.

------------------------------------------------------------------------------
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