Ad Widget

Collapse

How to export latest Data or graphs values ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • makemeasandwich
    Member
    • Apr 2015
    • 34

    #1

    How to export latest Data or graphs values ?

    Hello,

    how can I export latest data or graphs values? All I see is plain text and that would mean I need to copy paste everything into for example excel
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    You can export item history either via the Zabbix API or via SQL by accessing the Zabbix database directly.

    You might possibly also be interested in ZBXNEXT-1723

    If non of these options appear sufficient to you, then consider to create an appropriate feature request - if non of such exists already, of course.

    Comment

    • sancho
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Mar 2015
      • 295

      #3
      Hello,

      Although this is old, I'm sharing another way to export the results of Lastest Data to CSV.

      Using this module by the great aigars.kadikis https://blog.zabbix.com/generating-z...-module/24369/

      You can use the following query by changing itemname and hostgroup to the item you want to retrieve and the host group in which to search for this item.

      Code:
      SELECT h.name AS host,
             i.name AS item,
             ht.value AS valor,
             FROM_UNIXTIME(ht.clock) AS fecha
      FROM items i
      JOIN hosts h ON i.hostid = h.hostid
      JOIN history_text ht ON ht.itemid = i.itemid
      JOIN hosts_groups hg ON hg.hostid = h.hostid
      JOIN hstgrp g ON g.groupid = hg.groupid
      WHERE i.name = 'Itemname'
        AND i.status = 0
        AND i.flags IN (0,4)
        AND g.name = 'Hostgroup'
        AND ht.clock = (
            SELECT MAX(hh.clock)
            FROM history_text hh
            WHERE hh.itemid = i.itemid
        )
      ORDER BY h.name;
      For example, if we search for the "Free swap space" item on hosts belonging to the "Windows Servers" host group, the query would be as follows:

      Code:
      SELECT h.name AS host,
             i.name AS item,
             ht.value AS valor,
             FROM_UNIXTIME(ht.clock) AS fecha
      FROM items i
      JOIN hosts h ON i.hostid = h.hostid
      JOIN history_text ht ON ht.itemid = i.itemid
      JOIN hosts_groups hg ON hg.hostid = h.hostid
      JOIN hstgrp g ON g.groupid = hg.groupid
      WHERE i.name = 'Free swap space'
        AND i.status = 0
        AND i.flags IN (0,4)
        AND g.name = 'Windows Servers'
        AND ht.clock = (
            SELECT MAX(hh.clock)
            FROM history_text hh
            WHERE hh.itemid = i.itemid
        )
      ORDER BY h.name;
      Zabbix version tested: 7.4

      I hope it is useful to someone.
      Last edited by sancho; 16-08-2025, 18:24.

      Comment

      • PavelZ
        Senior Member
        • Dec 2024
        • 162

        #4
        Many people use Grafana together with Zabbix. And this program has export on any graph, apparently.

        Comment


        • sancho
          sancho commented
          Editing a comment
          Yes,
          Grafana is a way to export information to CSV. The one I've posted is another way to export the same information we get in Latest Data from Zabbix to CSV. Greetings.
      Working...