Ad Widget

Collapse

autoregistration json

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gzizzi
    Junior Member
    • Apr 2016
    • 2

    #1

    autoregistration json

    Hello
    I'm tryng to configure the auto-registration on a Zabbix server using the API, but I'm experiencing some problems.
    Here the json file:

    Code:
    {
        "jsonrpc": "2.0",
        "method": "action.create",
        "params": {
            "name": "Auto registration",
            "eventsource": 2,
            "status": 0,
            "esc_period": 120,
            "operations": [
                  {
                      "operationtype": 6,
                      "optemplate": [
                           {
                             "templateid": "10001"
                           }
                     ]
                  }
            ]
         },
        "auth": "<login-token>",
        "id": 2
    }
    used with the command:

    Code:
    curl -k -H "Content-Type: application/json" -X POST --data @autoregistration.json https://zabbix-fronted:443/api_jsonrpc.php
    The output is :

    Code:
    {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params.","data":"Incorrect parameter for action \"Auto registration\"."},"id":2}
    What's wrong with the json file?

    I'm using Zabbix 2.2.

    Thanks in advance,
    Giovanni
  • gzizzi
    Junior Member
    • Apr 2016
    • 2

    #2
    Solved. The problem was due to the incorrect value of the "id" parameter (2 instead of 1)

    Comment

    Working...