diff --git a/zabbixhost.py b/zabbixhost.py index e957737..6f7602a 100644 --- a/zabbixhost.py +++ b/zabbixhost.py @@ -122,14 +122,17 @@ class ZabbixAPI: "jsonrpc": "2.0", "method": "host.get", "params": { - "filter": { + "output": [ + "host" + ], + "search": { "host": hostname } - }, + }, "auth": self.auth, "id": 1 }) response = requests.post(self.zabbix_url, parameter, headers=self.header).text for i in json.loads(response)['result']: - self.host_id.append(str(i['hostid'])) + self.host_id.append(str(i['hostid'])) print(self.host_id) \ No newline at end of file