Linux
banshee/linux-collection/linux/snmp/
uptime
Time since boot of a Linux host by SNMP, and a warning after a reboot.
by banshee1 installation2 versions
Time since boot of a Linux host, by SNMP
Returns the time since the system booted, in hours. One watch is offered: a recent reboot.
How it works
The collector reads hrSystemUptime (HOST-RESOURCES-MIB), the system's time since boot in hundredths of a second, and not sysUpTime, the SNMP agent's own, which restarts each time snmpd does.
- A reboot shows as a time since boot shorter than the threshold of "Recent reboot".
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 |
|---|---|---|
uptime | Time since boot | h |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
| Recent reboot | Below a threshold, on uptime | warning below 0.5 h | yes |
Limits
hrSystemUptimecounts hundredths of a second on 32 bits: it wraps every 497 days, which the watch takes for a reboot.- A reboot shorter than the probe's interval is seen only if the threshold is longer than that interval.