21.1.3 Specifications for advanced scripts
- <Structure of this section>
(1) Script Classification
Scripts are divided into the following three types according to the startup method.
Script type |
Description |
---|---|
Command script |
Execute the operation command python to start thescript. |
Resident script |
Start the script as a resident program. Starts the file installed by the operation command install script by specifying it in the configuration command resident-script. |
Event startup script |
Starts the script when a monitoring event is detected. After installing a file using the operation command install script, use the applet function configuration command to specify the association between the monitoring event and the file to be started. |
(2) Standard input and output of scripts
The following table shows the support for standard input/output for scripts.
Script type |
Standard input |
Standard output |
Standard error output |
---|---|---|---|
Command script |
OK |
OK |
OK |
Resident script |
NG |
NG |
OK # |
Event startup script |
NG |
NG |
OK # |
(Legend) OK: Supported NG: Not supported
- #
-
This can be checked using the operation-command dump script-user-program.
(3) Script-only user
Resident scripts and event startup scripts operate with the privileges of the script-only user. The following table describes the script-only users.
Item |
User information |
---|---|
User name |
script |
Home directory |
/opt/script |
(4) Access authority
You can access the directories and files on the Switch using scripts that are executed by the Switch. The following table lists the range of directories and files that can be accessed by scripts.
Access type |
Description |
---|---|
Command script |
Follow the user privileges that invoked the command script. |
Resident script |
Follow the privileges of the script-only user. |
Event startup script |
(5) Number of scripts that can be executed simultaneously
The Switch can execute multiple scripts at the same time by starting multiple scripts. The following table shows the number of scripts that can be executed simultaneously.
Script type |
Maximum number of concurrent executions |
---|---|
Command script |
4 |
Resident script |
4 |
Event startup script |
4 |