Ad Widget

Collapse

Export dashboard data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • getUP
    Member
    • Jun 2006
    • 34

    #1

    Export dashboard data

    We want to export all data for a specific host group as shown on the dashboard to an external web page. Is there a specific query we can use? Or can anyone point is into the right direction?

    Basically an array containing the number of errors for that specific group would be sufficient (preferably divided into disaster, high, average, etc.).
  • sarathyme
    Member
    • Mar 2009
    • 58

    #2
    this may be of some help

    Code:
    SELECT g.name group_name, 
           COUNT(DISTINCT t.triggerid) alert_count, 
           t.priority priority
    FROM   hosts h, 
           items i, 
           hosts_groups hg, 
           groups g, 
           functions f, 
           triggers t 
    WHERE  h.status = 0 
           AND h.hostid = i.hostid 
           AND hg.groupid = g.groupid 
           AND hg.hostid = h.hostid 
           AND i.status = 0 
           AND i.itemid = f.itemid 
           AND t.triggerid = f.triggerid 
           AND t.VALUE = 1 
           AND t.status = 0 
    GROUP  BY g.name, t.priority;
    you get something like this


    +----------------+-------------+----------+
    | group_name | alert_count | priority |
    +----------------+-------------+----------+
    | Zabbix Servers | 9 | 3 |




    here

    priority [5,4,3,2,1,0]=[disaster,high,average,warning,info,not classified]

    Comment

    • sarathyme
      Member
      • Mar 2009
      • 58

      #3
      forgot to mention !!
      for questions like this, please post in Zabbix Forums->Zabbix Help
      (instead of Cookbook)

      Comment

      Working...