This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

discoveryrule.create

Description

object discoveryrule.create(object/array lldRules)

This method allows to create new LLD rules.

Parameters

(object/array) LLD rules to create.

The method accepts LLD rules with the standard LLD rule properties.

Return values

(object) Returns an object containing the IDs of the created LLD rules under the itemids property. The order of the returned IDs matches the order of the passed LLD rules.

Examples

Creating an LLD rule

Create a Zabbix agent LLD rule to discover mounted file systems. Discovered items will be updated every 30 seconds.

Request:

{
           "jsonrpc": "2.0",
           "method": "discoveryrule.create",
           "params": {
               "name": "Mounted filesystem discovery",
               "key_": "vfs.fs.discovery",
               "hostid": "10197",
               "type": "0",
               "interfaceid": "112",
               "delay": 30
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "itemids": [
                   "27665"
               ]
           },
           "id": 1
       }

Source

CDiscoveryRule::create() in frontends/php/api/classes/CDiscoveryRule.php.