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

Unable to update tags for discovered triggers via API

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 6.0.28, 7.0.0beta3
    • API (A)
    • None

      As described in the summary - the API cannot be used to update triggers created using trigger prototypes. 

      trigger.update returns an error:

      "data": "Cannot update \"tags\" for a discovered trigger"

      Here's example of running sample query to a usual trigger, and discovered one, with the responses.

      Manually created trigger:

      Request:

      {
          "jsonrpc": "2.0",
          "method": "trigger.update",
          "params": {
              "triggerid": "23289",
              "tags": [
                  {
                      "tag": "scope",
                      "value": "test"
                  },
                  {
                      "tag": "error",
                      "value": ""
                  }
              ]
          },
          "id": 1
      }

      Response:

      {
          "jsonrpc": "2.0",
          "result": {
              "triggerids": [
                  "23289"
              ]
          },
          "id": 1
      }

      Trigger updated, new tags applied.

      Discovered trigger:

      Request:

      {
          "jsonrpc": "2.0",
          "method": "trigger.update",
          "params": {
              "triggerid": "23292",
              "tags": [
                  {
                      "tag": "scope",
                      "value": "test"
                  },
                  {
                      "tag": "error",
                      "value": ""
                  }
              ]
          },
          "id": 1
      }

      Response:

      {
          "jsonrpc": "2.0",
          "error": {
              "code": -32500,
              "message": "Application error.",
              "data": "Cannot update \"tags\" for a discovered trigger \"/: Disk space is critically low\".",
              "debug": [
                  {
                      "file": "/usr/share/zabbix/include/classes/api/CApiService.php",
                      "line": 1201,
                      "function": "exception",
                      "class": "CApiService",
                      "type": "::"
                  },
                  {
                      "file": "/usr/share/zabbix/include/classes/api/services/CTriggerGeneral.php",
                      "line": 1182,
                      "function": "checkPartialValidator",
                      "class": "CApiService",
                      "type": "->"
                  },
                  {
                      "file": "/usr/share/zabbix/include/classes/api/services/CTrigger.php",
                      "line": 568,
                      "function": "validateUpdate",
                      "class": "CTriggerGeneral",
                      "type": "->"
                  },
                  {
                      "file": "/usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php",
                      "line": 131,
                      "function": "update",
                      "class": "CTrigger",
                      "type": "->"
                  },
                  {
                      "file": "/usr/share/zabbix/include/classes/core/CJsonRpc.php",
                      "line": 104,
                      "function": "callMethod",
                      "class": "CLocalApiClient",
                      "type": "->"
                  },
                  {
                      "file": "/usr/share/zabbix/api_jsonrpc.php",
                      "line": 63,
                      "function": "execute",
                      "class": "CJsonRpc",
                      "type": "->"
                  }
              ]
          },
          "id": 1
      }

            mbuz Maksym Buz
            mbuz Maksym Buz
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: