Ad Widget

Collapse

The validation error of Action create API can not be resolved on Zabbix Server 3.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcy-terui
    Junior Member
    • Jul 2019
    • 1

    #1

    The validation error of Action create API can not be resolved on Zabbix Server 3.0

    Hi there,

    I want to create an auto-registration action using Zabbix API. However, the API returns incorrect error messages and I can't be resolved it.
    I sent the following API request.

    Code:
    {
        "jsonrpc": "2.0",
        "method": "action.create",
        "params": {
            "esc_period": 0,
            "eventsource": 3,
            "status": 0,
            "operations": [
                {
                    "operationtype": 2
                },
                {
                    "operationtype": 4,
                    "opgroup": [
                        {
                            "groupid": "2"
                        }
                    ]
                },
                {
                    "operationtype": 6,
                    "optemplate": [
                        {
                            "templateid": "10001"
                        }
                    ]
                },
                {
                    "operationtype": 9
                }
            ],
            "filter": {
                "conditions": [
                    {
                        "conditiontype": 24,
                        "value": "foobar",
                        "operator": 2
                    }
                ],
                "evaltype": 0
            }
        },
        "id": 5,
        "auth": "0d0ba37e88481f1e4da2fcce68de1eab"
    }
    Then, Server returns the response including the following message.
    The message does not tell me what is incorrect parameter...

    Code:
    {
         "jsonrpc": "2.0",
         "error": {
             "code": -32602,
             "message": "Invalid params.",
             "data": "Incorrect parameter for action \"\"."
         },
         "id": 5
     }
    I sent the request like an example in the document, but the results were the same.
    https://www.zabbix.com/documentation.../action/create

    Code:
    {
        "jsonrpc": "2.0",
        "method": "action.create",
        "params": {
            "esc_period": 0,
            "eventsource": 1,
            "status": 0,
            "operations": [
                {
                    "esc_step_from": 1,
                    "esc_period": 0,
                    "optemplate": [
                        {
                            "templateid": "10001"
                        }
                    ],
                    "operationtype": 6,
                    "esc_step_to": 1
                }
            ],
            "filter": {
                "evaltype": 0,
                "conditions": [
                    {
                        "conditiontype": 21,
                        "value": "1"
                    },
                    {
                        "conditiontype": 10,
                        "value": "2"
                    }
                ]
            }
        },
        "id": 5,
        "auth": "a035fb2afd6deba37de08ce1a7285769"
    }
    ​​​​​​​
    I tried the following versions using zabbix official docker images.
    • zabbix-server-mysql + zabbix-web-apache-mysql
      • alpine-3.0.12
      • alpine-3.0.28
      • centos-3.0.28
    • mysql 5.7

    I am stuck. Is this a bug? Does anyone have any ideas?
    Last edited by marcy-terui; 01-08-2019, 10:26.
Working...