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

triggerprototype.get API returns 500 error in case if parameter "host" is specified

XMLWordPrintable

    • Technical backlog

      Problem description: According to user documentation the triggerprototype.get API has a parameter "host", in which it is possible to fulter the returned trigger prototypes by hte name of the host. In reality "500 error" is returned if this parameter is specified in the triggerprototype.get API and the following runtime error is observed:

      TypeError: Argument 2 passed to dbConditionInt() must be of the type array, null given, called in /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/include/classes/api/services/CTriggerPrototype.php on line 365 and defined in /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/include/db.inc.php:657
      Stack trace:
      #0 /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/include/classes/api/services/CTriggerPrototype.php(365): dbConditionInt()
      #1 /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/include/classes/api/clients/CLocalApiClient.php(131): CTriggerPrototype->get()
      #2 /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/include/classes/core/CJsonRpc.php(104): CLocalApiClient->callMethod()
      #3 /home/ubuntu/workspace/ZBXNEXT-5878-6.5-2/ui/api_jsonrpc.php(63): CJsonRpc->execute()
      #4 {main}
      

      Steps to reproduce:

      1. Execute the following API call:
        {
            "jsonrpc": "2.0",
            "method": "triggerprototype.get",
            "params": {
            	"countOutput": false,
            	"output": "extend",
                "host": "Zabbix server"
            },
            "auth": "f66568cf052fdde43711f38a5451472f",
            "id": 1
        }
        

      Result: 500 error is returned and the above runtime error is observed
      Expected: a list of trigger prototypes that belondgs to "Zabbix server" host should be returned

            zabbix.dev Zabbix Development Team
            solonkins Sergejs Olonkins
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: