Memory

Lingxi · Agent Health Monitor

Try it

Monitor OpenClaw Agent health, uptime, task status, and system metrics. Automatic alerts on failures, performance degradation, or unusual behavior. Includes...

What it does

Monitor OpenClaw Agent health, uptime, task status, and system metrics. Automatic alerts on failures, performance degradation, or unusual behavior. Includes memory management, session cleanup, and proactive self-healing.

The skill document

lingxi-agent-monitor

Proactive health monitoring and self-healing for AI Agent systems built on OpenClaw.

What It Monitors

MetricCheckAlert Threshold
Agent UptimeIs agent alive?Any downtime
Session CountActive sessions> 20 or < 1
Memory UsageAgent memory consumption> 80%
Task QueuePending/failed tasks> 5 failed
MCP ConnectionsExternal tool connectivityAny failure
API LatencyTool response time> 5 seconds
Error RateTool call failure %> 10%

Usage

Trigger Commands

"System health check"  → Full health scan + report
"Agent status"        → Quick status summary
"Memory check"         → Focus on memory metrics
"Task queue check"     → Focus on pending/failed tasks
"Alert me if..."      → Configure custom alert rules

Health Report Format

# Agent Health Report — YYYY-MM-DD HH:MM

## System Status
| Component | Status | Latency | Notes |
|-----------|--------|---------|-------|
| OpenClaw Gateway | ✅ Healthy | 45ms | |
| MCP Server | ✅ Connected | 120ms | |
| GitHub Integration | ✅ OK | 200ms | |
| ZeroGPU | ✅ OK | 80ms | |

## Session Overview
- Active sessions: 3
- Avg session duration: 23m
- Memory: 1.2GB / 4GB (30%)

## Recent Activity
- Tasks completed: 47
- Tasks failed: 2 (4.3%)
- Avg task duration: 1m 12s

## Alerts (if any)
- [ ] No critical alerts
- ⚠️ Warning: ZeroGPU latency > 500ms (3 occurrences)

Alert Levels

LevelTriggerAction
🔴 CriticalAgent down, all tools failingImmediate notification + restart attempt
🟡 WarningDegraded performance, > 10% error rateScheduled notification
🔵 InfoNew session, task milestoneLog only

Self-Healing Actions

When issues are detected, the agent can automatically:

  1. Restart failed MCP connections
  2. Clean up stale sessions (sessions idle > 2 hours)
  3. Flush memory cache when usage > 80%
  4. Retry failed tool calls (up to 3 attempts)
  5. Switch to backup providers (e.g., GitHub API fallback)

Configuration

{
  "alert_channels": ["log", "notification"],
  "memory_threshold_pct": 80,
  "session_idle_timeout_min": 120,
  "max_sessions": 20,
  "error_rate_threshold_pct": 10,
  "latency_threshold_ms": 5000,
  "self_heal_enabled": true,
  "health_check_interval_min": 15
}

Cron Schedule

*/15 * * * * → Health check every 15 minutes
0 */2 * * *  → Deep memory cleanup every 2 hours

Installation

clawhub install lingxi-agent-monitor

Integration with External Alerting

For external alerts (Slack, Discord, PagerDuty):

# In your notification workflow
curl -X POST $SLACK_WEBHOOK \
  -H "Content-Type: application/json" \
  -d '{"text": "🔴 Agent Alert: $ALERT_MESSAGE"}'

Memory Management

When memory usage is high:

  1. Archive completed session summaries to memory files
  2. Clear intermediate computation cache
  3. Merge small memory files into consolidated ones
  4. Prune session history beyond retention limit

Dashboard Endpoint

If running with n8n bridge:

GET /agent-monitor/dashboard  → HTML dashboard with real-time status
GET /agent-monitor/metrics   → JSON metrics endpoint
GET /agent-monitor/alerts     → JSON alert history

Related skills

Route OpenClaw CLI requests to the right command family and profile, then verify the outcome.

336 installs7 stars

Keep OpenClaw gateway alive: heartbeat monitoring, auto-restart, crash alerts, memory warning, uptime report.

3 installs

Build, bootstrap, and maintain a stable OpenClaw default agent identity by interviewing the user, updating IDENTITY.md, and seeding core context files (AGENT...

28 installs

Install and configure the security-related plugins required by OpenClaw, including the `agent-sentry` plugins. Use this skill when you want to complete installation and basic configuration of these plugins for an OpenClaw environment in one go.

Standalone advanced network diagnostics for OpenClaw to continuously test end-to-end connectivity from OpenClaw agent to Telegram Bot API and approximate del...

31 installs

Connect two OpenClaw agents on the same LAN as peer collaborators. No VPN, no port forwarding over the internet, no third-party relay. Direct sessions_send b...