From 2d3f239789eaa9abde1ff0a4360eb0ad4fabafe2 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 21 Jan 2015 14:47:54 +0100 Subject: [PATCH] Changes imprecise names and concepts in SNMP. Ticket: #1688 --- ...manage_network_components_form_network.php | 2 +- .../godmode/snmpconsole/snmp_alert.php | 118 +++++++++++------- .../snmpconsole/snmp_trap_generator.php | 2 +- .../include/help/en/help_field_match_snmp.php | 2 +- .../help/en/help_snmp_alert_custom.php | 6 +- .../include/help/es/help_field_match_snmp.php | 2 +- .../operation/snmpconsole/snmp_statistics.php | 4 +- .../operation/snmpconsole/snmp_view.php | 50 +++++--- 8 files changed, 114 insertions(+), 72 deletions(-) mode change 100644 => 100755 pandora_console/godmode/modules/manage_network_components_form_network.php mode change 100644 => 100755 pandora_console/godmode/snmpconsole/snmp_alert.php mode change 100644 => 100755 pandora_console/godmode/snmpconsole/snmp_trap_generator.php mode change 100644 => 100755 pandora_console/include/help/en/help_field_match_snmp.php mode change 100644 => 100755 pandora_console/include/help/en/help_snmp_alert_custom.php mode change 100644 => 100755 pandora_console/include/help/es/help_field_match_snmp.php mode change 100644 => 100755 pandora_console/operation/snmpconsole/snmp_statistics.php mode change 100644 => 100755 pandora_console/operation/snmpconsole/snmp_view.php diff --git a/pandora_console/godmode/modules/manage_network_components_form_network.php b/pandora_console/godmode/modules/manage_network_components_form_network.php old mode 100644 new mode 100755 index 6104fa9462..6539759b46 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -44,7 +44,7 @@ $data[3] = html_print_select ($snmp_versions, 'snmp_version', $snmp_version, push_table_row ($data, 'snmp_port'); $data = array (); -$data[0] = __('SNMP OID'); +$data[0] = __('SNMP Enterprise String'); $data[1] = html_print_input_text ('snmp_oid', $snmp_oid, '', 30, 400, true); //$table->colspan['snmp_2'][1] = 3; $data[2] = __('SNMP community'); diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php old mode 100644 new mode 100755 index a112180f26..a6c8b8724b --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -515,7 +515,7 @@ if ($create_alert || $update_alert) { //echo '' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . ''; // OID - echo ''.__('OID').''; + echo ''.__('Enterprise String').''; html_print_input_text ("oid", $oid, '', 50, 255); echo ''; @@ -548,18 +548,20 @@ if ($create_alert || $update_alert) { html_print_input_text ("single_value", $single_value, '', 20); echo ''; - // Custom OID/Data #1 - echo ''.__('Custom OID/Data'); - echo ui_print_help_icon ("field_match_snmp", true); - - echo ''; + // Variable bindings/Data #1 + echo '' . + '' . + __('Variable bindings/Data') . + ui_print_help_icon ("field_match_snmp", true) . + '' . + ''; echo '#'; html_print_input_text ("order_1", $order_1, '', 4); html_print_input_text ("custom_oid_data_1", $custom_oid_data_1, '', 60); echo ''; - // Custom OID/Data #2 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #2 + echo ''.__('Variable bindings/Data'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -568,8 +570,8 @@ if ($create_alert || $update_alert) { html_print_input_text ("custom_oid_data_2", $custom_oid_data_2, '', 60); echo ''; - // Custom OID/Data #3 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #3 + echo ''.__('Variable bindings/Data'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -578,8 +580,10 @@ if ($create_alert || $update_alert) { html_print_input_text ("custom_oid_data_3", $custom_oid_data_3, '', 60); echo ''; - // Custom OID/Data #4 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #4 + echo '' . + '' . + __('Variable bindings/Data'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -588,8 +592,10 @@ if ($create_alert || $update_alert) { html_print_input_text ("custom_oid_data_4", $custom_oid_data_4, '', 60); echo ''; - // Custom OID/Data #5 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #5 + echo '' . + '' . + __('Variable bindings/Data'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -598,8 +604,10 @@ if ($create_alert || $update_alert) { html_print_input_text ("custom_oid_data_5", $custom_oid_data_5, '', 60); echo ''; - // Custom OID/Data #6 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #6 + echo '' . + '' . + __('Variable bindings/Data'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -608,112 +616,128 @@ if ($create_alert || $update_alert) { html_print_input_text ("custom_oid_data_6", $custom_oid_data_6, '', 60); echo ''; - // Custom OID/Data #7 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #7 + echo '' . + '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_7", $order_7, '', 4); html_print_input_text ("custom_oid_data_7", $custom_oid_data_7, '', 60); echo ''; - // Custom OID/Data #8 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #8 + echo '' . + '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_8", $order_8, '', 4); html_print_input_text ("custom_oid_data_8", $custom_oid_data_8, '', 60); echo ''; - // Custom OID/Data #9 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #9 + echo '' . + '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_9", $order_9, '', 4); html_print_input_text ("custom_oid_data_9", $custom_oid_data_9, '', 60); echo ''; - // Custom OID/Data #10 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #10 + echo '' . + '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_10", $order_10, '', 4); html_print_input_text ("custom_oid_data_10", $custom_oid_data_10, '', 60); echo ''; - // Custom OID/Data #11 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #11 + echo '' . + '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_11", $order_11, '', 4); html_print_input_text ("custom_oid_data_11", $custom_oid_data_11, '', 60); echo ''; - // Custom OID/Data #12 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #12 + echo '' . + '' . __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_12", $order_12, '', 4); html_print_input_text ("custom_oid_data_12", $custom_oid_data_12, '', 60); echo ''; - // Custom OID/Data #13 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #13 + echo '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_13", $order_13, '', 4); html_print_input_text ("custom_oid_data_13", $custom_oid_data_13, '', 60); echo ''; - // Custom OID/Data #14 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #14 + echo '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_14", $order_14, '', 4); html_print_input_text ("custom_oid_data_14", $custom_oid_data_14, '', 60); echo ''; - // Custom OID/Data #15 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #15 + echo '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_15", $order_15, '', 4); html_print_input_text ("custom_oid_data_15", $custom_oid_data_15, '', 60); echo ''; - // Custom OID/Data #16 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #16 + echo '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_16", $order_16, '', 4); html_print_input_text ("custom_oid_data_16", $custom_oid_data_16, '', 60); echo ''; - // Custom OID/Data #17 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #17 + echo '' . + __('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_17", $order_17, '', 4); html_print_input_text ("custom_oid_data_17", $custom_oid_data_17, '', 60); echo ''; - // Custom OID/Data #18 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #18 + echo ''.__('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_18", $order_18, '', 4); html_print_input_text ("custom_oid_data_18", $custom_oid_data_18, '', 60); echo ''; - // Custom OID/Data #19 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #19 + echo ''.__('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_19", $order_19, '', 4); html_print_input_text ("custom_oid_data_19", $custom_oid_data_19, '', 60); echo ''; - // Custom OID/Data #20 - echo ''.__('Custom OID/Data'); + // Variable bindings/Data #20 + echo ''.__('Variable bindings/Data'); echo ''; echo '#'; html_print_input_text ("order_20", $order_20, '', 4); @@ -842,7 +866,7 @@ else { $table_filter->width = "98%"; $table_filter->data = array(); $table_filter->data[0][0] = __('Free search') . ui_print_help_tip( - __('Search by these fields description, OID, Custom Value, SNMP Agent (IP), Single value, each Custom OIDs/Datas.'), true); + __('Search by these fields description, OID, Custom Value, SNMP Agent (IP), Single value, each Variable bindings/Datas.'), true); $table_filter->data[0][1] = html_print_input_text('free_search', $free_search, '', 30, 100, true); $table_filter->data[0][2] = __('Trap type'); @@ -954,10 +978,10 @@ else { $table->size[2] = "90px"; $table->align[2] = 'center'; - $table->head[3] = __('OID'); + $table->head[3] = __('Enterprise String'); $table->align[3] = 'center'; - $table->head[4] = __('Custom Value/OID'); + $table->head[4] = __('Custom Value/Enterprise String'); $table->align[4] = 'center'; $table->head[5] = __('Description'); diff --git a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php old mode 100644 new mode 100755 index 4d36d17a6c..5ccb32c60a --- a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php +++ b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php @@ -68,7 +68,7 @@ $table->data[0][1] = html_print_input_text('snmp_host_address', $snmp_host_addre $table->data[1][0] = __('Community'); $table->data[1][1] = html_print_input_text('snmp_community', $snmp_community, '', 50, 255, true); -$table->data[2][0] = __('OID'); +$table->data[2][0] = __('Enterprise String'); $table->data[2][1] = html_print_input_text('snmp_oid', $snmp_oid, '', 50, 255, true); $table->data[3][0] = __('SNMP Agent'); diff --git a/pandora_console/include/help/en/help_field_match_snmp.php b/pandora_console/include/help/en/help_field_match_snmp.php old mode 100644 new mode 100755 index ab8816cf4a..47ab269c0c --- a/pandora_console/include/help/en/help_field_match_snmp.php +++ b/pandora_console/include/help/en/help_field_match_snmp.php @@ -4,7 +4,7 @@ */ ?> -

