Skip to main content

Anonymous Ubuntu host-level CPU/GPU resource and power monitor.

Project description

Anonymous System Resource Monitor

This is a host-level Ubuntu monitor for group servers. It samples aggregate CPU, memory, load, GPU power/utilization/memory/temperature, and best-effort CPU package power. It does not record PID, username, command line, Docker container, image, or compose service information.

Install from PyPI

Recommended with pipx:

sudo apt update
sudo apt install -y pipx
pipx ensurepath
pipx install system-resource-monitor

sudo "$(command -v system-resource-monitor)" install-systemd

Then check the timer:

systemctl list-timers system-resource-monitor.timer
sudo "$(command -v system-resource-monitor)" status

Safety Contract

The collect and report commands are read-only with respect to running workloads:

  • They do not call docker, kill, pkill, os.kill, signal APIs, terminate(), or kill().

  • They do not enumerate /proc/<pid> and do not inspect per-process metadata.

  • The only external command used by collect is:

    nvidia-smi --query-gpu=index,uuid,name,power.draw,utilization.gpu,utilization.memory,memory.used,memory.total,temperature.gpu --format=csv,noheader,nounits
    
  • The install-systemd, uninstall-systemd, and status commands may call systemctl, but only to manage system-resource-monitor.service and system-resource-monitor.timer.

  • The systemd unit also drops CAP_KILL and denies common signal-sending syscalls, so even accidental future signal-sending code should fail under the timer service.

Install from Source

cd system-resource-monitor

sudo mkdir -p /opt/system-resource-monitor /var/lib/system-resource-monitor
sudo install -m 0755 system_resource_monitor.py /opt/system-resource-monitor/system_resource_monitor.py
sudo install -m 0644 README.md /opt/system-resource-monitor/README.md
sudo install -m 0644 system-resource-monitor.service /etc/systemd/system/system-resource-monitor.service
sudo install -m 0644 system-resource-monitor.timer /etc/systemd/system/system-resource-monitor.timer
sudo chmod 0750 /var/lib/system-resource-monitor

sudo systemctl daemon-reload
sudo systemctl enable --now system-resource-monitor.timer

If installed as a Python package, prefer:

sudo "$(command -v system-resource-monitor)" install-systemd

Check Status

systemctl list-timers system-resource-monitor.timer
sudo systemctl status system-resource-monitor.service
journalctl -u system-resource-monitor.service -n 50

Collect Once

sudo "$(command -v system-resource-monitor)" collect

Export Reports

Recent 24 hours:

sudo "$(command -v system-resource-monitor)" report \
  --since-hours 24 \
  --out /tmp/system_resource_report_24h.csv

Recent 7 days:

sudo "$(command -v system-resource-monitor)" report \
  --since-hours 168 \
  --out /tmp/system_resource_report_7d.csv

Notes

  • GPU metrics use nvidia-smi --query-gpu, so NVIDIA drivers must be installed for GPU rows to appear.
  • CPU package power is read from /sys/class/powercap/intel-rapl:* when the kernel exposes it. If unavailable, it is stored as empty/NULL.
  • Energy estimates use power_w * interval_sec; first samples and samples after long gaps are not counted toward kWh estimates.
  • Data older than 90 days is deleted during each collection.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

system_resource_monitor-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

system_resource_monitor-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file system_resource_monitor-0.1.0.tar.gz.

File metadata

  • Download URL: system_resource_monitor-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for system_resource_monitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c779b737131cabc079819d2942f367e31ea50ad760f80c15a3faa8964de8dc3
MD5 749868d021dc82d0fda5ae673a1fc889
BLAKE2b-256 fba72525f146bdc05be90dbdc989147f6c463339c08ae29e441db8270c9761f3

See more details on using hashes here.

File details

Details for the file system_resource_monitor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for system_resource_monitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0a88637bb7d2b30c384770d3760c50cb6918d58993bae094e17e382241d1272
MD5 3d2ec061c6d75071fae0173755b67600
BLAKE2b-256 f43474b43c5dde43e88f7f7d7f5eb89885917e3d1870b08e89407ab56434f400

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page