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

Faulty logic of source data (history or trends) decision in CChart class

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 1.8.14, 2.0.3
    • Frontend (F)

      I believe this condition should be reviewed, as it doesn't make much sense, and leads to wrong selection of history instead of trends when displaying graphs with interval bigger than one day, but lesser than two days..

      frontends/php/include/classes/class.cchart.php, line 244:

      if((($real_item['history']*86400) > (time()-($this->from_time+$this->period/2))) &&			// should pick data from history or trends

      for data source selection to work properly, this line should read as:

      if((($real_item['history']*86400) > (time()-($this->from_time+60))) &&			// should pick data from history or trends

      note that "+60" (lesser number would work too, but I selected 60 seconds to be on the safe side) in second part of expression is necessary as sometimes on slow servers time()-($this->from_time results in wrong time interval. for example, when selecting 1d interval on my prehistoric test bench server, this expression can result in 86401, or even 86402, effectively annihilating possiblity of building the graph based on history data despite having correct time interval selected.

      the same logic should be applied on CPie class etc.

            Unassigned Unassigned
            alix alix
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: