Sending notifications via SMS+mobile phone

Ilya Meylikhov rage_q3 at mail.ru
Fri Apr 25 13:48:29 CEST 2008



-----Original Message-----
From: Peter Edmonds [mailto:termx23 at gmail.com] 
Sent: Friday, March 14, 2008 3:20 PM
To: Meylikhov
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Sending notifications via SMS+mobile phone

> Can anyone assist me in solving the following task: I need nagios to send
> SMS via mobile phone connected to COM port.

I use gnokii. I have used a Telular GSM SX5D and currently use an
Easygate analog fixed cellular terminal (via serial port). Gnokii is
avaialble in Debian Etch and supports a lot of mobile phones. Check
http://wiki.gnokii.org/index.php/Config for a partial list of
supported phones. The atgen driver in gnokii supports lots of phones.

/etc/gnokiirc looks like this

[global]
port = /dev/ttyS0
model = AT
initlength = default
connection = serial
use_locking = yes
serial_baudrate = 19200
smsc_timeout = 10
[gnokiid]
bindir = /usr/sbin/
[connect_script]
TELEPHONE = 12345678
[disconnect_script]
[logging]
debug = on
rlpdebug = off
xdebug = off



Notify command for service notifications looks like this

echo -e
"<$HOSTNAME$>\n$SERVICEDESC$\n$SERVICESTATE$\n$SERVICEOUTPUT$\n$LONGDATETIME
$"
|gnokii --sendsms $CONTACTPAGER$ >>
/usr/local/groundwork/nagios/var/gnokii.log 2>&1

For host notifications this does the job

echo -e
"<$HOSTNAME$>\n$SERVICEDESC$\n$SERVICESTATE$\n$HOSTOUTPUT$\n$LONGDATETIME$"
|gnokii --sendsms $CONTACTPAGER$ >> /usr/local/nagios/var/gnokii.log
2>&1

Peter Edmonds


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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