部署包含3个代理的状态页面流水线,实现服务监控、状态聚合和公开事件通报的自动化。使用此技能的场景:1....
状态页面设置 : 部署3 个代理, 自动服务监测、 状态汇总和事件通信是一项面向实际任务的技能,主要用于Roles.;Role.;
使用时应结合输入条件选择合适的执行方式,核对必要参数、依赖环境与输出内容,并按原始要求处理异常情况。从功能定位来看,该技能强调把分散的操作要求整理成清晰、可复用的处理流程,使用户能够围绕既定目标快速准备输入、选择执行方式并获得结构化结果。实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
部署 3 个智能体(agent),分别自动化执行服务监控、状态聚合与事件通知任务。
| 角色 | 主机名 | 技能(Skills) | 用途 |
|---|---|---|---|
| monitor | |
pilot-health, pilot-cron, pilot-metrics | 对端点发起探测请求,检查响应时间,检测服务中断与性能劣化 |
| aggregator | |
pilot-event-filter, pilot-dataset, pilot-audit-log | 将各服务健康检查结果聚合为整体系统状态,并跟踪正常运行时间 |
| publisher | |
pilot-webhook-bridge, pilot-announce, pilot-slack-bridge | 更新公开状态页,向订阅者发送事件通知(如邮件、Slack) |
步骤 1: 向用户询问该智能体应承担的角色以及要使用的前缀(prefix)。
步骤 2: 安装所选角色对应的功能模块(skills):
# monitor 角色: clawhub install pilot-health pilot-cron pilot-metrics # aggregator 角色: clawhub install pilot-event-filter pilot-dataset pilot-audit-log # publisher 角色: clawhub install pilot-webhook-bridge pilot-announce pilot-slack-bridge
步骤 3: 设置主机名:
pilotctl --json set-hostname-
步骤 4: 编写配置清单(setup manifest):
mkdir -p ~/.pilot/setups cat > ~/.pilot/setups/status-page.json << 'MANIFEST' <根据下方模板生成的对应角色清单> MANIFEST
步骤 5: 提示用户与直连通信对等体(direct communication peers)发起握手(handshake)操作。
{"setup":"status-page","setup_name":"Status Page","role":"monitor","role_name":"Service Monitor","hostname":"-monitor","description":"Pings endpoints, checks response times, detects outages and degradation.","skills":{"pilot-health":"Run HTTP/TCP health checks against configured service endpoints.","pilot-cron":"Schedule health checks at regular intervals (e.g. every 30 seconds).","pilot-metrics":"Track response times, error rates, and availability per service."},"peers":[{"role":"aggregator","hostname":"-aggregator","description":"Receives health check results for status aggregation"}],"data_flows":[{"direction":"send","peer":"-aggregator","port":1002,"topic":"health-check","description":"Per-service health check results"}],"handshakes_needed":["-aggregator"]}
{"setup":"status-page","setup_name":"Status Page","role":"aggregator","role_name":"Status Aggregator","hostname":"-aggregator","description":"Combines health checks into overall system status, tracks uptime percentages, maintains incident history.","skills":{"pilot-event-filter":"Filter health events by severity and detect incident-worthy degradation.","pilot-dataset":"Store uptime history, incident records, and historical status snapshots.","pilot-audit-log":"Log all status transitions and incident lifecycle events for audit."},"peers":[{"role":"monitor","hostname":"-monitor","description":"Sends health check results"},{"role":"publisher","hostname":"-publisher","description":"Receives status updates and incident events"}],"data_flows":[{"direction":"receive","peer":"-monitor","port":1002,"topic":"health-check","description":"Per-service health check results"},{"direction":"send","peer":"-publisher","port":1002,"topic":"status-update","description":"System status updates and incident events"}],"handshakes_needed":["-monitor","-publisher"]}
{"setup":"status-page","setup_name":"Status Page","role":"publisher","role_name":"Status Publisher","hostname":"-publisher","description":"Updates public status page, sends incident notifications to subscribers via email and Slack.","skills":{"pilot-webhook-bridge":"Push status updates and incident events to the public status page API.","pilot-announce":"Broadcast incident notifications to all registered subscribers.","pilot-slack-bridge":"Post incident updates and resolution notices to operations Slack channels."},"peers":[{"role":"aggregator","hostname":"-aggregator","description":"Sends status updates and incident events"}],"data_flows":[{"direction":"receive","peer":"-aggregator","port":1002,"topic":"status-update","description":"System status updates and incident events"},{"direction":"send","peer":"external","port":443,"topic":"incident-notification","description":"Incident notifications to subscribers"}],"handshakes_needed":["-aggregator"]}
monitor → aggregator:health-check 事件(端口 1002)aggregator → publisher:status-update 事件(端口 1002)publisher → external:通过 webhook 发送 incident-notification(端口 443)# monitor ↔ aggregator: pilotctl --json handshake-aggregator "setup: status-page" pilotctl --json handshake -monitor "setup: status-page" # aggregator ↔ publisher: pilotctl --json handshake -publisher "setup: status-page" pilotctl --json handshake -aggregator "setup: status-page"
# 在 aggregator 上 — 订阅 health-check 事件: pilotctl --json subscribe-monitor health-check # 在 publisher 上 — 订阅 status-update 事件: pilotctl --json subscribe -aggregator status-update # 在 monitor 上 — 发布一次健康检查结果: pilotctl --json publish -aggregator health-check '{"service":"api-gateway","status":"degraded","response_ms":2340,"threshold_ms":500}' # 在 aggregator 上 — 发布系统状态更新: pilotctl --json publish -publisher status-update '{"overall_status":"degraded","incident":true,"incident_id":"INC-2025-0018","affected_services":["api-gateway"]}'
需安装 pilot-protocol 技能模块、pilotctl 可执行文件、clawhub 可执行文件,并确保后台守护进程(daemon)正在运行。
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章