Skip to content

Commit

Permalink
After calling the manufacturer specific SNMP file, only populate the …
Browse files Browse the repository at this point in the history
…device->attributes if they're not empty.
  • Loading branch information
mark-unwin committed Oct 1, 2024
1 parent a7a3ae8 commit f5a2d1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/Helpers/snmp_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f5a2d1f

Please sign in to comment.