Ad Widget

Collapse

Granularity of history returned via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaragunde
    Junior Member
    • Jan 2011
    • 13

    #1

    Granularity of history returned via API

    Hi,

    I'm building a custom interface on top of Zabbix API, and I'd like to retrieve history data to build custom graphics.

    The problem is that if I'm showing a big interval of time, I get too many values (for example, retrieve a year of hourly-sampled data) and eventually make Zabbix run out of memory.

    Is there a way to specify the granularity of the data? Following the previous example, gather a year of data taking only one value per day.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    http://www.zabbix.com/documentation/1.8/api/history/get

    There are two parameters to try, time_from and time_to. They both take Unix time as their parameters.

    Hopefully that helps.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • jaragunde
      Junior Member
      • Jan 2011
      • 13

      #3
      I was thinking on something different, for example a way to specify a "step", and retrieve only one value on every ten stored values, for example.

      I guess that Zabbix web interface also has to do something similar when it plots a graph with a big zoom frame: not every value is shown, instead they are grouped and an average of every group is shown.

      Comment

      • jaragunde
        Junior Member
        • Jan 2011
        • 13

        #4
        It's an important feature for me, so I've started working on a patch. I'm taking inspiration from frontend/php/include/classes/class.cchart.php, function selectData(), which is used to gather history data to build charts in the web frontend.

        I've created a ticket: https://support.zabbix.com/browse/ZBXNEXT-656

        Comment

        • r-br
          Junior Member
          • Feb 2011
          • 27

          #5
          Such a feature is interesting to me as well.

          Comment

          Working...