Notify By SMS Problem

Andre Keller mluser at rbmail.ch
Fri Apr 13 20:50:06 CEST 2007


Hi Guys

I've got some problems to get my notification by sms working...

I'm using nagios 2.9 and smsclient 2.0.8z

when i execute the following command as user nagios (which the server 
runs under) the sms is being sent

/usr/bin/printf "%.150s" "$NOTIFICATIONTYPE$ 
$HOSTNAME$[$HOSTADDRESS$]/$SERVICESTATE$ /$SHORTDATETIME$/ 
$SERVICEOUTPUT$" | /usr/bin/sms_client *snip*myphone*snap*
the logfile (smbclient) entry for this command is

Apr 13 20:32:34 [1363] : Dialing SMSC 0794998990...
Apr 13 20:32:39 [1363] WARNING: read() Timeout
Apr 13 20:33:07 [1363] : Connection Established.
Apr 13 20:33:08 [1363] : SMSC Respsonse: 
<STX>01/00042/R/01/A/*snip*myphone*snap*:130407203306/10<ETX>
Apr 13 20:33:08 [1363] : Message accepted
Apr 13 20:33:08 [1363] : Hangup...
Apr 13 20:33:11 [1363] : swisscom Service Time: 37 Seconds
Apr 13 20:33:11 [1363] : [000] swisscom:*snip*myphone*snap* ""
Apr 13 20:33:11 [1362] : Total Elapsed Time: 37 Seconds



So i added the command to my configs

define command{
         command_name    notify-by-sms
         command_line    /usr/bin/printf "%.150s" "$NOTIFICATIONTYPE$ 
$HOSTNAME$[$HOSTADDRESS$]/$SERVICESTATE$ /$SHORTDATETIME$/ 
$SERVICEOUTPUT$" | /usr/bin/sms_client *snip*myphone*snap*
}

than i've shutdown a service so that a service check raises a 
notification...

In the nagios web interface notification the notification shows up:

Host     Service            Type     Time                Contact 
Notification Command  Information
server01 Network PHPMyAdmin CRITICAL 2007-04-13 19:32:58 nagios 
notify-by-sms         Connection refused

When i now check the log file only the following lines shows up

Apr 13 20:42:59 [1788] : Dialing SMSC 0794998990...
Apr 13 20:43:04 [1788] WARNING: read() Timeout

the modems is doing something and then unexpectedly disconnects...

If I send an sms with user nagios (sms_client number "hello") after this 
all work absolutly normal...


has anyone an idea whats causing this problem???



thank you

andre

PS: please excuse my english... i'm swiss ;)

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





More information about the Users mailing list