Ad Widget

Collapse

Api snmp host create

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fernandogm
    Junior Member
    • Jul 2020
    • 1

    #1

    Api snmp host create

    Hi. I'm trying to create a snmp host using API. Looks like I'm missing params but don't know which ones.
    My code:
    {
    "jsonrpc": "2.0",
    "method": "host.create",
    "params": {
    "host": "Testing",
    "interfaces": [
    {
    "type": 2,
    "main": 1,
    "useip": 1,
    "ip": "192.168.3.1",
    "dns": "",
    "port": "161",
    "bulk": 1,
    }
    ],
    "groups": [
    {
    "groupid": "21"
    }
    ],
    "templates": [
    {
    "templateid": "10233"
    }
    ],
    },
    "auth": AUTHTOKEN,
    "id": 1
    }





    The result:
    {
    "error": {
    "code": -32602,
    "data": "Incorrect arguments passed to function.",
    "message": "Invalid params."
    },
    "id": 1,
    "jsonrpc": "2.0"
    }
  • gert.derouck
    Member
    • Jan 2020
    • 69

    #2
    Hi, looks like there's a comma too much...?

    "templateid": "10233"
    }
    ], <----
    },
    "auth": AUTHTOKEN,
    "id": 1
    }

    Comment

    Working...