Tencent Cloud CAT: Cloud Dial Test Network Quality Analysis Skill

Preface

When monitoring tasks report errors or experience metric fluctuations, the common practice is to log into the console, browse charts, cross-reference packet captures, and examine multi-region data. Manually correlating “error distribution → performance trends → whether it’s a link issue → whether it’s a server-side issue” is often time-consuming, and the Agent side lacks a unified, scriptable interface. Below is the introduction of cat-network-quality-analysis (Skill display name: Tencent Cloud CAT), released by the Tencent Cloud Active Monitoring team. It fetches analysis streams through the ProcessAIEventsStream API, consolidating error analysis, overall analysis, performance analysis, packet capture analysis, and multi-task comparison into a single CLI/Skill invocation chain. Results are archived as Markdown, and stdout returns a single line of JSON for orchestration layer parsing.

What Is This

cat-network-quality-analysis is a network quality analysis Agent Skill designed for Tencent Cloud Active Monitoring (CAT, Cloud Automated Testing) tasks. Version 1.3.0, authored and maintained by the Active Monitoring Team. The Skill coordinate is @tencent-adm/cat-network-quality-analysis-v1-0-1, categorized under it-ops-security in SkillHub, and requires API key configuration (requires_api_key=true).

The core problem it solves: Within a specified task ID and time window, it triggers analysis on the CAT AI Console side using natural language or structured query-text, automatically generates scenario-based reports, and supports packet capture follow-up and multi-task horizontal comparison.

Tencent Cloud internal users need to use the intranet API endpoint cat.ai.internal.tencentcloudapi.com; the public default endpoint is cat.ai.tencentcloudapi.com.

Core Features

The following capabilities are derived from the Skill definition and manifest description, and can be selected based on scenarios:

  1. Error Analysis: Identifies abnormal types and error distribution patterns.
  2. Overall Analysis: Presents overall network quality and availability-related views of the monitored service.
  3. Performance Analysis: A performance metric dimension separated from overall analysis (available since v1.1.0).
  4. Packet Capture Analysis: Parses packet data for root cause diagnosis; supports initial “perform packet capture analysis” and packet capture follow-up with session-id (structured_json specifies probe time and error codes, etc.).
  5. Multi-task Comparison (v1.3.0): AnalyzeAction=MultiTaskCompare, compares key metrics between 1 main task and up to 5 comparison tasks; the monitoring type of the main task and comparison tasks must be consistent.

The script uses Python 3.10+, implements TC3-HMAC-SHA256 signature using the standard library, and has no third-party dependencies (removed tencentcloud-sdk-python since v1.2.0). The execution process is silent, streaming writes to Markdown files, and at the end, stdout outputs only a single line of JSON (containing fields such as report, md_path, session_id, pcap_candidates, incomplete, etc.).

Installation and Activation

Environment and Dependencies

No third-party packages need to be installed via pip; ensure Python 3.10 or above is available on the local machine, and directly run scripts/cat_network_quality_analysis.py within the Skill package.

Credentials and Endpoints (Two-level Configuration)

Loading priority: Environment variables > scripts/.env file.

Configuration Item Environment Variable Required Default Value Description
SecretId CAT_SECRET_ID Yes — Tencent Cloud API access key ID
SecretKey CAT_SECRET_KEY Yes — Tencent Cloud API access key KEY
Token CAT_TOKEN No — Temporary credentials (optional)
Endpoint CAT_ENDPOINT No cat.ai.tencentcloudapi.com Intranet users change to cat.ai.internal.tencentcloudapi.com

When CAT_* is not set, the script will fallback to reading TENCENTCLOUD_SECRET_ID, TENCENTCLOUD_SECRET_KEY, TENCENTCLOUD_TOKEN, TENCENTCLOUD_ENDPOINT; it is recommended to use CAT_* first.

If keys have not been activated yet, CAT API access permissions can be applied through the console:
https://console.cloud.tencent.com/cloudapp/run/yunti/apply-auth

Configure .env example under scripts/:

# scripts/.env
CAT_SECRET_ID=your-secret-id
CAT_SECRET_KEY=your-secret-key
CAT_TOKEN=your-token
CAT_ENDPOINT=cat.ai.internal.tencentcloudapi.com

.env is included in .gitignore, do not write keys into the code repository.

Equivalent environment variable method:

export CAT_SECRET_ID='your-secret-id'
export CAT_SECRET_KEY='your-secret-key'
export CAT_ENDPOINT='cat.ai.internal.tencentcloudapi.com'

tcproxycli Proxy Mode (Optional)

If tcproxycli is installed and TCPROXYCLI_PROXY_ENDPOINT and TCPROXYCLI_SESSION_KEY are set, the script can use proxy mode, without needing local SecretId/SecretKey. When not set, it defaults to TC3 signature mode.

export TCPROXYCLI_PROXY_ENDPOINT="https://your-proxy-endpoint"
export TCPROXYCLI_SESSION_KEY="your-session-key"

Using Skill in IDE

Official examples mention using natural language to describe requirements in CodeBuddy IDE, such as “analyze the monitoring errors of task-xxxxxxxx in the last 3 hours”, where the Agent loads SKILL.md and calls the script. Cursor and other runtimes supporting general SKILL.md can encapsulate calls with the same parameter constraints; specific installation entry points are subject to SkillHub.

