Loading...
Loading...
Compare original and translation side by side
Language / 语言: Respond in the same language the user uses. If the user speaks Chinese, use the Chinese (zh-CN) prompts below. If the user speaks English, use the English (en) prompts below.
NIS (CreateAndAnalyzeNetworkPath + GetNetworkReachableAnalysis) + CloudMonitor (DescribeMetricData)⚠️ CRITICAL / 关键: READ-ONLY OPERATIONS ONLYThis skill performs read-only network diagnostics. DO NOT create, modify, or delete any cloud resources.本技能仅执行只读网络诊断操作。严禁创建、修改或删除任何云资源。Allowed:,CreateAndAnalyzeNetworkPath,GetNetworkReachableAnalysis,DescribeMetricDataAPIsDescribe*允许:分析任务创建与查询、监控数据查询、Describe* 类查询 APIForbidden:(exceptCreate*),CreateAndAnalyzeNetworkPath,Modify*,Delete*,Start*,Stop*APIsRun*禁止:创建类 API(除外)、修改、删除、启停、执行类 APICreateAndAnalyzeNetworkPath
语言: 以用户使用的语言回复。 如果用户使用中文,请使用下方的中文提示。 如果用户使用英文,请使用下方的英文提示。
NIS (CreateAndAnalyzeNetworkPath + GetNetworkReachableAnalysis) + CloudMonitor (DescribeMetricData)⚠️ 关键: 仅支持只读操作本技能仅执行只读网络诊断操作。严禁创建、修改或删除任何云资源。允许调用的API:、CreateAndAnalyzeNetworkPath、GetNetworkReachableAnalysis、所有DescribeMetricData类查询APIDescribe*禁止调用的API:除外的所有CreateAndAnalyzeNetworkPath类、Create*类、Modify*类、Delete*类、Start*类、Stop*类APIRun*
Pre-check: Aliyun CLI >= 3.3.1 required Runto verify >= 3.3.1. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] runaliyun versionto enable automatic plugin installation.aliyun configure set --auto-plugin-install true
aliyun version
aliyun configure set --auto-plugin-install true前置检查:要求 Aliyun CLI 版本 >= 3.3.1 运行确认版本不低于3.3.1。如果未安装或版本过低,参考references/cli-installation-guide.md中的安装说明操作。之后必须运行aliyun version开启插件自动安装功能。aliyun configure set --auto-plugin-install true
aliyun version
aliyun configure set --auto-plugin-install truePre-check: Alibaba Cloud Credentials RequiredSecurity Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
is FORBIDDEN)echo $ALIBABA_CLOUD_ACCESS_KEY_ID- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
with literal credential valuesaliyun configure set- ONLY use
to check credential statusaliyun configure listbashaliyun configure list --user-agent AlibabaCloud-Agent-SkillsCheck the output for a valid profile (AK, STS, or OAuth identity).If no valid profile exists, STOP here.
- Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
in terminal or environment variables in shell profile)aliyun configure- Return and re-run after
shows a valid profilealiyun configure list
前置检查:需要阿里云凭证安全规则:
- 严禁读取、回显或打印AK/SK的值(例如禁止执行
)echo $ALIBABA_CLOUD_ACCESS_KEY_ID- 严禁要求用户在对话或命令行中直接输入AK/SK
- 严禁使用字面量凭证值执行
命令aliyun configure set- 仅可使用
检查凭证状态aliyun configure listbashundefined
检查输出中是否存在有效配置(AK、STS或OAuth身份)。 **如果不存在有效配置,请停止操作。** 1. 从[阿里云控制台](https://ram.console.aliyun.com/manage/ak)获取凭证 2. **在当前会话外**配置凭证(通过终端执行`aliyun configure`或在shell配置文件中设置环境变量) 3. 待`aliyun configure list`显示有效配置后,返回重新执行
nis:CreateAndAnalyzeNetworkPathnis:GetNetworkReachableAnalysiscms:DescribeMetricDatanis:CreateAndAnalyzeNetworkPathnis:GetNetworkReachableAnalysiscms:DescribeMetricDataIMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance IDs, IP addresses, protocol, ports, resource types, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
| Parameter | Required | Description (EN) | 说明 (ZH) | Default |
|---|---|---|---|---|
| RegionId | Yes | Region of the analysis task | 分析任务所在地域 | — |
| SourceType | Yes | | 源端类型 | — |
| SourceId | Yes | Source resource ID (or public IP if | 源资源 ID(公网 IP 类型直接填 IP) | — |
| SourceIpAddress | Conditional | On-Premise IP, required for | 云下私网 IP, | — |
| TargetType | Yes | | 目的端类型 | — |
| TargetId | Yes | Target resource ID (or public IP if | 目的资源 ID(公网 IP 类型直接填 IP) | — |
| TargetIpAddress | Conditional | On-Premise IP, required for | 云下私网 IP, | — |
| Protocol | Yes | | 协议类型 | — |
| TargetPort | Conditional | Required for | | — |
| SourcePort | Optional | Source port | 源端口 | — |
重要:参数确认 — 执行任何命令或API调用前,所有用户可自定义参数(例如RegionId、实例ID、IP地址、协议、端口、资源类型等)必须与用户确认。未经用户明确许可,不得假设或使用默认值。
| 参数 | 必填 | 说明 | 默认值 |
|---|---|---|---|
| RegionId | 是 | 分析任务所在地域 | — |
| SourceType | 是 | 源端类型,可选值: | — |
| SourceId | 是 | 源资源ID(若为 | — |
| SourceIpAddress | 条件必填 | 云下私网IP, | — |
| TargetType | 是 | 目的端类型,可选值: | — |
| TargetId | 是 | 目的资源ID(若为 | — |
| TargetIpAddress | 条件必填 | 云下私网IP, | — |
| Protocol | 是 | 协议类型,可选值: | — |
| TargetPort | 条件必填 | | — |
| SourcePort | 可选 | 源端口 | — |
| EN | ZH |
|---|---|
| "What is the source resource type? (ecs / vsw / internetIp / vpn / vbr)" | "请问源端资源类型是什么?(ecs / vsw / internetIp / vpn / vbr)" |
| "What is the target resource type? (ecs / vsw / internetIp / vpn / vbr / clb)" | "请问目的端资源类型是什么?(ecs / vsw / internetIp / vpn / vbr / clb)" |
| Condition | EN Prompt | ZH Prompt |
|---|---|---|
| "For public IP analysis, please provide the public IP address directly as the ID." | "分析公网路径时,请直接提供公网 IP 地址作为 ID 传入。" |
| "For hybrid cloud analysis, besides the resource ID, please also provide the On-Premise IP (private IP on your side)." | "连接云下环境时,除了资源 ID,请务必提供您的云下私网 IP (On-Premise IP) 以确保分析准确。" |
| EN | ZH |
|---|---|
| "What protocol? (tcp / udp / icmp) And what is the target port?" | "请问使用什么协议?(tcp / udp / icmp)目的端口是多少?" |
| 提示内容 |
|---|
| "请问源端资源类型是什么?(ecs / vsw / internetIp / vpn / vbr)" |
| "请问目的端资源类型是什么?(ecs / vsw / internetIp / vpn / vbr / clb)" |
| 条件 | 提示内容 |
|---|---|
类型为 | "分析公网路径时,请直接提供公网IP地址作为ID传入。" |
类型为 | "连接云下环境时,除了资源ID,请务必提供您的云下私网IP (On-Premise IP) 以确保分析准确。" |
| 提示内容 |
|---|
| "请问使用什么协议?(tcp / udp / icmp)目的端口是多少?" |
aliyun nis create-and-analyze-network-path \
--source-id <SourceId> \
--source-type <SourceType> \
--target-id <TargetId> \
--target-type <TargetType> \
--protocol <Protocol> \
--target-port <TargetPort> \
--source-ip-address <SourceIpAddress> \
--target-ip-address <TargetIpAddress> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-SkillsOmit/--source-ip-addressif SourceType/TargetType is not--target-ip-addressorvpn. Omitvbrif Protocol is--target-port.icmp
NetworkReachableAnalysisId⚠️ MANDATORY / 强制: ALWAYS perform reverse path analysis after forward analysis completes.MUST execute Step 3 (Reverse Path Analysis) immediately after Step 2 finishes. Do NOT skip or omit reverse path check.必须在正向分析完成后立即执行 Step 3(反向路径分析)。严禁跳过或省略反向路径检查。
aliyun nis create-and-analyze-network-path \
--source-id <SourceId> \
--source-type <SourceType> \
--target-id <TargetId> \
--target-type <TargetType> \
--protocol <Protocol> \
--target-port <TargetPort> \
--source-ip-address <SourceIpAddress> \
--target-ip-address <TargetIpAddress> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-Skills若SourceType/TargetType不是或vpn,可省略vbr/--source-ip-address参数。 若协议为--target-ip-address,可省略icmp参数。--target-port
NetworkReachableAnalysisId⚠️ 强制要求: 正向分析完成后必须执行反向路径分析。必须在正向分析完成后立即执行步骤3(反向路径分析),严禁跳过或省略反向路径检查。
aliyun nis get-network-reachable-analysis \
--network-reachable-analysis-id <ForwardAnalysisId> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-SkillsNetworkReachableAnalysisStatusfinishReachableNetworkReachableAnalysisResultaliyun nis get-network-reachable-analysis \
--network-reachable-analysis-id <ForwardAnalysisId> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-SkillsNetworkReachableAnalysisStatusfinishReachableNetworkReachableAnalysisResultSourceId/TypeTargetId/TypeTargetId/TypeSourceId/TypeSourceIpAddressTargetIpAddressTargetIpAddressSourceIpAddress--source-portTargetPort--target-portSince the client initiates the connection with a dynamically assigned ephemeral port, the reverse path (server → client) should use a random port in the ephemeral range (49152-65535) as the target port to simulate real return traffic.由于客户端发起连接时使用动态分配的临时端口,反向路径(服务端→客户端)的目的端口应使用临时端口范围(49152-65535)内的随机值来模拟真实回程流量。
aliyun nis create-and-analyze-network-path \
--source-id <OriginalTargetId> \
--source-type <OriginalTargetType> \
--target-id <OriginalSourceId> \
--target-type <OriginalSourceType> \
--protocol <Protocol> \
--source-port <OriginalTargetPort> \
--target-port <RandomPort_49152_to_65535> \
--source-ip-address <OriginalTargetIpAddress> \
--target-ip-address <OriginalSourceIpAddress> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-SkillsOmit/--source-ip-addressif SourceType/TargetType is not--target-ip-addressorvpn. 若源/目的类型不是vbr或vpn,可省略vbr/--source-ip-address。--target-ip-address
SourceId/TypeTargetId/TypeTargetId/TypeSourceId/TypeSourceIpAddressTargetIpAddressTargetIpAddressSourceIpAddress--source-portTargetPort--target-port由于客户端发起连接时使用动态分配的临时端口,反向路径(服务端→客户端)的目的端口应使用临时端口范围(49152-65535)内的随机值来模拟真实回程流量。
aliyun nis create-and-analyze-network-path \
--source-id <OriginalTargetId> \
--source-type <OriginalTargetType> \
--target-id <OriginalSourceId> \
--target-type <OriginalSourceType> \
--protocol <Protocol> \
--source-port <OriginalTargetPort> \
--target-port <RandomPort_49152_to_65535> \
--source-ip-address <OriginalTargetIpAddress> \
--target-ip-address <OriginalSourceIpAddress> \
--region <RegionId> \
--user-agent AlibabaCloud-Agent-Skills若源/目的类型不是或vpn,可省略vbr/--source-ip-address参数。--target-ip-address
NetworkReachableAnalysisIdNetworkReachableAnalysisIdCRITICAL / 关键: Always usefrom the actively initiated analysis task. IGNOREtopologyData.positivein any response — it is unreliable.topologyData.reverse始终使用主动发起的分析任务返回的。 忽略任何响应中的topologyData.positive——它不可靠。topologyData.reverse
ReachabletrueReachabletruefalseNetworkReachableAnalysisResultfalseerrorCodesecurityGroupDatarouteData关键: 始终使用主动发起的分析任务返回的字段,忽略任何响应中的topologyData.positive字段——该字段不可靠。topologyData.reverse
ReachabletruefalseNetworkReachableAnalysisResulterrorCodesecurityGroupDatarouteDatatopologyData.positivegraph LRnodeTypebizInsIdnodeListlinkListgraph LR
ECS_i-src["ECS: i-bp1xxx"] --> VRouter_vrt-1["VRouter: vrt-xxx"]
VRouter_vrt-1 --> VSW_vsw-1["VSW: vsw-xxx"]
VSW_vsw-1 --> ENI_eni-1["ENI: eni-xxx"]
ENI_eni-1 --> ECS_i-dst["ECS: i-bp2xxx"]topologyData.positivegraph LRnodeListnodeTypebizInsIdlinkListgraph LR
ECS_i-src["ECS: i-bp1xxx"] --> VRouter_vrt-1["VRouter: vrt-xxx"]
VRouter_vrt-1 --> VSW_vsw-1["VSW: vsw-xxx"]
VSW_vsw-1 --> ENI_eni-1["ENI: eni-xxx"]
ENI_eni-1 --> ECS_i-dst["ECS: i-bp2xxx"]topologyDatatopologyData| Prefix | Namespace | Metrics |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
aliyun cms DescribeMetricData \
--Namespace <Namespace> \
--MetricName <MetricName> \
--Dimensions '[{"instanceId":"<ResourceId>"}]' \
--StartTime <1HourAgoTimestamp> \
--EndTime <NowTimestamp> \
--Period 60 \
--user-agent AlibabaCloud-Agent-SkillsRate limit: 10 calls/second per account. Batch queries across multiple metrics should be paced accordingly.
topologyData| 前缀 | 命名空间 | 监控指标 |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
aliyun cms DescribeMetricData \
--Namespace <Namespace> \
--MetricName <MetricName> \
--Dimensions '[{"instanceId":"<ResourceId>"}]' \
--StartTime <1HourAgoTimestamp> \
--EndTime <NowTimestamp> \
--Period 60 \
--user-agent AlibabaCloud-Agent-Skills限流规则: 每个账号每秒最多调用10次,多指标批量查询需相应控制调用频率。
DescribeMetricDataDescribeMetricDatavpnvbrvpnvbrvpnvbr| Reference | Contents (EN) | 内容 (ZH) |
|---|---|---|
| references/ram-policies.md | Required RAM permissions | 所需 RAM 权限策略 |
| references/verification-method.md | Step-by-step verification commands | 逐步验证命令 |
| references/acceptance-criteria.md | Correct/incorrect CLI patterns | 正确/错误 CLI 模式对照 |
| references/cli-installation-guide.md | Aliyun CLI installation guide | 阿里云 CLI 安装指南 |
| 参考链接 | 内容 |
|---|---|
| references/ram-policies.md | 所需RAM权限策略 |
| references/verification-method.md | 逐步验证命令 |
| references/acceptance-criteria.md | 正确/错误CLI模式对照 |
| references/cli-installation-guide.md | 阿里云CLI安装指南 |