centreon-engine icon indicating copy to clipboard operation
centreon-engine copied to clipboard

Centreon ignores notification period

Open btassite opened this issue 7 years ago • 7 comments

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

btassite avatar Apr 18 '17 09:04 btassite

We can confirm the Issue, one of our customers reported same behavior.

itsul avatar Jun 23 '17 06:06 itsul

Same here, contact with empty notification period defined, are contacted with centreon-engine 1.5.1

grosbedos avatar Jul 18 '17 08:07 grosbedos

Could you check if you have the same behavior with Centreon Engine 1.5.3 / Centreon Broker 2.11.8 ?

ganoze avatar Jul 25 '17 13:07 ganoze

Sorry, my mistake. For me it is with centreon-web-2.8.9, centreon-broker-3.0.8 and centreon-engine-1.7.2.. Should i open another issue ? Thanks.

grosbedos avatar Jul 25 '17 13:07 grosbedos

We will test/use a newer version at some point but don't have a set schedule for it yet. However if grosbedos has the same behaviour with an even newer version it's safe to assume the suggested ones are also still affected.

btassite avatar Aug 24 '17 14:08 btassite

Tested Centreon 2.8.12, engine 1.7.2, broker 3.0.8, similar issue:

If I delete all fields for the timeperiod (i.e. they had values before but are now empty), notifications are sent. If I put e.g. 01:00-23:00 in a different day than today (while still leaving today's field empty), notifications are NOT sent today (presumably they will be sent for the day that has a time period), which is the correct behaviour.

I didn't test this a lot though, just noted the single occurrence while testing exceptions with the latest version. This is slightly different from the original issue in that notifications are only erroneously sent if none of the fields have data, whereas in 2.7.x it also happened if you had data in other fields.

btassite avatar Sep 18 '17 15:09 btassite

Which information do you need to solve this problem? We are expecting the same problem on Centreon Engine 20.04.4. We searched for problems that may be solve the problem, but nothing worked.

We found a workaround: Fill a field within the notification template which is empty (Wednesday or something from 11:58 - 11:59).

Till Centreon 2.6, empty fields were associated with 'do not send message'. This kind of handling notifications are more efficient. Is it possible to get this behavior again?

mreinders avatar Aug 27 '20 14:08 mreinders