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.

triggerprototype.create

Description

object triggerprototype.create(object/array triggerPrototypes)

This method allows to create new trigger prototypes.

Parameters

(object/array) Trigger prototypes to create.

The method accepts trigger prototypes with the standard trigger prototype properties.

The trigger expression has to be given in its expanded form and must contain at least one item prototype.

Return values

(object) Returns an object containing the IDs of the created trigger prototypes under the triggerids property. The order of the returned IDs matches the order of the passed trigger prototypes.

Examples

Creating a trigger prototype

Create a trigger prototype to detect when a file system has less than 20% free disk space.

Request:

{
           "jsonrpc": "2.0",
           "method": "triggerprototype.create",
           "params": {
               "description": "Free disk space is less than 20% on volume {#FSNAME}",
               "expression": "{Zabbix server:vfs.fs.size[{#FSNAME},pfree].last()}<20"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": {
               "triggerids": [
                   "15331"
               ]
           },
           "id": 1
       }

Source

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