Linux
banshee/linux-collection/linux/ssh/
load
Load average of a Linux by SSH over 1, 5 and 15 minutes, raw and per core.
by banshee1 installation2 versions
Load average of a Linux, by SSH
Returns the load average over 1, 5 and 15 minutes, the same divided by the number of cores, and the number of cores. A load of 1 per core keeps the whole machine busy; beyond it, tasks wait for a core.
How it works
The collector runs cat /proc/loadavg; grep -c '^cpu[0-9]' /proc/stat: the three averages, then the number of online cores (one cpuN line each in /proc/stat).
- Portable: both files are written by the kernel the same way on Alpine, Debian and Fedora;
grep -cexists in BusyBox and GNU grep./proc/cpuinfois not read, its layout changes with the architecture. Nothing is written on the target. - An answer that is not two lines, or a load or core count that is not a number, stops the collector
misconfigured.
Prerequisites
- an SSH account for monitoring, without write rights;
- 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
| Output | Unit | Meaning |
|---|---|---|
load-1, load-5, load-15 | — | load average over 1, 5 and 15 minutes |
load-1-per-core, load-5-per-core, load-15-per-core | — | the same divided by the number of cores |
cores | — | number of online cores |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
load-high Machine overloaded | above, on load-5-per-core | warning 1.5, critical 3 | yes |
load-unusual Unusual load | habit, on load-5-per-core | sensitivity normal | no |
Limits
- Linux counts in the load the tasks waiting for a disk (state D): a high load with a low CPU usage points to storage, see
linux/ssh/cpu(iowait) andlinux/ssh/diskio. - In a container, the load is the host's.