Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-2045

add trigger function that would return historical value's timestamp

XMLWordPrintable

      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.

            Unassigned Unassigned
            asaveljevs Aleksandrs Saveljevs
            Votes:
            29 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated: