System Metrics
Monitor device health -- CPU temperature, memory usage, disk usage, network I/O, and load averages.
Install
pip install plexus-agent[system]Quick Start
plexus run --sensor systemOr use it programmatically:
from plexus.sensors import SystemSensor, SensorHub
from plexus import Plexus
hub = SensorHub()
hub.add(SystemSensor(sample_rate=1))
hub.run(Plexus())Metrics Reference
| Metric | Type | Unit | Description |
|---|---|---|---|
cpu.temperature | float | °C | CPU die temperature |
cpu.usage_pct | float | % | CPU utilization percentage |
cpu.load | float | — | 1-minute load average |
memory.used_pct | float | % | RAM usage as a percentage |
memory.available_mb | float | MB | Available RAM |
disk.used_pct | float | % | Root filesystem usage |
disk.available_gb | float | GB | Available disk space |
net.rx_bytes | int | bytes | Network bytes received (cumulative) |
net.tx_bytes | int | bytes | Network bytes transmitted (cumulative) |
system.uptime | float | seconds | System uptime |
system.processes | int | — | Number of running processes |
CPU Temperature
CPU temperature reading depends on your hardware:
| Platform | Source |
|---|---|
| Raspberry Pi | /sys/class/thermal/thermal_zone0/temp |
| Linux (generic) | /sys/class/thermal/ or vcgencmd measure_temp fallback |
| macOS | Not available (metric omitted silently) |
If the temperature sensor is not available, the cpu.temperature metric is omitted silently — no errors, no placeholder values.
Sample Rate
The default sample rate is 1 Hz (one reading per second). Adjust it based on your use case:
# Slower sampling for long-running monitoring
hub.add(SystemSensor(sample_rate=0.1)) # Every 10 seconds
# Faster sampling for load testing
hub.add(SystemSensor(sample_rate=10)) # 10 times per secondUse Cases
- Fleet health monitoring — track CPU temp and memory across your device fleet
- Storage alerts — set alerts on
disk.used_pctto catch full disks before they cause failures - Network throughput — monitor
net.rx_bytesandnet.tx_bytesto track bandwidth usage - Load testing — watch
cpu.loadandmemory.used_pctduring stress tests
Next Steps
- CAN Bus -- Read automotive and industrial bus data
- CLI Reference -- Full list of
plexuscommands and flags