Creating a Custom Script
The custom script creation capability is provided. Shell, Python, and BAT scripts can be created.
Scenarios
Create a custom script on Cloud Operations Center.
Precautions
Confirm and complete the risk level of the script content.
Procedure
- Log in to COC.
- In the navigation pane on the left, choose Resource O&M > Automated O&M. In the Routine O&M area, click Scripts. On the displayed Scripts page, click the Custom Scripts tab and click Create Script.
Figure 1 Clicking Create Script
- Enter the basic script information.
Figure 2 Setting parameters
- Enter the script content. The script type can be Shell, Python, or Bat. And verify high-risk commands in the script.
The interpreter that is automatically added to the first line of the script content, for example, #!/usr/bin/python, requires a Python soft link on your VMs. If the soft link is missing, you need to modify the interpreter to ensure that it can be executed by your VMs.
Figure 3 Entering the script content
- Click Verify High-Risk Command.
- Verification scope: the high-risk commands involved in the detection. You can click High-Risk Commands to view the verification rules.
- Verification rule: Within the verification scope, the script content is matched with high-risk commands using regular expression matching.
- Verification result: The regular expression is used to check whether the script content is high-risk, that is, low-risk or high-risk.
The result of high-risk command verification is used only as a reference for grading the script risk level. The system does not forcibly require the consistency between script risk level and the verification result. Evaluate the risk level based on the actual service impact.
Figure 4 Verifying high-risk commands
- Enter the script input parameters. You can select the Sensitive check box to encrypt the parameters.
Figure 5 Entering script input parameters
Sensitive: parameters are anonymized and encrypted for storage.
- Enable Manual Review. This switch is enabled automatically for high-risk scripts.
Figure 6 Selecting the reviewer and the notification mode
- Click Submit.
Figure 7 Click Submit.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot