Skip to content

Commit 48273c6

Browse files
author
zhanghe5
committed
fix bugs
1 parent 81527c0 commit 48273c6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

zabbix_item_get.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def errmsg(msg):
5757
hostname = options.hostname
5858
key = options.key
5959
name = options.name
60-
61-
hostid=zapi.host.get({"filter":{"host":"Zabbix server"}})[0]["hostid"]
60+
hostid=zapi.host.get({"filter":{"host":hostname}})[0]["hostid"]
6261
item=zapi.item.get({"output": "extend","hostids": hostid,"search":{"key_": key}})
6362
print hostid,'\t',item

0 commit comments

Comments
 (0)