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.
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 vialscpu.disks()— block devices vialsblk(size, rotational flag, mount, model).disk_usage()— filesystem usage viadf, in bytes.gpus()— NVIDIA GPU inventory and sensors vianvidia-smi.
Health and security:
node_conditions()— Kubernetes-shaped pressure signals (Memory/Load/Disk/Thermal), eachok/warn/crit/unknown.disk_health()— overall SMART verdict per disk viasmartctl.proc_security()— per-process seccomp mode and capability masks from/proc/[pid]/status.thermals()— thermal-zone temperatures from/sys/class/thermal.
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.
remotes::install_github("cornball-ai/hwstate")Linux only (OS_type: unix; requires /proc and /sys).
MIT © cornball.ai