glances
Glances System Monitoring Skill
⚠️ MANDATORY SKILL INVOCATION ⚠️
YOU MUST invoke this skill (NOT optional) when the user mentions ANY of these triggers:
- "Glances stats", "system health", "CPU usage"
- "memory usage", "disk space", "container stats"
- "check Glances", "server monitoring", "process list"
- Any mention of Glances or system resource monitoring
Failure to invoke this skill when triggers occur violates your operational requirements.
Monitor system health via the Glances REST API (v4). Get real-time stats on CPU, memory, disk, network, sensors, containers, and processes.
Purpose
This skill provides read-only access to system metrics from a Glances server:
- CPU usage (total, per-core, load average)
- Memory and swap usage
- Disk I/O and filesystem space
- Network traffic (per interface)
- Temperature and fan sensors
- Docker/Podman container stats
- Process list (top consumers)
- System alerts and warnings
All operations are GET-only and safe for monitoring/reporting.
Setup
-
Start Glances in server mode on the target system:
glances -w --disable-webui # API only # or glances -w # API + Web UI -
Add credentials to .env file:
~/.homelab-skills/.env
GLANCES_URL="http://localhost:61208"
GLANCES_USERNAME="" # Optional: leave empty if no auth
GLANCES_PASSWORD="" # Optional: leave empty if no auth
Variable details:
GLANCES_URL: Glances server URL (default port 61208)GLANCES_USERNAME: HTTP Basic auth username (optional, leave empty if no auth)GLANCES_PASSWORD: HTTP Basic auth password (optional, leave empty if no auth)
Commands
All commands output JSON. Use jq for formatting or filtering.
Quick Overview
Get a quick system overview (CPU, memory, swap, load):
./scripts/glances-api.sh quicklook
System Info
./scripts/glances-api.sh system # Hostname, OS, platform
./scripts/glances-api.sh uptime # System uptime
./scripts/glances-api.sh core # CPU core count (physical/logical)
CPU Stats
./scripts/glances-api.sh cpu # Overall CPU usage
./scripts/glances-api.sh percpu # Per-core CPU usage
./scripts/glances-api.sh load # Load average (1/5/15 min)
Memory Stats
./scripts/glances-api.sh mem # Memory usage (total/used/free/percent)
./scripts/glances-api.sh memswap # Swap usage
Disk Stats
./scripts/glances-api.sh fs # Filesystem usage (mount points, space)
./scripts/glances-api.sh diskio # Disk I/O (read/write bytes/s)
./scripts/glances-api.sh raid # RAID array status (if available)
./scripts/glances-api.sh smart # S.M.A.R.T. disk health (if available)
Network Stats
./scripts/glances-api.sh network # Network interface traffic
./scripts/glances-api.sh ip # IP addresses
./scripts/glances-api.sh wifi # WiFi signal (if available)
./scripts/glances-api.sh connections # TCP connection states
Sensors
./scripts/glances-api.sh sensors # Temperature, fan, battery sensors
./scripts/glances-api.sh gpu # GPU stats (if available)
Processes
./scripts/glances-api.sh processlist # Full process list
./scripts/glances-api.sh processlist --top 10 # Top 10 by CPU
./scripts/glances-api.sh processcount # Process counts by state
Containers
./scripts/glances-api.sh containers # Docker/Podman containers
./scripts/glances-api.sh containers --running # Running only
Alerts & Status
./scripts/glances-api.sh alert # Active alerts/warnings
./scripts/glances-api.sh status # API status check
./scripts/glances-api.sh plugins # List available plugins
./scripts/glances-api.sh amps # Application monitoring (AMPs)
Raw Plugin Access
./scripts/glances-api.sh plugin <name> # Get any plugin data
./scripts/glances-api.sh plugin <name> <field> # Get specific field
Dashboard (All-in-One)
./scripts/glances-api.sh dashboard # Comprehensive system overview
Workflow
When the user asks about system health:
- "How's the server doing?" → Run
./scripts/glances-api.sh dashboard - "CPU usage?" → Run
./scripts/glances-api.sh cpu - "Memory?" → Run
./scripts/glances-api.sh mem - "Disk space?" → Run
./scripts/glances-api.sh fs - "What's using resources?" → Run
./scripts/glances-api.sh processlist --top 10 - "Container stats?" → Run
./scripts/glances-api.sh containers - "Any problems?" → Run
./scripts/glances-api.sh alert - "Temperatures?" → Run
./scripts/glances-api.sh sensors
Output Examples
Quick Look
{
"cpu": 12.5,
"cpu_name": "AMD Ryzen 9 5900X",
"mem": 45.2,
"swap": 0.0,
"load": 2.15
}
Memory
{
"total": 32212254720,
"available": 17637244928,
"percent": 45.2,
"used": 14575009792,
"free": 1234567890
}
Filesystem
[
{
"device_name": "/dev/nvme0n1p2",
"fs_type": "ext4",
"mnt_point": "/",
"size": 500107862016,
"used": 125026965504,
"free": 375080896512,
"percent": 25.0
}
]
Notes
- Glances API v4 is used (default since Glances 4.x)
- Requires network access to your Glances server
- Default port is 61208
- Some plugins may return empty data if not applicable (e.g.,
gpuwithout GPU,raidwithout RAID) - Authentication is optional; configure in Glances with
--usernameand--password - All calls are read-only GET requests
Multiple Servers
To monitor multiple Glances servers, use numbered environment variables in .env:
# In ~/.homelab-skills/.env
GLANCES1_URL="http://server1.local:61208"
GLANCES1_USERNAME=""
GLANCES1_PASSWORD=""
GLANCES2_URL="http://server2.local:61208"
GLANCES2_USERNAME=""
GLANCES2_PASSWORD=""
Then use with server number:
# Server 1 (default)
./scripts/glances-api.sh cpu
# Server 2
SERVER_NUM=2 ./scripts/glances-api.sh cpu
Note: Multi-server support requires script updates (not yet implemented)
Reference
- Glances REST API Documentation — Full endpoint reference
- Glances Official Docs
🔧 Agent Tool Usage Requirements
CRITICAL: When invoking scripts from this skill via the zsh-tool, ALWAYS use pty: true.
Without PTY mode, command output will not be visible even though commands execute successfully.
Correct invocation pattern:
<invoke name="mcp__plugin_zsh-tool_zsh-tool__zsh">
<parameter name="command">./skills/SKILL_NAME/scripts/SCRIPT.sh [args]</parameter>
<parameter name="pty">true</parameter>
</invoke>
More from jmagar/claude-homelab
memos
Manage notes and memos in self-hosted Memos service. Use when the user asks to "save this to memos", "create a memo", "search my memos", "find notes about X", "what did I write about", "add a note", "capture this", "remember this", "save this thought", or mentions note-taking, knowledge management, or personal notes.
65unraid
Query and monitor Unraid servers via the GraphQL API. Use when the user asks to 'check Unraid', 'monitor Unraid', 'Unraid API', 'get Unraid status', 'check disk temperatures', 'read Unraid logs', 'list Unraid shares', 'Unraid array status', 'Unraid containers', 'Unraid VMs', or mentions Unraid system monitoring, disk health, parity checks, or server status.
24plex
Control Plex Media Server - browse libraries, search media, check what's playing, view recently added. Use when the user asks to "check Plex", "search Plex", "what's on Plex", "recently added", "who's watching", "Plex sessions", "Plex library", "browse movies", "browse TV shows", or mentions Plex media server.
22tailscale
This skill should be used when managing Tailscale mesh VPN networks. Use when the user asks to "check tailscale status", "list tailscale devices", "ping a device", "send file via tailscale", "tailscale funnel", "tailscale serve", "create auth key", "check who's online", "tailscale exit node", "Magic DNS", or mentions Tailscale network management, tailnet operations, or VPN connectivity.
21qbittorrent
Manage torrents with qBittorrent. Use when the user asks to "list torrents", "add torrent", "pause torrent", "resume torrent", "delete torrent", "check download status", "torrent speed", "qBittorrent stats", or mentions qBittorrent/qbit torrent management.
20sonarr
This skill should be used when managing TV shows in Sonarr. Use when the user asks to "add a TV show", "search Sonarr", "find a series", "add to Sonarr", "remove a show", "check if show exists", "Sonarr library", "TVDB lookup", or mentions TV show management or Sonarr operations.
14