Ad Widget

Collapse

zabbix api parse error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • badamovic
    Junior Member
    • Jul 2013
    • 2

    #1

    zabbix api parse error

    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.
  • badamovic
    Junior Member
    • Jul 2013
    • 2

    #2
    Has anyone succesfully used host.create method on zabbix 2.0.3? This is all I need to know, am I doing something wrong or should I upgrade my zabbix?

    Comment

    Working...