Custom OID/Data #1-20

+

Variable bindings/Data #1-20

These are regular expressions that try to match varbinds 1 to 20. If there is a match, the alert is fired. The value of the variable is stored in the corresponding _snmp_fx_ macro (_snmp_f1_, _snmp_f2_, ...). Even though only twenty variables can be searched for matches, _snmp_fx_ macros are set for all of them (_snmp_f11_, _snmp_f12_, ...).

diff --git a/pandora_console/include/help/en/help_snmp_alert_custom.php b/pandora_console/include/help/en/help_snmp_alert_custom.php old mode 100644 new mode 100755 index 1fd667ecf2..8d21fc8941 --- a/pandora_console/include/help/en/help_snmp_alert_custom.php +++ b/pandora_console/include/help/en/help_snmp_alert_custom.php @@ -6,4 +6,8 @@

Custom Value/OID

-

This search in the trap "Value" fields, and also in the fields "Custom OID" and "Custom Value", that is, in the rest of the TRAP fields.

+

+ This search in the trap "Value" fields, and also in the fields + "Variable bindings" and "Custom Value", that is, in + the rest of the TRAP fields. +

diff --git a/pandora_console/include/help/es/help_field_match_snmp.php b/pandora_console/include/help/es/help_field_match_snmp.php old mode 100644 new mode 100755 index dea7a4e4ac..b4332e70ae --- a/pandora_console/include/help/es/help_field_match_snmp.php +++ b/pandora_console/include/help/es/help_field_match_snmp.php @@ -4,7 +4,7 @@ */ ?> -

