Hi-
I’ve got a test installation of Nagios set up and it’s pretty simple. It’s only monitoring a single service on a single host. It uses the contact group defined in the service block and the contact group has only a single contact.
The contact is set up to notify-by-email and host-notify-by-email, and the email address for the contact is set.
All is well. However, when I take the service down to test what happens, I only get a host notification, not a service notification.
Here are the config blocks that are interesting:
define service{
use generic-service ; Name of service template to use
host_name testuser2
service_description TEST_SVC
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 1
retry_check_interval 1
contact_groups test-admins
notification_interval 120
notification_period 24x7
notification_options c,r,w,u
check_command check_rate!5282!Orders!-16!-22!0!0
}
define contactgroup{
contactgroup_name test-admins
alias Test Administrators
members nagios
}
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,u,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email [email protected]
pager [email protected]
}
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: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$" | /usr/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: $DATETIME$\n” | /usr/bin/mail -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$
}
Here’s the nagios.log:
[1106704236] HOST ALERT: testuser2;DOWN;HARD;10;/sbin/ping6 -n -c 1 17.207.12.114
[1106767596] HOST NOTIFICATION: nagios;testuser2;DOWN;host-notify-by-email;/sbin/ping6 -n -c 1 17.207.12.114
[1106767626] SERVICE ALERT: testuser2;TEST_SVC;CRITICAL;HARD;1;CRITICAL - Count: 0, AVG: 0, ROC: 0%
I get notified for the host being down, but not for the service being down. Weird.
This is Nagios 1.2 running on Mac OS X.
Anyone have any ideas?
Edited ]