You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

discoveryruleprototype.create

Description

object discoveryruleprototype.create(object/array lldRules)

This method allows to create new LLD rule prototypes.

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.

Parameters

(object/array) LLD rule prototypes to create.

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

Parameter Type Description
filter object LLD rule prototype filter for the LLD rule.
preprocessing object/array LLD rule prototype preprocessing options.
lld_macro_paths object/array LLD rule prototype lld_macro_path options.
overrides object/array LLD rule prototype overrides options.

Return values

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

Examples

Creating an LLD rule prototype

Create an LLD rule prototype (Type: Nested) to discover tablespaces in database instance.

Request:

{
           "jsonrpc": "2.0",
           "method": "discoveryruleprototype.create",
           "params": {
               "name": "Discover tablespaces for {#DB}",
               "key_": "db.tablespace.discovery[{#DB}]",
               "hostid": "10084",
               "ruleid": "47251",
               "type": 23
           },
           "id": 1
       }

Response:

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

See also

Source

CDiscoveryRulePrototype::create() in ui/include/classes/api/services/CDiscoveryRulePrototype.php.