Changes imprecise names and concepts in SNMP. Ticket: #1688

This commit is contained in:
mdtrooper 2015-01-21 14:47:54 +01:00
parent c76f8dd616
commit 2d3f239789
8 changed files with 114 additions and 72 deletions

View File

@ -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');

118
pandora_console/godmode/snmpconsole/snmp_alert.php Normal file → Executable file
View File

@ -515,7 +515,7 @@ if ($create_alert || $update_alert) {
//echo '<tr><td class="datos"><b>' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . '</b></td></tr>';
// OID
echo '<tr id="tr-oid"><td class="datos2">'.__('OID').'</td><td class="datos2">';
echo '<tr id="tr-oid"><td class="datos2">'.__('Enterprise String').'</td><td class="datos2">';
html_print_input_text ("oid", $oid, '', 50, 255);
echo '</td></tr>';
@ -548,18 +548,20 @@ if ($create_alert || $update_alert) {
html_print_input_text ("single_value", $single_value, '', 20);
echo '</td></tr>';
// Custom OID/Data #1
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
echo ui_print_help_icon ("field_match_snmp", true);
echo '</td><td class="datos">';
// Variable bindings/Data #1
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data') .
ui_print_help_icon ("field_match_snmp", true) .
'</td>' .
'<td class="datos">';
echo '#';
html_print_input_text ("order_1", $order_1, '', 4);
html_print_input_text ("custom_oid_data_1", $custom_oid_data_1, '', 60);
echo '</td></tr>';
// Custom OID/Data #2
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #2
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Variable bindings/Data');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
@ -568,8 +570,8 @@ if ($create_alert || $update_alert) {
html_print_input_text ("custom_oid_data_2", $custom_oid_data_2, '', 60);
echo '</td></tr>';
// Custom OID/Data #3
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #3
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Variable bindings/Data');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
@ -578,8 +580,10 @@ if ($create_alert || $update_alert) {
html_print_input_text ("custom_oid_data_3", $custom_oid_data_3, '', 60);
echo '</td></tr>';
// Custom OID/Data #4
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #4
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
@ -588,8 +592,10 @@ if ($create_alert || $update_alert) {
html_print_input_text ("custom_oid_data_4", $custom_oid_data_4, '', 60);
echo '</td></tr>';
// Custom OID/Data #5
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #5
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
@ -598,8 +604,10 @@ if ($create_alert || $update_alert) {
html_print_input_text ("custom_oid_data_5", $custom_oid_data_5, '', 60);
echo '</td></tr>';
// Custom OID/Data #6
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #6
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
//echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
@ -608,112 +616,128 @@ if ($create_alert || $update_alert) {
html_print_input_text ("custom_oid_data_6", $custom_oid_data_6, '', 60);
echo '</td></tr>';
// Custom OID/Data #7
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #7
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_7", $order_7, '', 4);
html_print_input_text ("custom_oid_data_7", $custom_oid_data_7, '', 60);
echo '</td></tr>';
// Custom OID/Data #8
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #8
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_8", $order_8, '', 4);
html_print_input_text ("custom_oid_data_8", $custom_oid_data_8, '', 60);
echo '</td></tr>';
// Custom OID/Data #9
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #9
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_9", $order_9, '', 4);
html_print_input_text ("custom_oid_data_9", $custom_oid_data_9, '', 60);
echo '</td></tr>';
// Custom OID/Data #10
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #10
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_10", $order_10, '', 4);
html_print_input_text ("custom_oid_data_10", $custom_oid_data_10, '', 60);
echo '</td></tr>';
// Custom OID/Data #11
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #11
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_11", $order_11, '', 4);
html_print_input_text ("custom_oid_data_11", $custom_oid_data_11, '', 60);
echo '</td></tr>';
// Custom OID/Data #12
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #12
echo '<tr id="tr-custom_value">' .
'<td class="datos" valign="top">' . __('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_12", $order_12, '', 4);
html_print_input_text ("custom_oid_data_12", $custom_oid_data_12, '', 60);
echo '</td></tr>';
// Custom OID/Data #13
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #13
echo '<tr id="tr-custom_value"><td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_13", $order_13, '', 4);
html_print_input_text ("custom_oid_data_13", $custom_oid_data_13, '', 60);
echo '</td></tr>';
// Custom OID/Data #14
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #14
echo '<tr id="tr-custom_value"><td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_14", $order_14, '', 4);
html_print_input_text ("custom_oid_data_14", $custom_oid_data_14, '', 60);
echo '</td></tr>';
// Custom OID/Data #15
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #15
echo '<tr id="tr-custom_value"><td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_15", $order_15, '', 4);
html_print_input_text ("custom_oid_data_15", $custom_oid_data_15, '', 60);
echo '</td></tr>';
// Custom OID/Data #16
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #16
echo '<tr id="tr-custom_value"><td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_16", $order_16, '', 4);
html_print_input_text ("custom_oid_data_16", $custom_oid_data_16, '', 60);
echo '</td></tr>';
// Custom OID/Data #17
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #17
echo '<tr id="tr-custom_value"><td class="datos" valign="top">' .
__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_17", $order_17, '', 4);
html_print_input_text ("custom_oid_data_17", $custom_oid_data_17, '', 60);
echo '</td></tr>';
// Custom OID/Data #18
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #18
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_18", $order_18, '', 4);
html_print_input_text ("custom_oid_data_18", $custom_oid_data_18, '', 60);
echo '</td></tr>';
// Custom OID/Data #19
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #19
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Variable bindings/Data');
echo '</td><td class="datos">';
echo '#';
html_print_input_text ("order_19", $order_19, '', 4);
html_print_input_text ("custom_oid_data_19", $custom_oid_data_19, '', 60);
echo '</td></tr>';
// Custom OID/Data #20
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
// Variable bindings/Data #20
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Variable bindings/Data');
echo '</td><td class="datos">';
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');

View File

@ -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');

View File

@ -4,7 +4,7 @@
*/
?>
<h1>Custom OID/Data #1-20</h1>
<h1>Variable bindings/Data #1-20</h1>
<p>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_, ...).</p>

View File

@ -6,4 +6,8 @@
<h1>Custom Value/OID</h1>
<p>This search in the trap &#34;Value&#34; fields, and also in the fields &#34;Custom OID&#34; and &#34;Custom Value&#34;, that is, in the rest of the TRAP fields.</p>
<p>
This search in the trap &#34;Value&#34; fields, and also in the fields
&#34;Variable bindings&#34; and &#34;Custom Value&#34;, that is, in
the rest of the TRAP fields.
</p>

View File

@ -4,7 +4,7 @@
*/
?>
<h1>Custom OID/Data #1-20</h1>
<h1>Variable bindings/Data #1-20</h1>
<p>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_, ...).</p>

View File

@ -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();

50
pandora_console/operation/snmpconsole/snmp_view.php Normal file → Executable file
View File

@ -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] = '<strong>'.__('Free search').'</strong>' . 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] = '<strong>'.__('Type').'</strong>' . ui_print_help_tip(__('Search by trap type'), true);
$table->data[4][1] = '<strong>'.__('Trap type').'</strong>' . 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] = '<strong>'.__('Group by OID/IP').'</strong>';
$table->data[3][3] = '<strong>'.__('Group by Enterprise String/IP').'</strong>';
$table->data[3][4] = __('Yes') . '&nbsp;'.
html_print_radio_button ('group_by', 1, '', $group_by, true) .
'&nbsp;&nbsp;';
$table->data[3][4] .= __('No') . '&nbsp;' .
html_print_radio_button ('group_by', 0, '', $group_by, true);
$filter = '<form method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&refr='.((int)get_parameter('refr', 0)).'&pure='.$config["pure"].'&tab='.$tab.'">';
$filter = '<form method="POST" action="index.php?' .
'sec=snmpconsole&' .
'sec2=operation/snmpconsole/snmp_view&' .
'refr=' . ((int)get_parameter('refr', 0)) . '&' .
'pure=' . $config["pure"] . '">';
$filter .= html_print_table($table, true);
$filter .= '<div style="width: ' . $table->width . '; text-align: right;">';
$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 '<div class="nf">'.__('There are no SNMP traps in database').'</div>';
echo '<div class="nf">' .
__('There are no SNMP traps in database') . '</div>';
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] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
}
}
$data[8] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .'</a>';
$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 = '<table style="border:solid 1px #D3D3D3;" width="90%" class="toggle">
<tr>
<td align="left" valign="top" width="15%" ><b>' . __('Custom data:') . '</b></td>
<td align="left" valign="top" width="15%">' .
'<b>' . __('Variable bindings:') . '</b></td>
<td align="left" >';
if ($group_by) {
@ -558,7 +568,8 @@ if ($traps !== false) {
"free_search_string=" . $free_search_string;
$string .= '<a href='.$new_url.'>'.__('See more details').'</a>';
} 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 .= '</td>
</tr>
<tr>
<td align="left" valign="top">' . '<b>' . __('OID:') . '</td>
<td align="left" valign="top">' . '<b>' . __('Enterprise String:') . '</td>
<td align="left"> ' . $trap['oid'] . '</td>
</tr>';
@ -613,7 +624,10 @@ if ($traps !== false) {
$desc_trap_type = __('Other');
break;
}
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Type:') . '</td><td align="left">' . $desc_trap_type . '</td></tr>';
$string .= '<tr><td align="left" valign="top">' .
'<b>' . __('Trap type:') . '</b>' .
'</td>' .
'<td align="left">' . $desc_trap_type . '</td></tr>';
}
if ($group_by) {
@ -650,7 +664,7 @@ if ($traps !== false) {
<td align="left" valign="top">' . '<b>' . __('Last trap:') . '</td>
<td align="left">' . $last_trap . '</td>
</tr>';
}
$string .= '</table>';