SkillHub page:
https://www.skillhub.cn/skills/tencent-adm/cat-network-quality-analysis-v1-0-1

API metadata address:
https://api.skillhub.cn/tencent-adm/cat-network-quality-analysis-v1-0-1

Typical Usage

CLI Common Parameters

Parameter Required Description
--query-text Yes Query sent to CAT AI Console; common templates see references/query_text_templates.md; multi-task comparison is <structured_json>
--task-id Required except for multi-task comparison Format like task-xxxxxxxx
--start-time / --end-time Yes Millisecond-level 13-digit timestamp
--analyze-action No Console / PcapAnalysis / MultiTaskCompare, default inferred from query-text
--session-id For packet capture follow-up Session ID returned by initial analysis
--output / -o No Markdown path; default generated by task and report type
--suppress-pcap-candidates No Recommended to explicitly include in packet capture scenarios to suppress candidate list addition

query-text should not contain time descriptions or task IDs (passed by CLI trio).

Example 1: Error Analysis

python3 scripts/cat_network_quality_analysis.py \
  --query-text "Perform error analysis" \
  --task-id "task-xxxxxxxx" \
  --start-time 1773734439444 \
  --end-time 1773745239444 \
  --output task-xxxxxxxx/task-xxxxxxxx_error_report_20260319_143025.md

Example 2: Overall Analysis and Performance Analysis

For overall analysis, change query-text to “Perform overall analysis”; for performance analysis, change to “Perform performance analysis”, the other trio remains the same.

python3 scripts/cat_network_quality_analysis.py \
  --query-text "Perform performance analysis" \
  --task-id "task-xxxxxxxx" \
  --start-time 1773658839444 \
  --end-time 1773745239444 \
  --output task-xxxxxxxx/performance_report.md

Example 3: Packet Capture Analysis

Initial direct packet capture:

python3 scripts/cat_network_quality_analysis.py \
  --query-text "Perform packet capture analysis" \
  --task-id "task-xxxxxxxx" \
  --start-time 1773658839444 \
  --end-time 1773745239444 \
  --suppress-pcap-candidates \
  --output task-xxxxxxxx/pcap_report.md

Packet capture follow-up requires passing the session_id from the initial JSON, and query-text is structured JSON:

python3 scripts/cat_network_quality_analysis.py \
  --query-text '<structured_json>{"task_id":"task-xxxxxxxx","probe_time":1773905195000,"code":"12929"}</structured_json>' \
  --task-id "task-xxxxxxxx" \
  --start-time 1773905195000 \
  --end-time 1773905195000 \
  --session-id "17f57xxxxxxxxxxxxxxxx5b224055354" \
  --suppress-pcap-candidates \
  --output task-xxxxxxxx/task-xxxxxxxx_pcap_report_20260319_120000.md

Example 4: Multi-task Comparison

Do not pass --task-id; query-text specifies the main task and comparison list:

python3 scripts/cat_network_quality_analysis.py \
  --query-text '<structured_json>{"main_task_id":"task-aaaabbbb","compare_task_ids":["task-aaaa1111","task-bbbb2222"]}</structured_json>' \
  --start-time 1773658839444 \
  --end-time 1773745239444 \
  --output task-aaaabbbb/task-aaaabbbb_multitask_compare_report_20260319_143025.md

When users do not specify a time range, multi-task comparison defaults to analyzing the last 3 hours (end is the current millisecond timestamp, start = end - 10800000).

Output Convention

Success stdout example structure:

{"code": 0, "report": "# Report content...", "md_path": "/abs/path/report.md", "session_id": "xxx", "json_file": "...", "pcap_candidates": [], "incomplete": false}

On failure, code is 1 with an error field. If incomplete is true, it indicates that agent.done was not received normally via SSE, and the time window should be narrowed and retried.

Applicable Scenarios and Notes

Who it suits: Teams already using Tencent Cloud Active Monitoring who need to automatically generate reports in operations troubleshooting or Agent workflows; SkillHub tags point to IT operations and security monitoring scenarios.

Usage notes:

  • Except for multi-task comparison, a clear task-id must be present; when missing, confirm with the user, do not fabricate.
  • Multi-task comparison limit is 1 main task + 5 comparison tasks, and task types must be consistent.
  • Intranet and public endpoints cannot be mixed incorrectly, otherwise the service cannot be accessed.
  • For complete constraints of the packet capture branch, see references/branch_pcap.md, references/error_handling.md in the package.
  • SkillHub introduction mentions that the console can generate PDF analysis reports; this Skill script explicitly exports as Markdown and streams writes to files, PDF capability is subject to Tencent Cloud CAT product documentation: https://cloud.tencent.com/document/product/280

Conclusion

Tencent Cloud CAT (cat-network-quality-analysis) encapsulates five types of analysis scenarios of cloud monitoring and ProcessAIEventsStream streaming results into a scriptable, Agent-accessible Skill: after configuring CAT_* or tcproxycli, you can save Markdown to disk and get JSON summaries with the trio time window and query-text. For Skill and version information, see:
https://www.skillhub.cn/skills/tencent-adm/cat-network-quality-analysis-v1-0-1

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye