Huawei Cloud DWS Memory High Diagnosis for Openclaw

Openclaw Skills for Huawei Cloud DWS memory diagnosis automatically collect metrics, isolate root causes, and generate standardized HTML reports.

changhui123456
v1.0.2
Jul 16, 2026
0
50
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bigdata-dws-huawei-cloud-dws-dymem-diag

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bigdata-dws-huawei-cloud-dws-dymem-diag using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Huawei Cloud DWS Memory High Diagnosis?

Openclaw Skills for Huawei Cloud DWS memory diagnosis turn a memory alarm, OOM event, or high-usage trigger into an evidence-based root-cause workflow. The skill prefers KooCLI v3.2.0+ for cluster, host, and metric queries, and transparently falls back to the DWS Autopilot MCP Server when KooCLI is unavailable or the network probe fails.

It analyzes MemStat, InstanceMemory, and memory_diagnose_detail data to determine whether the incident is cluster-wide, node-specific, instance-specific, SQL-driven, or session-related. The result is a standardized HTML diagnosis report saved in the workspace root, with conclusions limited strictly to observed tool output.

Huawei Cloud DWS Memory High Diagnosis Use Cases

  • DWS cluster memory usage too high, memory alarm, insufficient memory, or OOM incidents
  • Need to determine whether pressure is global, partial, or isolated to a single node
  • Need to trace high-memory CN/DN instances, active users, sessions, or SQL statements
  • Suspected data skew, memory imbalance, work_mem pressure, shared_pool pressure, or memory leak behavior
  • KooCLI is preferred for diagnosis, but MCP fallback is required for resilience
  • A standardized HTML report is needed for incident handoff, review, or postmortem work

How Huawei Cloud DWS Memory High Diagnosis Works

  1. Detect the execution environment by running hcloud version; if the version is at least 3.2.0, start in KooCLI mode, otherwise switch to MCP mode. Probe network availability with a lightweight KooCLI API call, and if the first KooCLI call returns NETWORK_ERROR, fall back to MCP and keep that mode for the rest of the run.
  2. Query MemStat for the window from first_alarm_time - 1200000 to first_alarm_time, using paginated reads with limit=200. Merge all pages locally, then compute node memory usage, identify the highest-memory hosts, and classify the scope as global, partial, or single-node pressure.
  3. Query host information for the affected host IDs so the diagnosis can map host_id to host name and IP address. This step is used to label the suspicious node and connect host-level evidence to the alarm target.
  4. Query InstanceMemory for the same time window, again using pagination. Filter the cluster-wide response by inst_name, infer CN or DN from the instance name, and determine whether the pressure is mainly dynamic memory or process memory.
  5. Query memory_diagnose_detail, the largest dataset in the workflow, with the same time window and mandatory pagination. Extract active sessions, database users, SQL text, query IDs, plan types, and memory pool data, then use userName, state, duration_ms, and mem_used to identify high-memory users and statements.
  6. Analyze the combined evidence to decide whether the root cause is customer-side or system-side. Check for single SQL dominance, multi-user concurrency, session leaks, long transactions, work_mem pressure, shared_pool pressure, and possible memory leak trends. Convert all displayed timestamps from UTC millisecond values to Beijing time before placing them in the report.
  7. Resolve the display name from cluster_name or the cluster lookup, generate the final HTML diagnosis report, and save it in the current working directory as dws_mem_diagnosis_report_{timestamp}.html.

Huawei Cloud DWS Memory High Diagnosis Setup

  1. Verify that KooCLI is installed and meets the minimum version requirement.
hcloud version

If the command is missing or the version is below 3.2.0, install or upgrade KooCLI using the linked CLI installation guide.

  1. Confirm that credentials are configured without exposing secrets.
hcloud configure list

Use existing Huawei Cloud authentication only; never paste AK/SK values into chat or shell history.

  1. Install and configure the DWS Autopilot MCP Server as the fallback path when KooCLI is unavailable or returns NETWORK_ERROR.

  2. Ensure the account has the required permissions: dws:clusters:get, dws:clusters:list, dws:metricData:get, and dws:hostOverview:get.

  3. Prepare the required inputs for Openclaw Skills: alarm_serial_number, project_id, cluster_id, first_alarm_time, and alarm_name. Provide region_id when using hcloud commands.

  4. Validate access with a lightweight cluster query before running a full diagnosis.

hcloud DWS ListClusters --cli-region=<region> --project_id=<project_id> --offset=0 --limit=1
  1. Make sure the workspace is writable so the generated report file dws_mem_diagnosis_report_{timestamp}.html can be saved in the current working directory.

Huawei Cloud DWS Memory High Diagnosis Data Schema & Taxonomy

Input contract

Field Required Type Purpose
alarm_serial_number Yes string Alarm serial number
project_id Yes string Passed to all tool calls
cluster_id Yes string DWS cluster instance ID and alarm resourceId
first_alarm_time Yes integer UTC Unix millisecond timestamp used as the end of the diagnosis window
alarm_name Yes string Alarm title
region_id No string hcloud --cli-region value
node_name No string Host name extracted from alarm payload
instance_name No string Instance name extracted from the alarm MOI field
cluster_name No string Preferred display name if already known
alarm_severity No integer 1 Critical, 2 Major, 3 Minor, 4 Info

Collected metric layers

Layer Tool / Metric Primary fields Derived meaning
Cluster and host MemStat ctime, host_id, mem_total, mem_free, cached, buffers, watermark_high, watermark_min Node memory usage and cluster imbalance
Instance InstanceMemory host_id, inst_name, dynamic_used_memory, max_dynamic_memory, process_used_memory, max_process_memory, plus additional memory buckets CN/DN pressure and dynamic vs process memory split
Session and SQL memory_diagnose_detail active_sessions, query, query_id, userName, mem_used, state, duration_ms, plan_type, memory_pool Active users, high-memory SQL, session leaks, and pool pressure

Derived taxonomy

  • mem_scope: global high, partial high, single-node high, or normal/imbalanced
  • inst_type: CN or DN, inferred from inst_name
  • mem_type: dynamic memory high or process memory high
  • root_cause_category: customer-side or system-side
  • concurrent_mode: multi_user, single_user, or none
  • high_memory_sql_info, session_info, and memory_pool_summary: evidence bundles for the report

Output contract

Field Type Meaning
diagnosis_summary string Short result summary
diagnosis_report string HTML diagnosis report body

Generated artifact

  • dws_mem_diagnosis_report_{timestamp}.html is saved in the current working directory
  • timestamp uses local machine time in yyyyMMdd_HHmmss
  • Report timestamps are displayed in Beijing time (UTC+8)

Transport rules

  • Tool responses follow {"code":0,"data":...} on success and {"code":-1,"message":...} on failure
  • All metric queries must use paginated reads with limit=200 and be merged locally before analysis

Huawei Cloud DWS Memory High Diagnosis Advanced Features

  • Automatic KooCLI-first execution with MCP fallback when KooCLI is unavailable or returns NETWORK_ERROR
  • Mandatory pagination with limit=200 and local dataset merging for large metric responses
  • Cross-layer correlation across cluster, host, instance, session, and SQL evidence
  • CN/DN inference from inst_name when no explicit instance type field exists
  • Dynamic memory and process memory split, plus work_mem and shared_pool pressure checks
  • Session leak, long transaction, high concurrency, and memory leak heuristics
  • Top 3 user and SQL contribution tables with percentage-bar visualization
  • UTC-to-Beijing time normalization for all report timestamps
  • Evidence-only diagnosis policy with graceful degradation to unavailable when data is missing

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*