centreon-engine
centreon-engine copied to clipboard
Centreon ignores notification period
Looking back through the event logs, notification mail is always sent, regardless of time period defined.
Example: we have a host "1234x" with a defined service "Windows_CPU" and both host/service notification period "workhoursxy":
$ mysql -NBr centreon_storage -e "select services.service_id,services.notification_period,hosts.notification_period from hosts join services on services.host_id = hosts.host_id where name='"1234x"' and description='"Windows_CPU"' and services.enabled=1" 5678 workhoursxy workhoursxy
The time period it uses:
$ mysql -t centreon -e "select * from timeperiod where tp_name='workhoursxy';"
+-------+-------------+---------------------+-----------+-------------+-------------+--------------+-------------+-------------+-------------+
| tp_id | tp_name | tp_alias | tp_sunday | tp_monday | tp_tuesday | tp_wednesday | tp_thursday | tp_friday | tp_saturday |
+-------+-------------+---------------------+-----------+-------------+-------------+--------------+-------------+-------------+-------------+
| 5 | workhoursxy | Standard Work Hours | | 10:10-18:00 | 10:10-18:00 | 10:10-18:00 | 10:10-18:00 | 10:10-18:00 | |
+-------+-------------+---------------------+-----------+-------------+-------------+--------------+-------------+-------------+-------------+
Instead of just the first, a mail is sent for all 4 of the below critical service states, even though the notification period ends at 18:00. As an aside, similar notifications were also sent on the 16th, which is a Sunday, and not defined in the workhoursxy time period, i.e. no notifications should be sent that day at all.
$ mysql -NBr centreon_storage -e "select from_unixtime(start_time),from_unixtime(end_time) from servicestateevents where state=2 and in_downtime=0 and in_ack=0 and service_id=5678;" [..] 2017-04-17 14:01:37 2017-04-17 14:06:27 2017-04-17 19:56:37 2017-04-17 20:01:27 2017-04-17 20:36:37 2017-04-17 20:41:27 2017-04-17 21:16:37 2017-04-17 21:21:27 [..]
The service "Windows_CPU" has the workhoursxy notification period defined (but a 24x7 monitoring time period), and uses the generic-host template, which also has workhoursxy notification period (with also 24x7 monitoring time period).
Centreon 2.7.7 Centreon Engine 1.5.1 Centreon Broker 2.11.5