From a10503b927a8e688de4ce9870183d7f7fc4e9588 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 10 Nov 2018 21:05:25 +0000 Subject: [PATCH] Ensure the checks for ASA context devices are strict (#9441) --- includes/discovery/sensors/entity-sensor.inc.php | 2 +- includes/polling/os/asa.inc.php | 2 +- includes/polling/ports.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/discovery/sensors/entity-sensor.inc.php b/includes/discovery/sensors/entity-sensor.inc.php index 702fbc00e1..5dfdb87296 100644 --- a/includes/discovery/sensors/entity-sensor.inc.php +++ b/includes/discovery/sensors/entity-sensor.inc.php @@ -138,7 +138,7 @@ if (!empty($entity_oids)) { $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; } // Check for valid sensors diff --git a/includes/polling/os/asa.inc.php b/includes/polling/os/asa.inc.php index dd945893c7..a14d1875d5 100644 --- a/includes/polling/os/asa.inc.php +++ b/includes/polling/os/asa.inc.php @@ -10,7 +10,7 @@ * option) any later version. Please see LICENSE.txt at the top level of * 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'; $data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB'); diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index 0fe0623e3b..bd45e81344 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -683,7 +683,7 @@ foreach ($ports as $port) { } } else { if ($oid == 'ifOperStatus' || $oid == 'ifAdminStatus') { - if ($port[$oid . '_prev'] != $this_port[$oid]) { + if ($port[$oid.'_prev'] == null) { $port['update'][$oid . '_prev'] = $this_port[$oid]; } }