banshee/windows-collection/windows/snmp/
uptime
The time since a Windows started, and its recent restarts, by SNMP
par banshee1 installation2 versions
Uptime of a Windows, by SNMP
Returns the time since a Windows started, in hours. One watch is proposed, set on the probe: the recent restart.
How it works
The collector reads hrSystemUptime (1.3.6.1.2.1.25.1.1.0, HOST-RESOURCES-MIB), in hundredths of a second, and returns it in hours, rounded to a hundredth.
- It is the time since the system started, not since the SNMP agent started (
sysUpTime), which starts again at each restart of the SNMP service. - A restart shows as a time since start shorter than the threshold of "Recent restart".
- Nothing is skipped at the first run.
Nothing is written to the Windows: SNMP reads only.
Prerequisites
- The SNMP service of Windows, installed and started: - on Windows Server, the feature "SNMP Service" (Server Manager, Add Roles and Features; or
Install-WindowsFeature SNMP-Servicein PowerShell); - on Windows 10 and 11, the optional feature "Simple Network Management Protocol (SNMP)" (Settings, Optional features; orAdd-WindowsCapability -Online -Name SNMP.Client~~~~0.0.1.0in PowerShell). - In the properties of the service "SNMP Service", tab Security: - a community with the right READ ONLY, which banshee reads in
protocol:snmp:v2c:community; - under "Accept SNMP packets from these hosts", the address of the poller. - SNMPv3: the SNMP agent of Windows does not offer it;
protocol:snmp:versionstaysv2c. The community then travels in clear text: keep it read-only and accepted from the poller alone. - The Windows firewall open to the poller on UDP 161 (the rule "SNMP Service (UDP In)").
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
uptime | Time since start | h | no |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
rebooted | Recent restart | below a threshold, on uptime | warning below 0.5 h; no critical | yes |
A restart is seen only while the time since start is under the threshold: with the default, the watch stays raised for the first half hour after the start, then clears by itself. A probe that runs less often than the threshold can miss a restart.
Limits
hrSystemUptimecounts hundredths of a second on 32 bits: it wraps to zero every 497 days, which "Recent restart" takes for a restart.- With the "Fast startup" of Windows 10 and 11, a shutdown followed by a start is not a restart of the system: the time since start then goes on. Not yet checked on a real Windows whether the agent's count follows that of Windows there.