Gammu SMS Daemon writes Nagios text alerts to MYSQL but they dont get sent out to mobile!

Andrew Thompson andrew at fulgent.co.uk
Sun Jan 1 10:41:49 CET 2012


Hi all,

I know this is a Nagios support list but my question it more a Gammu, MYSQL and Nagios combination help that I am after.

Software:

Gammu 1.28
MYSQL Server
Ubuntu Desktop 11.04 32bit
Nokia 6021 via USB cable
Nagios 3.3.1



I have got everything working but 1 thing.

Nagios uses: /usr/bin/printf "***NAGIOS ALERT*** \n\n $NOTIFICATIONTYPE$\n\n$HOSTALIAS$ is $HOSTSTATE$" | /usr/bin/gammu-smsd-inject TEXT $CONTACTPAGER$
Nagios writes the text alerts to the Outbox table of the database as it should.

But that's where they stay; the daemon doesn't forward them out of the DB to the recipients phone!

If I change the command line a little and tell Nagios to use this:

/usr/bin/printf "***NAGIOS ALERT*** \n\n $NOTIFICATIONTYPE$\n\n$HOSTALIAS$ is $HOSTSTATE$" | /usr/bin/gammu --sendsms TEXT $CONTACTPAGER$
The phone sends any Nagios text alerts staright to the correct mobile phones so I know sending through the phone works fine.




These are my Gammu relevant setups


I have a smsd.conf file in /etc/init directory to try and keep the daemon alive

#smsd
#
#This service maintains the SMS Daemon from the point the system is started until it is shut down again

Description "SMSD DAEMON"

Start on runlevel [2345]
Stop on runlevel [016]

Respawn
Exec /usr/local/bin/smsd.sh


Script in
/usr/local/bin/smsd.sh

#! /bin/sh
Export LANG=en_US
/usr/bin/gammu-smsd MYSQL /etc/gammu-smsdrc






My gammu-smsdrc content:

[gammu]
Port = /dev/ttyUSB0
Connection = fbus
Model = 6021

[smsd]
Service = MYSQL
Commtimeout = 10
Sendtimeout = 30
Recievefrequency = 30
Deliveryreport = log
User = root
Password = xxxxxxxxxx
Pc = 127.0.0.1
Database = Nagios_Text




If I run

/sbin/initctl start smsd it replies with
smsd start/running, process XXXX

Then if straight away I run /sbin/initctl status smsd it replies with
smsd stop/waiting

Is this correct or is this the reason the messages never leave the DB?

Somebody offer me any assistance on getting those messages out the DB - im so close, yet so far!!

I need to present my boss with a full working Nagios setup to go live by Wed 4 Jan and I can nearly touch it.

Please help.

Thank you so much


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120101/f8a6d6b2/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
-------------- next part --------------
_______________________________________________
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