manual:config:items:itemtypes:script

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
manual:config:items:itemtypes:script [2020/11/25 08:14]
martins-v adding external link to JS guide (ZBX-18653)
manual:config:items:itemtypes:script [2021/01/27 20:27] (current)
Line 21: Line 21:
 ^Field^Description^ ^Field^Description^
 |Key    | Enter a unique key that will be used to identify the item.   | |Key    | Enter a unique key that will be used to identify the item.   |
-|Parameters ​  | Specify the variables to be passed to the script as the attribute and value pairs. \\ [[:​manual/​config/​macros|Built-in macros]] {HOST.CONN},​ {HOST.DNS}, {HOST.HOST},​ {HOST.IP}, {HOST.NAME} and [[manual/​config/​macros/​user_macros|user macros]] are supported. |+|Parameters ​  | Specify the variables to be passed to the script as the attribute and value pairs. \\ [[:​manual/​config/​macros|Built-in macros]] {HOST.CONN},​ {HOST.DNS}, {HOST.HOST},​ {HOST.IP}, {HOST.NAME}, {ITEM.ID}, {ITEM.KEY}, {ITEM.KEY.ORIG} and [[manual/​config/​macros/​user_macros|user macros]] are supported. |
 |Script ​    | Enter JavaScript code in the block that appears when clicking in the parameter field (or on the view/edit button next to it). This code must provide the logic for returning the metric value.\\ The code has access to all parameters, it may perform HTTP GET, POST, PUT and DELETE requests and has control over HTTP headers and request body.\\ See also: [[:​manual/​config/​items/​preprocessing/​javascript/​javascript_objects|Additional JavaScript objects]], [[https://​developer.mozilla.org/​en-US/​docs/​Web/​JavaScript/​Guide|JavaScript Guide]]. ​ | |Script ​    | Enter JavaScript code in the block that appears when clicking in the parameter field (or on the view/edit button next to it). This code must provide the logic for returning the metric value.\\ The code has access to all parameters, it may perform HTTP GET, POST, PUT and DELETE requests and has control over HTTP headers and request body.\\ See also: [[:​manual/​config/​items/​preprocessing/​javascript/​javascript_objects|Additional JavaScript objects]], [[https://​developer.mozilla.org/​en-US/​docs/​Web/​JavaScript/​Guide|JavaScript Guide]]. ​ |
 |Timeout | JavaScript execution timeout (1-60s, default 3s). \\ Time suffixes are supported, e.g. 30s, 1m.| |Timeout | JavaScript execution timeout (1-60s, default 3s). \\ Time suffixes are supported, e.g. 30s, 1m.|