Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hwstate

Read-only introspection of host hardware and resource state from R: memory, CPU, load, processes, storage, thermals, and GPUs, returned as plain data frames in one stable schema.

Part of Runix, an R-native Unix systems-administration framework. hwstate is the report half of Runix's OS/hardware touchpoint: the layer an orchestrator reads to see what a node is and how loaded it is.

Status: experimental. Version 0.0.1.x; the API changes without deprecation until 0.1.0.

Reporters

Point-in-time metrics:

  • mem_info() — memory totals and usage from /proc/meminfo, in bytes.
  • load_average() — 1/5/15-minute load and per-CPU load from /proc/loadavg.
  • processes() — one row per PID (ppid, uid, state, RSS, cgroup, command) from /proc/[pid].
  • cgroup_rss() — RSS rolled up per cgroup, largest first.

Static inventory:

  • cpu_info() — CPU model, sockets, cores, threads via lscpu.
  • disks() — block devices via lsblk (size, rotational flag, mount, model).
  • disk_usage() — filesystem usage via df, in bytes.
  • gpus() — NVIDIA GPU inventory and sensors via nvidia-smi.

Health and security:

  • node_conditions() — Kubernetes-shaped pressure signals (Memory/Load/Disk/Thermal), each ok/warn/crit/unknown.
  • disk_health() — overall SMART verdict per disk via smartctl.
  • proc_security() — per-process seccomp mode and capability masks from /proc/[pid]/status.
  • thermals() — thermal-zone temperatures from /sys/class/thermal.

Design rules

Plain data frames with stable columns. Fail-closed parsing where the fact is present (unparseable backend output is a typed error, never a guess) and fail-soft where the hardware is absent (no GPU, no SMART permission, no thermal zone returns an empty framed result, not an error). Injectable runners so tests run offline against recorded fixtures. Byte counts and UIDs are doubles, never 32-bit integers. Mutations are out of scope: hwstate only reports.

Install

remotes::install_github("cornball-ai/hwstate")

Linux only (OS_type: unix; requires /proc and /sys).

License

MIT © cornball.ai

About

Read-only introspection of host hardware and resource state from R (memory, CPU, load, processes, storage, thermal, GPU). Part of the Runix system-administration framework.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages