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

Add evaluation period to last() history function

XMLWordPrintable

    • Icon: Change Request Change Request
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • None
    • Server (S)
    • None

      It would be useful if the last() history function also would support evaluation periods. Especially with calculated items, it would be much easier to handle missing metric data because the host is offline.

      Let's assume I want to calculate the memory used in Linux. If the agent is not working or the host is offline, last() would also retrieve yesterday's data, which would result in an old memory usage being displayed in the host dashboard.

      To prevent this, I use count() to check whether any data has been received in the last 5 minutes. If not, the calculated item becomes unsupported and I can easily intercept it with preprocessing.

      last(//vm.memory.size[total]) - last(//vm.memory.size[available]) / (count(//vm.memory.size[available], 5m) > 0) 

      With longer formulas, this quickly becomes very ugly. If you had the option of specifying an evaluation period in last(), you could shorten it enormously. Maybe even with a performance gain, because Zabbix doesn't have to count and divide.

      last(//vm.memory.size[total]) - last(//vm.memory.size[available], 5m)

      So last(//vm.memory.size[available], 5m) would retrieve the most recent value within the last 5 minutes.

            wiper Andris Zeila
            Taikocuya Marcel Renner
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: