Skip to content

Commit

Permalink
Fix - use correct variable name for testing context_engine_id in SNMP…
Browse files Browse the repository at this point in the history
…v3 command line.
  • Loading branch information
mark-unwin committed Nov 6, 2024
1 parent 70357ac commit 655de38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Helpers/snmp_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function snmp_credentials(string $ip = '', array $credentials = array(), int $di
if (!empty($credential->credentials->context_name)) {
$command .= ' -n ' . escapeshellarg($credential->credentials->context_name);
}
if (!empty($credential->credentials->context_name)) {
if (!empty($credential->credentials->context_engine_id)) {
$command .= ' -E ' . escapeshellarg(implode(unpack("H*", $credential->credentials->context_engine_id)));
}
$command .= ' ' . $ip . ' ' . $oid;
Expand All @@ -113,7 +113,7 @@ function snmp_credentials(string $ip = '', array $credentials = array(), int $di
if (!empty($credential->credentials->context_name)) {
$log->command .= ' -n ' . escapeshellarg($credential->credentials->context_name);
}
if (!empty($credential->credentials->context_name)) {
if (!empty($credential->credentials->context_engine_id)) {
$log->command .= ' -E ' . escapeshellarg(implode(unpack("H*", $credential->credentials->context_engine_id)));
}
$log->command .= ' ' . $ip . ' ' . $oid;
Expand Down Expand Up @@ -164,7 +164,7 @@ function snmp_credentials(string $ip = '', array $credentials = array(), int $di
if (!empty($credential->credentials->context_name)) {
$log->command .= ' -n ' . escapeshellarg($credential->credentials->context_name);
}
if (!empty($credential->credentials->context_name)) {
if (!empty($credential->credentials->context_engine_id)) {
$log->command .= ' -E ' . escapeshellarg(implode(unpack("H*", $credential->credentials->context_engine_id)));
}
$log->command .= ' ' . $ip . ' ' . $oid;
Expand Down

0 comments on commit 655de38

Please sign in to comment.