Ad Widget

Collapse

Help with Zabbix API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bercko21
    Junior Member
    • Dec 2015
    • 7

    #1

    Help with Zabbix API

    Hello,
    I'm trying to use a script to add hosts to pre-created maintenance.
    I don't have anby expirience working with API and JSON and this is my first try.
    I have a script that logged in, get the authentication token and create the maintenance and get it's ID.

    Afterward, I'm trying to add hosts to the maintenance using this command:

    curl -s -X POST -H 'Content-Type: application/json-rpc' -d '
    {
    "jsonrpc": "2.0",
    "method": "maintenance.update",
    "params": {
    "maintenanceid": "40",
    "hostids": [
    "10108",
    "10114"
    ]
    },
    "auth": "b760203158f58ae193241fddec63cc5e",
    "id": 1
    }
    ' http://$zabbixserver/zabbix/api_jsonrpc.php

    The JSON in straight from the API manual (https://www.zabbix.com/documentation...tenance/update)

    After execution, I'm getting the following error:

    "id": 1,
    "error": {
    "data": "\"Active since\" must be between 1970.01.01 and 2038.01.18.",
    "message": "Invalid params.",
    "code": -32602
    },
    "jsonrpc": "2.0"

    Any idea how to solve it?
    Thanks!
Working...