I have disabled notifications during certain time periods, like so:
define timeperiod{
timeperiod_name test
alias Except test Hours
monday 08:20-08:15
[etc..]
sunday 08:20-08:15
}
So if a service goes down between 08:15-08:20, I don't get notified via mail. It just happened today that the service remained down for another 2 hours, and I was expecting to get an email when it's back in the notification_period.
How do I tell Nagios to send a notification email if it fits the notification times and the state of the service is still Critical?
EDIT:
My first approach was incorrect, so I followed an advice and used exclude periods like so:
define timeperiod{
timeperiod_name test2
alias test2
use 24x7
exclude test
}
define timeperiod{
timeperiod_name test
alias Except test Hours
thursday 12:15-12:25 # it was thursday when I tested
}
and the service check:
define service{
use generic-service
service_description TEST
check_command check_nrpe!check_TEST
host_name some.host.here
notification_period test2
}
and the service template:
define service{
name generic-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 1
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 0
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
max_check_attempts 2
check_interval 120s
retry_interval 60s
contact_groups admins
notification_options w,u,c,r
notification_interval 120s
notification_period 24x7
register 0
}
But I still don't get notified. I do get notified, however, if I manually reschedule the service check OR if I reload nagios.
0 Answers