Windows
banshee/windows-collection/windows/snmp/
uptime
The time since a Windows started, and its recent restarts, by SNMP
by banshee1 installation2 versions
// The time since a Windows started, by SNMP, from hrSystemUptime (HOST-RESOURCES-MIB):
// the system's, not the SNMP agent's (sysUpTime), which starts again at each restart of the service.
// A restart shows as a time since start shorter than the threshold of "Recent restart".
// hrSystemUptime counts hundredths of a second on 32 bits: it wraps to zero every 497 days,
// which the watch takes for a restart.
need('protocol:snmp');
output('uptime', 'number', array('label' => 'Time since start', 'unit' => 'h'));
watch.below('rebooted', 'Recent restart', 'uptime', array('warning' => 0.5));
value('uptime', number.round(snmp.get('1.3.6.1.2.1.25.1.1.0') / 360000, 2));