Go to main content

Oracle® Rack Universal Power Distribution Unit User's Guide

Exit Print View

Updated: May 2019
 
 

Writing or Loading a Lua Script

You can enter or load up to 4 scripts to the HPDU.


Note -  If you can no longer enter or load a new script after reaching the upper limit, you can either delete any script or modify or replace script codes.
  1. Select Device Settings → Lua Scripts → + Create New Script.
  2. Type a name for this script. Its length ranges between 1 to 63 characters.

    The name must contain only alphanumeric characters, underscore (_), and minus (-), with no spaces.

  3. Determine whether and when to automatically execute the loaded script.
    Lua Script Setting
    Description
    Start automatically at system boot
    When the HPDU reboots, the script is automatically executed.
    Restart after termination
    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.
    1. Click + Add argument.
    2. Type the key and value.
    3. Repeat Steps 4a and 4b to enter more arguments as needed.
    4. To remove an argument, click - (Minus button) next to it.

      Note -  Default arguments are overridden by the new arguments specified with the Start with Arguments command or with any Lua-script-related event rule.
  5. In the Source Code section, do one of the following. It is recommended to leave the Enable Syntax Highlighting check box selected unless you do not need different text colors to identify diverse code syntaxes.
    • To write a Lua script, type the codes in the Source Code section.
    • To load an existing Lua script file, click Load Local File.
    • To use one of the Lua script examples, click Load Example.

      Caution

      Caution  -  The new script overwrites all codes in the Source Code section. Therefore, do not load a new script if the current script meets your needs.


  6. Click Create.
  7. To execute the newly-added script immediately, click Start or the three vertical dots → Start with Arguments.
  8. To add more scripts, return to the scripts list by clicking Lua Scripts at the top of the page or in the Menu, and repeat Steps 1-7.