(This blog posting pertains to any BMC Discovery product: on-premise or Helix Discovery)
Some customers rely on Discovery to see the Uptime for hosts and devices.
One problem: OOTB, the Uptime is missing for NetworkDevice and SNMPManagedDevice.
Why? I'm not sure. But, maybe it is because the SNMP sysUpTime isn't always reliable.
We have a discussion here: does ADDM/Discovery discover network device sysUpTime?
According to google results, the maximum number of days that the SNMP sysUpTime will show is 497 days.
After 497 days, the SNMP sysUpTime value starts over again at 0.
Here are several articles I found about the topic:
If the device is up for longer than 497 days, then the value will not be correct for the sysUpTime.
You will have to decide whether or not that's a problem for you.
Devices should be upgraded (and consequently rebooted) with new firmware at intervals shorter than 497 days, if only for purposes of security, IMO.
We can provide the Uptime with a custom pattern. But, there is nothing that the pattern can do to get around the 497 day limitation.
The value is either correct, or it isn't correct .. and you won't know if it is or it isn't, unless you investigate further, and/or ask the sysadmin for the device.
Having said all that, I am pasting below, and attaching a pattern I wrote to get the Uptime for a NetworkDevice and for an SNMPManagedDevice.
FYI: I used this tutorial to see how to find and interpret the sysUpTime from this OID 220.127.116.11.18.104.22.168.0: https://www.easysnmp.com/tutorial/tutorial-step-2.html
Since the Uptime of a Host is found on the HostInfo, my pattern sets the Uptime for a Device on the DeviceInfo.
I only added the Uptime in days. I didn't add an uptime_seconds also exists on the HostInfo.
Steps to use the attached custom pattern:
1) Upload the attached custom pattern from the Manage>Knowledge page of the Discovery UI
2) Scan your devices
3) You can look for the Uptime using this query:
search FLAGS(no_segment) NetworkDevice, SNMPManagedDevice show summary, #InferredElement:Inference:Primary:DeviceInfo.uptime as 'Uptime Days'
tpl 1.13 module device_uptime;
origin := "Custom";
tree_path := "Custom", "device uptime";
from DiscoveryFunctions import DiscoveryFunctions 1.3;
// OID to obtain uptime
table device_uptime_table 1.0
"22.214.171.124.126.96.36.199.0" -> "device_uptime";
definitions localFunctions 1.0
type := function;
uptime_table := discovery.snmpGet(device, device_uptime_table);
if not uptime_table then
log.info("Failed to get uptime. Stopping pattern");
uptime_ticks := uptime_table.device_uptime;
log.debug("uptime in ticks = %uptime_ticks%");
// ((((ticks/60 seconds )/60 minutes )/24 hours )/100 ticks per second)
uptime_days := ((((uptime_ticks /60)/60)/24)/100);
log.debug("uptime in days = %uptime_days%");
device_infos := search(in device traverse InferredElement:Inference:Primary:DeviceInfo);
if device_infos then
device_info := device_infos;
device_info.uptime := uptime_days;
pattern device_uptime_discovery 1.0
add uptime attribute for a NetworkDevice
on device := NetworkDevice created, confirmed;
pattern snmpmanageddevice_uptime_discovery 1.0
add uptime attribute for a SNMPManagedDevice
on device := SNMPManagedDevice created, confirmed;