Fixed problems with snmpwalks, when server have mibs text in hexadeximal-string. Tiquet: #2288

This commit is contained in:
m-lopez-f 2015-06-01 15:23:08 +02:00
parent 58115b8296
commit 127daf8fdc
1 changed files with 4 additions and 4 deletions

View File

@ -1501,7 +1501,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
switch ($snmp3_security_level) { switch ($snmp3_security_level) {
case "authNoPriv": case "authNoPriv":
$command_str = $snmpwalk_bin . $command_str = $snmpwalk_bin .
' -m ALL -v 3' . ' -m ALL -Oa -v 3' .
' -u ' . escapeshellarg($snmp3_auth_user) . ' -u ' . escapeshellarg($snmp3_auth_user) .
' -A ' . escapeshellarg($snmp3_auth_pass) . ' -A ' . escapeshellarg($snmp3_auth_pass) .
' -l ' . escapeshellarg($snmp3_security_level) . ' -l ' . escapeshellarg($snmp3_security_level) .
@ -1512,7 +1512,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
break; break;
case "noAuthNoPriv": case "noAuthNoPriv":
$command_str = $snmpwalk_bin . $command_str = $snmpwalk_bin .
' -m ALL -v 3' . ' -m ALL -Oa -v 3' .
' -u ' . escapeshellarg($snmp3_auth_user) . ' -u ' . escapeshellarg($snmp3_auth_user) .
' -l ' . escapeshellarg($snmp3_security_level) . ' -l ' . escapeshellarg($snmp3_security_level) .
' ' . escapeshellarg($ip_target) . ' ' . escapeshellarg($ip_target) .
@ -1521,7 +1521,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
break; break;
default: default:
$command_str = $snmpwalk_bin . $command_str = $snmpwalk_bin .
' -m ALL -v 3' . ' -m ALL -Oa -v 3' .
' -u ' . escapeshellarg($snmp3_auth_user) . ' -u ' . escapeshellarg($snmp3_auth_user) .
' -A ' . escapeshellarg($snmp3_auth_pass) . ' -A ' . escapeshellarg($snmp3_auth_pass) .
' -l ' . escapeshellarg($snmp3_security_level) . ' -l ' . escapeshellarg($snmp3_security_level) .
@ -1538,7 +1538,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '',
case '2c': case '2c':
case '1': case '1':
default: default:
$command_str = $snmpwalk_bin . ' -m ALL -v ' . escapeshellarg($snmp_version) . ' -c ' . escapeshellarg($snmp_community) . ' ' . escapeshellarg($ip_target) . ' ' . $base_oid . ' 2> ' . $error_redir_dir; $command_str = $snmpwalk_bin . ' -m ALL -Oa -v ' . escapeshellarg($snmp_version) . ' -c ' . escapeshellarg($snmp_community) . ' ' . escapeshellarg($ip_target) . ' ' . $base_oid . ' 2> ' . $error_redir_dir;
break; break;
} }