diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bcecae6fd2..1a7f533f30 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,24 @@ +2013-03-05 Sergio Martin + + * include/functions_reporting.php: Fix little + bug of agents statistics + + * include/help/en/help_field_match_snmp.php + include/help/en/help_snmp_alert_field1.php + include/help/es/help_field_match_snmp.php + include/help/es/help_snmp_alert_field1.php + pandoradb.sql + pandoradb.postgreSQL.sql + pandoradb.oracle.sql + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql + extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql + godmode/alerts/configure_alert_action.php + godmode/alerts/alert_commands.php + godmode/snmpconsole/snmp_alert.php: Adapt snmp alert + editor to new alerts macro system. Now there are 10 fields + and are dinamically charged from javascript. Bug 3605775 + 2013-03-05 Miguel de Dios * operation/gis_maps/render_view.php, diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index 552fe0414a..8d1cec042c 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -438,11 +438,26 @@ ALTER TABLE `tusuario_perfil` ADD COLUMN `tags` TEXT NOT NULL; -- --------------------------------------------------------------------- ALTER TABLE `ttag` ADD COLUMN `email` text NULL; +-- --------------------------------------------------------------------- +-- Add more fields in snmp alerts (05/03/13) +-- --------------------------------------------------------------------- +ALTER TABLE `talert_snmp` ADD COLUMN `al_field4` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field5` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field6` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field7` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field8` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field9` text NOT NULL; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field10` text NOT NULL; + +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- +-- DATA +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- -- --------------------------------------------------------------------- -- Adding new network_component --- ---------------------------------------------------------------------- - +-- --------------------------------------------------------------------- INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`) VALUES ('Free RAM','Available RAM memory in bytes',16,1,0,0,300,0,'','','','SELECT AvailableBytes from Win32_PerfRawData_PerfOS_Memory',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic'); INSERT INTO `tnetwork_component` (`name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `wizard_level`) VALUES ('Hostname','The hostname of the machine.',16,3,0,0,300,0,'','','','ServerName FROM Win32_WindowsProductActivation',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic'); diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index 96a2bd0239..5038bcad6b 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -468,6 +468,23 @@ ALTER TABLE tusuario_perfil ADD (tags CLOB NOT NULL default ''); -- --------------------------------------------------------------------- ALTER TABLE ttag ADD (email CLOB NULL); +-- --------------------------------------------------------------------- +-- Add more fields in snmp alerts (05/03/13) +-- --------------------------------------------------------------------- +ALTER TABLE talert_snmp ADD COLUMN (al_field5 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field5 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field6 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field7 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field8 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field9 CLOB NOT NULL default ''); +ALTER TABLE talert_snmp ADD COLUMN (al_field10 CLOB NOT NULL default ''); + +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- +-- DATA +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- + -- --------------------------------------------------------------------- -- Adding new network_component -- --------------------------------------------------------------------- diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 0757c955cc..279b429a16 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -163,17 +163,17 @@ ALTER TABLE "tgrupo" ADD COLUMN "contact" text; ALTER TABLE "tgrupo" ADD COLUMN "other" text; -- ----------------------------------------------------- --- Table "talert_snmp" +-- Table ""talert_snmp"" -- ----------------------------------------------------- -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f1_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f2_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f3_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f4_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f5_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f6_" text DEFAULT ''; -ALTER TABLE "talert_snmp" ADD COLUMN "trap_type" INTEGER NOT NULL DEFAULT '-1'; -ALTER TABLE "talert_snmp" ADD COLUMN "single_value" varchar(255) DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f1_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f2_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f3_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f4_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f5_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "_snmp_f6_" text DEFAULT ''; +ALTER TABLE ""talert_snmp"" ADD COLUMN "trap_type" INTEGER NOT NULL DEFAULT '-1'; +ALTER TABLE ""talert_snmp"" ADD COLUMN "single_value" varchar(255) DEFAULT ''; -- ----------------------------------------------------- -- Table "tagente_modulo" @@ -459,10 +459,26 @@ ALTER TABLE "tusuario_perfil" ADD COLUMN "tags" text default ''; -- --------------------------------------------------------------------- ALTER TABLE "ttag" ADD COLUMN "email" TEXT NULL; +-- --------------------------------------------------------------------- +-- Add more fields in snmp alerts (05/03/13) +-- --------------------------------------------------------------------- +ALTER TABLE "talert_snmp" ADD COLUMN "al_field4" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field5" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field6" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field7" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field8" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field9" TEXT NULL; +ALTER TABLE "talert_snmp" ADD COLUMN "al_field10" TEXT NULL; + +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- +-- DATA +-- --------------------------------------------------------------------- +-- --------------------------------------------------------------------- + -- --------------------------------------------------------------------- -- Adding new network_component -- ---------------------------------------------------------------------- - INSERT INTO "tnetwork_component" ("name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level") VALUES ('Free RAM','Available RAM memory in bytes',16,1,0,0,300,0,'','','','SELECT AvailableBytes from Win32_PerfRawData_PerfOS_Memory',4,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic'); INSERT INTO "tnetwork_component" ("name", "description", "id_group", "type", "max", "min", "module_interval", "tcp_port", "tcp_send", "tcp_rcv", "snmp_community", "snmp_oid", "id_module_group", "id_modulo", "id_plugin", "plugin_user", "plugin_pass", "plugin_parameter", "max_timeout", "history_data", "min_warning", "max_warning", "str_warning", "min_critical", "max_critical", "str_critical", "min_ff_event", "custom_string_1", "custom_string_2", "custom_string_3", "custom_integer_1", "custom_integer_2", "post_process", "wizard_level") VALUES ('Hostname','The hostname of the machine.',16,3,0,0,300,0,'','','','ServerName FROM Win32_WindowsProductActivation',1,6,0,'','','10',0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,NULL,NULL,NULL,0,0,0.0000000000000,'basic'); diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index c31bc20393..6b631d806c 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -39,7 +39,14 @@ $pure = get_parameter('pure', 0); if (is_ajax ()) { $get_alert_command = (bool) get_parameter ('get_alert_command'); if ($get_alert_command) { - $id = (int) get_parameter ('id'); + $id = (int) get_parameter ('id', 0); + + // If command ID is not provided, check for action id + if($id == 0) { + $id_action = (int) get_parameter ('id_action'); + $id = alerts_get_alert_action_alert_command_id($id_action); + } + $command = alerts_get_alert_command ($id); // If is setted a description, we change the carriage return by
tags diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index e4d6b1cd3b..12a3199033 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -192,7 +192,7 @@ $(document).ready (function () { value: "1"}); values.push ({name: "id", value: this.value}); - jQuery.get ( + "ajax.php", + jQuery.get (, values, function (data, status) { original_command = js_html_entity_decode (data["command"]); @@ -227,7 +227,7 @@ $(document).ready (function () { ); }); - // Charge the fields of the + // Charge the fields of the command $("#id_command").trigger('change'); }); diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index fd9006c1ed..341489ef7d 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -45,9 +45,16 @@ else if (isset ($_GET["submit"])) { $custom_value = (string) get_parameter_post ("custom_value"); $time_threshold = (int) get_parameter_post ("time_threshold", SECONDS_5MINUTES); $time_other = (int) get_parameter_post ("time_other", -1); - $al_field1 = (string) get_parameter_post ("al_field1"); - $al_field2 = (string) get_parameter_post ("al_field2"); - $al_field3 = (string) get_parameter_post ("al_field3"); + $al_field1 = (string) get_parameter_post ("field1_value"); + $al_field2 = (string) get_parameter_post ("field2_value"); + $al_field3 = (string) get_parameter_post ("field3_value"); + $al_field4 = (string) get_parameter_post ("field4_value"); + $al_field5 = (string) get_parameter_post ("field5_value"); + $al_field6 = (string) get_parameter_post ("field6_value"); + $al_field7 = (string) get_parameter_post ("field7_value"); + $al_field8 = (string) get_parameter_post ("field8_value"); + $al_field9 = (string) get_parameter_post ("field9_value"); + $al_field10 = (string) get_parameter_post ("al_field10"); $max_alerts = (int) get_parameter_post ("max_alerts", 1); $min_alerts = (int) get_parameter_post ("min_alerts", 0); $priority = (int) get_parameter_post ("priority", 0); @@ -70,6 +77,13 @@ else if (isset ($_GET["submit"])) { 'al_field1' => $al_field1, 'al_field2' => $al_field2, 'al_field3' => $al_field3, + 'al_field4' => $al_field4, + 'al_field5' => $al_field5, + 'al_field6' => $al_field6, + 'al_field7' => $al_field7, + 'al_field8' => $al_field8, + 'al_field9' => $al_field9, + 'al_field10' => $al_field10, 'description' => $description, 'agent' => $source_ip, 'custom_oid' => $custom_value, @@ -102,7 +116,10 @@ else if (isset ($_GET["submit"])) { else { $sql = sprintf ("UPDATE talert_snmp SET priority = %d, id_alert = %d, al_field1 = '%s', - al_field2 = '%s', al_field3 = '%s', description = '%s', + al_field2 = '%s', al_field3 = '%s', al_field4 = '%s', + al_field5 = '%s', al_field6 = '%s',al_field7 = '%s', + al_field8 = '%s', al_field9 = '%s',al_field10 = '%s', + description = '%s', agent = '%s', custom_oid = '%s', oid = '%s', time_threshold = %d, max_alerts = %d, min_alerts = %d, _snmp_f1_ = '%s', _snmp_f2_ = '%s', _snmp_f3_ = '%s', @@ -110,6 +127,8 @@ else if (isset ($_GET["submit"])) { trap_type = %d, single_value = '%s' WHERE id_as = %d", $priority, $alert_type, $al_field1, $al_field2, $al_field3, + $al_field4, $al_field5, $al_field6, $al_field7, $al_field8, + $al_field9, $al_field10, $description, $source_ip, $custom_value, $oid, $time_threshold, $max_alerts, $min_alerts, $custom_oid_data_1, $custom_oid_data_2, $custom_oid_data_3, $custom_oid_data_4, $custom_oid_data_5, @@ -146,6 +165,13 @@ if ((isset ($_GET["update_alert"])) && ($_GET["update_alert"] != -1)) { $al_field1 = $alert["al_field1"]; $al_field2 = $alert["al_field2"]; $al_field3 = $alert["al_field3"]; + $al_field4 = $alert["al_field4"]; + $al_field5 = $alert["al_field5"]; + $al_field6 = $alert["al_field6"]; + $al_field7 = $alert["al_field7"]; + $al_field8 = $alert["al_field8"]; + $al_field9 = $alert["al_field9"]; + $al_field10 = $alert["al_field10"]; $max_alerts = $alert["max_alerts"]; $min_alerts = $alert["min_alerts"]; $priority = $alert["priority"]; @@ -170,6 +196,13 @@ elseif (isset ($_GET["update_alert"])) { $al_field1 = ""; $al_field2 = ""; $al_field3 = ""; + $al_field4 = ""; + $al_field5 = ""; + $al_field6 = ""; + $al_field7 = ""; + $al_field8 = ""; + $al_field9 = ""; + $al_field10 = ""; $max_alerts = 1; $min_alerts = 0; $priority = 0; @@ -208,15 +241,13 @@ if (isset ($_GET["update_alert"])) { /* SNMP alert filters */ - echo ''; + echo '
'; // Description echo ''; - - //echo ''; // OID @@ -310,19 +341,21 @@ if (isset ($_GET["update_alert"])) { //echo ''; // Alert fields - echo ''; - echo ''; + $al = array('al_field1' => $al_field1, 'al_field2' => $al_field2, 'al_field3' => $al_field3, + 'al_field4' => $al_field4, 'al_field5' => $al_field5, 'al_field6' => $al_field6, + 'al_field7' => $al_field7, 'al_field8' => $al_field8, 'al_field9' => $al_field9, + 'al_field10' => $al_field10); - echo ''; + // Hidden div with help hint to fill with javascript + html_print_div(array('id' => 'help_snmp_alert_hint', 'content' => ui_print_help_icon ("snmp_alert_field1", true), 'hidden' => true)); + + for ($i=1; $i<=10; $i++) { + echo ''; + } // Max / Min alerts echo '
'.__('Description').''; html_print_input_text ("description", $description, '', 60); echo '
' . __('Alert filters') . ui_print_help_icon("snmp_alert_filters", true) . '
' . __('Alert configuration') . ui_print_help_icon("snmp_alert_configuration", true) . '
'.__('Field #1 (Alias, name)'); - echo ui_print_help_icon ("snmp_alert_field1", true); - echo ''; - html_print_input_text ("al_field1", $al_field1, '', 60); - echo '
'.__('Field #2 (Single Line)').''; - html_print_input_text ("al_field2", $al_field2, '', 60); - echo '
'.__('Field #3 (Full Text)').''; - html_print_textarea ("al_field3", $al_field3, 4, $al_field3, 'style="width:400px"'); - echo '
'.html_print_image('images/spinner.gif',true); + echo ''.html_print_image('images/spinner.gif',true); + html_print_input_hidden('field'.$i.'_value', isset($al['al_field'.$i]) ? $al['al_field'.$i] : ''); + echo '
'.__('Min. number of alerts').''; @@ -397,6 +430,7 @@ if (isset ($_GET["update_alert"])) { } echo '
'; echo ""; + echo ""; } else { require_once ('include/functions_alerts.php'); @@ -504,5 +538,53 @@ function time_changed () { $(document).ready (function () { $('#time_threshold').change (time_changed); + + $("#alert_type").change (function () { + values = Array (); + values.push ({name: "page", + value: "godmode/alerts/alert_commands"}); + values.push ({name: "get_alert_command", + value: "1"}); + values.push ({name: "id_action", + value: this.value}); + jQuery.get (, + values, + function (data, status) { + original_command = js_html_entity_decode (data["command"]); + command_description = js_html_entity_decode (data["description"]); + for (i=1; i<=10; i++) { + var old_value = ''; + // Only keep the value if is provided from hidden (first time) + if ($("[name=field"+i+"_value]").attr('id') == "hidden-field" + i + "_value") { + old_value = $("[name=field"+i+"_value]").val(); + } + + // If the row is empty, hide de row + if(data["fields_rows"][i] == '') { + $('#table1-field'+i).hide(); + } + else { + $('#table1-field'+i).replaceWith(data["fields_rows"][i]); + + // The row provided has a predefined class. We delete it + $('#table1-field'+i).removeAttr('class'); + + // Add help hint only in first field + if(i == 1) { + var td_content = $('#table1-field'+i).find('td').eq(0); + td_content.html(td_content.html() + $('#help_snmp_alert_hint').html()); + } + + $("[name=field"+i+"_value]").val(old_value); + $('#table1-field').show(); + } + } + }, + "json" + ); + }); + + // Charge the fields of the action + $("#alert_type").trigger('change'); }); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 74edb8b762..9747d74cb0 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6648,7 +6648,8 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') { $stats = array(); if(isset($counts_info['total_count'])) { - $total_count = $counts_info['total_count']; + $not_init = isset($counts_info['notinit_count']) ? $counts_info['notinit_count'] : 0; + $total_count = $counts_info['total_count'] - $not_init; $stats[] = array('name' => 'total_count', 'count' => $total_count, 'title' => sprintf($template_title['total_count'], $total_count)); } @@ -6697,7 +6698,7 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') { $out .= ' : ' . $fired_count . ''; if (isset($critical_count) && $critical_count > 0) $out .= ' : ' . $critical_count . ''; - if (isset($warning_counts) && $warning_count > 0) + if (isset($warning_count) && $warning_count > 0) $out .= ' : ' . $warning_count . ''; if (isset($unknown_count) && $unknown_count > 0) $out .= ' : ' . $unknown_count . ''; 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 66a8b60521..8e55fc0d20 100644 --- a/pandora_console/include/help/en/help_field_match_snmp.php +++ b/pandora_console/include/help/en/help_field_match_snmp.php @@ -6,4 +6,4 @@

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).

+

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 FieldsX (1-10).

diff --git a/pandora_console/include/help/en/help_snmp_alert_field1.php b/pandora_console/include/help/en/help_snmp_alert_field1.php index 991b711ded..13bb138487 100644 --- a/pandora_console/include/help/en/help_snmp_alert_field1.php +++ b/pandora_console/include/help/en/help_snmp_alert_field1.php @@ -6,11 +6,11 @@

SNMP Trap - Alert field macros

-Once we've got the data fields, we must use them in the alert. With this purpose, the special macros _snmp_f1_, _snmp_f2_ and _snmp_f3_ are used. Using these macros doesn't have any sense out of SNMP trap alerts. - +Once we've got the data fields, we must use them in the alert. With this purpose, the special macros _snmp_fX_ are used. Using these macros doesn't have any sense out of SNMP trap alerts. +

To build the message, we would use the following string in Field1. - -Chassis Alert: _snmp_f2_ in device _snmp_f1_ - -You can use these macros in field1, field2 and field3 +

+ Chassis Alert: _snmp_f2_ in device _snmp_f1_ +

+You can use these macros in FieldX (1-10) of any alert

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 6989e1d9cf..fce52567a7 100644 --- a/pandora_console/include/help/es/help_field_match_snmp.php +++ b/pandora_console/include/help/es/help_field_match_snmp.php @@ -6,4 +6,4 @@

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).

+

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 FieldX (1-10).

diff --git a/pandora_console/include/help/es/help_snmp_alert_field1.php b/pandora_console/include/help/es/help_snmp_alert_field1.php index 370691b23a..0a649c12ae 100644 --- a/pandora_console/include/help/es/help_snmp_alert_field1.php +++ b/pandora_console/include/help/es/help_snmp_alert_field1.php @@ -6,11 +6,11 @@

SNMP Trap - Macros de datos para las alertas

-Una vez que ha parseado los campos de datos mediante regexp, puede usar esos campos de datos, para sustituir sus valores en las alertas. Para ello, se pueden usar las macros especiales _snmp_f1_, _snmp_f2_ y _snmp_f3_. Estas macros no tienen valor o sentido fuera del contexto de las alertas de traps SNMP. - +Una vez que ha parseado los campos de datos mediante regexp, puede usar esos campos de datos, para sustituir sus valores en las alertas. Para ello, se pueden usar las macros especiales _snmp_fX_. Estas macros no tienen valor o sentido fuera del contexto de las alertas de traps SNMP. +

Para contruir un mensaje, podrĂ­amos usar la siguiente cadena en el "campo1": - - Alerta de Chasis: _snmp_f2_ en dispositivo _snmp_f1_ - -Puede usar esas macros en el campo1, campo2 y campo3 de cualquier alerta. +

+ Alerta de Chasis: _snmp_f2_ en dispositivo _snmp_f1_ +

+Puede usar esas macros en los campos FieldX (1-10) de cualquier alerta.

diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index ecbfb330e3..884e4cc9a5 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -271,6 +271,13 @@ CREATE TABLE talert_snmp ( al_field1 CLOB default '', al_field2 CLOB default '', al_field3 CLOB default '', + al_field4 CLOB default '', + al_field5 CLOB default '', + al_field6 CLOB default '', + al_field7 CLOB default '', + al_field8 CLOB default '', + al_field9 CLOB default '', + al_field10 CLOB default '', description VARCHAR2(255) default '', alert_type NUMBER(5, 0) default 0 NOT NULL, agent VARCHAR2(100) default '', diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 510173229d..002eaa659c 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -255,6 +255,13 @@ CREATE TABLE "talert_snmp" ( "al_field1" text NOT NULL default '', "al_field2" text NOT NULL default '', "al_field3" text NOT NULL default '', + "al_field4" text NOT NULL default '', + "al_field5" text NOT NULL default '', + "al_field6" text NOT NULL default '', + "al_field7" text NOT NULL default '', + "al_field8" text NOT NULL default '', + "al_field9" text NOT NULL default '', + "al_field10" text NOT NULL default '', "description" varchar(255) default '', "alert_type" SMALLINT NOT NULL default 0, "agent" varchar(100) default '', diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 978582100b..7d1e62a6c3 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -262,6 +262,13 @@ CREATE TABLE IF NOT EXISTS `talert_snmp` ( `al_field1` text NOT NULL, `al_field2` text NOT NULL, `al_field3` text NOT NULL, + `al_field4` text NOT NULL, + `al_field5` text NOT NULL, + `al_field6` text NOT NULL, + `al_field7` text NOT NULL, + `al_field8` text NOT NULL, + `al_field9` text NOT NULL, + `al_field10` text NOT NULL, `description` varchar(255) default '', `alert_type` int(2) unsigned NOT NULL default '0', `agent` varchar(100) default '',