Использую pyzabbix, хочу добавить новый хост
z = ZabbixAPI(SERVER)
z.login(user=NAME, password=PASSWORD)
z.host.create({ "jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": "blablalbalba",
"interfaces": [
{
"type": 1,
"main": 1,
"useip": 1,
"ip": "myip/zabbix",
"dns": "",
"port": "10050"
}
],
"groups": [
{
"groupid": "37"
}
],
"templates": [
{
"templateid": "20045"
}
],
},
"auth": null,
"id": 1})
Вот что дает в результате
Traceback (most recent call last):
File "/home/kolas/PycharmProjects/untitled/test1.py", line 62, in <module>
"id": 1})
File "/usr/local/lib/python2.7/dist-packages/pyzabbix/__init__.py", line 157, in fn
args or kwargs
File "/usr/local/lib/python2.7/dist-packages/pyzabbix/__init__.py", line 99, in do_request
separators=(',', ': ')))
File "/usr/lib/python2.7/json/__init__.py", line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 209, in encode
chunks = list(chunks)
File "/usr/lib/python2.7/json/encoder.py", line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File "/usr/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "/usr/lib/python2.7/json/encoder.py", line 332, in _iterencode_list
for chunk in chunks:
File "/usr/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "/usr/lib/python2.7/json/encoder.py", line 442, in _iterencode
o = _default(o)
File "/usr/lib/python2.7/json/encoder.py", line 184, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <module 'null' from '/usr/local/lib/python2.7/dist-packages/null.pyc'> is not JSON serializable
Не могу понять что ему не угодило.