problem with service notification

M.N.A.Smadi smadim2 at grads.ece.mcmaster.ca
Wed Oct 5 21:50:49 CEST 2005


This thing is driving me nuts.  for the SIP_ONLINE service i want to 
have a very aggressive checking, so every minute do check and if 1 fails 
send notification.  I think i got things right since on the web 
interface i see the service as critical but I am not getting 
notifications even if restart nagios or do whatever. 


This is the relevent config file:

##############################################################################
#  SERVICES
#
###############################################################################
#
# service to "ping" the local machine

define service{
        host_name                       zya.com
        service_description             PING
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              4
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  admins
        notification_interval           960
        notification_period             24x7
        notification_options            w,u,c,r
        check_command                   check_ping!100.0,20%!500.0,60%
       }

define service{
        host_name                       zya.com
        service_description             SIP_ONLINE
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              1
        normal_check_interval           5
        retry_check_interval            1
        contact_groups                  admins
        notification_interval           1
        notification_period             24x7
         notification_options           w,u,c,r
        check_command                   check_sipast!nagios!GrobPadeg
       }



##############################################################################
#
# HOST GROUPS
#
###############################################################################


define hostgroup{
        hostgroup_name  my_testing_group
        alias   my_testing_group
        members zya.com
        }

###############################################################################
#
# HOSTS
#
###############################################################################

# Since this is a simple configuration file, we only monitor one host - the
# local host (this machine).

define host{
        host_name                   zya.com
        alias                           zya.com
        address                     X.Y.Z.Z
        check_command           check_sipast!nagios!GrobPadeg
        max_check_attempts      1
        notification_interval   120
        notification_period     24x7
        notification_options    d,r
        contact_groups  admins
        }
# EOF




Narum, Kyle wrote:

>You have notification_options defined for your hosts, but not your
>services.  If you add at least one notification_option to your
>service(s), you should receive the notifications. 
>
>-----Original Message-----
>From: nagios-users-admin at lists.sourceforge.net
>[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of
>M.N.A.Smadi
>Sent: Wednesday, October 05, 2005 2:07 PM
>To: nagios-users at lists.sourceforge.net
>Subject: [Nagios-users] problem with service notification
>
>Hi;
>I get notifications if the command associated with host exits with a
>critical code but if the commands associated with the services exit with
>a critical code i dont get notifications.  I am not exactly sure what i
>am missing.
>
>thanks
>moe smadi
>
>I am using the following config object:
>########################################################################
>#######
>#
># TIME PERIODS
>#
>########################################################################
>#######
># This defines a timeperiod where all times are valid for checks, #
>notifications, etc.  The classic "24x7" support nightmare. :-)
>
>define timeperiod{
>        timeperiod_name 24x7
>        alias           24 Hours A Day, 7 Days A Week
>        sunday          00:00-24:00
>        monday          00:00-24:00
>        tuesday         00:00-24:00
>        wednesday       00:00-24:00
>        thursday        00:00-24:00
>        friday          00:00-24:00
>        saturday        00:00-24:00
>        }
>
>########################################################################
>#######
>#
># CONTACTS
>#
>########################################################################
>#######
>define contact{
>        contact_name                    nagios
>        alias                           Nagios Admin
>        service_notification_period     24x7
>        host_notification_period        24x7
>        service_notification_options    w,u,c,r
>        host_notification_options       d,r
>        service_notification_commands   notify-by-email
>        host_notification_commands      host-notify-by-email
>        email                           whatever at whatever.com
>        }
>
>
>########################################################################
>#######
>#
># CONTACT GROUPS
>#
>########################################################################
>#######
>define contactgroup{
>        contactgroup_name       admins
>        alias                   Nagios Administrators
>        members                 nagios
>        }
>
>
>########################################################################
>#######
>#
># COMMANDS
>#
>########################################################################
>#######
>define command{
>        command_name    check_ping
>        command_line    /usr/local/nagios/libexec/check_ping -H 
>$HOSTADDRESS$ -w $ARG1$ -c $ARG2$
>}
>
>define command{
>        command_name    check_sipast
>        command_line    /usr/local/nagios/libexec/check_sipast -r 
>$HOSTADDRESS$ -u $ARG1$ -p $ARG2$
>}
>
>
>define command{
>        command_name    notify-by-email
>        command_line    /usr/bin/printf "%b" "***** Nagios  
>*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SER
>VICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: 
>$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info
>:\n\n$OUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert -
>$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
>        }
>
>define command{
>        command_name    host-notify-by-email
>        command_line    /usr/bin/printf "%b" "***** Nagios  
>*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME
>$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: 
>$OUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTA
>TE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
>        }
>
>
>########################################################################
>######
>#  SERVICES
>#
>########################################################################
>#######
>#
># service to "ping" the local machine
>
>define service{
>        host_name                       xyz.com
>        service_description             PING
>        is_volatile                     0
>        check_period                    24x7
>        max_check_attempts              4
>        normal_check_interval           5
>        retry_check_interval            1
>        contact_groups                  admins
>        notification_interval           960
>        notification_period             24x7
>        check_command                   check_ping!100.0,20%!500.0,60%
>       }
>
>define service{
>        host_name                       xyz.com
>        service_description             SIP_ONLINE
>        is_volatile                     0
>        check_period                    24x7
>        max_check_attempts              4
>        normal_check_interval           5
>        retry_check_interval            1
>        contact_groups                  admins
>        notification_interval           960
>        notification_period             24x7
>        check_command                   check_sipast!nagios!hi
>       }
>
>
>
>########################################################################
>######
>#
># HOST GROUPS
>#
>########################################################################
>#######
>
>
>define hostgroup{
>        hostgroup_name  my_testing_group
>        alias   my_testing_group
>        members zia-sv-008
>        }
>
>########################################################################
>#######
>#
># HOSTS
>#
>########################################################################
>#######
>
># Since this is a simple configuration file, we only monitor one host -
>the # local host (this machine).
>
>define host{
>        host_name               xyz.com
>        alias                   zxy
>        address                 X.X.X.X
>        check_command           check_sipast!nagios!hi
>        max_check_attempts      1
>        notification_interval   120
>        notification_period     24x7
>        notification_options    d,r
>        contact_groups  admins
>        }
># EOF
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by:
>Power Architecture Resource Center: Free content, downloads,
>discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
>_______________________________________________
>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
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by:
>Power Architecture Resource Center: Free content, downloads, discussions,
>and more. http://solutions.newsforge.com/ibmarch.tmpl
>_______________________________________________
>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
>
>  
>



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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