From f5a2d1f1770a1985e181ef54fda9f0d9162f7a5e Mon Sep 17 00:00:00 2001 From: Mark Unwin Date: Thu, 26 Sep 2024 14:51:25 +1000 Subject: [PATCH] After calling the manufacturer specific SNMP file, only populate the device->attributes if they're not empty. --- app/Helpers/snmp_helper.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Helpers/snmp_helper.php b/app/Helpers/snmp_helper.php index 078b8403f..a7a040049 100644 --- a/app/Helpers/snmp_helper.php +++ b/app/Helpers/snmp_helper.php @@ -723,10 +723,12 @@ function snmp_audit(string $ip = '', object $credentials = null, int $discovery_ $log->command_time_to_execute = (microtime(true) - $item_start); if (!empty($new_details)) { foreach ($new_details as $key => $value) { - $details->$key = $value; - $log->command = $key; - $log->command_output = $value; - $discoveryLogModel->create($log); + if (!empty($value)) { + $details->$key = $value; + $log->command = $key; + $log->command_output = $value; + $discoveryLogModel->create($log); + } } } unset($log->id, $log->command, $log->command_output, $log->command_time_to_execute);