diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php
index b4fade177d..a218d59710 100644
--- a/pandora_console/extensions/realtime_graphs.php
+++ b/pandora_console/extensions/realtime_graphs.php
@@ -122,7 +122,7 @@ function pandora_realtime_graphs () {
echo '';
// Define a custom action to save the OID selected in the SNMP browser to the form
- html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false);
+ html_print_input_hidden ('custom_action', urlencode (base64_encode('
')), false);
html_print_input_hidden ('incremental_base', '0');
echo '';
diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php
index 915d1b542a..557b17f388 100644
--- a/pandora_console/godmode/agentes/module_manager_editor_network.php
+++ b/pandora_console/godmode/agentes/module_manager_editor_network.php
@@ -27,7 +27,7 @@ html_print_input_hidden ('ajax_url', ui_get_full_url("ajax.php"), false);
html_print_input_hidden ('search_matches_translation', __("Search matches"), false);
// Define a custom action to save the OID selected in the SNMP browser to the form
-html_print_input_hidden ('custom_action', urlencode (base64_encode('
')), false);
+html_print_input_hidden ('custom_action', urlencode (base64_encode('
')), false);
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index 390d6ec151..f101faee0f 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -383,7 +383,7 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid, $version = '
else {
$snmptranslate_bin = $config['snmptranslate'];
}
- exec ($snmptranslate_bin . " -Td " . escapeshellarg($oid),
+ exec ($snmptranslate_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . " -Td " . escapeshellarg($oid),
$translate_output);
foreach ($translate_output as $line) {
if (preg_match ('/SYNTAX\s+(.*)/', $line, $matches) == 1) {
@@ -399,13 +399,18 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid, $version = '
$oid_data['display_hint'] = $matches[1];
}
}
-
- // Parse the description
- $translate_output = implode ('', $translate_output);
- if (preg_match ('/DESCRIPTION\s+\"(.*)\"/', $translate_output, $matches) == 1) {
- $oid_data['description'] = $matches[1];
+
+ // Parse the description. First search for it in custom values
+ $custom_data = db_get_row('ttrap_custom_values', 'oid', $oid);
+ if ($custom_data === false) {
+ $translate_output = implode ('', $translate_output);
+ if (preg_match ('/DESCRIPTION\s+\"(.*)\"/', $translate_output, $matches) == 1) {
+ $oid_data['description'] = $matches[1];
+ }
+ } else {
+ $oid_data['description'] = $custom_data['description'];
}
-
+
$full_value = explode (':', trim ($full_oid[1]));
if (! isset ($full_value[1])) {
$oid_data['value'] = trim ($full_oid[1]);
@@ -482,26 +487,26 @@ function snmp_browser_print_oid ($oid = array(), $custom_action = '',
$table->data[$i][1] = $oid['status'];
$i++;
}
-
+
$closer = '';
$closer .= html_print_image ("images/blade.png", true, array ("title" => __('Close'), "style" => 'vertical-align: middle;'), false);
$closer .= '';
-
- $table->head[0] = $closer;
- $table->head[1] = __('OID Information');
-
+
// Add a span for custom actions
if ($custom_action != '') {
- $output .= '' . $closer . $custom_action . '';
+ $table->head[0] = '' . $closer . $custom_action . '';
+ } else {
+ $table->head[0] = $closer;
}
-
+
+ $table->head[1] = __('OID Information');
$output .= html_print_table($table, true);
-
+
$url = "index.php?" .
"sec=gmodules&" .
"sec2=godmode/modules/manage_network_components";
- $output .= '