object itemprototype.create(object/array itemPrototypes)
This method allows to create new item prototypes.
(object/array)
Item prototype to create.
Additionally to the standard item prototype properties, the method accepts the following parameters.
Parameter | Type | Description |
---|---|---|
ruleid (required) |
string | ID of the LLD rule that the item belongs to. |
applications | array | IDs of applications to be assigned to the discovered items. |
(object)
Returns an object containing the IDs of the created item prototypes under the itemids
property. The order of the returned IDs matches the order of the passed item prototypes.
Create an item prototype to monitor free disc space on a discovered file system. Discovered items should be numeric Zabbix agent items updated every 30 seconds.
Request:
{
"jsonrpc": "2.0",
"method": "itemprototype.create",
"params": {
"name": "Free disk space on $1",
"key_": "vfs.fs.size[{#FSNAME},free]",
"hostid": "10197",
"ruleid": "27665",
"type": 0,
"value_type": 3,
"interfaceid": "112",
"delay": 30
},
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 1
}
Response:
CItemPrototype::create() in frontends/php/include/classes/api/services/CItemPrototype.php.