- Service Overview
- Getting Started
-
User Guide
- COC Enablement and Permissions Granting
- Overview
-
Application and Resource Management
- Resource Management
-
Application Management
- Creating an Application
- Modifying an Application
- Deleting an Application
- Editing an Application Topology
- Creating a Component
- Modifying a Component
- Deleted a Component
- Creating a Group
- Modifying a Group
- Deleting a Group
- Manually Associating Resources with a Group
- Intelligently Associating Resources with a Group
- Transferring Resources
- Disassociating a Resource from an Application Group
- Viewing Resource Details
- Viewing Capacity Rankings
- Multi-cloud Configurations
- Cross-Account Resources
- Resource O&M
- Automated O&M
- Faults
- Change Management
- Resilience Center
- Task Management
- Basic Configurations
- Viewing Logs
- Best Practices
- API Reference
-
FAQs
- Product Consulting
- Resource Management FAQs
-
FAQs About Resource O&M
-
Patch Management FAQs
- What Can I Do If the Patch Baselines Do Not Take Effect?
- What Are the Differences Between the Installation Rule Baselines And User-defined Baselines?
- What Can I Do If Exception all mirrors were tried Is Recorded in the Patch Service Ticket Log?
- Why Can't I Select a Node?
- What Can I Do If the Compliance Report Still Reports Non-compliance for a Patch After the Patch Has Been Repaired?
- What Can I Do If the lsb_release not found Error Occurs During Patch Operations?
- Automation FAQs
- Batch Operation FAQs
- FAQs About Parameter Management
- Resource O&M Permissions and Supported Actions
-
Patch Management FAQs
- FAQs About Fault Management
- FAQs About Change Ticket Management
- Resilience Center FAQs
- Change History
- General Reference
Show all
Copied.
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.
NOTE:
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.
NOTE:
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
NOTE:
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