Zabbix Documentation 1.8

Sidebar

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve trigger details based on filtering options. All parameters are optional. If parameter is set in query, this option is considered as being ON, except if parameter is equal to NULL.

Parameters

Parameter Type Description Details
nodeids array Node IDs
groupids array HostGroup IDs
templateids array Template IDs
hostids array Host IDs
triggerids array Trigger IDs
itemids array Item IDs
applicationids array Application IDs
functions array Trigger functions
inherited integer Inherited from template s "0" - not inherited, "1" - inherited
templated integer Templated triggers "0" - belongs to hosts, "1" - belongs to templates
monitored integer Monitored triggers Checks trigger, item and host status
active integer Monitored triggers Checks trigger and host status
maintenance integer Triggers in maintenance
withUnacknowledgedEvents integer Triggers with unacknowledged events
withAcknowledgedEvents integer Triggers with acknowledged events
withLastEventUnacknowledged integer Triggers with last unacknowledged events
skipDependent integer Do not select dependent triggers in PROBLEM state
editable integer only with read-write permission. Ignored for SuperAdmins
lastChangeSince string Optional filter by last changed state time
lastChangeTill string Optional filter by last changed state time
group string Optional filter by host group name
host string Optional filter by host name
only_true string Triggers in state PROBLEM and recently switched (30 min)
min_severity string Optional filter by severity
filter array Optional filter by trigger fields
search array Return triggers by any given object field pattern
startSearch integer Search triggers field pattern only in start of the field
excludeSearch integer Exclude from result, triggers by given field pattern
searchWildcardsEnabled integer Search pattern in whole field using wildcards 1 - enable, 0 - disable
output string Output options Values: shorten, refer, extend
expandData string Adds additional fields to triggers default host, hostid
expandDescription string Expands trigger description Expands macros
select_groups string Select host groups Values: shorten, refer, extend
select_hosts string Select hosts Values: shorten, refer, extend
select_items string Select trigger items Values: shorten, refer, extend
select_functions string Select trigger functions Values: shorten, refer, extend
select_dependencies string Select trigger dependencies Values: shorten, refer, extend
countOutput integer Count triggers, return the number of triggers found
groupCount integer Return the number of results grouped by given IDs
preservekeys integer Return hash instead of array Keys of hash are object IDs
sortfield string Sort by trigger field Values: triggerid,description,status,priority,lastchange
sortorder string Sort order Values: ASC, DESC
limit int max number of trigger objects to return

Returns

Parameter Description
result Operation successful. Result will contain array of trigger objects.
error In case of any errors

Example

Get triggers details by trigger descriptions "APC: System UPS Global State", "APC: System UPS Load" in host "ZABBIX-Server":

{
       "jsonrpc": "2.0",
       "method": "trigger.get",
       "params": {
           "filter": {
               "host": ["ZABBIX-Server"],
               "description": ["APC: System UPS Global State", "APC: System UPS Load"]
           },
           "output": "extend"
       },
       "auth": "6f38cddc44cfbb6c1bd186f9a220b5a0",
       "id": 2
       }

Retrieved trigger details:

{
       "jsonrpc": "2.0",
       "result": [{
           "triggerid": "100100000013502",
           "expression": "{100100000013078}=0",
           "description": "APC: System UPS Global State",
           "url": "",
           "status": "0",
           "value": "2",
           "priority": "1",
           "lastchange": "1277987805",
           "dep_level": "0",
           "comments": "System UPS Global State",
           "error": "Zabbix was restarted.",
           "templateid": "0",
           "type": "0"
       },
       {
           "triggerid": "100100000013503",
           "expression": "{100100000013077}=0",
           "description": "APC: System UPS Load",
           "url": "",
           "status": "0",
           "value": "2",
           "priority": "2",
           "lastchange": "1273213952",
           "dep_level": "0",
           "comments": "System UPS Load",
           "error": "Host is unavailable.",
           "templateid": "0",
           "type": "0"
       }],
       "id": 2
       }