Custom OID/Data #1-20

+

Variable bindings/Data #1-20

Son expresiones regulares que intentan casar con las variables 1 a 20. Si hay un acierto, se dispara la alerta. El valor de la variable se guarda en la macro _snmp_fx_ correspondiente (_snmp_f1_, _snmp_f2_, ...). Aunque sólo se puede especificar una expresión regular para veinte variables, las macros _snmp_fx_ macros están disponibles para todas ellas (_snmp_f11_, _snmp_f12_, ...).

diff --git a/pandora_console/operation/snmpconsole/snmp_statistics.php b/pandora_console/operation/snmpconsole/snmp_statistics.php old mode 100644 new mode 100755 index d5d6cc8500..26f4078206 --- a/pandora_console/operation/snmpconsole/snmp_statistics.php +++ b/pandora_console/operation/snmpconsole/snmp_statistics.php @@ -162,7 +162,7 @@ unset($table_source); // By OID $table_oid = new StdClass(); $table_oid->width = '100%'; -$table_oid->head[] = __("Traps received by OID") . " - " . sprintf(__('Top %d'), 25); +$table_oid->head[] = __("Traps received by Enterprise String") . " - " . sprintf(__('Top %d'), 25); $table_oid->head_colspan[] = 2; $table_oid->headstyle[] = "background-color: #82b92e"; $table_oid->size = array(); @@ -175,7 +175,7 @@ $table_oid_row = array(); $table_oid_data = new StdClass(); $table_oid_data->width = '100%'; $table_oid_data->head = array(); -$table_oid_data->head['oid'] = __('Trap OID'); +$table_oid_data->head['oid'] = __('Trap Enterprise String'); $table_oid_data->head['num'] = __('Number'); $table_oid_data->data = array(); diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php old mode 100644 new mode 100755 index 16a68aeb0b..425cbe879a --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -49,7 +49,7 @@ foreach ($user_groups as $id=>$name) { $str_user_groups .= $id; } else { - $str_user_groups .= ','.$id; + $str_user_groups .= ',' . $id; } $i++; } @@ -320,18 +320,22 @@ $table->data[2][3] = ''.__('Free search').'' . ui_print_help_ti $table->data[2][4] = html_print_input_text ('free_search_string', $free_search_string, '', 40, 0, true); // Type filter (ColdStart, WarmStart, LinkDown, LinkUp, authenticationFailure, Other) -$table->data[4][1] = ''.__('Type').'' . ui_print_help_tip(__('Search by trap type'), true); +$table->data[4][1] = ''.__('Trap type').'' . ui_print_help_tip(__('Search by trap type'), true); $trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm start (1)'), 2 => __('Link down (2)'), 3 => __('Link up (3)'), 4 => __('Authentication failure (4)'), 5 => __('Other')); $table->data[4][2] = html_print_select ($trap_types, 'trap_type', $trap_type, 'this.form.submit();', '', '', true, false, false); -$table->data[3][3] = ''.__('Group by OID/IP').''; +$table->data[3][3] = ''.__('Group by Enterprise String/IP').''; $table->data[3][4] = __('Yes') . ' '. html_print_radio_button ('group_by', 1, '', $group_by, true) . '  '; $table->data[3][4] .= __('No') . ' ' . html_print_radio_button ('group_by', 0, '', $group_by, true); -$filter = '
'; +$filter = ''; $filter .= html_print_table($table, true); $filter .= '
'; $filter .= html_print_submit_button(__('Update'), 'search', false, 'class="sub upd"', true); @@ -347,7 +351,8 @@ $trapcount = (int) db_get_value_sql($sql_count); // No traps if (empty ($traps)) { - echo '
'.__('There are no SNMP traps in database').'
'; + echo '
' . + __('There are no SNMP traps in database') . '
'; return; } @@ -368,7 +373,9 @@ $url_snmp = "index.php?" . "group_by=" . $group_by . "&" . "free_search_string=" . $free_search_string; -$urlPagination = $url_snmp . "&pagination=" . $pagination . "&offset=" . $offset; +$urlPagination = $url_snmp . "&" . + "pagination=" . $pagination . "&" . + "offset=" . $offset; ui_pagination ($trapcount, $urlPagination, $offset, $pagination); @@ -391,7 +398,7 @@ $table->head[1] = __('SNMP Agent'); $table->align[1] = "center"; $table->size[1] = '15%'; -$table->head[2] = __('OID'); +$table->head[2] = __('Enterprise String'); $table->align[2] = "center"; $table->size[2] = '18%'; @@ -401,7 +408,7 @@ if ($group_by) { $table->size[3] = '5%'; } -$table->head[4] = __('Value'); +$table->head[4] = __('Trap subtype'); $table->align[4] = "center"; $table->size[4] = '10%'; @@ -421,7 +428,9 @@ $table->head[8] = __('Action'); $table->align[8] = "center"; $table->size[8] = '10%'; -$table->head[9] = html_print_checkbox_extended ("allbox", 1, false, false, "javascript:CheckAll();", 'class="chk" title="'.__('All').'"', true); +$table->head[9] = html_print_checkbox_extended ("allbox", 1, false, + false, "javascript:CheckAll();", + 'class="chk" title="'.__('All').'"', true); $table->align[9] = "center"; $table->size[9] = '5%'; @@ -430,7 +439,7 @@ $table->style[8] = "background: #F3F3F3; color: #111 !important;"; // Skip offset records $idx = 0; if ($traps !== false) { - + foreach ($traps as $trap) { $data = array (); if (empty($trap["description"])){ @@ -532,10 +541,10 @@ if ($traps !== false) { $data[8] .= '' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . ' '; } } - + $data[8] .= '' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .''; - $data[8] .= enterprise_hook ('editor_link', array ($trap)); - + $data[8] .= enterprise_hook ('editor_link', array ($trap)); + $data[9] = html_print_checkbox_extended ("snmptrapid[]", $trap["id_trap"], false, false, '', 'class="chk"', true); @@ -544,7 +553,8 @@ if ($traps !== false) { //Hiden file for description $string = ' - + - + '; @@ -613,7 +624,10 @@ if ($traps !== false) { $desc_trap_type = __('Other'); break; } - $string .= ''; + $string .= '' . + ''; } if ($group_by) { @@ -650,7 +664,7 @@ if ($traps !== false) { '; - + } $string .= '
' . __('Custom data:') . '' . + '' . __('Variable bindings:') . ' '; if ($group_by) { @@ -558,7 +568,8 @@ if ($traps !== false) { "free_search_string=" . $free_search_string; $string .= ''.__('See more details').''; - } else { + } + else { // Print binding vars separately $binding_vars = explode ("\t", $trap['oid_custom']); foreach ($binding_vars as $var) { @@ -569,7 +580,7 @@ if ($traps !== false) { $string .= '
' . '' . __('OID:') . '' . '' . __('Enterprise String:') . ' ' . $trap['oid'] . '
' . '' . __('Type:') . '' . $desc_trap_type . '
' . + '' . __('Trap type:') . '' . + '' . $desc_trap_type . '
' . '' . __('Last trap:') . ' ' . $last_trap . '
';