Ensure the checks for ASA context devices are strict (#9441)

This commit is contained in:
Neil Lathwood
2018-11-10 21:05:25 +00:00
committed by GitHub
parent 9c7d5ed5ba
commit a10503b927
3 changed files with 3 additions and 3 deletions

View File

@@ -138,7 +138,7 @@ if (!empty($entity_oids)) {
$valid_sensor = false; $valid_sensor = false;
} }
} }
if ($current == '-127' || ($device['os'] == 'asa' && str_contains($device['hardware'], 'sc'))) { if ($current == '-127' || ($device['os'] == 'asa' && ends_with($device['hardware'], 'sc'))) {
$valid_sensor = false; $valid_sensor = false;
} }
// Check for valid sensors // Check for valid sensors

View File

@@ -10,7 +10,7 @@
* option) any later version. Please see LICENSE.txt at the top level of * option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details. * the source code distribution for details.
*/ */
if (!str_contains($device['hardware'], 'sc')) { if (!ends_with($device['hardware'], 'sc')) {
$oids = 'entPhysicalModelName.1 entPhysicalSoftwareRev.1 entPhysicalSerialNum.1 entPhysicalModelName.4 entPhysicalSoftwareRev.4'; $oids = 'entPhysicalModelName.1 entPhysicalSoftwareRev.1 entPhysicalSerialNum.1 entPhysicalModelName.4 entPhysicalSoftwareRev.4';
$data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB'); $data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB');

View File

@@ -683,7 +683,7 @@ foreach ($ports as $port) {
} }
} else { } else {
if ($oid == 'ifOperStatus' || $oid == 'ifAdminStatus') { if ($oid == 'ifOperStatus' || $oid == 'ifAdminStatus') {
if ($port[$oid . '_prev'] != $this_port[$oid]) { if ($port[$oid.'_prev'] == null) {
$port['update'][$oid . '_prev'] = $this_port[$oid]; $port['update'][$oid . '_prev'] = $this_port[$oid];
} }
} }