Hi,
I'm using zabbix 2.0.3 and I'm trying to create host with host.create method. Here's an example (this is actually example from https://www.zabbix.com/documentation...pi/host/create with grouid, templateid and auth changed)
# cat testme.json
{
"jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": "test server",
"interfaces": [
{
"type": 1,
"main": 1,
"useip": 1,
"ip": "192.168.1.1",
"dns": "",
"port": "10050"
}
],
"groups": [
{
"groupid": "47"
}
],
"templates": [
{
"templateid": "10192"
}
],
"inventory": {
"macaddress_a": "01234",
"macaddress_b": "56768"
}
},
"auth": "3eb0c4653e2bea2ec673502b2b8cc920",
"id": 1
}
# curl -s -X POST -H 'Content-Type: application/json' --data @testem.json http://localhost/api_jsonrpc.php | json_reformat
{
"jsonrpc": "2.0",
"error": {
"code": -32700,
"message": "Parse error",
"data": "Invalid JSON. An error occurred on the server while parsing the JSON text."
},
"id": null
}
I just can't figure what I'm doing wrong.
I'm using zabbix 2.0.3 and I'm trying to create host with host.create method. Here's an example (this is actually example from https://www.zabbix.com/documentation...pi/host/create with grouid, templateid and auth changed)
# cat testme.json
{
"jsonrpc": "2.0",
"method": "host.create",
"params": {
"host": "test server",
"interfaces": [
{
"type": 1,
"main": 1,
"useip": 1,
"ip": "192.168.1.1",
"dns": "",
"port": "10050"
}
],
"groups": [
{
"groupid": "47"
}
],
"templates": [
{
"templateid": "10192"
}
],
"inventory": {
"macaddress_a": "01234",
"macaddress_b": "56768"
}
},
"auth": "3eb0c4653e2bea2ec673502b2b8cc920",
"id": 1
}
# curl -s -X POST -H 'Content-Type: application/json' --data @testem.json http://localhost/api_jsonrpc.php | json_reformat
{
"jsonrpc": "2.0",
"error": {
"code": -32700,
"message": "Parse error",
"data": "Invalid JSON. An error occurred on the server while parsing the JSON text."
},
"id": null
}
I just can't figure what I'm doing wrong.
Comment