manual:api:reference:trigger:create

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
manual:api:reference:trigger:create [2016/02/16 15:25]
127.0.0.1 external edit
manual:api:reference:trigger:create [2016/10/13 11:45]
iivs updated example
Line 15: Line 15:
 ^ Parameter ^ Type ^ Description ^ ^ Parameter ^ Type ^ Description ^
 | dependencies | array | Triggers that the trigger is dependent on. \\ \\ The triggers must have the ''​triggerid''​ property defined. | | dependencies | array | Triggers that the trigger is dependent on. \\ \\ The triggers must have the ''​triggerid''​ property defined. |
 +| tags         | array | Trigger tags. |
  
 <note important>​The trigger expression has to be given in its expanded form.</​note>​ <note important>​The trigger expression has to be given in its expanded form.</​note>​
Line 32: Line 33:
     "​jsonrpc":​ "​2.0",​     "​jsonrpc":​ "​2.0",​
     "​method":​ "​trigger.create",​     "​method":​ "​trigger.create",​
-    "​params": ​{ +    "​params": ​[ 
-        "​description":​ "​Processor load is too high on {HOST.NAME}",​ +        ​
-        "​expression":​ "​{Linux server:​system.cpu.load[percpu,​avg1].last()}>​5",​ +            ​"​description":​ "​Processor load is too high on {HOST.NAME}",​ 
-        "​dependencies":​ [ +            "​expression":​ "​{Linux server:​system.cpu.load[percpu,​avg1].last()}>​5",​ 
-            { +            "​dependencies":​ [ 
-                "​triggerid":​ "14062+                { 
-            } +                    "​triggerid":​ "​17367"​ 
-        +                } 
-    },+            ​
 +        }, 
 +        ​{ 
 +            "​description":​ "​Service status",​ 
 +            "​expression":​ "​{Linux server:​log[/​var/​log/​system,​Service .* has stopped].strlen()}<>​0",​ 
 +            "​dependencies":​ [ 
 +                ​
 +                    ​"​triggerid":​ "17368" 
 +                } 
 +            ​], 
 +            "​tags":​ [ 
 +                { 
 +                    "​tag":​ "​service",​ 
 +                    "​value":​ "​{{ITEM.VALUE}.regsub(\"​Service (.*) has stopped\",​ \"​\\1\"​)}"​ 
 +                }, 
 +                { 
 +                    "​tag":​ "​error",​ 
 +                    "​value":​ ""​ 
 +                } 
 +            ​
 +        } 
 +    ],
     "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​     "​auth":​ "​038e1d7b1735c6a5436ee9eae095879e",​
     "​id":​ 1     "​id":​ 1
Line 52: Line 74:
     "​result":​ {     "​result":​ {
         "​triggerids":​ [         "​triggerids":​ [
-            "14102"+            "17369",​ 
 +            "17370"
         ]         ]
     },     },