PyZabbix host.create 方法错误
Errors with PyZabbix host.create method
我遇到了这个问题:
pyzabbix.ZabbixAPIException: ('Error -32602: Invalid params., Incorrect arguments passed to function.', -32602)
这是我的代码:
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
}]
)
我使用的每个变量都是一个字符串。我决定查找我的错误,我认为 是我需要的,但显然我仍然遇到错误,只是不同的错误。也许这是一个接口问题,我不确定。关于如何解决这个问题的任何想法?
here是解释
here是一个例子
您需要像这样更改代码
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
}]
)
我遇到了这个问题:
pyzabbix.ZabbixAPIException: ('Error -32602: Invalid params., Incorrect arguments passed to function.', -32602)
这是我的代码:
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
}]
)
我使用的每个变量都是一个字符串。我决定查找我的错误,我认为
here是解释
here是一个例子
您需要像这样更改代码
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
}]
)