Zabbix Documentation 1.8

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

api:trigger:get

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

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
groupidsarrayHostGroup IDs
templateidsarrayTemplate IDs
hostidsarrayHost IDs
triggeridsarrayTrigger IDs
itemidsarrayItem IDs
applicationidsarrayApplication IDs
functionsarrayTrigger functions
inheritedintegerInherited from template s “0” - not inherited, “1” - inherited
templatedintegerTemplated triggers “0” - belongs to hosts, “1” - belongs to templates
monitoredintegerMonitored triggers Checks trigger, item and host status
activeintegerMonitored triggers Checks trigger and host status
maintenanceintegerTriggers in maintenance
withUnacknowledgedEventsintegerTriggers with unacknowledged events
withAcknowledgedEventsintegerTriggers with acknowledged events
withLastEventUnacknowledgedintegerTriggers with last unacknowledged events
skipDependentintegerDo not select dependent triggers in PROBLEM state
editableintegeronly with read-write permission. Ignored for SuperAdmins
lastChangeSincestringOptional filter by last changed state time
lastChangeTillstringOptional filter by last changed state time
groupstringOptional filter by host group name
hoststringOptional filter by host name
only_truestringTriggers in state PROBLEM and recently switched (30 min)
min_severitystringOptional filter by severity
filterarrayOptional filter by trigger fields
searcharrayReturn triggers by any given object field pattern
startSearchintegerSearch triggers field pattern only in start of the field
excludeSearchintegerExclude from result, triggers by given field pattern
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
expandDatastringAdds additional fields to triggers default host, hostid
expandDescriptionstringExpands trigger description Expands macros
select_groupsstringSelect host groups Values: shorten, refer, extend
select_hostsstringSelect hosts Values: shorten, refer, extend
select_itemsstringSelect trigger items Values: shorten, refer, extend
select_functionsstringSelect trigger functions Values: shorten, refer, extend
select_dependenciesstringSelect trigger dependencies Values: shorten, refer, extend
countOutputintegerCount triggers, return the number of triggers found
groupCountintegerReturn the number of results grouped by given IDs
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by trigger field Values: triggerid,description,status,priority,lastchange
sortorderstringSort order Values: ASC, DESC
limitintmax number of trigger objects to return

Returns

Parameter Description
resultOperation 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
}