Sending notifications via SMS+mobile phone

Ilya Meylikhov rage_q3 at mail.ru
Wed Mar 26 19:24:47 CET 2008


Hello, Peter!
I've bought Siemens TC35i and installed gnokii but I am unable to send sms
using this setup.


srv-nagios:/home/rage# gnokii --sendsms +71111111
GNOKII Version 0.6.14
LOG: debug mask is 0x1
Lockfile /var/lock/LCK..ttyS0 is stale. Overriding it..
phone instance config:
model: AT
port_device: /dev/ttyS0
connection_type: 0
init_length: 0
serial_baudrate: 9600
serial_write_usleep: -1
hardware_handshake: 0
require_dcd: 0
smsc_timeout: 100
connect_script:
disconnect_script:
rfcomm_cn: 1
sm_retry: off
Initializing AT capable mobile phone ...
Serial device: opening device /dev/ttyS0
Serial device: setting RTS to high and DTR to high
Message sent: 0x00 / 0x0004
41 54 5a 0d                                     | ATZ
write: [ATZ<cr>]
Message sent: 0x00 / 0x0005
41 54 45 31 0d                                  | ATE1
write: [ATE1<cr>]
Message sent: 0x00 / 0x000a
41 54 2b 43 4d 45 45 3d 31 0d                   | AT+CMEE=1
write: [AT+CMEE=1<cr>]
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 4d 0d                         | AT+CGMM
write: [AT+CGMM<cr>]
Message sent: 0x06 / 0x0007
41 54 2b 47 4d 4d 0d                            | AT+GMM
write: [AT+GMM<cr>]
Initialization failed (11)
Telephone interface init failed: Command timed out.
Quitting.
Command timed out.

I've also tried it with /dev/ttyS1 and tried to set the number to 81111111
and got the same message. Can you please assist me in troubleshooting this
issue?

Thanks in advance
	Faithfully yours,
		      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


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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