Over the past weekend, I noticed that Nagios didn’t send out any notifications when a service (MSSQL) died on a host recently. The outage is clearly logged, but no notifications fired, not even in the notifications log.
Notifications are enabled on the service template - in fact, nothing is disabled anywhere in the system. I get other notifications from the system so I know the email chain itself is fine.
define contact{
contact_name Ron
alias Ron Gage
service_notification_period 24x7
host_notification_period 24x7
service_notification_options 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]
address1 [email protected]
}
define contactgroup{
contactgroup_name tester
alias System Test
members Ron
}
define host{
name testhost ; The name of this host tem
notifications_enabled 1 ; Host notifications are enable
event_handler_enabled 1 ; Host 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 acr
retain_nonstatus_information 1 ; Retain non-status information
register 0 ; DONT REGISTER THIS DEFINITION
max_check_attempts 1
notification_interval 60
notification_period 24x7
notification_options d,r
contact_groups tester
}
define host{
use testhost
host_name test_server
address 172.22.7.93
check_command check-host-alive
}
define service{
name test-service ; The ‘name’ of this servi
active_checks_enabled 1 ; Active service checks are ena
passive_checks_enabled 1 ; Passive service checks are en
parallelize_check 1 ; Active service checks should
obsess_over_service 1 ; We should obsess over this se
check_freshness 0 ; Default is to NOT check servi
notifications_enabled 1 ; Service notifications are ena
event_handler_enabled 1 ; Service event handler is enab
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 acr
retain_nonstatus_information 1 ; Retain non-status information
check_period 24x7
is_volatile 0
max_check_attempts 1
normal_check_interval 5
retry_check_interval 1
contact_groups tester
notification_interval 60
notification_period 24x7
register 0 ; DONT REGISTER THIS DEFINITION
}
define service{
use test-service
host_name test_server
service_description HTTP
check_command check_http
}
You are going to have to look at all the setting in the config files for this, and find the ONE typo that I am sure is there somewhere.
Also, check the file /var/spool/mail/nagios and it should be zero bytes.
If not, su - nagios and read the mail by typing:
mail
I have that from time to time, and the problem is not nagios, but with delivering email to the server.
Looks like you’re missing a “notification_options” setting in your service definitions. You’ve got it for the host, but you’ll probably need to set it for services, too. At least, that’s how my config is running (v. 2.0b4).