This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

trigger.getobjects

Description

array trigger.getobjects(object filter)

This method allows to retrieve triggers that match the given filter criteria.

This method is deprecated and will be removed in the future. Please use trigger.get instead.

Parameters

(object) Criteria to search by.

Additionally to the standard standard trigger properties the following parameters are supported as search criteria.

Parameter Type Description
host string/array Technical name of the host that the trigger belongs to.
hostid string/array ID of the host that the trigger belongs to.

Return values

(array) Returns an array of objects with all properties.

Examples

Retrieving triggers by name

Retrieve triggers with the name "/etc/passwd has been changed on {HOST.NAME}" from two hosts.

Request:

{
           "jsonrpc": "2.0",
           "method": "trigger.getobjects",
           "params": {
               "description": "/etc/passwd has been changed on {HOST.NAME}",
               "hostid": [
                   "30069",
                   "30049"
               ]
           },
           "auth": "3a57200802b24cda67c4e4010b50c065",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "triggerid": "13938",
                   "expression": "{13385}>0",
                   "description": "/etc/passwd has been changed on {HOST.NAME}",
                   "url": "",
                   "status": "0",
                   "value": "0",
                   "priority": "2",
                   "lastchange": "0",
                   "comments": "",
                   "error": "Agent is unavailable.",
                   "templateid": "10016",
                   "type": "0",
                   "value_flags": "1",
                   "flags": "0"
               },
               {
                   "triggerid": "14062",
                   "expression": "{13513}>0",
                   "description": "/etc/passwd has been changed on {HOST.NAME}",
                   "url": "",
                   "status": "0",
                   "value": "0",
                   "priority": "2",
                   "lastchange": "0",
                   "comments": "",
                   "error": "",
                   "templateid": "10016",
                   "type": "0",
                   "value_flags": "0",
                   "flags": "0"
               }
           ],
           "id": 1
       }

See also

Source

CTrigger::getObject() in frontends/php/include/classes/api/services/CTrigger.php.