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

Negative time values are display as positive in "latest data" and "Graph" if unit is 's'

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 1.8.1
    • Frontend (F)

      I have an item that return the diff in seconds between 2 times, the diff can either be positive or negative so the Item type is "Float" as "Unsigned Integer" won't work for the negative times. The value is properly obtained and stored in the PGSQL database (select from history showed the positive and negative values),

      but if I set the unit to "s" (seconds), then the value displayed in the "latest data" screen and "graph" are shown as positive all the time (even if the value is negative).
      removing the unit fixes the problem (but then I loose the nice time formatting in hour/minute/seconds).

      I believe the problem is in the zbx_date2age() function in include/func.inc.php:

              $time = abs($end_date-$start_date);
      

        1. negative.png
          20 kB
          Aleksandrs Saveljevs

            Unassigned Unassigned
            fischaz Johan Fischer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: