Service Notification Problems

Dan Davis hokie99cpe at gmail.com
Thu May 19 20:39:59 CEST 2005


I am having problems getting service outages to notify. Host notifications 
work fine.

Below I have attached snippets of various configs. All of the configs are 
being read into nagios properly. Host notifcations are being sent 
properly... it's just service notications that are not working. I restart 
(not just reload) nagios after config changes.

I am running Nagios 2.0b3 on FC3.

-Dan Davis

Relevant snippets on cfg files:

nagios.cfg:
log_notifications=1
enable_notifications=1

Other configs that are in files that are read into nagios:
define contact{
contact_name nagios-admin
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 validuser at fqdn.com ; the system has no problems seding to this email 
address... host notifications work fine...
}

define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios-admin
}

define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 1 ; Default is to NOT check service 'freshness'
freshness_threshold 300 ; 5 Minute threshold
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program 
restarts
retain_nonstatus_information 1 ; Retain non-status information across 
program restarts
normal_check_interval 1 ;
retry_check_interval 1 ;
max_check_attempts 2 ;
check_period 24x7 ;
is_volatile 0 ;
contact_groups admins
notification_interval 0 ;
notification_period 24x7 ;
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A 
TEMPLATE!
}

define service{
use generic-service ; Name of service template to use
host_name nagioshost
service_description Processes (httpd)
check_command check_specific_procs!1!11!httpd
}

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
}

define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: 
$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: 
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: 
$LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** 
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" 
$CONTACTEMAIL$
}

# 'host-notify-by-email' command definition
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: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | 
/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050519/85418add/attachment.html>


More information about the Users mailing list