Ad Widget

Collapse

Manual Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bman1978
    Junior Member
    • Oct 2009
    • 7

    #1

    Manual Query

    I'm trying to run a manual query against the Zabbix database to create some performance reports. Basically, I want to see min/max/avg CPU utilization for each host. I'm not sure what query is run by the Zabbix front end to generate the graphs.

    Here's a query I've written but it is taking forever.
    select 'CPU', avg(value), max(value), min(value), hosts.name from hosts, history h, items i
    where hosts.hostid = i.hostid
    and h.itemid = i.itemid
    and i.hostid in (10358, 10448)
    and i.name = 'CPU Utilization'
    and h.clock between unix_timestamp('2013-12-01 00:00:00') and unix_timestamp('2013-12-31 23:59:59')
    group by hosts.hostid;

    Any suggestions?

    Thanks,

    Brian
    Last edited by bman1978; 08-01-2014, 02:31.
  • bman1978
    Junior Member
    • Oct 2009
    • 7

    #2
    Ahh.. I have to query trends!

    Comment

    Working...