From c6fa4556f35df954e76572a6e0f616b772b64646 Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Tue, 1 Oct 2024 09:46:26 +1000 Subject: [PATCH] Minor tests in Cisco helper. --- app/Helpers/snmp_9_helper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Helpers/snmp_9_helper.php b/app/Helpers/snmp_9_helper.php index 6f46cdc33..8e7a174f3 100644 --- a/app/Helpers/snmp_9_helper.php +++ b/app/Helpers/snmp_9_helper.php @@ -11,8 +11,10 @@ $details = new \StdClass(); $details->manufacturer = 'Cisco Systems'; # the only MIB providing overall RAM is 1.3.6.1.4.1.9.3.6.6.0 which is deprecated - $details->memory_count = intval(my_snmp_get($ip, $credentials, "1.3.6.1.4.1.9.3.6.6.0") / 1024); - $details->storage_count = intval(my_snmp_get($ip, $credentials, "1.3.6.1.4.1.9.2.10.1.0") / 1048576); + $temp = my_snmp_get($ip, $credentials, "1.3.6.1.4.1.9.3.6.6.0"); + $details->memory_count = (!empty($temp)) ? intval($temp / 1024) : 0; + $temp = my_snmp_get($ip, $credentials, "1.3.6.1.4.1.9.2.10.1.0"); + $details->storage_count = (!empty($temp)) ? intval($temp / 1048576) : 0; $details->description = my_snmp_get($ip, $credentials, "1.3.6.1.2.1.1.1.0"); $details->os_version = ''; $details->os_group = '';