This is a translation of the original English documentation page. Help us make it better.



object drule.create(object/array discoveryRules)

This method allows to create new discovery rules.

This method is only available to Admin and Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.


(object/array) Discovery rules to create.

Additionally to the standard discovery rule properties, the method accepts the following parameters.

Parameter Type Description
array Discovery checks to create for the discovery rule.

Visszatérési értékek

(object) A létrehozott objektum azonosítóit tartalmazó objektumot ad vissza felfedezési szabályok a "druleids" tulajdonság alatt. A sorrend a a visszaadott azonosítók megfelelnek az átadott felfedezési szabályok sorrendjének.


Create a discovery rule

Create a discovery rule to find machines running the Zabbix agent in the local network. The rule must use a single Zabbix agent check on port 10050.


           "jsonrpc": "2.0",
           "method": "drule.create",
           "params": {
               "name": "Zabbix agent discovery",
               "iprange": "",
               "dchecks": [
                       "type": "9",
                       "key_": "system.uname",
                       "ports": "10050",
                       "uniq": "0"
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1


           "jsonrpc": "2.0",
           "result": {
               "druleids": [
           "id": 1

Lásd még


CDRule::create() az ui/include/classes/api/services/CDRule.php-ban.