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/

interfaces

Network interfaces of a Linux by SSH: link, speed, traffic, errors, addresses and bonds.

  • linux
  • ssh
  • network
  • interface
  • bond
  • alpine
  • debian
  • fedora

by banshee1 installation2 versions

Network interfaces of a Linux, by SSH

Returns, for each network interface, the link state, the negotiated speed and duplex, the MTU, the traffic, errors and drops, its IP addresses, and the members of a bond. Thirteen watches are offered, each one set on the probe.

What changed since version 1

  • Members of a bridge, like members of a bond, are no longer judged on their addresses.
  • no-address and missing are no longer checked by default, and missing expects no name: an interface without an address (a VLAN parent, an unused port) raised a critical, and names like eth0 depend on the machine.
  • mtu expects 1500 instead of 9000.
  • A kernel older than 3.15, without carrier_changes, no longer stops the collector; a missing ip command does, with its error, where version 1 counted no address and raised no-address.
  • Nothing readable in /sys/class/net stops the collector misconfigured (version 1: unreachable), as the machine answered.
  • Watch ids and kinds are unchanged: a probe upgraded from version 1 keeps its settings.

How it works

The collector reads in one command the files of /sys/class/net (state, speed, duplex, MTU, bond members, bridge port, counters) with grep -s -H, then counts the global addresses of each interface with ip -o addr show scope global.

  • Traffic comes from the counters over the interval between two runs: there is none on the first run.
  • A file a driver does not serve (the speed of a link that is down, of a Wi-Fi card) is silenced by grep -s, and its value is missing.
  • Portable: /sys/class/net is written by the kernel the same way on Alpine, Debian and Fedora; -s and -H are options of BusyBox as of GNU grep; ip -o … scope global is understood by iproute2 (Debian, Fedora) and by the ip applet of BusyBox (Alpine). 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).

Outputs

OutputUnitPerMeaning
link—interfaceup, down, lowerlayerdown…
carrier-changes—interfacelink changes since boot
speedMbit/sinterfacenegotiated speed
duplex—interfacefull or half
mtu—interfaceMTU
traffic-in, traffic-out, trafficbit/sinterfacetraffic in, out and both
in-percent, out-percent%interfacetraffic over the negotiated speed
packetspackets/sinterfacepackets in and out
errorserrors/sinterfaceerrors in and out
dropspackets/sinterfacedrops in and out
drop-percent%interfaceshare of packets dropped
addresses—interfaceglobal IP addresses, bond and bridge members excluded
bond-members, bond-members-up—bondmembers, and those whose link is up

By default, lo, docker* and veth* are left out; the selection is changed on the probe.

Watches

WatchKindDefaultsChecked
link-down Link downstate, on linkcritical down, lowerlayerdownyes
link-flapping Link flappingincrease, on carrier-changeswarning 3, window 1 hyes
speed-degraded Negotiated speed degradedcustomexpected 1000 Mbit/s; half-duplex criticalyes
saturation-in Inbound saturationabove, on in-percentwarning 70, critical 90, for 5 minyes
saturation-out Outbound saturationabove, on out-percentwarning 70, critical 90, for 5 minyes
errors Errorscustomwarning beyond 1 error/min, critical beyond 0.1 % of trafficyes
drops Packets droppedabove, on drop-percentwarning 0.5, critical 2yes
traffic-unusual Unusual traffichabit, on trafficfloor 10,000,000no
mute Silent interfacesilence, on packetswarning 10 minno
missing Missing interfacemissing, on linkno expected nameno
bond-degraded Bond degradedcustomwarning when a member is down, critical when 1 is leftyes
mtu Unexpected MTUexpect, on mtuwarning unless 1500no
no-address No IP address leftbelow, on addressescritical 1no

Limits

  • Virtual interfaces (virtio, most cloud NICs) report no speed: they have no usage percent and no speed-degraded.
  • The counters of a bond add up those of its members: the traffic shows on both.