360 Secure SkillHub
360 安全技能中心

System Monitor

通过本地 Python 脚本采集并展示系统 CPU、内存、磁盘、网络与进程指标,支持查看当前状态、持续监视、可配置采样间隔、资源阈值告警和 JSON 输出。

dinghaibin
dinghaibin
热度 33.08
最近更新 2026-05-11 17:47:26
分类:自动化依赖:代码执行应用场景:DevOps / 自动化脚本 / 报告撰写

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add sys-monitor-dhb
Metadata
name
system-monitor
description
Monitor system metrics like CPU, memory, disk, and network. Use when user needs to track server performance, set up alerts for high resource usage, monitor uptime, check process status, or create system health reports.

System Monitor

Monitor system metrics like CPU, memory, disk, and network.

Quick Start

# Check current status
python scripts/monitor.py --status

# Monitor continuously
python scripts/monitor.py --watch

Usage

python scripts/monitor.py [OPTIONS]

Options:
  --status        Show current system status
  --watch         Monitor continuously
  --interval SECS Check interval (default: 5)
  --cpu           Show CPU usage
  --memory        Show memory usage
  --disk          Show disk usage
  --network       Show network stats
  --processes     Show top processes
  --alert VALUE   Alert threshold (e.g., cpu:90)
  --json          Output as JSON

Examples

# Quick status check
python scripts/monitor.py --status

# Watch mode
python scripts/monitor.py --watch --interval 10

# Alert on high CPU
python scripts/monitor.py --watch --alert cpu:90

# Alert on low disk
python scripts/monitor.py --watch --alert disk:90

# JSON output for dashboards
python scripts/monitor.py --status --json

Alert Examples

# CPU above 90%
python scripts/monitor.py --watch --alert cpu:90

# Memory above 80%
python scripts/monitor.py --watch --alert memory:80

# Disk above 85%
python scripts/monitor.py --watch --alert disk:85

Metrics

  • CPU usage per core
  • Memory usage (used/free/total)
  • Disk usage per partition
  • Network I/O
  • Top processes by CPU/memory
  • Uptime