From c5aa737fa8ed4e05df045be111dd0719bccde866 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 9 Feb 2012 18:12:50 +0000 Subject: [PATCH] 2012-02-09 Juan Manuel Ramon * include/help/en/help_field_match_snmp.php include/help/es/help_field_match_snmp.php godmode/snmpconsole/snmp_alert.php: Changed order of fields in this view. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5541 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++ .../godmode/snmpconsole/snmp_alert.php | 105 +++++++++--------- .../include/help/en/help_field_match_snmp.php | 2 +- .../include/help/es/help_field_match_snmp.php | 2 +- 4 files changed, 63 insertions(+), 53 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a634d458d4..5ce12c15db 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2012-02-09 Juan Manuel Ramon + + * include/help/en/help_field_match_snmp.php + include/help/es/help_field_match_snmp.php + godmode/snmpconsole/snmp_alert.php: Changed order of fields in this + view. + 2012-02-09 Sergio Martin * godmode/groups/group_list.php: Cleaned old code used in diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 37c45fec27..0f5dc8368d 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -188,9 +188,16 @@ if (isset ($_GET["update_alert"])) { /* SNMP alert filters */ - echo ''; + echo '
'; - echo ''; + // Description + echo ''; + + + + //echo ''; // OID echo ''; - //Button - //echo '
' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . '
'.__('Description').''; + html_print_input_text ("description", $description, '', 60); + echo '
' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . '
'.__('OID').''; @@ -222,51 +229,8 @@ if (isset ($_GET["update_alert"])) { html_print_input_text ("single_value", $single_value, '', 20); echo '
'; - - // End table - echo "
"; - - // Alert configuration - - echo ''; - - echo ''; - - // Alert type (e-mail, event etc.) - echo ''; - - // Description - echo ''; - // Custom OID/Data #1 - echo ''; // Custom OID/Data #2 - echo ''; // Custom OID/Data #3 - echo ''; // Custom OID/Data #4 - echo ''; // Custom OID/Data #5 - echo ''; // Custom OID/Data #6 - echo ''; + //Button + //echo '
' . __('Alert configuration') . ui_print_help_icon("snmp_alert_configuration", true) . '
'.__('Alert action').''; - - $fields = array (); - $result = db_get_all_rows_in_table ('talert_actions', "name"); - if ($result === false) { - $result = array (); - } - - foreach ($result as $row) { - $fields[$row["id"]] = $row["name"]; - } - - switch ($config['dbtype']){ - case "mysql": - case "postgresql": - html_print_select_from_sql ('SELECT id, name FROM talert_actions ORDER BY name', - "alert_type", $alert_type, '', '', 0, false, false, false); - break; - case "oracle": - html_print_select_from_sql ('SELECT id, dbms_lob.substr(name,4000,1) as name FROM talert_actions ORDER BY dbms_lob.substr(name,4000,1)', - "alert_type", $alert_type, '', '', 0, false, false, false); - break; - } - echo '
'.__('Description').''; - html_print_input_text ("description", $description, '', 60); - echo '
'.__('Field #1 Match'); + echo '
'.__('Custom OID/Data #1'); echo ui_print_help_icon ("field_match_snmp", true); echo ''; @@ -274,7 +238,7 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Field #2 Match'); + echo '
'.__('Custom OID/Data #2'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -282,7 +246,7 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Field #3 Match'); + echo '
'.__('Custom OID/Data #3'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -290,7 +254,7 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Field #4 Match'); + echo '
'.__('Custom OID/Data #4'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -298,7 +262,7 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Field #5 Match'); + echo '
'.__('Custom OID/Data #5'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; @@ -306,13 +270,25 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Field #6 Match'); + echo '
'.__('Custom OID/Data #6'); //echo ui_print_help_icon ("snmp_alert_custom", true); echo ''; html_print_input_text ("custom_oid_data_6", $custom_oid_data_6, '', 60); echo '
'; + + // End table + //echo "
"; + + // Alert configuration + + //echo ''; + +// echo ''; + // Alert fields echo ''; + + // Alert type (e-mail, event etc.) + echo ''; + echo '
' . __('Alert configuration') . ui_print_help_icon("snmp_alert_configuration", true) . '
'.__('Field #1 (Alias, name)'); echo ui_print_help_icon ("snmp_alert_field1", true); @@ -362,6 +338,33 @@ if (isset ($_GET["update_alert"])) { echo '
'.__('Priority').''; echo html_print_select (get_priorities (), "priority", $priority, '', '', '0', false, false, false); echo '
'.__('Alert action').''; + + $fields = array (); + $result = db_get_all_rows_in_table ('talert_actions', "name"); + if ($result === false) { + $result = array (); + } + + foreach ($result as $row) { + $fields[$row["id"]] = $row["name"]; + } + + switch ($config['dbtype']){ + case "mysql": + case "postgresql": + html_print_select_from_sql ('SELECT id, name FROM talert_actions ORDER BY name', + "alert_type", $alert_type, '', '', 0, false, false, false); + break; + case "oracle": + html_print_select_from_sql ('SELECT id, dbms_lob.substr(name,4000,1) as name FROM talert_actions ORDER BY dbms_lob.substr(name,4000,1)', + "alert_type", $alert_type, '', '', 0, false, false, false); + break; + } + echo '
'; echo ""; diff --git a/pandora_console/include/help/en/help_field_match_snmp.php b/pandora_console/include/help/en/help_field_match_snmp.php index b03a07f565..66a8b60521 100644 --- a/pandora_console/include/help/en/help_field_match_snmp.php +++ b/pandora_console/include/help/en/help_field_match_snmp.php @@ -4,6 +4,6 @@ */ ?> -

Fields match 1-6

+

Custom OID/Data #1-6

There are regular expressions. It is possible to use selectors in order to select a part of the regular expression that will be load in _snmp_fx_ macro. You can use these macros in Field #1 (Alias, name), Field #2 (Single Line) and Field #3 (Full Text).

diff --git a/pandora_console/include/help/es/help_field_match_snmp.php b/pandora_console/include/help/es/help_field_match_snmp.php index 02c2dae108..6989e1d9cf 100644 --- a/pandora_console/include/help/es/help_field_match_snmp.php +++ b/pandora_console/include/help/es/help_field_match_snmp.php @@ -4,6 +4,6 @@ */ ?> -

Fields match 1-6

+

Custom OID/Data #1-6

Son expresiones regulares. Es posible usar selectores para seleccionar parte de la expresión regular que se cargará en la macro _snmp_fx_. Puedes usar estas macros en los campos Field #1 (Alias, name), Field #2 (Single Line) y Field #3 (Full Text).