diff --git a/pandora_console/extras/mr/37.sql b/pandora_console/extras/mr/37.sql new file mode 100644 index 0000000000..9f240d889d --- /dev/null +++ b/pandora_console/extras/mr/37.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; +ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; +ALTER TABLE `talert_snmp` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d9fe58ee64..9236f7a5d8 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -666,6 +666,7 @@ CREATE TABLE IF NOT EXISTS `tevent_alert` ( ALTER TABLE `tevent_alert` ADD COLUMN `special_days` tinyint(1) default 0; ALTER TABLE `tevent_alert` MODIFY COLUMN `time_threshold` int(10) NOT NULL default 86400; +ALTER TABLE `tevent_alert` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; -- ----------------------------------------------------- -- Table `tevent_alert_action` @@ -1239,6 +1240,7 @@ ALTER TABLE talert_templates ADD COLUMN `field12_recovery` TEXT NOT NULL DEFAULT ALTER TABLE talert_templates ADD COLUMN `field13_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field14_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; -- --------------------------------------------------------------------- -- Table `talert_snmp` @@ -1248,6 +1250,7 @@ ALTER TABLE talert_snmp ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL, MODIFY COLUMN `al_field12` text NOT NULL, MODIFY COLUMN `al_field13` text NOT NULL, diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index d79ca90ca8..b801e4ddb9 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -290,6 +290,7 @@ function update_template($step) $max_alerts = (int) get_parameter('max_alerts'); $min_alerts = (int) get_parameter('min_alerts'); $min_alerts_reset_counter = (int) get_parameter('min_alerts_reset_counter'); + $disable_event = (int) get_parameter('disable_event'); $type = (string) get_parameter('type'); $value = (string) html_entity_decode(get_parameter('value')); $max = (float) get_parameter('max'); @@ -320,6 +321,7 @@ function update_template($step) 'max_value' => $max, 'min_value' => $min, 'matches_value' => $matches, + 'disable_event' => $disable_event, ]; // Different datetimes format for oracle @@ -532,6 +534,7 @@ if ($id && ! $create_template) { $max_alerts = $template['max_alerts']; $min_alerts = $template['min_alerts']; $min_alerts_reset_counter = $template['min_alerts_reset_counter']; + $disable_event = $template['disable_event']; $threshold = $template['time_threshold']; $fields = []; for ($i = 1; $i <= $config['max_macro_fields']; $i++) { @@ -578,8 +581,7 @@ if ($step == 2) { // Firing conditions and events $table->colspan = []; - $table->colspan[4][1] = 3; - + // $table->colspan[4][1] = 1; $table->data[0][0] = __('Days of week'); $table->data[0][1] = __('Mon'); $table->data[0][1] .= html_print_checkbox('monday', 1, $monday, true); @@ -653,6 +655,9 @@ if ($step == 2) { true ); + $table->data[4][2] = __('Disable event'); + $table->data[4][3] = html_print_checkbox('disable_event', 1, $disable_event, true); + $table->data[5][0] = __('Default action'); $usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true))); switch ($config['dbtype']) { diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index 403a871622..e32644b9a8 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -283,7 +283,6 @@ html_print_input_hidden('new', 1); html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); echo ''; echo ''; -hd('entra o que ase'); enterprise_hook('close_meta_frame'); ?> diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 66651d6522..7d0fc75876 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -170,6 +170,7 @@ if ($save_alert || $modify_alert) { $trap_type = (int) get_parameter('trap_type', -1); $single_value = (string) get_parameter('single_value'); $position = (int) get_parameter('position'); + $disable_event = (int) get_parameter('disable_event'); $group = (int) get_parameter('group'); if ($time_threshold == -1) { @@ -245,6 +246,7 @@ if ($save_alert || $modify_alert) { 'trap_type' => $trap_type, 'single_value' => $single_value, 'position' => $position, + 'disable_event' => $disable_event, 'id_group' => $group, ]; @@ -296,8 +298,8 @@ if ($save_alert || $modify_alert) { order_11 = '%d', order_12 = '%d', order_13 = '%d', order_14 = '%d', order_15 = '%d', order_16 = '%d', order_17 = '%d', order_18 = '%d', order_19 = '%d', - order_20 = '%d', trap_type = %d, - single_value = '%s', position = '%s', id_group ='%s' + order_20 = '%d', trap_type = %d, single_value = '%s', + position = '%s', disable_event = %d, id_group ='%s' WHERE id_as = %d", $priority, $alert_type, @@ -366,6 +368,7 @@ if ($save_alert || $modify_alert) { $trap_type, $single_value, $position, + $disable_event, $group, $id_as ); @@ -460,6 +463,7 @@ if ($update_alert || $duplicate_alert) { $trap_type = $alert['trap_type']; $single_value = $alert['single_value']; $position = $alert['position']; + $disable_event = $alert['disable_event']; $group = $alert['id_group']; } else if ($create_alert) { // Variable init @@ -532,6 +536,7 @@ if ($update_alert || $duplicate_alert) { $trap_type = -1; $single_value = ''; $position = 0; + $disable_event = 0; $group = 0; } @@ -566,7 +571,7 @@ if ($duplicate_alert) { '.db_escape_key_identifier('_snmp_f18_').', '.db_escape_key_identifier('_snmp_f19_').', '.db_escape_key_identifier('_snmp_f20_').", - trap_type, single_value, position, id_group, + trap_type, single_value, position, disable_event, id_group, order_1, order_2, order_3, order_4, order_5, order_6, order_7, order_8, order_9, order_10, order_11, order_12, order_13, order_14, order_15, order_16, order_17, order_18, order_19, order_20) @@ -574,7 +579,7 @@ if ($duplicate_alert) { (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', - '%s', '%s', '%s', '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, + '%s', '%s', '%s', '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", $id_alert, $al_field1, @@ -627,6 +632,7 @@ if ($duplicate_alert) { $trap_type, $single_value, $position, + $disable_event, $group, $order_1, $order_2, @@ -1080,6 +1086,10 @@ if ($create_alert || $update_alert) { html_print_input_text('position', $position, '', 3); echo ''; + echo '