Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18082

API request action.create doesn't validate conditiontype field

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.2
    • API (A)
    • None

      Steps to reproduce:

      Send the following request:

      {
        "jsonrpc": "2.0",
        "method": "action.create",
        "params": {
          "name": "Some Error Notification",
          "eventsource": 0,
          "status": 0,
          "esc_period": "{$TLDM.ACK.ESC.PERIOD}",
          "filter": {
            "evaltype": 0,
            "conditions": [{ "conditiontype": 2, "operator": 0, "value": "16782" }]
          },
          "operations": [
            {
              "operationtype": 0,
              "esc_period": "0",
              "esc_step_from": "2",
              "esc_step_to": "0",
              "evaltype": 0,
              "opmessage_usr": [{ "userid": "30" }],
              "opcommand_hst": [{ "hostid": 0 }],
              "opmessage": {
                "default_msg": 0,
                "subject": "{\"host\":\"{HOST.ID}\",\"item\":\"{{ITEM.KEY}.regsub(\"tldm.comp.(.+).result\", \"tldm.\\1.problem\")}\"}",
                "message": "REMINDER - compliance violation for <origin>\nThis is an automatic compliance violation message.\nOrigin: <origin>\nCheck result: <descr>\nTechnical error message: <error_msg>",
                "mediatypeid": "18"
              },
              "opcommand": {},
              "opconditions": [{ "contidiontype": 14, "value": "1", "operator": 0 }]
            }
          ],
          "recovery_operations": []
        },
        "id": 1,
        "auth": "7b5c6c7fbbe2420227a465b03b581752"
      }
      
      

      Please note there is a typo in the conditiontype field.

      Result:
      See screenshot:

      Expected:
      Given that conditiontype parameter is mandatory I'd expect this request to fail, not to create garbage condition.

            zabbix.dev Zabbix Development Team
            Kalimulin Alex Kalimulin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: