Nagios not triggering one notification but another?

Schmitz, Carsten Carsten.Schmitz at aegon.com
Mon Jan 10 14:19:31 CET 2005


> What does the "Notifications" link in the menu tell you?

It says that "notify-by-sms-mdm" was indeed triggered.

But digging a bit more, I found two permission problems that were the cause of all this - the logfile for the SMS script was owned by my user and 755 (thats why I wouldn't see the log entries by the nagios user ID I was expecting), and nagios was not member of group UUCP (and /dev/ttyS0 was writable only to root and UUCP members therefore I didn't get the SMS). Stupid me :(

So I'm happy to say my problem is solved - many thanks for the input!


> Most (all?) GSM modems need a spooling mechanism since they usually 
> can't handle more than one message at the time.

True. Thats why I first looked at smsd (smstools-1.14.8.tar) but couldn't get it to work with my Wavecom M-1206B-ON modem (haven't spent much time though, still hoping). Currently I'm using gsmsendsms, a sample program for gsmlib-1.10.tar, which works just fine. I frankly don't know if it does any queue control, will have to find out and if its not suitable, I'll see if I can get smsd to work.

Thanks,

Carsten












-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se]
Sent: Monday, January 10, 2005 12:53 PM
To: Schmitz, Carsten
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] Nagios not triggering one notification but
another?


Schmitz, Carsten wrote:
> Hi fellow Nagios users,
> 
> I have a problem thats driving me insane - its probably a tiny thing
> I'm overlooking and maybe someone can point me into the right
> direction.
> 
> We have an installation of Nagios 1.2 monitoring ~30 servers and lots
> of services. I had setup SMS notification in the past via an
> email-to-sms provider and that worked fine.
> 
> Now we have purchased an GPRS modem to send our own SMS. I have a
> shell script that can send SMS, and I'm trying to get Nagios to
> trigger it. However, nothing happens. Therefore, I tried to simplify
> the setup for easy debugging, and it seems that one notification just
> isn't triggered while another one is.
> 
> This is my test setup (showing relevant excerpts from the config
> files below):
> 
> 
> services.cfg:
> 
> define service{ use                             generic-service
> ; Name of service template to use
> 
> host_name                       nemesis service_description
> Internal Diagnostics is_volatile                     0 check_period
> 24x7 max_check_attempts              1 normal_check_interval
> 1 retry_check_interval            1 contact_groups
> sms_test notification_interval           2400 notification_period
> 24x7 notification_options            c,r check_command
> diag }
> 
> 
> contactgroups.cfg:
> 
> define contactgroup{ contactgroup_name       sms_test alias
> SMS Test members                 sms_carsten }
> 
> 
> 
> contacts.cfg:
> 
> 
> define contact{ contact_name                    sms_carsten alias
> Carsten Schmitz - SMS MDM service_notification_period     24x7 
> host_notification_period        24x7 service_notification_options
> c,r host_notification_options       d,u,r 
> service_notification_commands   diag_out,notify-by-sms-mdm 
> host_notification_commands      host-notify-by-sms-mdm email
> devnull at mydomain.com pager
> my_cellular_number }
> 
> (note: my_cellular_number is of course a placeholder, it has my real
> numeric number in the actual file)
> 
> 
> misccommands.cfg:
> 
> define command{ command_name    notify-by-sms-mdm command_line
> /usr/local/nagios/libexec/alert_sms_mdm $CONTACTPAGER$
> "$SERVICEDESC$\n$HOSTNAME$ -
> $HOSTALIAS$\n$HOSTADDRESS$\n$SERVICESTATE$\n$OUTPUT$\n$DATETIME$" }
> 
> 
> define command{ command_name    diag_out command_line    echo
> $CONTACTPAGER$ "$SERVICEDESC$\n$HOSTNAME$ -
> $HOSTALIAS$\n$HOSTADDRESS$\n$SERVICESTATE$\n$OUTPUT$\n$DATETIME$" >
> /tmp/nagios_diag_out.out }
> 
> 
> "diag" is just a dummy script that exits with return code 0 or 1 at
> my liking, so that I can easily trigger a Nagios alert. It also
> writes a log file. "/usr/local/nagios/libexec/alert_sms_mdm" is the
> SMS script that also writes a log file. "diag_out" just writes a file
> in /tmp for seeing if Nagios triggers a notification, and for seeing
> what the output after variable expansion looks like.
> 
> I have "reloaded" nagios and the config check went just fine.
> 
> 
> What works:
> 
> I can see in the "diag" log file that the check itself is being
> triggered by nagios. I can see in /tmp/nagios_diag_out.out that the
> "diag_out" misccommand (first notification) has been run I can take
> the output from Nagios from the /tmp/nagios_diag_out.out file (same
> as the output for "notify-by-sms-mdm" would be) and pass it on the
> shell to the SMS script and I get an SMS (and a log file entry that
> notify-by-sms-mdm has been run).
> 
> What fails:
> 
> I do not receive an SMS (or a log file entry saying that it called
> notify-by-sms-mdm) when the Nagios alert is triggered.
> 

What does the "Notifications" link in the menu tell you?

> I'm sure this is not a bug but me overlooking a tiny detail somewhere
> ... if someone among the fellow Nagios using community spots the
> problem, I'd be very grateful for a hint.
>

Most (all?) GSM modems need a spooling mechanism since they usually 
can't handle more than one message at the time.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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