Linux
banshee/linux-collection/linux/snmp/
users
Number of open sessions on a Linux host by SNMP.
by banshee1 installation2 versions
Open sessions on a Linux host, by SNMP
Returns the number of open sessions. One watch is offered, with no default threshold.
How it works
The collector reads hrSystemNumUsers (HOST-RESOURCES-MIB): net-snmp counts the sessions the system records in utmp, on the console as well as remote ones (SSH, a graphical session).
Prerequisites
snmpd(net-snmp) running on the host, listening on an address the poller reaches (UDP 161), with the firewall open to the poller only.- The view granted to the poller includes
hrSystem(.1.3.6.1.2.1.25.1), which most default configurations already allow. - Read-only access, SNMPv2c or SNMPv3, set on the host or one of its folders (
protocol:snmp:*variables).
# /etc/snmp/snmpd.conf
agentaddress udp:161
view banshee included .1.3.6.1.2.1.25.1
rocommunity <community> 192.0.2.10 -V banshee
# or: rouser <user> priv -V banshee Outputs
| Name | Label | Unit |
|---|---|---|
users | Open sessions |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
| Too many open sessions | Above a threshold, on users | no threshold | no |
Limits
- What is normal depends on the server, a jump host or a server nobody logs into: the watch has no default threshold.
- A session that does not write to
utmp(a command run over SSH without a terminal, an automation tool) is not counted.