psql graphs > 25d 13h -- empty plot (possible fix here!)

XMLWordPrintable

    • Type: Incident report
    • Resolution: Fixed
    • Priority: Major
    • 1.4.3
    • Affects Version/s: 1.4.3
    • Component/s: Frontend (F)
    • None

      I changed one line of code in include/classes/graph.inc.php, where the SQL query is generated.

      At line #995 we have:
      Code:

      $calc_field = 'round('.$x.'(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'; / required for 'group by' support of Oracle */

      ...which I changed to:
      Code:

      $calc_field = 'round('.$x.'::int8*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'; /* required for 'group by' support of Oracle */

      This works great in my setup and I can now get graphs for >25d 13h periods (one month for example!)...

      Now, this is obviously not a portable fix... Oracle, MySQL, SQLITE and others will probably not like the '::int8' I inserted.

      Questions:

      • How would one go about implementing a general fix ?
      • What is that 'i' column for, anyway ? (it looks like a complex SQL based way of generating a sequential index... could it be generated on the PHP side, eliminating this question at all ?)

      I'll keep an eye on feedback or reach me at ex #dot# vitorino #at# gmail #dot# com
      Cheers,

      http://www.zabbix.com/forum/showthread.php?t=7454

            Assignee:
            Unassigned
            Reporter:
            Alexei Vladishev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: