【发布时间】:2016-02-02 06:56:45
【问题描述】:
请帮助我们生成每周报告。
我们使用zabbix提供的数据库。
服务器详情
操作系统-Redhat 6.4 mysql服务器版本:5.5.17
我们使用下面的查询来查询当前时间。
查询:
select h.host "Device Type",
replace(replace(replace(i.name,'$1',substring_index(substring_index(i.key_,',',1),'[',-1)),
'$2',substring_index(substring_index(i.key_,',',2),',',-1)),
'$3',substring_index(substring_index(i.key_,',',-1),']',1)) "Parameter Description",
i.lastvalue/1024/1024/1024 "VALUE",
i.delay "Polling Interval(in min)" from hosts h, items i, interface n
where h.hostid=n.hostid and h.hostid=i.hostid and h.status=0 and i.status=0 and h.host='CRMAPP01' order by h.host;)
【问题讨论】:
-
欢迎来到stackoverflow。该查询有什么问题?请添加更多详细信息。
-
查询没有问题,但它的显示当前报告...但我需要每周报告...
-
一旦我们不知道 zabbix 的表名,这很难回答。我认为更好的方法是使用 zabbix api。 zabbix.com/documentation/2.4/manual/api