[ZBXNEXT-894] Notifications after maintenance period expires Created: 2011 Aug 18  Updated: 2017 May 31  Resolved: 2012 Aug 30

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Pavel Timofeev Assignee: Alexei Vladishev
Resolution: Won't fix Votes: 4
Labels: actions, maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Zabbix 1.8.5


Issue Links:
Duplicate

 Description   

Hello!

If the trigger state is changed during the maintenance period Zabbix sends me notification about it after maintenance period expires.

It's good feature when the trigger is still in PROBLEM state.
But if trigger had to go back to OK state during the maintenance period Zabbix sends me notification anyway after maint.per. expired.

Example:
We have daily maintenance period from 04:00 to 05:00 for some host.
At 04:20 some trigger of this host goes to PROBLEM state. Ok, no notifications.
At 04:50 our trigger goes to to OK state. Ok, no notifications too.
But at 05:00 when the maintenance period will expire zabbix will send notification! like trigger just switched to OK.

Someone wants to know that our trigger switched during maint period, but someone do not want.

May be we need a checkbox to control this feature?



 Comments   
Comment by Pavel Timofeev [ 2011 Aug 21 ]

zabbix 1.8.6 is affected too.
I just checked it.

Comment by Pavel Timofeev [ 2011 Aug 25 ]

Please, fix it before zabbix-1.8.7 release

Comment by richlv [ 2011 Aug 25 ]

it's currently not scheduled for 1.8.7

Comment by Pavel Timofeev [ 2011 Aug 25 ]

it's very painful bug.

Comment by Pavel Timofeev [ 2011 Aug 25 ]

For example, Nagios and Zenoss doesn't do such notifications.

Comment by Pavel Timofeev [ 2011 Aug 31 ]
  1. vi src/zabbix_server/timer/timer.c

/******************************************************************************
*

  • Function: generate_events
    *
  • Purpose: generate events for triggers after maintenance period
  • The events will be generated only in case of trigger was FALSE
  • before maintenance and became TRUE after maintenance, also in
  • case if it was TRUE before and FALSE after.
    ..................................
    Following this purpose current event generates is wrong.
    That's what I mean.
Comment by Pavel Timofeev [ 2011 Aug 31 ]

Folks, this is really stupid and obvious bug!

Here is the one line patch.

  1. cat files/patch-src_timer.c
      • src/zabbix_server/timer/timer.c.orig 2011-08-31 11:49:08.000000000 +0400
        +++ src/zabbix_server/timer/timer.c 2011-08-31 11:49:48.000000000 +0400
        @@ -433,7 +433,7 @@
        get_trigger_values(triggerid, maintenance_from, maintenance_to,
        &value_before, &value_inside, &value_after);
  • if (value_before == value_inside && value_inside == value_after)
    + if (value_before == value_after)
    continue;

/* Preparing event for processing */

Is it right?
I'd love to see it in 1.8.7 release

Comment by Pavel Timofeev [ 2011 Sep 05 ]

Just confirm the bug at least

Comment by richlv [ 2011 Sep 05 ]

it can't be confirmed until properly tested

Comment by richlv [ 2011 Sep 05 ]

ok, so thanks to explanation from server dev sasha, the problem in this case - it works as designed
it's not a bug. initial requirements specifically asked for an ok event to be generated if a trigger flapped in the maintenance to ensure that this happening is not missed.

personally, i agree that in majority of cases that's not needed, though.

so there should be some way to configure whether flap during the maintenance should be alerted upon or not. whether it's a maintenance level option, action condition or something else, that's to be researched and decided.

Comment by Pavel Timofeev [ 2011 Sep 05 ]

> ok, so thanks to explanation from server dev sasha, the problem in this case - it works as designed

sorry, what did you mean? I didn't understand.
Because comment for generate_events says the opposite

>it's not a bug. initial requirements specifically asked for an ok event to be generated if a trigger flapped in the maintenance to ensure that this happening is not missed.
>
>personally, i agree that in majority of cases that's not needed, though

Yea, there is no monitoring system which behave this way. This feature useless in 99%.
When I set maintenance (aka downtime) period for server I DO NOT want to receive messages for given server. Because generally I do maintenance actions on this server and, of course, some trigger will switch.
This is why maintenance periods (downtimes) was invented.
I think default events generation should be changed.

