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

If the timeshift parameter is set in function timeleft() the calculation is still made from current time

XMLWordPrintable

      Problem description: If function timeleft() is used in timeshift in a trigger expression, or in a calculated item formula, then this timeshift parameter is only taken into account when selecting the data for calculation, but the calculation itself is made from current time.
      In this case, if the time left to reach the threshold is smaller than the timeshift parameter value, then the formula would return the maximal allowed value, as if the threshold has already been reached.
      In my opinion, to correctly describe the tendency, the moment from which the calculation is made should also take into account the timeshift parameter.

      Steps to reproduce:

      1. Create host "test"
      2. Create a trapper item is key "trap" for this host
      3. Create a calculated item with formula timeleft("test:trap",#5,30s,10)
      4. Send values from 0 to 6 to this trapper within 10 seconds period
      5. Open calculated item configuration and press "Test" button
      6. Wait for 30 seconds
      7. In the opened "Test item" dialogue click "Get value and test"
        Result 1: the maximal possible value is returned by the Test item dialogue, as if the threshold "10" has already been reached.
      8. Change the threshold in the formula to "100" and repeat steps 4-7
        Result 2: The value returned in the Test item overlay dialogue indicates that calculation is made from the current moment and the timeshift parameter is not taken into account during calculation.

      Expected: if Timeshift parameter is set then the timeleft() calculation should be made from "now()-timeshift" moment and not from current time.

            Kalimulin Alex Kalimulin
            solonkins Sergejs Olonkins
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: