-
New Feature Request
-
Resolution: Unresolved
-
Minor
-
None
-
2.2.0
Suppose we received value "1" for an item at time "1234567890" (a Unix timestamp for "Sat Feb 14 01:31:30 EET 2009"). Currently, we have a function last(), which returns "1". We also wish to have a function, say, unixtime(), which would return "1234567890".
Scenario where this would be useful is as follows. We wish to check how old something is, so we create an item, "last.change", which updates once per day and contains the timestamp of the last change. Then, we create a trigger, "{host:last.change.now()} - {host:last.change.last()} > {$MAX_AGE}". This alerts us when something has been updated too long ago and works well.
However, the problem with the above trigger is that it is recalculated every 30 seconds by the timer process. This puts unnecessary load on the server. So the suggestion is to replace now() with the proposed function unixtime(): "{host:last.change.unixtime()} - {host:last.change.last()} > {$MAX_AGE}". This way, trigger will only be recalculated once per day when it really needs to.
- causes
-
ZBXNEXT-9603 New built-in macros and functions for timestamp tracking
- Needs specification
- is duplicated by
-
ZBXNEXT-7059 Trigger fucntion to get item history date/time
- Closed