Nagios + Gnokii -> SMS not being sent

adigei adi at nextlan.ro
Sat Nov 15 18:49:00 CET 2008


Hi,

i spent a week debugging this and ... i still can't see the light from the end 
of the tunnel :), so i'm posting here, hoping someone can see what i'm doing 
wrong.

Nagios works perfect at sending e-mail alerts, Gnokii also works perfect when i 
type the commands in the console.

So, i added in the file /usr/local/nagios/etc/objects/contacts.cfg    
for the contact 'admin':

service_notification_commands   notify-service-by-email,notify-service-by-sms
host_notification_commands      notify-host-by-email,notify-host-by-sms

in /usr/local/nagios/etc/objects/commands.cfg i have the following:

# 'notify-host-by-sms' command definition
define command{
        command_name    notify-host-by-sms
        command_line    /usr/bin/sms_gnokii
        }
# 'notify-service-by-sms' command definition
define command{
        command_name    notify-service-by-sms
        command_line    /usr/bin/sms_gnokii
        }

For the simplicity i use a simple script that sends a standard SMS
/usr/bin/sms_gnokii contains:

#!/bin/sh
#
# Gnokii Plugin script
# (c) Horst venzke
# v 0.1 - 17.01.2004

echo Alert |/usr/local/bin/gnokii --sendsms 07xxxxxxxx

If i run the script /usr/bin/sms_gnokii in the console i receive the SMS with 
the text "Alert". Theoratically, when something goes down, Nagios runs the 
command_line and i should receive the sample text SMS, right ? Well, i don't:(.

I looked in logs and found this:

nagios: HOST NOTIFICATION: Adi;Backup;CUSTOM (UP);notify-host-by-sms;PING OK - 
Packet loss = 0%, RTA = 0.31 ms;nagiosadmin;custom

nagios: HOST NOTIFICATION: Adi;Backup;CUSTOM (UP);notify-host-by-email;PING OK -
 Packet loss = 0%, RTA = 0.31 ms;nagiosadmin;custom


It looks like Nagios is doing his job, but i receive no SMS, only emails, 
anyone with an ideea please?

Adi.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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