Skip to main content

Module linux

Module linux 

Source
Expand description

Linux-specific readers for /sys and /proc.

These cover what sysinfo does not expose: hwmon sensors, RAPL energy counters, per-device disk I/O, btrfs, mdadm and ZFS state, failed systemd units.

Every reader takes its root directories from SysRoots instead of hard-coding /sys and /proc, so tests can point them at a fixture tree.

Modules§

battery
Laptop batteries from /sys/class/power_supply.
btrfs
btrfs filesystem health from /sys/fs/btrfs/<fsid>.
diskstats
Per-device disk I/O from /proc/diskstats.
drm
AMD and Intel GPUs from /sys/class/drm/card<N>/device.
hwmon
Hardware monitoring chips from /sys/class/hwmon.
mdstat
Linux md (mdadm) arrays from /proc/mdstat.
meminfo
Supplementary memory figures from /proc/meminfo.
mounts
Mount table from /proc/mounts.
net
Network link state from /sys/class/net/<iface> and, for Wi-Fi, iw.
procstat
Thread counts from /proc/<pid>/stat.
rapl
CPU package power from RAPL energy counters in /sys/class/powercap.
systemd
systemd units in the “failed” state, from systemctl list-units --state=failed (no root needed), refreshed at most every [FAILED_UNITS_REFRESH] to keep the cost of spawning it negligible.
zfs
ZFS pools from the kernel module’s statistics, readable without root: /proc/spl/kstat/zfs/<pool>/state holds the pool’s health, the same word zpool status shows (ONLINE, DEGRADED, FAULTED, …).

Structs§

SysRoots
Root directories of the kernel pseudo filesystems.