Updated on 2023-08-17 GMT+08:00

Creating a Script

CBH gives you the ability to manage scripts. You can execute scripts to perform complicated or repetitive operation tasks, improving O&M efficiency. CBH allows you to 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 CBH.

Constraints

  • Script management is available only in the CBH professional editions.
  • Currently, you can manage Python and Shell scripts with CBH.
  • Your scripts can be managed only by yourself and cannot be managed by other users in the CBH system.

Prerequisites

You have the management permissions for the Script module.

Procedure

  1. Log in to the CBH system.
  2. Choose Operation > Script to go to the script management page.

    Figure 1 List of scripts

  3. Click New in the upper right corner of the page.

    Figure 2 New Script

  4. 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

  5. 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.