Hi,
I have defined services that don’t require to be checked all day long, typically apt. I don’t want to receive more then 2 notifications per day about it. So I’ve defined a PointCheck
period that checks for an hour between 07:00 and 08:00, but receive notification about that service outside of this range. I receive notification during all the Notification.period
. Is this the expected behaviour?
Thank you for any insights.
object TimePeriod "PointCheck" {
import "legacy-timeperiod"
display_name = "WorkdayPointCheck"
ranges = {
"friday" = "07:00-08:00"
"monday" = "07:00-08:00"
"thursday" = "07:00-08:00"
"tuesday" = "07:00-08:00"
"wednesday" = "07:00-08:00"
}
}
template Service "apt" {
check_command = "[apt](nnnnn?name=apt)"
check_period = "PointCheck"
enable_notifications = true
enable_active_checks = true
enable_passive_checks = true
command_endpoint = host_name
}
object TimePeriod "Workdays" {
import "legacy-timeperiod"
display_name = "9to5"
ranges = {
"friday" = "09:00-17:00"
"monday" = "09:00-17:00"
"thursday" = "09:00-17:00"
"tuesday" = "09:00-17:00"
"wednesday" = "09:00-17:00"
}
}
template Notification "Mail Service Notification" {
command = "mail-service-notification"
period = "Workdays"
states = [ Critical, OK, Unknown, Warning ]
types = [ Problem, Recovery ]
}
apply Notification "Mail Molbio Service Notification" to Service {
import "Mail Service Notification"
assign where host.enable_notifications != "false" && host.vars.department == "molbio"
users = [ "Molbio" ]
}