From 49e02ce0291d6ba20b023be0d31377067805d6b7 Mon Sep 17 00:00:00 2001 From: vgilc Date: Wed, 23 Apr 2014 14:54:57 +0000 Subject: [PATCH] 2014-04-23 Vanessa Gil * godmode/agentes/agent_wizard.snmp_explorer.php: Changed 'network_snmp_data' for 'network_snmp_data_inc' for module types: Bytes read and Bytes written. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9803 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 +++++ .../agentes/agent_wizard.snmp_explorer.php | 24 +++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index c4cbb6cb6d..de4e0074c3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2014-04-23 Vanessa Gil + + * godmode/agentes/agent_wizard.snmp_explorer.php: Changed + 'network_snmp_data' for 'network_snmp_data_inc' for module + types: Bytes read and Bytes written. + 2014-04-23 Alejandro Gallardo * godmode/setup/setup_netflow.php: Added a prompt dialog diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php index 89bbc6cda3..5756f7ba55 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php @@ -346,8 +346,12 @@ if ($create_modules) { // Split module data to get type, name, etc $device_exploded = explode($separator, $device); $device_name = $device_exploded[0]; - $device_type = $device_exploded[1]; + $name_exploded = explode('-', $device_name); + $name = ltrim(html_entity_decode($name_exploded[1])); + + $device_type = $device_exploded[1]; + // Delete type from device id unset($device_exploded[0]); unset($device_exploded[1]); @@ -356,8 +360,12 @@ if ($create_modules) { $device_id = implode($separator, $device_exploded); $values['descripcion'] = $devices_prefix_descriptions[$device_type]; - - $values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); + + if (($name == 'Bytes read') || ($name == 'Bytes written')) { + $values['id_tipo_modulo'] = modules_get_type_id('remote_snmp_inc'); + } else { + $values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); + } $values['snmp_oid'] = $devices_prefix_oids[$device_type] . $device_id; @@ -541,7 +549,7 @@ if ($create_modules) { $success_message = ''; $error_message = ''; - + if (count($results[NOERR]) > 0) { $success_message .= sprintf(__('%s modules created succesfully'), count($results[NOERR])) . '
'; } @@ -552,11 +560,13 @@ if ($create_modules) { $error_message .= sprintf(__('%s modules already exist') . ':
  * ' . implode('
  * ', $results[ERR_EXIST]), count($results[ERR_EXIST])) . '
'; } - if (!empty($success_message)) { - ui_print_success_message($success_message); - } if (!empty($error_message)) { ui_print_error_message($error_message); + } else { + if (empty($success_message)) { + $success_message .= sprintf(__('Modules created succesfully')) . '
'; + } + ui_print_success_message($success_message); } } }