Adapters
System Metrics

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 system

Or 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

MetricTypeUnitDescription
cpu.temperaturefloat°CCPU die temperature
cpu.usage_pctfloat%CPU utilization percentage
cpu.loadfloat1-minute load average
memory.used_pctfloat%RAM usage as a percentage
memory.available_mbfloatMBAvailable RAM
disk.used_pctfloat%Root filesystem usage
disk.available_gbfloatGBAvailable disk space
net.rx_bytesintbytesNetwork bytes received (cumulative)
net.tx_bytesintbytesNetwork bytes transmitted (cumulative)
system.uptimefloatsecondsSystem uptime
system.processesintNumber of running processes

CPU Temperature

CPU temperature reading depends on your hardware:

PlatformSource
Raspberry Pi/sys/class/thermal/thermal_zone0/temp
Linux (generic)/sys/class/thermal/ or vcgencmd measure_temp fallback
macOSNot 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 second

Use Cases

  • Fleet health monitoring — track CPU temp and memory across your device fleet
  • Storage alerts — set alerts on disk.used_pct to catch full disks before they cause failures
  • Network throughput — monitor net.rx_bytes and net.tx_bytes to track bandwidth usage
  • Load testing — watch cpu.load and memory.used_pct during stress tests

Next Steps

  • CAN Bus -- Read automotive and industrial bus data
  • CLI Reference -- Full list of plexus commands and flags