[ZBX-21967] Incorrect problem duration calculation Created: 2022 Nov 23  Updated: 2023 Oct 07

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.2.5
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Egor T. Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

zabbix_server (Zabbix) 6.2.0
Revision db780895726 4 July 2022, compilation time: Jul 4 2022 07:16:54


Attachments: PNG File image-2022-11-23-16-25-01-940.png     PNG File image-2022-11-23-16-38-17-025.png     PNG File image-2022-11-23-16-38-52-334.png     PNG File image-2022-11-23-16-39-06-193.png     PNG File image-2022-11-23-16-39-33-213.png     PNG File image-2022-11-28-08-39-19-016.png     PNG File service-recovery.png    
Issue Links:
Sub-task
depends on ZBX-17188 Problems with negative duration are c... Open

 Description   

In case of service oriented monitoring structure like below:

Service based notifications was configured. We interested to receive notification only from top level service if service status changing. We need to send notification if service in "High" or "Disaster" status.

In case of status changed like this OK->High(or disaster)->OK.: No problem

But if status change lie this:

OK->Average->High->Average->OK

We are receiving negative time:

 

Below you can see events:

Look like this operate like this:

I think that negative time itself for problem duration - problem.

Service level actions and notification should be not the same as trigger based.



 Comments   
Comment by Egor T. [ 2022 Nov 28 ]

More correct picture:

Comment by Aigars Kadikis [ 2022 Nov 30 ]

Hi Egor,

Thank you for contacting Zabbix. I think the surface level root cause is that the default media type is using EVENT.DURATION macro:

Most of the time, the EVENT.DURATION will work fine (by accident). But since there can be some overlapping going (like one child problem ends, and another child problem starts in same level), then using EVENT.DURATION macro (at the very top) is incorrect.
We need a dedicated SERVICE.DURATION macro, which is not yet implemented:
https://www.zabbix.com/documentation/6.2/en/manual/appendix/macros/supported_by_location

Comment by Egor T. [ 2022 Dec 01 ]

Hello.

Thank you for your reply. Do you have plan for that?

Generated at Fri May 22 19:28:37 EEST 2026 using Jira 10.3.18#10030018-sha1:5642e4ad348b6c2a83ebdba689d04763a2393cab.