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
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
Comment