fix: Ignore meraki bad_uptime #4691

This commit is contained in:
crcro
2016-10-08 20:48:11 +03:00
committed by Neil Lathwood
parent c0d7ad44b0
commit 80497f5295
2 changed files with 44 additions and 44 deletions

View File

@@ -116,7 +116,7 @@ if (isset($config['enable_bgp']) && $config['enable_bgp']) {
} }
// Device rebooted boxes // Device rebooted boxes
if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== false && $config['uptime_warning'] > 0 && $config['os'][$os]['bad_uptime'] !== true) { if (filter_var($config['uptime_warning'], FILTER_VALIDATE_FLOAT) !== false && $config['uptime_warning'] > 0 && $config['os'][$device['os']]['bad_uptime'] !== true) {
if (is_admin() === true || is_read() === true) { if (is_admin() === true || is_read() === true) {
$sql = "SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0 LIMIT " . $config['front_page_down_box_limit']; $sql = "SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '" . $config['uptime_warning'] . "' AND D.ignore = 0 LIMIT " . $config['front_page_down_box_limit'];
} else { } else {

View File

@@ -50,7 +50,7 @@ if ($device["os"] != "edgeswitch") {
} }
} }
if (is_numeric($uptime) && $config['os'][$os]['bad_uptime'] !== true) { if (is_numeric($uptime) && ($config['os'][$device['os']]['bad_uptime'] !== true)) {
if ($uptime < $device['uptime']) { if ($uptime < $device['uptime']) {
log_event('Device rebooted after ' . formatUptime($device['uptime']), $device, 'reboot', $device['uptime']); log_event('Device rebooted after ' . formatUptime($device['uptime']), $device, 'reboot', $device['uptime']);
} }