>so there should be some way to configure whether flap during the maintenance should be alerted upon or not. whether it's a maintenance level option, action condition or something else, that's to be researched and decided.

My boss looked at me like %) and laughed when I told him about this bug/feature.

P.S. Sorry for my english.It's difficult to explane somethig.

Comment by richlv [ 2011 Sep 09 ]

turns out, it's the comment that is wrong.

please note that i fully agree that majority of users wouldn't want to receive such notifications, but that's the original specification... so the solution might be to introduce some way to control this behaviour.

Comment by richlv [ 2011 Sep 09 ]

ok, here's a workaround idea from alexei. add "trigger value=problem" condition and enable recovery message. should help you to get rid of that unwanted ok message

Comment by Pavel Timofeev [ 2011 Oct 07 ]

Thank you!

Comment by Pavel Timofeev [ 2012 Apr 26 ]

I hope this will be resolved in 2.0

Comment by richlv [ 2012 Apr 27 ]

given that 2.0 always enables escalations and adds "trigger value=problem" condition by default, this might just get "fixed" that way...

Comment by Raymond Kuiper [ 2012 Aug 30 ]

Shouldn't this be closed? Using the 'Trigger value=PROBLEM' solution seems to work and it is included by default in ZBX2.0 now.

Comment by richlv [ 2012 Aug 30 ]

sounds reasonable, closing

Comment by richlv [ 2012 Dec 28 ]

comment was fixed in r32354 for 2.0 and in r32355 for trunk

Comment by Pavel Timofeev [ 2013 Jan 17 ]

So, is it going to be changed?
Solution with "'Trigger value=PROBLEM' + 'recovery message'" isn't fix, but temporary workaround obviously.
I can create new ZBXNEXT to introduce some way to control such behaviour.

Comment by richlv [ 2013 Jan 17 ]

since 2.0 actions are enabled always, thus actions without "trigger value=problem" would probably result in really strange and unexpected behaviour. i don't think anybody will have such actions, so this solution seems sufficient.

Comment by Pavel Timofeev [ 2013 Jan 17 ]

I don't know whether I understand you. Sorry!
But it wouldn't result strange or unexpected behaviour.
http://img-fotki.yandex.ru/get/6433/16519813.0/0_9f447_51d9cb9f_orig
As you can see there is no "Trigger value" definition in this action.
I/We have been using such configuration for actions since Zabbix 1.4. There was no maintenance feature in Zabbix in those days.
And it works as exprected: no "Trigger value" definition -> so alerts on OK and PROBLEM.

And this way is less labour-intensive than your way. You don't need to fill recovery message)
I do not know, but I think it's more logical.

Comment by richlv [ 2013 Jan 17 ]

that's why i said "since 2.0", you use 1.8

Comment by Pavel Timofeev [ 2013 Jan 17 ]

So, you want to say that doesn't work for 2.0? =)

Comment by Pavel Timofeev [ 2013 Jan 17 ]

Really, I want to descuss. Maybe forum is better place?

Comment by Pavel Timofeev [ 2013 Jan 17 ]

Your explanation leads to idea that 'Trigger value' condition doesn't make sense. Like there is no need for such condition at all.

Comment by richlv [ 2013 Jan 18 ]

it indeed changed in 2.0. feel free to discuss it on irc, but note the usual irc rules

https://zabbix.org/wiki/Getting_help

Comment by Pavel Timofeev [ 2013 Jan 28 ]

Richlv, after closing this ticket it got worse on 2.0 version =(
Now on 2.0, even if "trigger state when maintenance period starts" is NOT EQUAL "trigger state when maintenance period ends" zabbix doesn't send notification!
It's very bad. It worked on 1.8. Described behavior in this ticket was great, excluding sutiation when "trigger state when maintenance period starts" is EQUAL "trigger state when maintenance preiod ends".

Comment by Pavel Timofeev [ 2013 Feb 05 ]

I'd like to discuss https://www.zabbix.com/forum/showthread.php?t=38875
I see in trunk there is still similar explanation of generate_events function in src/zabbix_server/timer/timer.c file.
Any plans to rework notifications after maintenance?

Comment by richlv [ 2016 Apr 15 ]

ZBXNEXT-3196 might change this behaviour

Generated at Sat Apr 20 05:57:08 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.