Install
openclaw skills install @sdk-team/alibabacloud-lb-healthcheckRead-only health-check diagnostics for Alibaba Cloud load balancers (CLB/ALB/NLB). Collects listener health-check configuration, forwarding rules, server groups and backend server probe status, and produces a structured diagnosis report; never changes any configuration. Use when health checks fail, backend servers are marked unhealthy, or the customer asks about load balancer health-check configuration. Triggers: "health check failed", "unhealthy backend server", "backend probe abnormal", "backend server unhealthy", "SLB health check diagnosis", "CLB health check diagnosis", "ALB health check diagnosis", "NLB health check diagnosis", "listener health check configuration query", "server group probe status".
openclaw skills install @sdk-team/alibabacloud-lb-healthcheckDiagnose health-check issues on Alibaba Cloud load balancers: "health check failed", "backend server unhealthy", "listener health check configuration", "which backends are being probed and why they fail".
Core approach: route to the matching diagnosis script by instance ID prefix, collect listeners, forwarding rules, server groups and per-backend probe status, then deliver a structured report plus per-server self-check commands.
All OpenAPI calls (invoked through the aliyun CLI) include:
--user-agent AlibabaCloud-Agent-Skills/{SKILL_NAME}/{session-id}alibabacloud-lb-healthcheckslb, alb, nlb and vpc plugins installed. All API calls go through the CLI plugin mode (e.g. aliyun slb describe-health-status); there are no Python SDK dependencies.Route by the instance ID prefix and load only the guide of the matched product:
| Prefix | Product | Script | Reference Guide |
|---|---|---|---|
lb- | CLB (Classic Load Balancer) | scripts/diagnose_clb.py | references/clb-guide.md |
alb- | ALB (Application Load Balancer) | scripts/diagnose_alb.py | references/alb-guide.md |
nlb- | NLB (Network Load Balancer) | scripts/diagnose_nlb.py | references/nlb-guide.md |
One diagnosis run touches these products, always in this order, always read-only:
instance ID prefix
|
v
[1] STS GetCallerIdentity -- confirm the caller identity behind the CLI credential chain
|
v
[2] SLB | ALB | NLB instance attribute -- enumerate listeners of the matched product only
|
v
[3] same product, per listener -- health-check configuration of each listener
| (HTTP/HTTPS listeners additionally: forwarding rules)
v
[4] same product, per server group -- server group members (backend servers)
|
v
[5] same product, per listener -- backend probe status, merged onto [4] by server ID + port
|
v
[6] VPC DescribeVSwitches -- ALB/NLB only: vSwitch CIDRs for probe source context
| (skipped for CLB, whose probe range is fixed)
v
report tables + Graceful Degradation Log
Decision criteria at each branch point:
| Decision | Input | Rule |
|---|---|---|
| Which product API set and script | Instance ID prefix | lb- -> SLB/CLB, alb- -> ALB, nlb- -> NLB (see Instance Routing) |
| Which listener attribute API | Listener protocol | TCP / UDP / HTTP / HTTPS each have their own attribute query on CLB; ALB/NLB expose one listener list per product |
| Whether to read forwarding rules | Listener protocol | Only for HTTP/HTTPS listeners; L4 listeners have none |
| Which server group API | Group reference on the listener | vServer group id, master-slave group id, or neither (instance-level default backends) |
| Whether to resolve vSwitch CIDRs | Product | ALB/NLB only; CLB probes come from a fixed range |
| Which listeners to visit at all | --listener-protocols / --listener-ports | Filters are applied before any per-listener loop, so a narrowed scope costs fewer calls |
| Continue or abort after a failed query | Error kind | Permission denial and per-entity failures are recorded and the run continues; only a failed first instance query leaves an empty report skeleton (both land in the degradation log) |
The three scripts share an identical parameter interface:
| Parameter | Required | Description |
|---|---|---|
--load-balancer-id | Yes | Instance ID (lb-xxx / alb-xxx / nlb-xxx) |
--region | No | RegionId, e.g. cn-hangzhou. Fallback: env vars (ALIBABA_CLOUD_REGION_ID etc.) → current profile of ~/.aliyun/config.json → exit with guidance |
--format | No | json or markdown; default markdown |
--output | No | Report file path; default stdout |
--listener-protocols | No | Filter listeners by protocol, comma separated (e.g. HTTP,HTTPS or TCP,UDP) |
--listener-ports | No | Filter listeners by port, comma separated (e.g. 80,443) |
# CLB
python3 scripts/diagnose_clb.py --load-balancer-id lb-xxx --region cn-hangzhou \
--output output/lb-xxx-healthcheck.md
# ALB, scoped to ports 80/443
python3 scripts/diagnose_alb.py --load-balancer-id alb-xxx --listener-ports 80,443 \
--output output/alb-xxx-healthcheck.md
# NLB, scoped to L4 protocols
python3 scripts/diagnose_nlb.py --load-balancer-id nlb-xxx --listener-protocols TCP,UDP \
--output output/nlb-xxx-healthcheck.md
Every Markdown report ends with a fixed ## Graceful Degradation Log section listing queries that degraded (for example, a permission-denied probe-status query) instead of aborting the diagnosis.
This skill is strictly read-only: only Describe* / List* / Get* queries are allowed. Never execute any Update / Delete / Modify / Create / Set operation — no listener, server group, forwarding rule or instance configuration changes — even when the user asks to "fix" something. Report findings and recommendations instead.
MANDATORY AUTO-FILL DECLARATION. Whenever any target input is not given by the user and you fill it in yourself instead of asking, the final reply (or the report metadata) MUST carry an explicit auto-fill declaration naming the item and its source — e.g. "Instance ID auto-located via a read-only load balancer list query: lb-xxx" or "Region auto-resolved from ~/.aliyun/config.json: cn-hangzhou". A scope line such as "diagnosis scope: all instances named *-test" is not a declaration: it states what was covered, not that the value was auto-filled. Stating a bare conclusion over auto-filled inputs without this declaration is a violation.
~/.aliyun/config.json. When the region is auto-filled, declare the source explicitly in the response, e.g. "Region auto-resolved from ~/.aliyun/config.json: cn-hangzhou". If no source yields a region, ask the user for the RegionId.--output output/<instance-id>-healthcheck.md.The customer-facing script is the wording handed to the customer when backends fail health checks. It is never written into the Markdown report file — it is output as a standalone section in the conversation body so the user can copy it directly. If the script stdout or the generated report contains customer-facing wording, remove it from the file and move it to the conversation body.
Never use the following in the opening or closing paragraph: "probe completed" / "diagnosis completed"; any region name or region alias (e.g. cn-hangzhou / China (Hangzhou)); layer terminology such as "Layer 4 / Layer 7 / L4 / L7"; "health check probing completed / this probe covered N listeners". State conclusions directly and use protocol + port instead of layer terms.
Abnormal case:
Hello, instance {Instance ID} currently has {N} backend servers failing health checks; they have been isolated by {CLB|ALB|NLB} and no longer receive traffic. Please log into each backend server below and run the corresponding commands to troubleshoot:
All-normal case:
Hello, instance {Instance ID} currently passes all backend server health checks; no abnormal backends were found. If the business is still affected, continue investigating from directions such as the network path and application-layer timeouts.
Each abnormal backend block starts with its owning server group / listener entry plus the health-check protocol / port / path / method, followed by the five-step commands defined in Backend Server Self-Check Commands. Background data at the top of a block states probe facts and parameters only, never inferred causes. Command lines contain the command itself only — no trailing "— to verify xxx" explanations. Product-specific structure, security-group step conditions, tcpdump filter expressions and entry-point deduplication rules are defined by the per-product guides (references/clb-guide.md, references/alb-guide.md, references/nlb-guide.md). Multi-port servers follow Pitfall 3.
grep -E 'port1|port2' aggregation.When backends fail health checks, hand these commands to the customer (run on each failing backend server; replace <PORT>, <PATH>, <METHOD> and <PROBE_IP> with values from the report):
ss -tlnp | grep ':<PORT>'ss -ulnp | grep ':<PORT>'curl -v -X <METHOD> http://127.0.0.1:<PORT><PATH>curl -v -k -X <METHOD> https://127.0.0.1:<PORT><PATH>telnet 127.0.0.1 <PORT>iptables -L INPUT -n -v --line-numbers and systemctl status firewalld && firewall-cmd --list-allip route show and ip rule showtcpdump -i eth0 'src net 100.64.0.0/10 and tcp port <PORT>' -nn -c 20tcpdump -i eth0 'tcp port <PORT> and (host <PROBE_IP_1> or <PROBE_IP_2>)' -nn -c 20--listener-protocols and/or --listener-ports to avoid querying every listener, wasting credits and producing redundant output. All three scripts support both filters.and binds tighter than or. Correct: tcpdump -i eth0 'tcp port 80 and (host 172.22.0.52 or 172.22.0.51 or 172.16.10.170)' -nn -c 20. Wrong (and host A or B or C parses as (port 80 and host A) or B or C): tcpdump -i eth0 tcp port 80 and host 172.22.0.52 or 172.22.0.51 or 172.16.10.170 -nn -c 20. CLB uses the single expression src net 100.64.0.0/10 and has no such issue.| Error | Cause | Resolution |
|---|---|---|
| No credentials found | Default credential chain not configured | Configure the aliyun CLI default credential chain (run aliyun configure) |
| Region cannot be resolved | No --region, no region env var, no profile region | Pass --region <RegionId> explicitly or set ALIBABA_CLOUD_REGION_ID |
| Permission denied (403) on a query | RAM policy lacks the specific read action | The script degrades gracefully and logs it in ## Graceful Degradation Log; grant the action per references/ram-policies.md |
| Instance not found / wrong region | Instance ID and region mismatch | Confirm the instance ID prefix and the correct region with the user |