Updated on 2025-09-11 GMT+08:00

Overview

The script management function of COC is a core tool that helps you implement O&M automation. It provides efficient and accurate solutions for complex or repetitive O&M tasks. With script execution tools, you do not need to perform a large number of complex manual operations, configure devices one by one, and repeatedly execute tasks. Instead, you can create scripts to complete tasks at a time. This greatly shortens the task handling time and effectively avoids human misoperations, fundamentally improves the efficiency and accuracy of O&M.

The practical features of this function are reflected in multiple dimensions, and each feature solves the actual pain points in the O&M process.

  • Risk detection mechanism: Before a script is put into use, the system comprehensively scans the script's content to accurately identify high-risk operations, such as key file deletions, core configuration modification, and unauthorized access, and sends alarms to you in a timely manner. In addition, the system provides specific risk locations and modification suggestions for any risks detected. This mechanism blocks the execution path of dangerous scripts from the source, significantly reducing security risks such as system breakdown and data loss caused by script errors or malicious code.
  • Cross-OS compatibility: The system is compatible with two mainstream OSs: Windows and Linux. No matter whether the server cluster uses a single system or a hybrid system architecture, scripts can run smoothly. The script management function automatically performs syntax adaptation and environment verification based on different system features. For example, Shell scripts that are supported by Linux OS and PowerShell scripts that are compatible with the Windows OS will be used based on the actual OS used. You do not need to manually adjust the script format.
  • Wide resource coverage: Currently, multiple mainstream cloud resources, such as ECSs, BMSs, and FlexusL instances, are supported. You can use a unified script management portal to start operations on elastically scalable virtual servers, high-performance BMSs, and dedicated instances that have been optimized for specific applications. This function breaks management barriers between different resource types and meets centralized O&M requirements in diversified cloud environments.

Procedure Description

The script management process is clear and orderly, including the following operations:

  • Creating a script: Log in to COC, access the script management module, and click Create Script. On the displayed page, enter basic information such as the script name and description, select a proper script type (such as Shell, Python, and Bat) based on the target OS, and compile or upload the script content.
  • Executing a script: Select the target resource where the script is to be executed. You can select one or more ECSs, BMSs, and FlexusL instances. After the target resource is confirmed, you can send the script execution command. The system delivers the corresponding script to the selected resources and automatically executes the script. During the execution, you can view the execution progress and status in real time.
  • Viewing and managing the execution result: After the script is executed, a script service ticket record is generated to record the script execution result. In the result, you can find required information, such as whether the execution is successful and output logs, and can view the script service ticket. In addition, you can edit, delete, and reuse scripts. For details, see Managing Custom Scripts.

Here are some examples of how the script management function helps customers deliver proven value in the actual O&M scenarios: When security agents need to be centrally deployed for hundreds of ECSs, an automatic script can be used to complete all configurations within hours, replacing manual operations of several person-days. To periodically delete log files of each server, you only need to set the script execution period. The system will automatically trigger the deletion process to prevent logs from occupying the disk space. In cross-resource collaboration scenarios, for example, synchronizing the time server configurations of BMSs and FlexusL instances, scripts can be configured to access different resources in sequence based on the preset logic and modify the configurations to ensure configuration consistency. In these scenarios, the script management function has been proven to be stable, secure, and efficient, which reduces manual O&M workload and improves the efficiency. In this way, O&M personnel can focus on more strategic system optimization and risk prevention and control.

Concepts

Custom scripts: You can create and manage Shell, Python, or Bat scripts. Custom scripts can be used for global parameters and the associated parameter center.

Public scripts: There are a variety of commonly used solutions in a public script. The details of public scripts are visible to all users. Public scripts cannot be added, modified, or deleted.