diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1ea73a7206..ad84982223 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-06-17 Miguel de Dios + + * include/functions.php: fixed in the function "get_snmpwalk" the + lost global $config var. + + Fixes: #2295 + 2013-06-14 Miguel de Dios * extensions/plugin_registration.php: fixed the url of module diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index b0baa3acf4..57ef3a85fc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1271,10 +1271,12 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_au $snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '', $snmp3_privacy_method = '', $snmp3_privacy_pass = '', $quick_print = 0, $base_oid = "", $snmp_port = '') { + global $config; + // Note: quick_print is ignored // Fix for snmp port - if (!empty($snmp_port)){ + if (!empty($snmp_port)) { $ip_target = $ip_target.':'.$snmp_port; } @@ -1282,8 +1284,8 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_au if ($base_oid != "") { $base_oid = escapeshellarg ($base_oid); } - - if ($config['snmpwalk'] == '') { + + if (empty($config['snmpwalk'])) { switch (PHP_OS) { case "FreeBSD": $snmpwalk_bin = '/usr/local/bin/snmpwalk'; @@ -1312,7 +1314,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_au exec ($snmpwalk_bin . ' -m ALL -v ' . escapeshellarg($snmp_version) . ' -c ' . escapeshellarg($snmp_community) . ' ' . escapeshellarg($ip_target) . ' ' . $base_oid . ' 2>/dev/null', $output, $rc); break; } - + // Parse the output of snmpwalk foreach ($output as $line) { @@ -1322,7 +1324,7 @@ function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_au $snmpwalk[$full_oid[0]] = $full_oid[1]; } } - + return $snmpwalk; }