User Tools

Site Tools


Sidebar

1.8:api:trigger

Trigger

Methods

Class containing methods for operations with Triggers.

MethodsDescription
get() Get trigger details
exists() Check if trigger exists
create() Create triggers
update() Update trigger details
delete() Delete triggers
addDependencies() Delete triggers
deleteDependencies() Delete triggers

Object details

The table contains complete list of Trigger attributes.

ParameterTypeDescriptionDetails
triggeridintegerTrigger ID
descriptionstringTrigger name
expressionstringExpression
urlstringReferenced URL
statusintegerStatus
valueintegerState
priorityintegerSeverity
lastchangeintegerTime of last state change
dep_levelintegerDependency level
commentsintegerDescription
errorintegerError
templateidintegerParent trigger ID
typeintegerEvent generation

Field values

Status

ValueType
0Trigger is active
1Trigger is disabled

Value

ValueType
0 OK
1 PROBLEM
2 UNKNOWN

Priority

ValueType
0Not classified
1Information
2Warning
3Average
4High
5Disaster

Type

ValueType
0Normal event generation
1Generate multiple PROBLEM events

Common tasks

The table contains list of common trigger-related tasks and possible implementation using Zabbix API

TaskHOWTO
Add an trigger Use method trigger.create
Add a bunch of new triggers Use method trigger.create with array of Trigger objects
Enable an trigger Use method trigger.update, set “status”:0
Disable an trigger Use method trigger.update, set “status”:1
Retrieve trigger details by Trigger IDs Use method trigger.get with parameter triggerids
Retrieve triggers details by Host name Use method trigger.get with parameter filter, specify “host”: [”<your host1>”]