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/

processes

Processes of a Linux by SSH: total, zombies, and instances, memory and CPU per process name.

  • linux
  • ssh
  • process
  • alpine
  • debian
  • fedora

by banshee1 installation2 versions

Processes of a Linux, by SSH

Returns the number of processes and of zombies, and for each process name watched, the number of its instances, their memory and their CPU time.

How it works

The collector runs cat /proc/[0-9]*/stat (the name, state and CPU times of each process) and grep -s -H ^VmRSS: /proc/[0-9]*/status (its resident memory).

  • Instances of the same name add up. The CPU time is the time used per second over the interval between two runs, as a share of one core: a process using two full cores shows 200 %. It has no value on the first run, nor when an instance ended and the sum went backwards.
  • A process that ends during the reading is simply missing from the answer.
  • Portable: /proc/<pid> is written by the kernel the same way on Alpine, Debian and Fedora, where the columns of ps differ; -s and -H are options of BusyBox as of GNU grep. Nothing is written on the target.

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);
  • on a kernel mounted with hidepid, an account allowed to see the other users' processes.

Outputs

OutputUnitPerMeaning
processes——number of processes, kernel threads included
zombies——processes ended but not reaped by their parent
instances—process namenumber of running instances
memoryMiBprocess nameresident memory of all instances
cpu%process nameCPU time, as a share of one core

By default only sshd, cron and crond are watched; the selection is changed on the probe.

Watches

WatchKindDefaultsChecked
missing Process missingmissing, on instancesno expected nameyes, raises once names are set
zombies Zombies piling upabove, on zombieswarning 20, for 3 runsyes
too-many Too many processesabove, on processesno thresholdno
memory-high Memory of a processabove, on memoryno thresholdno
cpu-high CPU of a processabove, on cpuwarning 90, for 3 runsno

Limits

  • The name is the kernel's: 15 characters at most, without path or arguments.
  • No expected name by default: cron is cron on Debian and crond on Fedora and Alpine, and the SSH server may be dropbear.
  • The memory of processes sharing pages (forks of a server) is counted once per instance.