SysOM Inspection (sysom-inspection)
Inspections are launched with the sysom-osops CLI command
(sysom-osops inspection ecs ...). Always go through the CLI instead of calling
the inspection OpenAPI directly.
CLI Setup
Check whether the CLI is available:
command -v sysom-osops
If it is missing, install it:
curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh | sudo bash
Then verify only the binary:
command -v sysom-osops
If the CLI is installed but has no inspection subcommand yet, run
sysom-osops update first, then retry.
If a command fails due to missing RAM permissions, follow
references/ram-policies.md to attach the minimum permission policy.
Quick Start
# Focused inspection by intent (--query)
# Run only CPU/load related items (keyword mapping)
sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "cpu related inspection"
# Combined intent: memory and disk
sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "memory and disk"
# Natural-language sentence: intent is extracted automatically, matching packet-loss items
sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "check whether this machine has network packet loss"
# If the query matches no items, it falls back to a full inspection automatically
# Batch inspection (--scope-type batch, auto diagnosis supported)
# Inspect all specified instances -> auto root-cause diagnosis on the Top-3 most severe
# anomalous instances -> LLM summary (the rest get copy-ready deep-dive commands in the report)
sysom-osops inspection ecs --region cn-shenzhen --scope-type batch --instances i-aaa,i-bbb,i-ccc
# Region-wide inspection (--scope-type all, auto diagnosis supported)
# Auto-discover every ECS instance in the region (limit 5000) -> Top-3 anomalies auto-diagnosed
# -> LLM summary; one command for the full closed loop
sysom-osops inspection ecs --region cn-shenzhen --scope-type all
# Re-check an existing report (--report-id)
# Returns immediately without re-running (auto-generated in inspection next_steps).
# IMPORTANT: --region and --scope-type (or --instance) MUST match the original
# inspection command, otherwise the replay will fail with MissingParam errors.
sysom-osops inspection ecs --region cn-shenzhen --scope-type all --report-id inspection-82a64d9d-11c5-45b2-a81c-27fc754891e8
Invocation Modes
- Focused inspection:
--query "<intent>" maps keywords or extracted intent to concrete
items (CPU/load keyword mapping, combined intents such as memory + disk, natural-language
sentences such as network packet-loss checks). A query matching no items falls back to a
full inspection automatically.
- Batch:
--scope-type batch --instances i-aaa,i-bbb,... inspects all specified instances,
auto-diagnoses the Top-3 most severe anomalous ones, and lists copy-ready deep-dive commands
for the rest in the report.
- Region-wide:
--scope-type all auto-discovers every ECS instance in the region
(limit 5000), then applies the same Top-3 auto-diagnosis and LLM summarization in one command.
- Report replay:
--region <region> --scope-type <scope-type> --report-id <reportId>
(or --region <region> --instance <instanceId> --report-id <reportId>) returns the
existing report immediately without re-running the inspection; inspection results emit
this replay command — with the original --region and --scope-type/--instance —
in next_steps automatically.
Observability
- UA template (required for all SDK requests):
AlibabaCloud-Agent-Skills/{SKILL_NAME}/{session-id}
- Runtime resolved form in this skill:
AlibabaCloud-Agent-Skills/alibabacloud-alinux-sysom-inspection/<SKILL_SESSION_ID>
- Unified session-id rule:
- A single session-id is generated once per session (one CLI execution) and must be
reused consistently across all API calls, both CLI and SDK requests.
- Generation priority: external env
SKILL_SESSION_ID (preferred) -> auto-generated
fallback sid-<32-char hex> (uuid4 hex); invalid injected values fall back to the
generated id.
- Accepted format:
[A-Za-z0-9][A-Za-z0-9._:-]{7,127}.
- The resolved value is exported to process env
SKILL_SESSION_ID so downstream calls
stay consistent.
- The
sysom-osops CLI injects the UA header automatically and follows the same unified
session-id rule.
Execution Flow
- Before each inspection, the CLI verifies SysOM activation and permissions (
InitialSysom,
source=skill_hub); activation and installation prompts are handled by the CLI itself.
- Every new inspection calls ROA API
POST /api/v1/inspection/createInstanceInspection with
source=skill_hub; selected items come from --query keyword/intent mapping, and a query
matching no items falls back to a full inspection.
- Each mode runs a full closed loop: inspect (metrics + logs) -> automatic root-cause diagnosis
on detected anomalies -> LLM-summarized Chinese report.
- Automatic root-cause diagnosis is triggered via
InvokeDiagnosis (injecting
__sysom_diagnosis_source=skill_hub into params) and polled via GetDiagnosisResult
until success / fail / timeout.
- Batch (
--scope-type batch --instances ...) inspects every specified instance; region-wide
(--scope-type all) auto-discovers all ECS instances in the region (limit 5000). Both
automatically diagnose the Top-3 most severe anomalous instances and include copy-ready
deep-dive commands for the remaining ones in the report.
- Report lookup uses ROA API
GET /api/v1/inspection/getInspectionReport; the CLI polls until
the report succeeds or times out.
--region <region> --scope-type <scope-type> --report-id <reportId> (or with
--instance instead of --scope-type) skips task creation and directly fetches the
existing report; inspection results emit this replay command in next_steps
automatically, including the original --region and --scope-type/--instance.
- Local threshold/event-rule configuration is not used; anomaly decisions come from the
server-side inspection report.
Error Handling
When a CLI invocation fails, classify the failure by the error text (Error: <Code>: ...)
and handle it as follows instead of blind retries:
- Permission (
Forbidden.RAM): explain that sysom:InitialSysom /
sysom:InvokeAgentCli is missing and point the user to references/ram-policies.md
for the minimum policy; do not retry.
- Parameter (
InvalidParameter, invalid argument): identify the offending argument
and guide the user to verify the instance id and region; do not attribute it to the
service.
- Throttling (
Throttling): tell the user the request was rate-limited and advise
retrying later; do not retry automatically in a loop.
- Internal (
InternalError): report the temporary service failure honestly and
suggest retrying later; do not attribute it to user input.
- Empty region (
no ECS instances found): not an error. Report that the region has
no ECS instances and skip the inspection; never fabricate a report.
Extensibility Notes
- Inspection focus is controlled by
--query (keyword/intent mapping to concrete items);
unmatched queries fall back to a full inspection.
- Use
--scope-type batch --instances ... for batch inspection and --scope-type all for the
whole region (limit 5000 instances); both auto-diagnose the Top-3 most severe anomalies.
- Use
--region <region> --scope-type <scope-type> --report-id <reportId> (or with
--instance instead of --scope-type) to re-check an existing report without
re-execution; the replay command is emitted automatically in inspection next_steps
with the original --region and --scope-type/--instance.
- A local Python CLI (
./scripts/osops.sh inspection) is kept only as a fallback for
environments where sysom-osops is unavailable.
- Memory anomaly trigger logic of the fallback path stays implemented in
scripts/sysom_cli/inspection/command.py.
- To add more post-inspection specialized diagnosis actions, reuse the
InvokeDiagnosis
integration pattern.
1---2name: alibabacloud-alinux-sysom-inspection3description: Inspect ECS instance health, detect anomalies in memory, disk, CPU, load, and resource leaks, and automatically trigger deep diagnosis when critical memory issues are detected. Suitable for routine inspections, troubleshooting, and risk warning scenarios. Trigger keywords: SysOM, inspection, instance diagnosis, memory_usage_rate, memory usage.4---5
6# SysOM Inspection (`sysom-inspection`)
7
8Inspections are launched with the `sysom-osops` CLI command
9(`sysom-osops inspection ecs ...`). Always go through the CLI instead of calling
10the inspection OpenAPI directly.
11
12## CLI Setup
13
14Check whether the CLI is available:
15
16```bash
17command -v sysom-osops
18```
19
20If it is missing, install it:
21
22```bash
23curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh | sudo bash
24```
25
26Then verify only the binary:
27
28```bash
29command -v sysom-osops
30```
31
32If the CLI is installed but has no `inspection` subcommand yet, run
33`sysom-osops update` first, then retry.
34
35If a command fails due to missing RAM permissions, follow
36`references/ram-policies.md` to attach the minimum permission policy.
37
38## Quick Start
39
40```bash
41# Focused inspection by intent (--query)
42# Run only CPU/load related items (keyword mapping)
43sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "cpu related inspection"
44
45# Combined intent: memory and disk
46sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "memory and disk"
47
48# Natural-language sentence: intent is extracted automatically, matching packet-loss items
49sysom-osops inspection ecs --region cn-shenzhen --instance i-xxxxxxxx --query "check whether this machine has network packet loss"
50
51# If the query matches no items, it falls back to a full inspection automatically
52
53# Batch inspection (--scope-type batch, auto diagnosis supported)
54# Inspect all specified instances -> auto root-cause diagnosis on the Top-3 most severe
55# anomalous instances -> LLM summary (the rest get copy-ready deep-dive commands in the report)
56sysom-osops inspection ecs --region cn-shenzhen --scope-type batch --instances i-aaa,i-bbb,i-ccc
57
58# Region-wide inspection (--scope-type all, auto diagnosis supported)
59# Auto-discover every ECS instance in the region (limit 5000) -> Top-3 anomalies auto-diagnosed
60# -> LLM summary; one command for the full closed loop
61sysom-osops inspection ecs --region cn-shenzhen --scope-type all
62
63# Re-check an existing report (--report-id)
64# Returns immediately without re-running (auto-generated in inspection next_steps).
65# IMPORTANT: --region and --scope-type (or --instance) MUST match the original
66# inspection command, otherwise the replay will fail with MissingParam errors.
67sysom-osops inspection ecs --region cn-shenzhen --scope-type all --report-id inspection-82a64d9d-11c5-45b2-a81c-27fc754891e8
68```
69
70## Invocation Modes
71
72- **Focused inspection:** `--query "<intent>"` maps keywords or extracted intent to concrete
73 items (CPU/load keyword mapping, combined intents such as memory + disk, natural-language
74 sentences such as network packet-loss checks). A query matching no items falls back to a
75 full inspection automatically.
76- **Batch:** `--scope-type batch --instances i-aaa,i-bbb,...` inspects all specified instances,
77 auto-diagnoses the Top-3 most severe anomalous ones, and lists copy-ready deep-dive commands
78 for the rest in the report.
79- **Region-wide:** `--scope-type all` auto-discovers every ECS instance in the region
80 (limit 5000), then applies the same Top-3 auto-diagnosis and LLM summarization in one command.
81- **Report replay:** `--region <region> --scope-type <scope-type> --report-id <reportId>`
82 (or `--region <region> --instance <instanceId> --report-id <reportId>`) returns the
83 existing report immediately without re-running the inspection; inspection results emit
84 this replay command — with the original `--region` and `--scope-type`/`--instance` —
85 in `next_steps` automatically.
86
87## Observability
88
89- **UA template (required for all SDK requests):**
90 - `AlibabaCloud-Agent-Skills/{SKILL_NAME}/{session-id}`
91 - Runtime resolved form in this skill: `AlibabaCloud-Agent-Skills/alibabacloud-alinux-sysom-inspection/<SKILL_SESSION_ID>`
92- **Unified session-id rule:**
93 - A single session-id is generated once per session (one CLI execution) and must be
94 reused consistently across all API calls, both CLI and SDK requests.
95 - Generation priority: external env `SKILL_SESSION_ID` (preferred) -> auto-generated
96 fallback `sid-<32-char hex>` (uuid4 hex); invalid injected values fall back to the
97 generated id.
98 - Accepted format: `[A-Za-z0-9][A-Za-z0-9._:-]{7,127}`.
99 - The resolved value is exported to process env `SKILL_SESSION_ID` so downstream calls
100 stay consistent.
101- The `sysom-osops` CLI injects the UA header automatically and follows the same unified
102 session-id rule.
103
104## Execution Flow
105
106- Before each inspection, the CLI verifies SysOM activation and permissions (`InitialSysom`,
107 `source=skill_hub`); activation and installation prompts are handled by the CLI itself.
108- Every new inspection calls ROA API `POST /api/v1/inspection/createInstanceInspection` with
109 `source=skill_hub`; selected items come from `--query` keyword/intent mapping, and a query
110 matching no items falls back to a full inspection.
111- Each mode runs a full closed loop: inspect (metrics + logs) -> automatic root-cause diagnosis
112 on detected anomalies -> LLM-summarized Chinese report.
113- Automatic root-cause diagnosis is triggered via `InvokeDiagnosis` (injecting
114 `__sysom_diagnosis_source=skill_hub` into `params`) and polled via `GetDiagnosisResult`
115 until `success` / `fail` / timeout.
116- Batch (`--scope-type batch --instances ...`) inspects every specified instance; region-wide
117 (`--scope-type all`) auto-discovers all ECS instances in the region (limit 5000). Both
118 automatically diagnose the Top-3 most severe anomalous instances and include copy-ready
119 deep-dive commands for the remaining ones in the report.
120- Report lookup uses ROA API `GET /api/v1/inspection/getInspectionReport`; the CLI polls until
121 the report succeeds or times out.
122- `--region <region> --scope-type <scope-type> --report-id <reportId>` (or with
123 `--instance` instead of `--scope-type`) skips task creation and directly fetches the
124 existing report; inspection results emit this replay command in `next_steps`
125 automatically, including the original `--region` and `--scope-type`/`--instance`.
126- Local threshold/event-rule configuration is not used; anomaly decisions come from the
127 server-side inspection report.
128
129## Error Handling
130
131When a CLI invocation fails, classify the failure by the error text (`Error: <Code>: ...`)
132and handle it as follows instead of blind retries:
133
134- **Permission (`Forbidden.RAM`)**: explain that `sysom:InitialSysom` /
135 `sysom:InvokeAgentCli` is missing and point the user to `references/ram-policies.md`
136 for the minimum policy; do not retry.
137- **Parameter (`InvalidParameter`, invalid argument)**: identify the offending argument
138 and guide the user to verify the instance id and region; do not attribute it to the
139 service.
140- **Throttling (`Throttling`)**: tell the user the request was rate-limited and advise
141 retrying later; do not retry automatically in a loop.
142- **Internal (`InternalError`)**: report the temporary service failure honestly and
143 suggest retrying later; do not attribute it to user input.
144- **Empty region (`no ECS instances found`)**: not an error. Report that the region has
145 no ECS instances and skip the inspection; never fabricate a report.
146
147## Extensibility Notes
148
149- Inspection focus is controlled by `--query` (keyword/intent mapping to concrete items);
150 unmatched queries fall back to a full inspection.
151- Use `--scope-type batch --instances ...` for batch inspection and `--scope-type all` for the
152 whole region (limit 5000 instances); both auto-diagnose the Top-3 most severe anomalies.
153- Use `--region <region> --scope-type <scope-type> --report-id <reportId>` (or with
154 `--instance` instead of `--scope-type`) to re-check an existing report without
155 re-execution; the replay command is emitted automatically in inspection `next_steps`
156 with the original `--region` and `--scope-type`/`--instance`.
157- A local Python CLI (`./scripts/osops.sh inspection`) is kept only as a fallback for
158 environments where `sysom-osops` is unavailable.
159- Memory anomaly trigger logic of the fallback path stays implemented in
160 `scripts/sysom_cli/inspection/command.py`.
161- To add more post-inspection specialized diagnosis actions, reuse the `InvokeDiagnosis`
162 integration pattern.