[ZBXNEXT-252] New Recovery message Macro: {TRIGGER_IN_PREV_STATE} Created: 2010 Feb 23  Updated: 2024 Apr 10  Resolved: 2020 Mar 31

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Installation (I), Server (S)
Affects Version/s: 1.8.2
Fix Version/s: 5.0.0alpha4, 5.0 (plan)

Type: Change Request Priority: Major
Reporter: João Figueiredo Assignee: Michael Veksler
Resolution: Fixed Votes: 24
Labels: macros, trivial
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBXNEXT-2360 Downtime Duration in Recovery Message Closed
Team: Team C
Sprint: Sprint 62 (Mar 2020)
Story Points: 0.125

 Description   

This one is found in quite some monitoring solutions, and is hanging to be added to Zabbix since 2005

It should return the time the Trigger took to step from ON->OFF
" It will require new macro, say

{TRIGGER_IN_PREV_STATE}

or similar, which would return time spent in previous trigger state."



 Comments   
Comment by Alexei Vladishev [ 2013 Jan 28 ]

See also ZBXNEXT-384.

Comment by LEONARDO H. MACHADO [ 2014 Jul 11 ]

Any chance of getting it coded? It would be very usefull for me! TRIGGER_DURATION or something like that. Thank you for zabbix!

Comment by Mattias Geniar [ 2015 Jul 02 ]

Just going to throw it out there, this would indeed be a killer feature for automated downtime calculations based on the first action firing.

Comment by Stephan Knauss [ 2018 Jan 22 ]

I monitor web scenarios and have a custom action for notifications of these. In the recovery message I included the macro EVENT.AGE which then tells me how long my scenario had failed. Not exactly what is requested here but sounds so similar that it might be useful for some.

Comment by Alexei Vladishev [ 2020 Mar 04 ]

I think it should be implemented as macro {EVENT.DURATION}, which will return event duration (obviously). The macro will be used in all contexts currently supported by existing macro {EVENT.AGE}, except Discovery and Autoregistration notifications. Output format will be also identical to {EVENT.AGE}.

Comment by Michael Veksler [ 2020 Mar 24 ]

Mini SPEC:

Add support new macro {EVENT.DURATION} for macros with following types:

  • MACRO_TYPE_MESSAGE_NORMAL
  • MACRO_TYPE_MESSAGE_RECOVERY
  • MACRO_TYPE_MESSAGE_ACK

Output format will be also identical to {EVENT.AGE}.
Scenarios of the macro substitution

source object status
EVENT_SOURCE_TRIGGERS  
EVENT_SOURCE_INTERNAL EVENT_OBJECT_TRIGGER
EVENT_SOURCE_INTERNAL EVENT_OBJECT_ITEM
EVENT_SOURCE_INTERNAL EVENT_OBJECT_LLDRULE
EVENT_SOURCE_DISCOVERY  
EVENT_SOURCE_AUTOREGISTRATION  

The recovery message template:

Problem has been resolved at {EVENT.RECOVERY.TIME} on {EVENT.RECOVERY.DATE}
Problem name: {EVENT.NAME}
Problem duration: {EVENT.DURATION} 
Host: {HOST.NAME}
Severity: {EVENT.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}
Comment by Michael Veksler [ 2020 Mar 25 ]

Available in

Documentation updated:

Generated at Fri Apr 25 20:07:25 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.