Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16350

Inefficient time_shift function

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 4.0.9
    • Server (S)
    • None

      I created a calculated item with this formula:

      avg("system.cpu.load[percpu,avg1]",6h,1w)
      

      In my opinion it should calculate the 6h average of the CPU load how it was one week ago.
      As soon when I hit the "Check now" button, the following line appears in my zabbix_server.log:

        3071:20190708:161816.899 slow query: 26.190513 sec, "select clock,ns,value from history where itemid=305210 and clock>1561969069 and clock<=1562594929"
      

      The itemid is related to the CPU item above. Due to the timestamps it selects the values for the following periods (in my timezone - GMT+02:00 DST):

      from Monday, 1 July 2019 10:17:49
      till Monday, 8 July 2019 16:08:49

      Which is a whole week. Shouldn't it only select 6h, but one week ago, so:

      from Monday, 1 July 2019 10:17:49
      till Monday, 1 July 2019 16:08:49

      Which would be way more efficient.

      Goal would be to compare the current 6h average CPU load with the 6h average one week ago and check if the difference is higher/lower than a specified threshold > trend monitoring.

            aleksejs.petrovs Aleksejs Petrovs
            Birchler Dominique
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: