mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
Fall back to using snmpEngineTime rather than be the default
This commit is contained in:
@@ -28,8 +28,7 @@ if (!empty($agent_data['uptime'])) {
|
||||
}
|
||||
|
||||
if (empty($uptime)) {
|
||||
$uptime = (integer) snmp_get($device, 'snmpEngineTime.0', '-OUqv', 'SNMP-FRAMEWORK-MIB');
|
||||
if (!is_numeric($snmpEngineTime)) {
|
||||
$snmp_uptime = (integer) snmp_get($device, 'snmpEngineTime.0', '-OUqv', 'SNMP-FRAMEWORK-MIB');
|
||||
$hrSystemUptime = snmp_get($device, 'hrSystemUptime.0', '-Oqv', 'HOST-RESOURCES-MIB');
|
||||
if (!empty($hrSystemUptime) && !strpos($hrSystemUptime, 'No') && ($device['os'] != 'windows')) {
|
||||
echo 'Using hrSystemUptime ('.$hrSystemUptime.")\n";
|
||||
@@ -57,11 +56,12 @@ if (empty($uptime)) {
|
||||
$secs = ($secs + ($mins * 60));
|
||||
$uptime = $secs;
|
||||
}//end if
|
||||
}//end if
|
||||
|
||||
if ($snmp_uptime > $uptime && is_numeric($snmp_uptime)) {
|
||||
$uptime = $snmp_uptime;
|
||||
d_echo('hrSystemUptime or sysUpTime looks like to have rolled, using snmpEngineTime instead');
|
||||
}
|
||||
else {
|
||||
echo 'Using snmpEngineTime ('.$uptime.")\n";
|
||||
}//end if
|
||||
}//end if
|
||||
|
||||
if (is_numeric($uptime)) {
|
||||
if ($uptime < $device['uptime']) {
|
||||
|
||||
Reference in New Issue
Block a user