Jllin

python通过zabbixapi获取数据
from pyzabbix import ZabbixAPI, ZabbixAPIException ZABBIX...
扫描右侧二维码阅读全文
14
2018/10

python通过zabbixapi获取数据

from pyzabbix import ZabbixAPI, ZabbixAPIException
ZABBIX_SERVER = 'http://ip:port/zabbix/'
ZABBIX_USER = 'Admin'
ZABBIX_PWD = 'password'
zapi = ZabbixAPI(ZABBIX_SERVER)
zapi.login(ZABBIX_USER, ZABBIX_PWD)
zapi.history.get(itemids=[itemid1],sortfield='clock',sortorder='DESC',time_from = starttime,time_till = endtime)

#获取2018-04-16 0点到9:30之间的数据
zapi.history.get(itemids=640596,sortfield='clock',sortorder='DESC',time_from = 1523808000,time_till = 1523842200)
# 最近400条
zapi.history.get(itemids=640596,sortfield='clock',sortorder='DESC',limit=400)

Last modification:October 14th, 2018 at 10:51 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment