Notification error on nagios 1.2 when sending sms

Michael Huettig Michael.Huettig at Medien-Systempartner.de
Fri Jun 4 14:40:09 CEST 2004



**********************************************************************
Diese E-Mail wurde auf Viren ueberprueft.
www.mimesweeper.com
**********************************************************************
-------------- next part --------------
Hi everybody,
yesterday i send this question to list, but i think, itś not the right time, 
so here is my question again ...

i have found a notification error on nagios 1.2, when sending sms to 
cell-phones on a service-escalation.
Please have a little bit time to read my explanation:

We have some groups with three members and some groups with only one member, 
host-escalation works fine to all the groups, which have only one member. 
The first group net-admins-sms has an error in notification, sometimes all 
users get sms, 
but mostly only two users get sms, sometimes user_a and user_c, sometimes 
user_b and user_c, 
the 3rd user doesn't get any sms. Restarting nagios1.2 and the nagios-server 
doesn't resolve the problem

In nagios.log i see, that every user is notified by email and sms. 
Sms-application yaps-server doesn't receive notifications from nagios for all 
contacts. 

SMS-App is yaps-0.93 which get nagios-notification via a pipe to serialize the 
parallel outgoing mails. 
It reads the pipe while its not empty and put the notification to a single 
command to yaps. This works fine!

To verify this problem i installed nagios-test-machine and set one unique 
cell-phone-number 
for all contacts and started a test which works properly. 
Nagios-Production and Nagios-Test have the same software-environment (SUSE8.1, 
yaps-0.93, nagios-1.2).
Nagios-Production monitors 320 hosts with 1040 services, Nagios-Test monitors 
50 hosts with 240 services. 
nagios.cfg is fine-tuned (max_concurrent_checks=65).

Could anyone understand my problem and give me a hint, to debug and resolve 
the problem???
If you have any further question, please contact me.

With best regards
Michael

Config-snippets:
================
define contactgroup{
        contactgroup_name       net-admins-sms
        alias                           Netz-Admins SMS
        members                 user_a-sms, user_b-sms, user_c-sms
        }

define contactgroup{
        contactgroup_name       operating-sms
        alias                           Operating SMS
        members                 operating-sms
        }

define contactgroup{
        contactgroup_name       chief-sms
        alias                           The Chief SMS
        members                 chief-sms
        }

example for all contacts:
define contact{
        contact_name                            user_a-sms
        alias                                           Michael Huettig
        service_notification_period     8-23
        host_notification_period                8-23
        service_notification_options    c,r
        host_notification_options               d,u,r
        service_notification_commands   notify-by-email, notify-by-sms
        host_notification_commands      host-notify-by-email, 
host-notify-by-sms
        email                                   Michael.Huettig at Medien-Systempartner.de
        pager                                   017xxxxxxxx
        }

# Hostgroup 'switches' escalation definition
define hostgroupescalation{
        hostgroup_name          Switche
        first_notification                      3
        last_notification                       0
        contact_groups                  net-admins-sms, operating-sms, 
chief-sms
        notification_interval           15
        }

# 'host-notify-by-sms' command definition
define command{
        command_name    host-notify-by-sms
        command_line    echo "$CONTACTPAGER$" 
"\"$NOTIFICATIONTYPE$:  $HOSTNAME$ ist $HOSTSTATE$ ($OUTPUT$) 
$NOTIFICATIONNUMBER$ .te Benachrichtigung: Datum: $DATETIME$\"" 
> /usr/local/nagios/var/rw/yaps.cmd
        }

The yaps-server:
# Filename:
# ===========
# yaps-server
#
# Beschreibung / Description
# ==========================
#
# liest aus einer Pipe und sendet den
# gelesenen String per SMS
# Dieser Umweg ist notwendig, weil Nagios
# nicht sicherstellen kann, dass mehrfache
# yaps-Kommandos sequentiell ausgefuehrt werden,
# damit es keine Konflikte beim Modemzugriff gibt.
#
# Die Pipe muss angelegt sein mittels
# mkfifo /usr/local/nagios/var/rw/yaps.cmd
#
# English
# -------
#
# this script reads a pipe and sends the
# string as a SMS
# This work around is necessary because
# Nagios can't make sure that yaps commands
# are processed sequential. Otherwise there
# is a conflict by accessing the device.
#
# You need to create the pipe your self.
# mkfifo /usr/local/nagios/var/rw/yaps.cmd
#
PIPE=/usr/local/nagios/var/rw/yaps.cmd
LOGFILE=/var/log/yaps-server.log
FNAME=/tmp/yaps.$$

test -p $PIPE || exit 1

while true; do
  read command < $PIPE
  echo "$command" > $FNAME
  if [ -s $FNAME ]; then
    /usr/bin/yaps -t -z $FNAME >>$LOGFILE && rm $FNAME
  else
    echo "No data in file" >> $LOGFILE
  fi
done;
_____________________________________________ end of yaps-server


More information about the Users mailing list