'Errors with PyZabbix host.create method
I'm getting this problem:
pyzabbix.ZabbixAPIException: ('Error -32602: Invalid params., Incorrect arguments passed to function.', -32602)
Here is my code:
add_host = zapi.host.create(
host = host_sharepoint,
status = 0,
interfaces = [{
"type": 2,
"main": 1,
"useip": 1,
"ip": str(row["IP"]),
"dns": "",
"port": "161"
}],
groups = [{
"groupid": "27"
}],
templates = [{
"templateid": template_id
}]
)
Every variable that I am using is a string. I decided to look up my error and I was thinking that this was what I needed, but apparently I'm still getting erros, just different ones. Maybe It's an interface thing, I'm not sure. Any ideas on how to solve this?
Solution 1:[1]
here is the explanation
here is an example
You need to change the code like this
add_host = zapi.host.create(
host = host_sharepoint,
status = 0,
interfaces = [{
"type": 2,
"main": 1,
"useip": 1,
"ip": str(row["IP"]),
"dns": "",
"port": "161",
"details": {
"version": 2,
"community": "public"
}
}],
groups = [{
"groupid": "27"
}],
templates = [{
"templateid": template_id
}]
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Wowa Po |