2012-04-04 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/javascript/pandora_modules.js
	 include/functions.php
	 extensions/snmp_explorer.php
	 godmode/agentes/module_manager_editor.php: Fixed several errors in
	 snmp walk and snmp explorer functionality.
	 
	 Fixes: #3514508



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5896 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-04-04 12:30:11 +00:00
parent 31f3915a6f
commit 99248c0eaf
5 changed files with 31 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2012-04-04 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/javascript/pandora_modules.js
include/functions.php
extensions/snmp_explorer.php
godmode/agentes/module_manager_editor.php: Fixed several errors in
snmp walk and snmp explorer functionality.
Fixes: #3514508
2012-04-04 Dario Rodriguez <dario.rodriguez@artica.es>
* extensions/update_pandora.php: Moved from gsetup

View File

@ -56,7 +56,7 @@ function snmp_explorer() {
$snmpis = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1");
$snmp3_privacy_method, $snmp3_privacy_pass, 0, ".1.3.6.1.2.1", $tcp_port);
if($snmpis === false) {
$snmpis = array();

View File

@ -82,8 +82,16 @@ if (is_ajax ()) {
}
if ($snmp_walk) {
$ip_target = (string) get_parameter ('ip_target');
$snmp_community = (string) get_parameter ('snmp_community');
$test_ip_type = get_parameter ('ip_target');
if (is_array($test_ip_type))
$ip_target = (string)array_shift($test_ip_type);
else
$ip_target = (string) get_parameter ('ip_target');
$test_snmp_community = get_parameter ('snmp_community');
if (is_array($test_snmp_community))
$snmp_community = (string)array_shift($test_snmp_community);
else
$snmp_community = (string) get_parameter ('snmp_community');
$snmp_version = get_parameter('snmp_version');
$snmp3_auth_user = get_parameter('snmp3_auth_user');
$snmp3_security_level = get_parameter('snmp3_security_level');
@ -91,10 +99,11 @@ if (is_ajax ()) {
$snmp3_auth_pass = get_parameter('snmp3_auth_pass');
$snmp3_privacy_method = get_parameter('snmp3_privacy_method');
$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass');
$snmp_port = get_parameter('snmp_port');
$snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community, $snmp3_auth_user,
$snmp3_security_level, $snmp3_auth_method, $snmp3_auth_pass,
$snmp3_privacy_method, $snmp3_privacy_pass, 1);
$snmp3_privacy_method, $snmp3_privacy_pass, 1, "", $snmp_port);
if ($snmpwalk === false) {
echo json_encode ($snmpwalk);

View File

@ -1150,10 +1150,15 @@ function array_key_to_offset($array, $key) {
*/
function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_auth_user = '',
$snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '',
$snmp3_privacy_method = '', $snmp3_privacy_pass = '', $quick_print = 0, $base_oid = "") {
$snmp3_privacy_method = '', $snmp3_privacy_pass = '', $quick_print = 0, $base_oid = "", $snmp_port = '') {
snmp_set_quick_print ($quick_print);
// Fix for snmp port
if (!empty($snmp_port)){
$ip_target = $ip_target.':'.$snmp_port;
}
switch ($snmp_version) {
case '3':
$snmpwalk = @snmp3_real_walk ($ip_target, $snmp3_auth_user,

View File

@ -260,6 +260,7 @@ function configure_modules_form () {
"snmp_walk" : 1,
"ip_target" : $("#text-ip_target").fieldValue (),
"snmp_community" : $("#text-snmp_community").fieldValue (),
"snmp_port" : $("#text-tcp_port").val(),
"snmp_version": $('#snmp_version').val(),
"snmp3_auth_user": $('input[name=snmp3_auth_user]').val(),
"snmp3_security_level": $('#snmp3_security_level').val(),