Zabbix Documentation 1.8

2.23.04.0 (current)In development:4.2 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

api:drule

DRule

Methods

Class containing methods for operations with Discovery Rules.

MethodsDescription
get() Get discovery rule details
exists() Check if discovery rule exists
create() Create discovery rules
update() Update discovery rule details
delete() Delete discovery rules

Object details

The table contains complete list of Discovery Rule attributes.

ParameterTypeDescriptionDetails
druleidintegerDiscovery Rule ID
proxy_hostidintegerProxy Host ID.
namestringDiscovery Rule name.
iprangestringIp range.
delayintegerDelay between checks
nextcheckintegerNext check date Zabbix internal field
statusintegerStatus
unique_dcheckidstringUnique discovery check ID

Common tasks

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

TaskHOWTO
Add a bunch of new discovery rules Use method discovery rule.create with array of Discovery Rule objects
Enable a discovery rule Use method drule.update, set “status”:0
Disable a discovery rule Use method drule.update, set “status”:1
Retrieve discovery rule details by Discovery Rule IDs Use method drule.get with parameter druleids
Retrieve discovery rule details by Discovery Rule name Use method drule.get with parameter filter, specify “name”:“<your discovery rule>“