Notify By SMS Problem

Marco Supino Marco at praxell.com
Sat Apr 14 00:40:38 CEST 2007


This is from the smsclient FAQ

Question   I can't get smsclient to run from inside a script. (eg.
netsaint) 
Answer 
by default SMSClient uses stdout to display some information
(dialing...). Some apllications (eg. netsaint) don't want to know what a
script returns, and SMSClient sends it output into the great wide
open... This results in a Broken Pipe . You should call smsclient
without output, smsclient -q .


Hope it helps.

Marco.


-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Andre
Keller
Sent: Friday, April 13, 2007 21:50
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Notify By SMS Problem

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=DEVDE
V
_______________________________________________
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


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