Zabbix Documentation 1.8

Sidebar

Table of Contents

get()

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

Parameters

Parameter Type Description Details
nodeids array Node IDs
druleids array Discovery rule IDs
dhostids array Discovery host IDs
dserviceids array Discovery service IDs
dcheckids array Discovery check IDs
editable integer only with read-write permission. Ignored for SuperAdmins
filter array Optional filter by discovery rule fields
search array Return discovery rules by any given discovery rule object field pattern
startSearch integer Search discovery rules field pattern only in start of the field
excludeSearch integer Exclude from result, discovery rules 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
selectDHosts string Select discovery hosts Values: shorten, refer, extend
selectDChecks string Select discovery checks Values: shorten, refer, extend
selectDServices string Select discovery services Values: shorten, refer, extend
countOutput integer Count discovery rules, return the number of discovery rules 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 discovery rule field Values: druleid, name
sortorder string Sort order Values: ASC, DESC
limit int max number of discovery rule objects to return

Returns

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

Example

Get discovery rules details by discovery rule name pattern "local":

{
       "jsonrpc":"2.0",
       "method":"drule.get",
       "params":{
           "search": {"name": "local"},
           "output": "extend"
       },
       "auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
       "id":2
       }

Retrieved discovery rule details:

{
       "jsonrpc":"2.0",
       "result":[{
           "druleid":"100100000000003",
           "proxy_hostid":"0",
           "name":"Local network",
           "iprange":"192.168.0.1-255",
           "delay":"3600",
           "nextcheck":"1280502905",
           "status":"0",
           "unique_dcheckid":"0"
       }],
       "id":2
       }