Janu
ary 201
9
Legrand PDU User Guide 249
Lua Scripts
If you can write or obtain any Lua scripts, you can create or load them into the Legrand PDU to control its
behaviors.
Legrand also provides some Lua scripts examples, which you can load as needed.
Note: Not all Legrand Lua script examples can apply to your Legrand PDU model. You should read each
example's introduction before applying them.
You must have the Administrator Privileges to manage Lua scripts.
Writing or Loading a Lua Script
You can enter or load up to 4 scripts to the Legrand PDU.
Tip: If you can no longer enter or load a new script after reaching the upper limit, you can either delete any
existing script or simply modify/replace an existing script's codes. See
Modifying or Deleting a Script
(on
page 251).
To write or load a Lua script:
1. Choose Device Settings > Lua Scripts >
.
2. Type a name for this script. Its length ranges between 1 to 63 characters.
The name must contain the following characters only.
Alphanumeric
characters
Underscore
(_)
Minus
(-)
Note: Spaces are NOT permitted.
3. Determine whether and when to automatically execute the loaded script.
Checkbox
Behavior when selected
Start automatically at
system boot
Whenever the Legrand PDU reboots, the script is
automatically executed.
Restart after
termination
The script is automatically executed each time after 10
seconds since the script execution finishes.
4. (Optional) Determine the arguments that will be executed by default.
a. Click
.
b. Type the key and value.
c. Repeat the same steps to enter more arguments as needed.
To remove any existing argument, click
adjacent to it.
Note: The above default arguments will be overridden by new arguments specified with the "Start with
Arguments" command or with any Lua-script-related event rule. See
Manually Starting or Stopping a
Script
(on page 249) or
Start or Stop a Lua Script
(on page 220).
5. In the Source Code section, do one of the following. It is recommended to leave the Enable Syntax
Highlighting checkbox selected unless you do not need different text colors to identify diverse code
syntaxes.
Содержание 1U
Страница 1: ...Legrand PDU User Guide Xerus Firmware v3 5 0 ...
Страница 2: ...Copyright 2019 Legrand Inc LG 0B v3 5 0 E January 2019 255 80 0054 00 ...
Страница 53: ...January 2019 Legrand PDU User Guide 53 ...
Страница 77: ...January 2019 Legrand PDU User Guide 77 4 Press to show the Network Cascading page ...