jeudi 5 mars 2015

zabbix api get all host names


Vote count:

0




I'm using Python to query a Zabbix server in an attempt to get a list of hostids and hostnames. I'm testing with the following:



zapi = ZabbixAPI(server=server, log_level=debuglevel)
zapi.login(username, password)

hosts = zapi.host.get({"params":{"output":"hostid", "name"}})
print hosts


The above test only prints out the hostids. The host names are not retrieved.


example of output:



[{u'hostid': u'10084'}, {u'hostid': u'30000'}, {u'hostid': u'30001'}, {u'hostid': u'30002'}]


What I am doing wrong? :(



asked 19 secs ago







zabbix api get all host names

Aucun commentaire:

Enregistrer un commentaire