Zabbix Documentation 1.8

3.04.04.24.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.4Guidelines

User Tools

Site Tools


Sidebar

api:trigger:create

Table of Contents

create()

This function allows you to create a trigger as defined by the trigger data array.

Parameters

Parameter Type OptionalDescriptionDetails
trigger dataarray or object Array of Trigger objects or a single objecttriggerid shouldn't be specified

Returns

Parameter Description
resultOperation successful. Result will contain array of created Trigger IDs. triggerid are assigned to each Trigger object
error In case of any errors

Example

Create new trigger for host “ZABBIX-Server” and enable it

{
"jsonrpc": "2.0",
"method": "trigger.create",
"params": [{
	"description": "TEST_MACRO",
	"expression": "{ZABBIX-Server:vfs.fs.inode[/,{$MACRO}].max(\"{$MACRO2}\")}={$MACRO3}",
	"status": 0
}],
"auth": "038e1d7b1735c6a5436ee9eae095879e",
"id": 2
}

Trigger created successfully:

{
"jsonrpc": "2.0",
"result": {
   "triggerids": ["100100000214797"]
},
"id": 2
}

Trigger already exists:

{
"jsonrpc": "2.0",
"error": {
      "code": -32602,
      "message": "Invalid params.",
      "data": "[ CTrigger::create ] Cannot create Trigger"
},
"id": 2
}