【发布时间】:2015-05-07 16:22:45
【问题描述】:
我正在使用 Python 查询 Zabbix 服务器,以尝试获取主机 ID 和主机名列表。我正在测试以下内容:
zapi = ZabbixAPI(server=server, log_level=debuglevel)
zapi.login(username, password)
hosts = zapi.host.get({"params":{"output":"hostid", "name"}})
print hosts
上面的测试只打印出hostid。不检索主机名。
输出示例:
[{u'hostid': u'10084'}, {u'hostid': u'30000'}, {u'hostid': u'30001'}, {u'hostid': u'30002'}]
我做错了什么? :(
【问题讨论】: