Sending notifications via SMS+mobile phone
Ilya Meylikhov
rage_q3 at mail.ru
Fri Apr 25 14:15:49 CEST 2008
Hello! Could anyone please assist me in troubleshooting the following task:
I've bought a TC-35i GSM modem and connect it to my linux Debian box.
Everything works fine and I can successfully send sms using the following
command:
echo "some test text" | gnokii --sendsms myNumber
The problem is that nagios can't send sms using gnokii and I can't figure
out why Peter's script (I add it to my message in the bottom) won't work for
me.
The command for nagios is:
define command{
command_name notify-service-by-email
command_line echo -e
"<$HOSTNAME$>\n$SERVICEDESC$\n$SERVICESTATE$\n$SERVICEOUTPUT$\n$LONGDATETIME
$" |gnokii --sendsms $CONTACTPAGER$ >> /usr/local/nagios/var/gnokii.log 2>&1
}
I got the following message in /usr/local/nagios/var/nagios.log:
[1209125514] SERVICE ALERT: vector;Check SMTP;CRITICAL;SOFT;1;Connection
refused
[1209125574] SERVICE ALERT: vector;Check SMTP;CRITICAL;SOFT;2;Connection
refused
[1209125634] SERVICE ALERT: vector;Check SMTP;CRITICAL;HARD;3;Connection
refused
[1209125634] SERVICE NOTIFICATION: nagiosadmin;vector;Check
SMTP;CRITICAL;notify-service-by-email;Connection refused
Thanks in advance,
Ilya.
-----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