Creating a Script
You can use a bastion host to manage scripts. You can execute scripts to perform complicated or repetitive operation tasks, improving O&M efficiency. You can compile scripts online or import scripts by file.
This topic describes how to create a script.
HSS-Agent automatic download and installation scripts have been built in bastion hosts.
Constraints
- Script management is supported by professional editions only.
- Currently, Python and Shell script can be managed.
- Your scripts can be managed by yourself, administrator, or department administrator.
Prerequisites
You have the management permissions for the Script module.
Procedure
- Log in to your bastion host.
- Choose Operation > Script to go to the script management page.
- Click New in the upper right corner of the page.
- In the displayed New Script dialog box, configure the basic information about the script.
Table 1 Script information parameters Parameter
Description
Source
The script content source. This parameter can be set to Edit online or From file.
- Edit online: indicates that you can edit the script information online to form your script.
- From file: indicates that you can import an offline script file to form your script. The file cannot exceed 5 MB in size.
Department Name
Department to which the host resource belongs.
Name
Name of the script. For a user-defined script rule, the script name must be unique in the system.
NOTE:For the script imported by file, the name is automatically filled based on the name of the imported file.
Remarks
Brief script description
- Click OK. The system returns to the script list page, and you can view the information about the new script.
Follow-up Operations
After creating an online edited script, you can edit the script online on the script details page. For more details, see Viewing and Modifying Script Information.
- Constraints
- Prerequisites
- Procedure
- Follow-up Operations