[ZBXNEXT-1118] New macros for showing date and time of history data Created: 2012 Feb 14  Updated: 2025 Jan 16  Resolved: 2025 Jan 16

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Server (S)
Affects Version/s: None
Fix Version/s: None

Type: New Feature Request Priority: Trivial
Reporter: Kodai Terashima Assignee: Zabbix Development Team
Resolution: Duplicate Votes: 8
Labels: macros
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBXNEXT-9603 New built-in macros and functions for... Closed
Sub-task
part of ZBXNEXT-9603 New built-in macros and functions for... Closed
Sprint: S25-W2/3

 Description   

New macros for showing date and time of history data are useful for notification message, especially using Zabbix proxy.

Example,

{ITEM.DATE}

or

{HISTORY.DATE}

: show the date of history data which generate the event

{ITEM.TIME}

or

{HISTORY.TIME}

: show the time of history data which generate the event

Zabbix server already has

{EVENT.DATE}

macro to display "the time of event generated".
However, If Zabbix proxy keeps data on offline buffer because of network problem, event time is delayed.
In this case user cannot understand when the problem was happened correctly from the notification message.



 Comments   
Comment by Thierry Sallé [ 2013 Dec 18 ]

as I say in issue ZBXNEXT-2045, a macro to display the last time a data is collected for an item would be great.
It's not exactly the same as "the time of history wich generate the event", but it's an item time macro.

  • {ITEM.LASTCLOCK}

    = time of the last collected data for the item.

  • {ITEM.LASTDATE}

    = Date of the last collected data for the item.

I vote for this feature

Comment by Leonardo Savoini [ 2024 Oct 08 ]

It exists when items are log type, and you can use {ITEM.LOG.AGE} {ITEM.LOG.DATE} and {ITEM.LOG.TIME}, but not for other types.

I'm using honeycombs to keep track of Mysql NDB backups and current phase (one of many examples):
So in the Primary label I'm using this 2 macros to get the hostname to identify the cluster.

{HOST.NAME}

On the Secondary label I have the last number of the backup and the current phase of the data node (using preprocessors to discard if the value didn't change), but I also want to show "when" I got this new value.
And this is could be the perfect usage:

{ITEM.LASTVALUE}

{ITEM.LAST.DATE}

{ITEM.LAST.TIME}

Also, this will help to reduce the amount of items per template/host as we don't need to capture "when". And finally think about triggers using these macros.

Comment by Kim Anthonisen [ 2024 Oct 08 ]

This seems to have a duplicate: https://support.zabbix.com/browse/ZBXNEXT-7017

I have voted for both

Comment by Leonardo Savoini [ 2024 Oct 10 ]

Another use case. I have a trapper item for JSON strings. It could take 100ms or could take 1 hour to receive the next one.

First, I want to see on a dashboard widget how long in secs was the last one. Though I still need to create a calculated item (1 second intervals) to check difference between {ITEM.LAST.TIME} and now(). Maybe can be possible to add another macro (or a macro function) to do this in real time.

Second, I need to use baseline functions for triggers, as the incoming data drops during night and certain hours.

Comment by Alexander Vladishev [ 2025 Jan 16 ]

This will be implemented with ZBXNEXT-9603. Please follow updates there.

Generated at Tue Apr 29 06:03:23 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.