banshee/linux-collection/linux/ssh/
cpu
CPU usage of a Linux by SSH: each core, the whole, iowait and steal, from /proc/stat.
by banshee1 installation2 versions
v2Latest
Published on October 28, 2026. One naming convention across collections; documentation completed.
Processors of a Linux, by SSH
Returns the usage of each processor and of all of them, the share of time spent waiting for disks (iowait) and the time stolen by the hypervisor (steal), and the number of processors. Seven watches are offered, each one set on the probe.
Versions
Generic: /proc/stat is written by the kernel the same way on Alpine, Debian and Fedora, and grep without options is the same in BusyBox and GNU grep. A kernel older than 2.6.11, without the steal column, stops the collector misconfigured.
How it works
The collector runs grep ^cpu /proc/stat and reads the cpu line (the whole) and the cpuN lines (each logical processor): user, nice, system, idle, iowait, irq, softirq and steal times since boot.
- Usage is
1 − (idle + iowait) / totalover the interval, total being the sum of the eight times; iowait and steal are their own share of the total. - On the first run there is no interval yet: the run is skipped. So is a run where a counter went backwards (iowait may on some kernels).
- Nothing is written on the target.
Prerequisites
- an SSH account for monitoring, without write rights; reading
/procneeds no privilege; - the fingerprint of the server's host key, set in
protocol:ssh:fingerprint(not needed when the Security settings trust the first SSH fingerprint presented).
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
cpu-busy | Overall processor usage | % | no |
iowait | Waiting for disks | % | no |
steal | Stolen by the hypervisor | % | no |
core-busy | Processor usage | % | yes, per processor (cpu0, cpu1…) |
cores | Number of processors | — | no |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
cpu-high | Processor saturated | above a threshold, on cpu-busy | warning above 85 %, critical above 95 %, for 3 runs | yes |
iowait-high | Waiting for disks | above a threshold, on iowait | warning above 20 %, for 5 min; no critical | yes |
steal-high | Stolen by the hypervisor | above a threshold, on steal | warning above 10 %, for 5 min; no critical | yes |
core-hot | A processor saturated | above a threshold, on core-busy | warning above 95 %, for 3 runs; no critical | no |
core-idle | A processor underused | below a threshold, on core-busy | warning below 20 %; no critical | no |
core-neglected | A processor left idle | deviates from the others, on core-busy | warning when a processor is more than 30 % below the median of the others; no critical | no |
core-count | Unexpected number of processors | expected value, on cores | no expected value: it raises nothing until one is set on the probe | yes |
Limits
- Values arrive from the second run on; a probe whose interval is long averages over it.
- The processors are the logical ones: on a processor with two threads per core, each thread is one processor.
stealis only meaningful on a virtual machine; it stays at 0 on bare metal.