banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Linux

banshee/linux-collection/linux/ssh/

cpu

CPU usage of a Linux by SSH: each core, the whole, iowait and steal, from /proc/stat.

  • linux
  • ssh
  • cpu
  • alpine
  • debian
  • fedora

by banshee1 installation2 versions

CPU of a Linux, by SSH

Returns the usage of each core and of the whole CPU, the share of time spent waiting for disks (iowait) and the time stolen by the hypervisor (steal), and the number of cores. Seven watches are offered, each one set on the probe.

What changed since version 1

  • iowait and steal are new outputs, with their watches iowait-high and steal-high, checked.
  • New defaults, closer to a production server: cpu-high warns at 85 and is critical at 95 for 3 runs (version 1: critical at 60); core-hot warns at 95 and is no longer checked (version 1: 70, checked); core-idle and core-neglected are no longer checked, as an idle core is normal on most servers.
  • A run where iowait went backwards is skipped, and a kernel without the steal column stops the collector misconfigured with its reason, where version 1 stopped on a missing field.
  • Every watch keeps its id and kind: a probe upgraded from version 1 keeps its checks and settings.

How it works

The collector runs grep ^cpu /proc/stat and reads the cpu line (the whole) and the cpuN lines (each core): user, nice, system, idle, iowait, irq, softirq and steal times since boot.

  • Usage is 1 − (idle + iowait) / total over 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).
  • Portable: /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. Nothing is written on the target.

Prerequisites

  • an SSH account for monitoring, without write rights; reading /proc needs 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

OutputUnitPerMeaning
cpu-busy%—usage of the whole CPU
iowait%—time spent waiting for I/O
steal%—time stolen by the hypervisor
core-busy%core (cpu0, cpu1…)usage of each core
cores——number of cores

Watches

WatchKindDefaultsChecked
cpu-high CPU busyabove, on cpu-busywarning 85, critical 95, for 3 runsyes
iowait-high Waiting for disksabove, on iowaitwarning 20, for 5 minyes
steal-high Stolen by the hypervisorabove, on stealwarning 10, for 5 minyes
core-hot A core saturatedabove, on core-busywarning 95, for 3 runsno
core-idle A core underusedbelow, on core-busywarning 20no
core-neglected A core left idledeviate, on core-busywarning 30 below the median of the other coresno
core-count Unexpected number of coresexpect, on coresno expected valueyes, raises once a value is set

Limits

  • Values arrive from the second run on; a probe whose interval is long averages over it.
  • steal is only meaningful on a virtual machine; it stays at 0 on bare metal.
  • A kernel older than 2.6.11, without the steal column, stops the collector misconfigured.