360 Secure SkillHub
360 安全技能中心

Agent Health Monitor

一个 Node.js 模块,用于监控 Agent 和会话健康:检查会话状态、检测无响应 Agent、跟踪 CPU/内存资源占用,并在发现故障时发出告警;支持一次性检查与按固定间隔持续监控,输出包含总数、健康与异常数量、失败 Agent 列表和资源使用摘要的健康报告。

jpengcheng523-netizen
jpengcheng523-netizen
热度 59.16
最近更新 2026-05-18 12:34:31
分类:自动化依赖:代码执行应用场景:自动化脚本 / 工作流 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agent-health-monitor
Metadata
name
agent-health-monitor
description
Monitors agent health status and detects failures for fault-tolerant agent systems. **Trigger scenarios:** - User asks about agent health or status - User mentions "check agents", "agent failure", "health check" - System needs to detect unresponsive agents - Fault tolerance monitoring required

Agent Health Monitor

Monitors agent and session health to detect failures and ensure system reliability.

Usage

const monitor = require('./skills/agent-health-monitor');

// Check all agents health
const health = await monitor.checkHealth();

// Get failed agents
const failed = await monitor.getFailedAgents();

// Monitor continuously
monitor.startMonitoring(30000); // Check every 30s

Features

  • Session Status Check: Verifies active sessions
  • Agent Liveness Detection: Detects unresponsive agents
  • Resource Monitoring: Tracks CPU/memory usage
  • Failure Alerts: Notifies on detected failures

Output

Returns a health report with:

  • Total agents/sessions count
  • Healthy vs unhealthy count
  • Failed agents list
  • Resource usage summary