Install
openclaw skills install @sdk-team/alibabacloud-rds-mysql-inspectionBatch health inspection for Alibaba Cloud RDS MySQL instances. Supports single, multiple, or all-instance global scan with configurable time window (default 7 days, max 30). Outputs one HTML report per instance plus a summary HTML. Dimensions: instance basics, resource utilization (CPU/memory/disk/IOPS/connections), CloudMonitor alert history, top 20 space-consuming tables (DAS), slow log statistics (DAS), kernel-version / expiration checks. Cluster instances auto-detected; per-node metrics and slow logs. Triggers: RDS inspection, RDS health check, RDS MySQL inspection, Alibaba Cloud RDS inspection, batch/global/multi-instance inspection, slow log analysis, space analysis, RDS 巡检, 阿里云 RDS 巡检, 数据库巡检, 批量巡检, 慢日志分析, 表空间分析.
openclaw skills install @sdk-team/alibabacloud-rds-mysql-inspectionThis skill performs batch health inspections of Alibaba Cloud RDS MySQL instances. It supports three modes — single instance, multiple instances, and global batch — with a configurable time window (default 7 days, up to 30 days), and produces standardized HTML inspection reports.
You do not need to run any command manually. Simply describe the request in natural language.
Example 1: Single instance
Inspect RDS instance rm-bp1xxxxxx帮我巡检下 RDS 实例 rm-bp1xxxxxxExample 2: Multiple instances with a custom time window
Inspect rm-bp1xxx and rm-bp1yyy for the past 14 days巡检 rm-bp1xxx 和 rm-bp1yyy 这两个实例,看最近 14 天的情况Example 3: Global inspection
Run a health inspection on all RDS MySQL instances and produce a summary report帮我对所有 RDS MySQL 实例做一次健康巡检,输出汇总报告Example 4: Limit by region
Inspect all RDS MySQL instances in cn-hangzhou and cn-shanghai巡检 cn-hangzhou 和 cn-shanghai 两个 region 的所有 RDS MySQL 实例rds describe-regions to obtain the list of available regions (filters out ClosedDown).Pre-check: Aliyun CLI >= 3.3.3 required
Run
aliyun versionto verify the version is >= 3.3.3. If the CLI is missing or outdated, runcurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashto install or upgrade, or follow https://help.aliyun.com/zh/cli/ for installation instructions.
Pre-check: Aliyun CLI plugin update required
[MUST] Run
aliyun configure set --auto-plugin-install trueto enable automatic plugin installation. [MUST] Runaliyun plugin updateto ensure all locally installed plugins are up to date.
aliyun version
aliyun configure set --auto-plugin-install true
aliyun plugin update
Only Python standard library modules are used (subprocess, json, argparse, concurrent.futures, datetime); pip install is not required.
[MUST] CLI User-Agent — Every
aliyunCLI invocation made by this skill must include:--user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspectionThe
call_cli()wrapper inscripts/inspect.pyinjects this UA automatically, so it does not need to be repeated on each command.
[MUST] Enable AI-Mode — AI-mode must be enabled before any Agent Skill execution. Run the following before invoking any CLI command:
aliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspection"
[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response (regardless of success, failure, exception, user cancellation, or session end), AI-mode must be disabled. AI-mode is reserved for active Agent Skill executions and must not remain enabled once the skill stops running.
aliyun configure ai-mode disable
This skill uses read-only RDS / CMS / DAS APIs. The full custom-policy JSON, per-action purpose table, and system-policy alternatives are declared in references/ram-policies.md. Attach that policy to the executing RAM identity before running the skill.
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values
- NEVER ask the user to input AK/SK directly in the conversation or command line
- ONLY use
aliyun configure listto check credential statusaliyun configure listInspect the output and confirm a valid profile exists. If no credentials are configured, guide the user to configure them outside of the conversation:
aliyun configure
python3 scripts/inspect.py [options]
| Argument | Short | Type | Description | Default |
|---|---|---|---|---|
--instance-ids | -i | string | Instance ID (repeatable, or comma-separated in a single value) | none |
--all | — | flag | Globally inspect every RDS MySQL instance | off |
--days | -d | int | Time-window length in days (1-30) | 7 |
--start-time | — | YYYY-MM-DD | Start date (mutually exclusive with --days) | none |
--end-time | — | YYYY-MM-DD | End date (must be supplied together with --start-time) | none |
--output | -o | path | Output directory | ./rds-inspection-reports/<ts>/ |
--profile | -p | string | Aliyun CLI profile name | default profile |
--regions | — | string | Limit the scan to specific regions (comma-separated) | all |
--concurrency | -c | int | Per-instance inspection concurrency | 3 |
--region-concurrency | — | int | Region scan concurrency | 3 |
--skip-space | — | flag | Skip the DAS space analysis (saves 30-150 s per instance) | off |
Validation rules (enforced automatically by the script):
-i or --all is required.--days must be between 1 and 30; values outside this range raise an error.--start-time and --end-time must be supplied together, with a span of <= 30 days.aliyun rds describe-regions --region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspection
Extract RegionId from the returned Regions.RDSRegion[] and drop any region whose Status contains closed.
For each region, call:
aliyun rds describe-db-instances --region <RegionId> \
--engine MySQL --page-size 100 --page-number <N> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspection
Paginate based on TotalRecordCount until all records are retrieved. Merge into a complete [{instanceId, regionId, ...}] list.
--all: every instance.-i id1,id2: filter from the full list (the region ID for each instance is carried automatically; the user does not need to specify it).Unmatched instance IDs produce a warning but do not abort the overall workflow.
aliyun rds describe-db-instance-attribute --region <RegionId> \
--db-instance-id <InstanceId> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspection
Extract the key fields: Category (determines whether the instance is a cluster), DBClusterNodes (cluster node list), MaxConnections, MaxIOPS, MaxIOMBPS, CurrentKernelVersion, LatestKernelVersion, ExpireTime, etc.
Within each instance, the following collection steps run sequentially.
cms describe-metric-list)Five core metrics. The MetricName and Dimensions depend on whether the instance is a cluster.
Cluster instances (Category=cluster, queried per node):
| MetricName | Meaning |
|---|---|
Cluster_CpuUsage | CPU utilization |
Cluster_MemoryUsage | Memory utilization |
Cluster_DiskUsage | Disk utilization |
Cluster_IOPSUsage | IOPS utilization |
Cluster_ConnectionUsage | Connection utilization |
Dimensions: [{"instanceId":"<DBInstanceId>","nodeId":"<NodeId>"}]
Non-cluster instances:
| MetricName | Meaning |
|---|---|
CpuUsage / MemoryUsage / DiskUsage / IOPSUsage / ConnectionUsage | Same as above |
Dimensions: [{"instanceId":"<DBInstanceId>"}]
Invocation template:
aliyun cms describe-metric-list \
--namespace acs_rds_dashboard \
--metric-name <MetricName> \
--period 60 \
--start-time <StartMillis> --end-time <EndMillis> \
--dimensions '<JSON>' \
--length 2000 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-rds-mysql-inspection
Paginate via NextToken until all data points are retrieved.
cms describe-alert-log-list)aliyun cms describe-alert-log-list \
--namespace acs_rds_dashboard --product rds \
--search-key <DBInstanceId> \
--start-time <ms> --end-time <ms> \
--page-size 100 --page-number <N>
Page through all results. Sort by alert severity in descending order: CRITICAL / P0 / P1 > WARN / P2 > INFO / P3 / P4.
das describe-slow-log-statistic)aliyun das describe-slow-log-statistic \
--instance-id <DBInstanceId> \
--start <ms> --end <ms> \
--order-by <Count|QueryTime> \
[--node-id <NodeId>] \
--endpoint das.cn-shanghai.aliyuncs.com
Notes:
das.cn-shanghai.aliyuncs.com (DAS is centrally deployed).--node-id (use the Master node).Count and once by QueryTime.# Trigger the task
aliyun das create-storage-analysis-task \
--instance-id <DBInstanceId> \
--endpoint das.cn-shanghai.aliyuncs.com
# Poll for results
aliyun das get-storage-analysis-result \
--instance-id <DBInstanceId> --task-id <TaskId> \
--endpoint das.cn-shanghai.aliyuncs.com
Poll every 5 seconds, with a 180-second cap. Take the top 20 tables from StorageAnalysisResult.TableStats.
Each instance is scored 0-100. Deductions:
Each instance produces instances/<DBInstanceId>.html containing the following sections:
(cluster) tag) / Class / Storage / MaxConnections / MaxIOPS / MaxIOMBPS / primary and secondary zones / VPC + VSwitch / status / pay type / Lock / maintenance window / creation + expiration / current + latest kernel / cluster node list (for clusters).dataZoom); one line per node for clusters.TableStats. Columns: database / table / total space / data / index / fragmentation / row count.Outputs summary.html, with anchor navigation plus the following eight sections:
./rds-inspection-reports/<timestamp>/
├── summary.html # Aggregated inspection report (8 sections)
└── instances/
├── rm-bp1xxx.html # Per-instance report (5 sections)
├── rm-bp1yyy.html
└── ...
In the summary report, every instance ID is a hyperlink that opens the corresponding per-instance report in a new tab.
| Metric | Normal | Warning | Critical |
|---|---|---|---|
| CPU utilization | < 60% | 60-80% | > 80% |
| Memory utilization | < 60% | 60-80% | > 80% |
| Disk utilization | < 70% | 70-85% | > 85% |
| IOPS utilization | < 60% | 60-80% | > 80% |
| Connection utilization | < 60% | 60-80% | > 80% |
| Overall health score | >= 80 | 60-79 | < 60 |
| Dimension | Non-cluster instance | Cluster instance (Category=cluster) |
|---|---|---|
| CMS MetricName | No prefix (CpuUsage, etc.) | Prefixed with Cluster_ |
| CMS Dimensions | {"instanceId":"<id>"} | {"instanceId":"<id>","nodeId":"<nid>"}, queried per node |
| DAS slow log | --instance-id only | Must also pass --node-id (use the Master node) |
| HTML metric charts | Single line | One line per node |
| Cluster-level aggregation | N/A | CPU / memory peak = max of all node peaks |
The cluster node list is obtained from the DBClusterNodes field returned by rds describe-db-instance-attribute.
| Scenario | Estimated Duration |
|---|---|
| Single instance (with space analysis) | 60-200 seconds |
Single instance (--skip-space) | 10-30 seconds |
| 10 instances at concurrency 3 | 5-15 minutes |
50 instances with --all | 30-90 minutes |
Tips for faster runs:
--skip-space; DAS space analysis costs 30-150 seconds per instance.--regions cn-hangzhou,... to skip other regions.-c for higher concurrency (be aware that the CMS API has a default 20 QPS limit; <= 5 is recommended).This is a read-only inspection skill.
das create-storage-analysis-task, which schedules a side analysis task and does not modify any instance data; all other invocations are pure read operations.scripts/inspect.py — Main inspection script (CLI + collection + rendering).references/ram-policies.md — Full RAM permission reference (custom policy JSON + action purposes).