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/

tcp

TCP connections of a Linux by SSH, IPv4 and IPv6: established, TIME-WAIT, CLOSE-WAIT, listening.

  • linux
  • ssh
  • tcp
  • network
  • alpine
  • debian
  • fedora

by banshee1 installation2 versions

v2Latest

Published on October 28, 2026. One naming convention across collections; documentation completed.

TCP connections of a Linux, by SSH

Returns the established connections, those waiting to be closed on either side (TIME-WAIT, CLOSE-WAIT), the listening ports and the total, IPv4 and IPv6 together.

Versions

Generic: /proc/net/tcp and /proc/net/tcp6 are written by the kernel the same way on Alpine, Debian and Fedora; the awk program only uses what BusyBox awk, mawk (Debian) and gawk (Fedora) all know.

How it works

The collector runs cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | awk '…': awk counts the sockets per state on the target, so that a server with a hundred thousand connections returns a few lines.

  • tcp6 is missing on a machine without IPv6: cat keeps quiet, and the IPv4 sockets are counted.
  • The collector's own SSH connection is a TCP connection: reading none stops the collector misconfigured.
  • 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

NameLabelUnitPer instance
establishedEstablished connections—no
time-waitConnections in TIME-WAIT—no
close-waitConnections in CLOSE-WAIT—no
listenListening ports—no
totalTCP connections—no

Watches

NameTitleKindDefaultsChecked by default
too-manyToo many TCP connectionsabove a threshold, on establishedno thresholdno
unusualUnusual number of connectionshabit, on establishedsensitivity normalno
close-waitConnections left openabove a threshold, on close-waitwarning above 100, for 3 runs; no criticalno

Limits

  • Only the network namespace of the SSH server is seen: the connections of a container in its own namespace are not.
  • CLOSE-WAIT piling up says an application does not close its connections; the collector does not say which one.