From 45b0392d8da2d58736ca63133f45fe1d79fdd836 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Tue, 12 Mar 2019 15:12:43 +0100 Subject: [PATCH 01/18] Removed unnecesary io_safe_inpunt on from functions_api.php Former-commit-id: 3120967c09d6629f0c1a1197d122a7e11788fbb7 --- pandora_console/include/functions_api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e57dd31013..98f12faad7 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11620,7 +11620,7 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3) returnError('error_parameter', 'Error in the parameters.'); return; } else if ($other['type'] == 'array') { - $comment = io_safe_input($other['data'][0]); + $comment = $other['data'][0]; $meta = $other['data'][1]; $history = $other['data'][2]; From a3865a31810365c792c5bec4df993a3a69d71b5a Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 27 Mar 2019 18:16:53 +0100 Subject: [PATCH 02/18] flip flop keep counters Former-commit-id: 0d39875c7a78f4be07fdffcf76a686007333c626 --- pandora_console/extras/mr/27.sql | 23 ++++ .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 17 +++ .../godmode/agentes/configurar_agente.php | 3 + .../godmode/agentes/module_manager_editor.php | 2 + .../agentes/module_manager_editor_common.php | 60 ++++++++-- .../modules/manage_network_components.php | 3 + .../manage_network_components_form.php | 3 + .../manage_network_components_form_common.php | 53 ++++++++- pandora_console/pandoradb.sql | 16 +++ pandora_server/lib/PandoraFMS/Core.pm | 108 ++++++++++++------ 10 files changed, 238 insertions(+), 50 deletions(-) create mode 100644 pandora_console/extras/mr/27.sql diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql new file mode 100644 index 0000000000..a2c721cd5f --- /dev/null +++ b/pandora_console/extras/mr/27.sql @@ -0,0 +1,23 @@ +START TRANSACTION; + +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; + +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_normal` int(4) unsigned default '0'; + +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_warning` int(4) unsigned default '0'; + +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_critical` int(4) unsigned default '0'; + +COMMIT; \ No newline at end of file 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 6e5e2ebcc9..4aed6f9000 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 @@ -58,6 +58,11 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tlocal_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; + -- ----------------------------------------------------- -- Table `tpolicy_modules` @@ -136,6 +141,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `tpolicies` @@ -1260,6 +1269,10 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL default 0; ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0; +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `tagente_datos` @@ -1279,6 +1292,10 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_max` int(4) default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `tagente` diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 9c10099042..c0a9c27c41 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1320,6 +1320,7 @@ if ($update_module || $create_module) { $ff_event_normal = (int) get_parameter('ff_event_normal'); $ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_critical = (int) get_parameter('ff_event_critical'); + $ff_type = (int) get_parameter('ff_type'); $each_ff = (int) get_parameter('each_ff'); $ff_timeout = (int) get_parameter('ff_timeout'); $unit = (string) get_parameter('unit_select'); @@ -1482,6 +1483,7 @@ if ($update_module) { 'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_critical' => $ff_event_critical, + 'ff_type' => $ff_type, 'each_ff' => $each_ff, 'ff_timeout' => $ff_timeout, 'unit' => io_safe_output($unit), @@ -1677,6 +1679,7 @@ if ($create_module) { 'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_critical' => $ff_event_critical, + 'ff_type' => $ff_type, 'each_ff' => $each_ff, 'ff_timeout' => $ff_timeout, 'unit' => io_safe_output($unit), diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index aaa2078479..9d49bb0a96 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -249,6 +249,7 @@ if ($id_agent_module) { $ff_event_normal = $module['min_ff_event_normal']; $ff_event_warning = $module['min_ff_event_warning']; $ff_event_critical = $module['min_ff_event_critical']; + $ff_type = $module['ff_type']; $each_ff = $module['each_ff']; $ff_timeout = $module['ff_timeout']; // Select tag info. @@ -393,6 +394,7 @@ if ($id_agent_module) { $ff_event_normal = ''; $ff_event_warning = ''; $ff_event_critical = ''; + $ff_type = 0; $id_category = 0; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 892228042a..1724ee6622 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -496,10 +496,28 @@ if (modules_is_string_type($id_module_type) || $edit) { $table_simple->data[5][1] .= '
'.__('Inverse interval').''; $table_simple->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy); -// FF stands for Flip-flop -$table_simple->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); +// FF stands for Flip-flop. +$table_simple->data[6][0] = __('FF threshold').' '; +$table_simple->data[6][0] .= ui_print_help_icon('ff_threshold', true); -$table_simple->data[6][1] = html_print_radio_button('each_ff', 0, '', $each_ff, true, $disabledBecauseInPolicy).' '.__('All state changing').' : '; +$table_simple->data[6][1] .= __('Keep counters'); +$table_simple->data[6][1] .= html_print_checkbox( + 'ff_type', + 1, + $ff_type, + true, + $disabledBecauseInPolicy +).'
'; + +$table_simple->data[6][1] .= html_print_radio_button( + 'each_ff', + 0, + '', + $each_ff, + true, + $disabledBecauseInPolicy +); +$table_simple->data[6][1] .= ' '.__('All state changing').' : '; $table_simple->data[6][1] .= html_print_input_text( 'ff_event', $ff_event, @@ -512,7 +530,16 @@ $table_simple->data[6][1] .= html_print_input_text( '', $classdisabledBecauseInPolicy ).'
'; -$table_simple->data[6][1] .= html_print_radio_button('each_ff', 1, '', $each_ff, true, $disabledBecauseInPolicy).' '.__('Each state changing').' : '; +$table_simple->data[6][1] .= html_print_radio_button( + 'each_ff', + 1, + '', + $each_ff, + true, + $disabledBecauseInPolicy +); + +$table_simple->data[6][1] .= ' '.__('Each state changing').' : '; $table_simple->data[6][1] .= __('To normal'); $table_simple->data[6][1] .= html_print_input_text( 'ff_event_normal', @@ -526,6 +553,7 @@ $table_simple->data[6][1] .= html_print_input_text( '', $classdisabledBecauseInPolicy ).' '; + $table_simple->data[6][1] .= __('To warning'); $table_simple->data[6][1] .= html_print_input_text( 'ff_event_warning', @@ -539,6 +567,7 @@ $table_simple->data[6][1] .= html_print_input_text( '', $classdisabledBecauseInPolicy ).' '; + $table_simple->data[6][1] .= __('To critical'); $table_simple->data[6][1] .= html_print_input_text( 'ff_event_critical', @@ -552,16 +581,31 @@ $table_simple->data[6][1] .= html_print_input_text( '', $classdisabledBecauseInPolicy ); + $table_simple->data[7][0] = __('Historical data'); if ($disabledBecauseInPolicy) { - // If is disabled, we send a hidden in his place and print a false checkbox because HTML dont send disabled fields and could be disabled by error - $table_simple->data[7][1] = html_print_checkbox('history_data_fake', 1, $history_data, true, $disabledBecauseInPolicy); + // If is disabled, we send a hidden in his place and print a false + // checkbox because HTML dont send disabled fields + // and could be disabled by error. + $table_simple->data[7][1] = html_print_checkbox( + 'history_data_fake', + 1, + $history_data, + true, + $disabledBecauseInPolicy + ); $table_simple->data[7][1] .= ''; } else { - $table_simple->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true, $disabledBecauseInPolicy); + $table_simple->data[7][1] = html_print_checkbox( + 'history_data', + 1, + $history_data, + true, + $disabledBecauseInPolicy + ); } -// Advanced form part +// Advanced form part. $table_advanced = new stdClass(); $table_advanced->id = 'advanced'; $table_advanced->width = '100%'; diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index f1fae1785d..ab2063fe35 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -124,6 +124,7 @@ $pure = get_parameter('pure', 0); $ff_event_normal = (int) get_parameter('ff_event_normal'); $ff_event_warning = (int) get_parameter('ff_event_warning'); $ff_event_critical = (int) get_parameter('ff_event_critical'); +$ff_type = (int) get_parameter('ff_type'); $each_ff = (int) get_parameter('each_ff'); if (count($id_tag_selected) == 1 && empty($id_tag_selected[0])) { @@ -261,6 +262,7 @@ if ($create_component) { 'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_critical' => $ff_event_critical, + 'ff_type' => $ff_type, 'each_ff' => $each_ff, ] ); @@ -355,6 +357,7 @@ if ($update_component) { 'min_ff_event_normal' => $ff_event_normal, 'min_ff_event_warning' => $ff_event_warning, 'min_ff_event_critical' => $ff_event_critical, + 'ff_type' => $ff_type, 'each_ff' => $each_ff, ] ); diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 3f9a33cb8a..fd922046d1 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -76,6 +76,7 @@ if ($create_network_from_module) { $ff_event_normal = $data_module['min_ff_event_normal']; $ff_event_warning = $data_module['min_ff_event_warning']; $ff_event_critical = $data_module['min_ff_event_critical']; + $ff_type = $data_module['ff_type']; $each_ff = $data_module['each_ff']; } @@ -134,6 +135,7 @@ if (isset($id)) { $ff_event_normal = $component['min_ff_event_normal']; $ff_event_warning = $component['min_ff_event_warning']; $ff_event_critical = $component['min_ff_event_critical']; + $ff_type = $component['ff_type']; $each_ff = $component['each_ff']; if ($type >= 15 && $type <= 18) { @@ -192,6 +194,7 @@ if (isset($id)) { $ff_event_normal = 0; $ff_event_warning = 0; $ff_event_critical = 0; + $ff_type = 0; $each_ff = 0; $snmp_version = 1; diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 2e511c6f6f..7b33a0a275 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -233,7 +233,23 @@ $table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inver $table->data[6][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); $table->colspan[6][1] = 3; -$table->data[6][1] = html_print_radio_button('each_ff', 0, '', $each_ff, true).' '.__('All state changing').' : '; + +$table->data[6][1] = __('Keep counters'); +$table->data[6][1] .= html_print_checkbox( + 'ff_type', + 1, + $ff_type, + true +).'
'; + +$table->data[6][1] .= html_print_radio_button( + 'each_ff', + 0, + '', + $each_ff, + true +).' '.__('All state changing').' : '; + $table->data[6][1] .= html_print_input_text( 'ff_event', $ff_event, @@ -242,13 +258,40 @@ $table->data[6][1] .= html_print_input_text( 15, true ).'
'; -$table->data[6][1] .= html_print_radio_button('each_ff', 1, '', $each_ff, true).' '.__('Each state changing').' : '; +$table->data[6][1] .= html_print_radio_button( + 'each_ff', + 1, + '', + $each_ff, + true +).' '.__('Each state changing').' : '; $table->data[6][1] .= __('To normal'); -$table->data[6][1] .= html_print_input_text('ff_event_normal', $ff_event_normal, '', 5, 15, true).' '; +$table->data[6][1] .= html_print_input_text( + 'ff_event_normal', + $ff_event_normal, + '', + 5, + 15, + true +).' '; $table->data[6][1] .= __('To warning'); -$table->data[6][1] .= html_print_input_text('ff_event_warning', $ff_event_warning, '', 5, 15, true).' '; +$table->data[6][1] .= html_print_input_text( + 'ff_event_warning', + $ff_event_warning, + '', + 5, + 15, + true +).' '; $table->data[6][1] .= __('To critical'); -$table->data[6][1] .= html_print_input_text('ff_event_critical', $ff_event_critical, '', 5, 15, true); +$table->data[6][1] .= html_print_input_text( + 'ff_event_critical', + $ff_event_critical, + '', + 5, + 15, + true +); $table->data[7][0] = __('Historical data'); $table->data[7][1] = html_print_checkbox('history_data', 1, $history_data, true); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 0ecc9b8f5d..457bef61d6 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -249,6 +249,10 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `min_ff_event_normal` int(4) unsigned default '0', `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', + `ff_type` tinyint(1) unsigned default '0', + `ff_normal` int(4) unsigned default '0', + `ff_warning` int(4) unsigned default '0', + `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', @@ -863,6 +867,10 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `min_ff_event_normal` int(4) unsigned default '0', `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', + `ff_type` tinyint(1) unsigned default '0', + `ff_normal` int(4) unsigned default '0', + `ff_warning` int(4) unsigned default '0', + `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', `dynamic_max` int(4) default '0', @@ -2222,6 +2230,10 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( `min_ff_event_normal` int(4) unsigned default '0', `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', + `ff_type` tinyint(1) unsigned default '0', + `ff_normal` int(4) unsigned default '0', + `ff_warning` int(4) unsigned default '0', + `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', @@ -2300,6 +2312,10 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `min_ff_event_normal` int(4) unsigned default '0', `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', + `ff_type` tinyint(1) unsigned default '0', + `ff_normal` int(4) unsigned default '0', + `ff_warning` int(4) unsigned default '0', + `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 2e79e4958c..3316cc2202 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1609,49 +1609,82 @@ sub pandora_process_module ($$$$$$$$$;$) { my $min_ff_event = $module->{'min_ff_event'}; my $current_utimestamp = time (); my $ff_timeout = $module->{'ff_timeout'}; + my $ff_warning = $module->{'ff_warning'}; + my $ff_critical = $module->{'ff_critical'}; + my $ff_normal = $module->{'ff_normal'}; - if ($module->{'each_ff'}) { - $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); - $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); - $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); - } - - if ($last_known_status == $new_status) { - # Avoid overflows - $status_changes = $min_ff_event if ($status_changes > $min_ff_event); + if ($module->{'ff_type'} == 0) { + if ($module->{'each_ff'}) { + $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); + $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); + $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); + } - $status_changes++; - if ($module_type =~ m/async/ && $min_ff_event != 0 && $ff_timeout != 0 && ($utimestamp - $ff_start_utimestamp) > $ff_timeout) { + if ($last_known_status == $new_status) { + # Avoid overflows + $status_changes = $min_ff_event if ($status_changes > $min_ff_event); + + $status_changes++; + if ($module_type =~ m/async/ && $min_ff_event != 0 && $ff_timeout != 0 && ($utimestamp - $ff_start_utimestamp) > $ff_timeout) { + $status_changes = 0; + $ff_start_utimestamp = $utimestamp; + } + } + else { $status_changes = 0; - $ff_start_utimestamp = $utimestamp; + $ff_start_utimestamp = $utimestamp if ($module_type =~ m/async/); + } + + # Active ff interval + if ($module->{'module_ff_interval'} != 0 && $status_changes < $min_ff_event) { + $current_interval = $module->{'module_ff_interval'}; + } + + # Change status + if ($status_changes >= $min_ff_event && $known_status != $new_status) { + generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh); + $status = $new_status; + + # Update module status count. + $mark_for_update = 1; + + # Safe mode execution. + if ($agent->{'safe_mode_module'} == $module->{'id_agente_modulo'}) { + safe_mode($pa_config, $agent, $module, $new_status, $known_status, $dbh); + } + } + } else { + # Independent min_ff_event for all. + if ($module->{'each_ff'}) { + $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); + $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); + $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); + } + + if ($last_known_status == $new_status) { + $ff_normal = 0; + $ff_critical = 0; + $ff_warning = 0; + } else { + # Status change. + $ff_critical++ if ($new_status == 1); + $ff_warning++ if ($new_status == 2); + $ff_normal++ if ($new_status == 0); + } + + if ( ($new_status == 0 && $ff_normal >= $min_ff_event) + || ($new_status == 1 && $ff_critical >= $min_ff_event) + || ($new_status == 2 && $ff_warning >= $min_ff_event)) { + $status = $new_status; + $ff_normal = 0; + $ff_critical = 0; + $ff_warning = 0; } } - else { - $status_changes = 0; - $ff_start_utimestamp = $utimestamp if ($module_type =~ m/async/); - } - - # Active ff interval - if ($module->{'module_ff_interval'} != 0 && $status_changes < $min_ff_event) { - $current_interval = $module->{'module_ff_interval'}; - } - - # Change status - if ($status_changes >= $min_ff_event && $known_status != $new_status) { - generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh); - $status = $new_status; - # Update module status count. - $mark_for_update = 1; - - # Safe mode execution. - if ($agent->{'safe_mode_module'} == $module->{'id_agente_modulo'}) { - safe_mode($pa_config, $agent, $module, $new_status, $known_status, $dbh); - } - } # Set not-init modules to normal status even if min_ff_event is not matched the first time they receive data. # if critical or warning status, just pass through here and wait the time min_ff_event will be matched. - elsif ($status == 4) { + if ($status == 4) { generate_status_event ($pa_config, $processed_data, $agent, $module, 0, $status, $known_status, $dbh); $status = 0; @@ -1692,10 +1725,11 @@ sub pandora_process_module ($$$$$$$$$;$) { status_changes = ?, utimestamp = ?, timestamp = ?, id_agente = ?, current_interval = ?, running_by = ?, last_execution_try = ?, last_try = ?, last_error = ?, - ff_start_utimestamp = ? + ff_start_utimestamp = ?, ff_normal = ?, ff_warning = ?, ff_critical = ? WHERE id_agente_modulo = ?', $processed_data, $status, $status, $new_status, $new_status, $status_changes, $current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id, - $utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $ff_start_utimestamp, $module->{'id_agente_modulo'}); + $utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $ff_start_utimestamp, + $ff_normal, $ff_warning, $ff_critical, $module->{'id_agente_modulo'}); } # Save module data. Async and log4x modules are not compressed. From e3222626dca81b05fd513d4e141fbd8763960888 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Thu, 28 Mar 2019 09:49:16 +0100 Subject: [PATCH 03/18] fixed error in bbdd Former-commit-id: dddd4fc90a4d3847c04108ba4dcdd4988872066f --- pandora_console/extras/mr/27.sql | 17 +++-------------- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 13 +++---------- pandora_console/pandoradb.sql | 15 +++------------ 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/pandora_console/extras/mr/27.sql b/pandora_console/extras/mr/27.sql index a2c721cd5f..3b6391af07 100644 --- a/pandora_console/extras/mr/27.sql +++ b/pandora_console/extras/mr/27.sql @@ -5,19 +5,8 @@ ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned defaul ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; -ALTER TABLE `tagente_modulo` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_normal` int(4) unsigned default '0'; - -ALTER TABLE `tagente_modulo` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_warning` int(4) unsigned default '0'; - -ALTER TABLE `tagente_modulo` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_critical` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0'; COMMIT; \ No newline at end of file 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 4aed6f9000..c5e1ad75e1 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 @@ -59,10 +59,6 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tlocal_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tlocal_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; - -- ----------------------------------------------------- -- Table `tpolicy_modules` @@ -142,9 +138,6 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tpolicy_modules` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `tpolicies` @@ -1159,6 +1152,9 @@ ALTER TABLE tagente_estado MODIFY `status_changes` tinyint(4) unsigned default 0 ALTER TABLE tagente_estado CHANGE `last_known_status` `known_status` tinyint(4) default 0; ALTER TABLE tagente_estado ADD COLUMN `last_known_status` tinyint(4) default 0; ALTER TABLE tagente_estado ADD COLUMN last_unknown_update bigint(20) NOT NULL default 0; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_normal` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_warning` int(4) unsigned default '0'; +ALTER TABLE `tagente_estado` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `talert_actions` @@ -1293,9 +1289,6 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_normal` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_warning` int(4) unsigned default '0'; -ALTER TABLE `tnetwork_component` ADD COLUMN `ff_critical` int(4) unsigned default '0'; -- --------------------------------------------------------------------- -- Table `tagente` diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 457bef61d6..fef32673b7 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -164,6 +164,9 @@ CREATE TABLE IF NOT EXISTS `tagente_estado` ( `last_known_status` tinyint(4) default 0, `last_error` int(4) NOT NULL default '0', `ff_start_utimestamp` bigint(20) default 0, + `ff_normal` int(4) unsigned default '0', + `ff_warning` int(4) unsigned default '0', + `ff_critical` int(4) unsigned default '0', `last_dynamic_update` bigint(20) NOT NULL default '0', `last_unknown_update` bigint(20) NOT NULL default '0', PRIMARY KEY (`id_agente_estado`), @@ -250,9 +253,6 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', `ff_type` tinyint(1) unsigned default '0', - `ff_normal` int(4) unsigned default '0', - `ff_warning` int(4) unsigned default '0', - `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', @@ -868,9 +868,6 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', `ff_type` tinyint(1) unsigned default '0', - `ff_normal` int(4) unsigned default '0', - `ff_warning` int(4) unsigned default '0', - `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', `dynamic_max` int(4) default '0', @@ -2231,9 +2228,6 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', `ff_type` tinyint(1) unsigned default '0', - `ff_normal` int(4) unsigned default '0', - `ff_warning` int(4) unsigned default '0', - `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', @@ -2313,9 +2307,6 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `min_ff_event_warning` int(4) unsigned default '0', `min_ff_event_critical` int(4) unsigned default '0', `ff_type` tinyint(1) unsigned default '0', - `ff_normal` int(4) unsigned default '0', - `ff_warning` int(4) unsigned default '0', - `ff_critical` int(4) unsigned default '0', `each_ff` tinyint(1) unsigned default '0', `ff_timeout` int(4) unsigned default '0', `dynamic_interval` int(4) unsigned default '0', From 33197df731da78301d9dbb85adf9530b8c88181f Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Thu, 28 Mar 2019 17:33:49 +0100 Subject: [PATCH 04/18] add new functionality flipflop Former-commit-id: 00a71df0d228833dbe7211504e11418d91622d93 --- pandora_server/lib/PandoraFMS/Core.pm | 103 +++++++++++++++++--------- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 3316cc2202..29d3f14f62 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1605,42 +1605,53 @@ sub pandora_process_module ($$$$$$$$$;$) { $current_interval = $module->{'module_interval'}; } - #Update module status + # Update module status. my $min_ff_event = $module->{'min_ff_event'}; my $current_utimestamp = time (); my $ff_timeout = $module->{'ff_timeout'}; - my $ff_warning = $module->{'ff_warning'}; - my $ff_critical = $module->{'ff_critical'}; - my $ff_normal = $module->{'ff_normal'}; - if ($module->{'ff_type'} == 0) { - if ($module->{'each_ff'}) { - $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); - $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); - $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); - } + # Counters. + my $ff_warning = $agent_status->{'ff_warning'}; + my $ff_critical = $agent_status->{'ff_critical'}; + my $ff_normal = $agent_status->{'ff_normal'}; + + if ($module->{'each_ff'}) { + $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); + $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); + $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); + } + + if ($last_known_status == $new_status) { + # Avoid overflows + $status_changes = $min_ff_event if ($status_changes > $min_ff_event && $module->{'ff_type'} == 0); - if ($last_known_status == $new_status) { - # Avoid overflows - $status_changes = $min_ff_event if ($status_changes > $min_ff_event); + $status_changes++; + if ($module_type =~ m/async/ && $min_ff_event != 0 && $ff_timeout != 0 && ($utimestamp - $ff_start_utimestamp) > $ff_timeout) { + # Only type ff with counters. + $status_changes = 0 if ($module->{'ff_type'} == 0); - $status_changes++; - if ($module_type =~ m/async/ && $min_ff_event != 0 && $ff_timeout != 0 && ($utimestamp - $ff_start_utimestamp) > $ff_timeout) { - $status_changes = 0; - $ff_start_utimestamp = $utimestamp; - } - } - else { - $status_changes = 0; - $ff_start_utimestamp = $utimestamp if ($module_type =~ m/async/); + $ff_start_utimestamp = $utimestamp; + + # Reset counters because expired timeout. + $ff_normal = 0; + $ff_critical = 0; + $ff_warning = 0; } + } + else { + # Only type ff with counters. + $status_changes = 0 if ($module->{'ff_type'} == 0); - # Active ff interval + $ff_start_utimestamp = $utimestamp if ($module_type =~ m/async/); + } + + if ($module->{'ff_type'} == 0) { + # Active ff interval. if ($module->{'module_ff_interval'} != 0 && $status_changes < $min_ff_event) { $current_interval = $module->{'module_ff_interval'}; } - # Change status + # Change status. if ($status_changes >= $min_ff_event && $known_status != $new_status) { generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh); $status = $new_status; @@ -1654,31 +1665,50 @@ sub pandora_process_module ($$$$$$$$$;$) { } } } else { - # Independent min_ff_event for all. - if ($module->{'each_ff'}) { - $min_ff_event = $module->{'min_ff_event_normal'} if ($new_status == 0); - $min_ff_event = $module->{'min_ff_event_critical'} if ($new_status == 1); - $min_ff_event = $module->{'min_ff_event_warning'} if ($new_status == 2); - } - - if ($last_known_status == $new_status) { + if ($status == $new_status) { + # If the status is equal to the previous status reset the counters. $ff_normal = 0; $ff_critical = 0; $ff_warning = 0; } else { - # Status change. + # Sequential critical and normal status are needed + # if don't, reset counters. + if ($last_known_status == 1 && $new_status != 1) { + $ff_critical = 0; + } elsif ($last_known_status == 0 && $new_status != 0) { + $ff_normal = 0; + } + + # Increase counters. $ff_critical++ if ($new_status == 1); $ff_warning++ if ($new_status == 2); $ff_normal++ if ($new_status == 0); } - + if ( ($new_status == 0 && $ff_normal >= $min_ff_event) || ($new_status == 1 && $ff_critical >= $min_ff_event) || ($new_status == 2 && $ff_warning >= $min_ff_event)) { + # Change status generate event. + generate_status_event ($pa_config, $processed_data, $agent, $module, $new_status, $status, $known_status, $dbh); $status = $new_status; + + # Update module status count. + $mark_for_update = 1; + + # Safe mode execution. + if ($agent->{'safe_mode_module'} == $module->{'id_agente_modulo'}) { + safe_mode($pa_config, $agent, $module, $new_status, $known_status, $dbh); + } + + # Reset counters because change status. $ff_normal = 0; $ff_critical = 0; $ff_warning = 0; + } else { + # Active ff interval + if ($module->{'module_ff_interval'} != 0) { + $current_interval = $module->{'module_ff_interval'}; + } } } @@ -1696,6 +1726,11 @@ sub pandora_process_module ($$$$$$$$$;$) { generate_status_event ($pa_config, $processed_data, $agent, $module, $known_status, $status, $known_status, $dbh); $status = $known_status; + # reset counters because change status. + $ff_normal = 0; + $ff_critical = 0; + $ff_warning = 0; + # Update module status count. $mark_for_update = 1; } From b2e16848f9a1fbaccfac15d2fbab6b846da9b00a Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Fri, 29 Mar 2019 14:59:31 +0100 Subject: [PATCH 05/18] add new ff type Former-commit-id: b9ff391d6586e5844e78207d44cdf9b80c98ba7e --- .../godmode/agentes/agent_template.php | 1 + .../godmode/massive/massive_edit_modules.php | 111 +++++++++++++-- .../include/ajax/snmp_browser.ajax.php | 1 + pandora_console/include/functions_api.php | 129 +++++++++++------- pandora_server/lib/PandoraFMS/PluginTools.pm | 3 + 5 files changed, 189 insertions(+), 56 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 64e78320f5..f4c93bb9f1 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -106,6 +106,7 @@ if (isset($_POST['template_id'])) { 'min_ff_event_normal' => $row2['min_ff_event_normal'], 'min_ff_event_warning' => $row2['min_ff_event_warning'], 'min_ff_event_critical' => $row2['min_ff_event_critical'], + 'ff_type' => $row2['ff_type'], ]; $name = $row2['name']; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 568e74dbbb..917117aa1c 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -844,20 +844,110 @@ $table->data['edit1'][1] = ''; $table->data['edit6'][3] = html_print_extended_select_for_unit('unit', '-1', '', '', '0', '15', true, false, false, false, 1); - // FF stands for Flip-flop - $table->data['edit7'][0] = __('FF threshold').' '.ui_print_help_icon('ff_threshold', true); + // FF stands for Flip-flop. + $table->data['edit7'][0] = __('FF threshold').' '; + $table->data['edit7'][0] .= ui_print_help_icon( + 'ff_threshold', + true + ); + $table->colspan['edit7'][1] = 3; - $table->data['edit7'][1] = __('Mode').' '.html_print_select(['' => __('No change'), '1' => __('Each state changing'), '0' => __('All state changing')], 'each_ff', '', '', '', '', true).'
'; - $table->data['edit7'][1] .= __('All state changing').' : '.html_print_input_text('min_ff_event', '', '', 5, 15, true).'
'; + $table->data['edit7'][1] = __('Mode').' '; + $table->data['edit7'][1] .= html_print_select( + [ + '' => __('No change'), + '1' => __('Each state changing'), + '0' => __('All state changing'), + ], + 'each_ff', + '', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 400px;' + ).'
'; + + $table->data['edit7'][1] .= __('All state changing').' : '; + $table->data['edit7'][1] .= html_print_input_text( + 'min_ff_event', + '', + '', + 5, + 15, + true + ).'
'; + $table->data['edit7'][1] .= __('Each state changing').' : '; - $table->data['edit7'][1] .= __('To normal').html_print_input_text('min_ff_event_normal', '', '', 5, 15, true).' '; - $table->data['edit7'][1] .= __('To warning').html_print_input_text('min_ff_event_warning', '', '', 5, 15, true).' '; - $table->data['edit7'][1] .= __('To critical').html_print_input_text('min_ff_event_critical', '', '', 5, 15, true).' '; + $table->data['edit7'][1] .= __('To normal').' '; + $table->data['edit7'][1] .= html_print_input_text( + 'min_ff_event_normal', + '', + '', + 5, + 15, + true + ).' '; + + $table->data['edit7'][1] .= __('To warning').' '; + $table->data['edit7'][1] .= html_print_input_text( + 'min_ff_event_warning', + '', + '', + 5, + 15, + true + ).' '; + + $table->data['edit7'][1] .= __('To critical').' '; + $table->data['edit7'][1] .= html_print_input_text( + 'min_ff_event_critical', + '', + '', + 5, + 15, + true + ).'
'; + + $table->data['edit7'][1] .= __('Keep counters').' '; + $table->data['edit7'][1] .= html_print_checkbox( + 'ff_type', + 1, + 0, + true + ); $table->data['edit8'][0] = __('FF interval'); - $table->data['edit8'][1] = html_print_input_text('module_ff_interval', '', '', 5, 10, true).ui_print_help_tip(__('Module execution flip flop time interval (in secs).'), true); + $table->data['edit8'][1] = html_print_input_text( + 'module_ff_interval', + '', + '', + 5, + 10, + true + ); + $table->data['edit8'][1] .= ui_print_help_tip( + __('Module execution flip flop time interval (in secs).'), + true + ); + $table->data['edit8'][2] = __('FF timeout'); - $table->data['edit8'][3] = html_print_input_text('ff_timeout', '', '', 5, 10, true).ui_print_help_tip(__('Timeout in secs from start of flip flop counting. If this value is exceeded, FF counter is reset. Set to 0 for no timeout.'), true); + $table->data['edit8'][3] = html_print_input_text( + 'ff_timeout', + '', + '', + 5, + 10, + true + ); + $table->data['edit8'][3] .= ui_print_help_tip( + __('Timeout in secs from start of flip flop counting. If this value is exceeded, FF counter is reset. Set to 0 for no timeout.'), + true + ); $table->data['edit9'][0] = __('Historical data'); $table->data['edit9'][1] = html_print_select(['' => __('No change'), '1' => __('Yes'), '0' => __('No')], 'history_data', '', '', '', '', true); @@ -1685,7 +1775,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' $agents_select = [$agents_select]; } - // List of fields which can be updated + // List of fields which can be updated. $fields = [ 'dynamic_interval', 'dynamic_max', @@ -1730,6 +1820,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' 'min_ff_event_normal', 'min_ff_event_warning', 'min_ff_event_critical', + 'ff_type', 'each_ff', 'module_ff_interval', 'ff_timeout', diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php index 11d233c676..85f8b3e68a 100644 --- a/pandora_console/include/ajax/snmp_browser.ajax.php +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -121,6 +121,7 @@ if (is_ajax()) { 'min_ff_event_normal' => 0, 'min_ff_event_warning' => 0, 'min_ff_event_critical' => 0, + 'ff_type' => 0, 'each_ff' => 0, ] ); diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e57dd31013..f3dc6efde2 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1,19 +1,36 @@ ;;; - * ;;;;;;;; - * ;;;;;;; - * ;;;;;; - * ;;;; in this order - * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) - * example: - * - * api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_| - * - * @param $thrash3 Don't use + * @param string $id Name of agent to add the module. + * @param string $thrash1 Don't use. + * @param array $other It's array, $other as param is ;;; + * ;;;;;;;; + * ;;;;;;; + * ;;;;;; + * ;;;; in this order + * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_). + * @param string $thrash3 Don't use. + * @example: api.php?op=set&op2=create_network_module&id=pepito&other=prueba|0|7|1|10|15|0|16|18|0|15|0|www.google.es|0||0|180|0|0|0|0|latency%20ping&other_mode=url_encode_separator_|* + * @return mixed Return. */ function api_set_create_network_module($id, $thrash1, $other, $thrash3) { @@ -3090,22 +3106,23 @@ function api_set_create_network_module($id, $thrash1, $other, $thrash3) 'min_ff_event_critical' => $other['data'][27], 'critical_inverse' => $other['data'][28], 'warning_inverse' => $other['data'][29], + 'ff_type' => $other['data'][30], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null + // Column 'descripcion' cannot be null. } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null + // Column 'module_macros' cannot be null. } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info + // TODO: Improve the error returning more info. returnError('error_create_network_module', __('Error in creation network module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3222,6 +3239,7 @@ function api_set_update_network_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', + 'ff_type', ]; $values = []; @@ -3326,22 +3344,23 @@ function api_set_create_plugin_module($id, $thrash1, $other, $thrash3) 'min_ff_event_critical' => $other['data'][32], 'critical_inverse' => $other['data'][33], 'warning_inverse' => $other['data'][34], + 'ff_type' => $other['data'][35], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null + // Column 'descripcion' cannot be null. } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null + // Column 'module_macros' cannot be null. } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info + // TODO: Improve the error returning more info. returnError('error_create_plugin_module', __('Error in creation plugin module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3387,7 +3406,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent + // If we want to change the module to a new agent. if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -3404,7 +3423,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists + // Check if agent exists. $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating plugin module. Id_agent doesn\'t exist.')); @@ -3448,6 +3467,7 @@ function api_set_update_plugin_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', + 'ff_type', ]; $values = []; @@ -3546,22 +3566,23 @@ function api_set_create_data_module($id, $thrash1, $other, $thrash3) 'ff_timeout' => $other['data'][23], 'critical_inverse' => $other['data'][24], 'warning_inverse' => $other['data'][25], + 'ff_type' => $other['data'][26], ]; if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null + // Column 'descripcion' cannot be null. } if (! $values['module_macros']) { $values['module_macros'] = ''; - // Column 'module_macros' cannot be null + // Column 'module_macros' cannot be null. } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info + // TODO: Improve the error returning more info. returnError('error_create_data_module', __('Error in creation data module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -3818,7 +3839,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent + // If we want to change the module to a new agent. if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -3835,7 +3856,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists + // Check if agent exists. $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating data module. Id_agent doesn\'t exist.')); @@ -3870,6 +3891,7 @@ function api_set_update_data_module($id_module, $thrash1, $other, $thrash3) 'critical_inverse', 'warning_inverse', 'policy_linked', + 'ff_type', ]; $values = []; @@ -3947,7 +3969,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) $disabled_types_event[EVENTS_GOING_UNKNOWN] = (int) !$other['data'][27]; $disabled_types_event = json_encode($disabled_types_event); - // SNMP version 3 + // SNMP version 3. if ($other['data'][14] == '3') { if ($other['data'][23] != 'AES' and $other['data'][23] != 'DES') { returnError('error_create_snmp_module', __('Error in creation SNMP module. snmp3_priv_method doesn\'t exist. Set it to \'AES\' or \'DES\'. ')); @@ -4000,6 +4022,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][31], 'min_ff_event_warning' => $other['data'][32], 'min_ff_event_critical' => $other['data'][33], + 'ff_type' => $other['data'][34], ]; } else { $values = [ @@ -4032,18 +4055,19 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][25], 'min_ff_event_warning' => $other['data'][26], 'min_ff_event_critical' => $other['data'][27], + 'ff_type' => $other['data'][28], ]; } if (! $values['descripcion']) { $values['descripcion'] = ''; - // Column 'descripcion' cannot be null + // Column 'descripcion' cannot be null. } $idModule = modules_create_agent_module($idAgent, $name, $values, true); if (is_error($idModule)) { - // TODO: Improve the error returning more info + // TODO: Improve the error returning more info. returnError('error_create_snmp_module', __('Error in creation SNMP module.')); } else { returnData('string', ['type' => 'string', 'data' => $idModule]); @@ -4091,7 +4115,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) return; } - // If we want to change the module to a new agent + // If we want to change the module to a new agent. if ($other['data'][0] != '') { if (!util_api_check_agent_and_print_error($other['data'][0], 'string', 'AW')) { return; @@ -4108,7 +4132,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) } } - // Check if agent exists + // Check if agent exists. $check_id_agent = db_get_value('id_agente', 'tagente', 'id_agente', $other['data'][0]); if (!$check_id_agent) { returnError('error_update_data_module', __('Error updating snmp module. Id_agent doesn\'t exist.')); @@ -4116,7 +4140,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) } } - // SNMP version 3 + // SNMP version 3. if ($other['data'][13] == '3') { if ($other['data'][22] != 'AES' and $other['data'][22] != 'DES') { returnError( @@ -4180,6 +4204,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) 'min_ff_event_warning', 'min_ff_event_critical', 'policy_linked', + 'ff_type', ]; } else { $snmp_module_fields = [ @@ -4211,6 +4236,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3) 'min_ff_event_warning', 'min_ff_event_critical', 'policy_linked', + 'ff_type', ]; } @@ -4308,6 +4334,7 @@ function api_set_new_network_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][20], 'min_ff_event_warning' => $other['data'][21], 'min_ff_event_critical' => $other['data'][22], + 'ff_type' => $other['data'][23], ]; $name_check = db_get_value('name', 'tnetwork_component', 'name', $id); @@ -4408,6 +4435,7 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][24], 'min_ff_event_warning' => $other['data'][25], 'min_ff_event_critical' => $other['data'][26], + 'ff_type' => $other['data'][27], ]; $name_check = db_get_value('name', 'tnetwork_component', 'name', $id); @@ -4543,6 +4571,7 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][29], 'min_ff_event_warning' => $other['data'][30], 'min_ff_event_critical' => $other['data'][31], + 'ff_type' => $other['data'][32], ]; } else { $values = [ @@ -4574,6 +4603,7 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) 'min_ff_event_normal' => $other['data'][25], 'min_ff_event_warning' => $other['data'][26], 'min_ff_event_critical' => $other['data'][27], + 'ff_type' => $other['data'][28], ]; } @@ -4654,6 +4684,7 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2) 'min_ff_event_warning' => $other['data'][8], 'min_ff_event_critical' => $other['data'][9], 'ff_timeout' => $other['data'][10], + 'ff_type' => $other['data'][11], ]; $name_check = enterprise_hook( @@ -6409,6 +6440,7 @@ function api_set_add_data_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_warning'] = $other['data'][21]; $values['min_ff_event_critical'] = $other['data'][22]; $values['ff_timeout'] = $other['data'][23]; + $values['ff_type'] = $other['data'][24]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -6650,6 +6682,7 @@ function api_set_add_network_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_normal'] = $other['data'][24]; $values['min_ff_event_warning'] = $other['data'][25]; $values['min_ff_event_critical'] = $other['data'][26]; + $values['ff_type'] = $other['data'][27]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -6859,6 +6892,7 @@ function api_set_add_plugin_module_policy($id, $thrash1, $other, $thrash3) $values['min_ff_event_normal'] = $other['data'][29]; $values['min_ff_event_warning'] = $other['data'][30]; $values['min_ff_event_critical'] = $other['data'][31]; + $values['ff_type'] = $other['data'][32]; if ($name_module_policy !== false) { if ($name_module_policy[0]['name'] == $other['data'][0]) { @@ -7276,6 +7310,7 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][30], 'min_ff_event_warning' => $other['data'][31], 'min_ff_event_critical' => $other['data'][32], + 'ff_type' => $other['data'][33], ]; } else { $values = [ @@ -7305,6 +7340,7 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) 'min_ff_event_normal' => $other['data'][24], 'min_ff_event_warning' => $other['data'][25], 'min_ff_event_critical' => $other['data'][26], + 'ff_type' => $other['data'][27], ]; } @@ -13268,6 +13304,7 @@ function api_set_apply_module_template($id_template, $id_agent, $thrash3, $thras 'min_ff_event_normal' => $row2['min_ff_event_normal'], 'min_ff_event_warning' => $row2['min_ff_event_warning'], 'min_ff_event_critical' => $row2['min_ff_event_critical'], + 'ff_type' => $row2['ff_type'], ]; $name = $row2['name']; diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 9fb0066972..603dd2622c 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -721,6 +721,9 @@ sub print_module { if (! (empty ($data->{min_ff_event_critical}))) { $xml_module .= "\t{min_ff_event_critical} . "]]>\n"; } + if (! (empty ($data->{ff_type}))) { + $xml_module .= "\t{ff_type} . "]]>\n"; + } if (! (empty ($data->{ff_timeout}))) { $xml_module .= "\t{ff_timeout} . "]]>\n"; } From 5ca01b02941f8e872e76fb00881adf086c0e9357 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 1 Apr 2019 10:27:24 +0200 Subject: [PATCH 06/18] add ff_type linux agent Former-commit-id: 0e903a7e304c5a2ea4dcf8570e45663524777748 --- pandora_agents/unix/pandora_agent | 3 +++ pandora_server/lib/PandoraFMS/DataServer.pm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 093bc078f5..fd710f4c75 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -662,6 +662,8 @@ sub parse_conf_modules($) { $module->{'ff_timeout'} = $1; } elsif ($line =~ /^\s*module_each_ff\s+(\S+)\s*$/) { $module->{'each_ff'} = $1; + } elsif ($line =~ /^\s*module_ff_type\s+(\d+)\s*$/) { + $module->{'ff_type'} = $1; # Macros } elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) { $module->{'macros'}{$1} = $2; @@ -2532,6 +2534,7 @@ sub write_module_xml ($@) { $Xml .= " " . $module->{'min_ff_event_critical'} . "\n" if (defined ($module->{'min_ff_event_critical'})); $Xml .= " " . $module->{'ff_timeout'} . "\n" if (defined ($module->{'ff_timeout'})); $Xml .= " " . $module->{'each_ff'} . "\n" if (defined ($module->{'each_ff'})); + $Xml .= " " . $module->{'ff_type'} . "\n" if (defined ($module->{'ff_type'})); # Data list if ($#data > 0) { diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index bc66eb2d72..8e08a7d482 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -641,7 +641,7 @@ sub process_module_data ($$$$$$$$$$) { 'unknown_instructions' => '', 'tags' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, 'quiet' => 0, 'module_ff_interval' => 0, 'alert_template' => '', 'crontab' => '', 'min_ff_event_normal' => 0, 'min_ff_event_warning' => 0, 'min_ff_event_critical' => 0, 'ff_timeout' => 0, 'each_ff' => 0, 'module_parent' => 0, - 'module_parent_unlink' => 0, 'cron_interval' => 0}; + 'module_parent_unlink' => 0, 'cron_interval' => 0, 'ff_type' => 0}; # Other tags will be saved here $module_conf->{'extended_info'} = ''; From be0f96b5f0ce8fc2b414eed90ffb09a9781855f9 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 1 Apr 2019 12:52:09 +0200 Subject: [PATCH 07/18] add ff_type Windows agent Former-commit-id: d167449fe305d6a013eb2b2e22ec48a58af1e346 --- .../win32/modules/pandora_module.cc | 18 ++++++++++++++++++ pandora_agents/win32/modules/pandora_module.h | 2 ++ .../win32/modules/pandora_module_factory.cc | 19 ++++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index eac38c8fa1..e7c751d367 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -78,6 +78,7 @@ Pandora_Module::Pandora_Module (string name) { this->warning_inverse = ""; this->quiet = ""; this->module_ff_interval = ""; + this->module_ff_type = ""; this->module_alert_template = ""; this->module_crontab = ""; } @@ -733,6 +734,13 @@ Pandora_Module::getXml () { module_xml += this->module_ff_interval; module_xml += "\n"; } + + /* Module FF type */ + if (this->module_ff_type != "") { + module_xml += "\t"; + module_xml += this->module_ff_type; + module_xml += "\n"; + } /* Module Alert template */ if (this->module_alert_template != "") { @@ -1028,6 +1036,16 @@ Pandora_Module::setModuleFFInterval (string value) { this->module_ff_interval = value; } +/** + * Set the module FF type for the module. + * + * @param value module FF type value to set. + */ +void +Pandora_Module::setModuleFFType (string value) { + this->module_ff_type = value; +} + /** * Set the module Alert template for the module. * diff --git a/pandora_agents/win32/modules/pandora_module.h b/pandora_agents/win32/modules/pandora_module.h index 9fb29e1183..c766766950 100644 --- a/pandora_agents/win32/modules/pandora_module.h +++ b/pandora_agents/win32/modules/pandora_module.h @@ -176,6 +176,7 @@ namespace Pandora_Modules { string unit, custom_id, str_warning, str_critical; string module_group, warning_inverse, critical_inverse, quiet; string module_ff_interval, module_alert_template, module_crontab; + string module_ff_type; string critical_instructions, warning_instructions, unknown_instructions, tags; protected: @@ -277,6 +278,7 @@ namespace Pandora_Modules { void setWarningInverse (string value); void setQuiet (string value); void setModuleFFInterval (string value); + void setModuleFFType (string value); void setModuleAlertTemplate (string value); void setModuleCrontab (string value); diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc index 658ff724fd..b05422f104 100644 --- a/pandora_agents/win32/modules/pandora_module_factory.cc +++ b/pandora_agents/win32/modules/pandora_module_factory.cc @@ -119,6 +119,7 @@ using namespace Pandora_Strutils; #define TOKEN_WARNING_INVERSE ("module_warning_inverse ") #define TOKEN_QUIET ("module_quiet ") #define TOKEN_MODULE_FF_INTERVAL ("module_ff_interval ") +#define TOKEN_MODULE_FF_TYPE ("module_ff_type ") #define TOKEN_MACRO ("module_macro") #define TOKEN_NATIVE_ENCODING ("module_native_encoding") #define TOKEN_ALERT_TEMPLATE ("module_alert_template") @@ -176,7 +177,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { string module_unit, module_group, module_custom_id, module_str_warning, module_str_critical; string module_critical_instructions, module_warning_instructions, module_unknown_instructions, module_tags; string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval; - string module_native_encoding, module_alert_template; + string module_native_encoding, module_alert_template, module_ff_type; string macro; Pandora_Module *module; bool numeric; @@ -254,6 +255,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { module_warning_inverse = ""; module_quiet = ""; module_ff_interval = ""; + module_ff_type = ""; module_native_encoding = ""; module_alert_template = ""; module_user_session = ""; @@ -507,6 +509,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { if (module_ff_interval == "") { module_ff_interval = parseLine (line, TOKEN_MODULE_FF_INTERVAL); } + + if (module_ff_type == "") { + module_ff_type = parseLine (line, TOKEN_MODULE_FF_TYPE); + } if (module_alert_template == "") { module_alert_template = parseLine (line, TOKEN_ALERT_TEMPLATE); @@ -1087,6 +1093,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { } } + if (module_ff_type != "") { + pos_macro = module_ff_type.find(macro_name); + if (pos_macro != string::npos){ + module_ff_type.replace(pos_macro, macro_name.size(), macro_value); + } + } + if (module_alert_template != "") { pos_macro = module_alert_template.find(macro_name); if (pos_macro != string::npos){ @@ -1447,6 +1460,10 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { if (module_ff_interval != "") { module->setModuleFFInterval (module_ff_interval); } + + if (module_ff_type != "") { + module->setModuleFFType (module_ff_type); + } if (module_alert_template != "") { module->setModuleAlertTemplate (module_alert_template); From c679751f94a0cb6d9ff4441986d05795e18261e2 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 2 Apr 2019 16:01:24 +0200 Subject: [PATCH 08/18] fixed error add ff_type Former-commit-id: 177e40f655f309eed3e7d877ffb00172b0105095 --- .../godmode/massive/massive_edit_modules.php | 20 +++++++++++++++---- .../modules/manage_network_components.php | 1 + .../include/javascript/pandora_modules.js | 6 ++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 917117aa1c..ae6b5b1432 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -914,11 +914,23 @@ $table->data['edit1'][1] = '
'; ).'
'; $table->data['edit7'][1] .= __('Keep counters').' '; - $table->data['edit7'][1] .= html_print_checkbox( + $table->data['edit7'][1] .= html_print_select( + [ + '' => __('No change'), + '1' => __('Active Counters'), + '0' => __('Inactive Counters'), + ], 'ff_type', - 1, - 0, - true + '', + '', + '', + '', + true, + false, + true, + '', + false, + 'width: 400px;' ); $table->data['edit8'][0] = __('FF interval'); diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index ab2063fe35..906f36be15 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -499,6 +499,7 @@ $url = ui_get_url_refresh( 'ff_event_warning' => false, 'ff_event_critical' => false, 'each_ff' => false, + 'ff_type' => false, ] ); diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index e835f87c24..889fd0f3dd 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -1,3 +1,8 @@ +/* + global $ + global jQuery +*/ + /* Modules ids to check types */ var id_modules_icmp = Array(6, 7); var id_modules_tcp = Array(8, 9, 10, 11); @@ -412,6 +417,7 @@ function configure_modules_form() { "value", data["min_ff_event_critical"] == 0 ? 0 : data["min_ff_event_critical"] ); + $("#checkbox-ff_type").prop("checked", data["ff_type"]); // Shows manual input if post_process field is setted if (data["post_process"] != 0) { From a0a250bef77e0d206ff85476123a285fc7be3741 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 2 Apr 2019 16:45:01 +0200 Subject: [PATCH 09/18] fixed error add ff_type Former-commit-id: b270ec363b84bbfafcea5418b6007aba8217680b --- pandora_console/include/javascript/pandora_modules.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 889fd0f3dd..abc91ce532 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -100,6 +100,7 @@ function configure_modules_form() { $("#text-unit").attr("value", ""); $("#checkbox-critical_inverse").attr("value", 0); $("#checkbox-warning_inverse").attr("value", 0); + $("#checkbox-ff_type").attr("value", 0); $("#textarea_critical_instructions").attr("value", ""); $("#textarea_warning_instructions").attr("value", ""); $("#textarea_unknown_instructions").attr("value", ""); @@ -182,6 +183,8 @@ function configure_modules_form() { "value", data["min_ff_event"] == 0 ? 0 : data["min_ff_event"] ); + + $("#checkbox-ff_type").prop("checked", data["ff_type"]); $("#text-post_process").attr( "value", data["post_process"] == 0 ? 0 : data["post_process"] From 33db6d2f0c324d3e3597771ef3b5cc72978c3ac1 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 4 Apr 2019 18:13:29 +0200 Subject: [PATCH 10/18] If is metaconsole, param meta is setted to true Former-commit-id: d652754fc131a0024c0c7846335a4362767e5f1d --- pandora_console/include/functions_api.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 98f12faad7..e3aedd122a 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11608,7 +11608,9 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3) global $config; if (defined('METACONSOLE')) { - return; + $meta = true; + } else { + $meta = $other['data'][1]; } if (!check_acl($config['id_user'], 0, 'EW')) { @@ -11621,7 +11623,6 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3) return; } else if ($other['type'] == 'array') { $comment = $other['data'][0]; - $meta = $other['data'][1]; $history = $other['data'][2]; $status = events_comment( From 447655409ddd4f16ef16df6a53723ca4f977049d Mon Sep 17 00:00:00 2001 From: Daniel Barbero Date: Fri, 5 Apr 2019 09:27:46 +0200 Subject: [PATCH 11/18] fixed minor error keep counters local and network components Former-commit-id: 8d57bede6ea7c6f44d51a696a3257600410734fe --- pandora_console/include/javascript/pandora_modules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index abc91ce532..7d81facfe8 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -420,7 +420,12 @@ function configure_modules_form() { "value", data["min_ff_event_critical"] == 0 ? 0 : data["min_ff_event_critical"] ); - $("#checkbox-ff_type").prop("checked", data["ff_type"]); + + if (data["ff_type"] != 0) { + $("#checkbox-ff_type").prop("checked", 1); + } else { + $("#checkbox-ff_type").prop("checked", 0); + } // Shows manual input if post_process field is setted if (data["post_process"] != 0) { From 1ddb5ebff46e46adb938c6257521d54e9a424a81 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 6 Apr 2019 00:01:32 +0200 Subject: [PATCH 12/18] Auto-updated build strings. Former-commit-id: 4b2eb28f3aa59b694fe9347111e626dc25d5b207 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ccc4c495a3..667c5c9433 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190405 +Version: 7.0NG.733-190406 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 8780e8a466..a05f3544b4 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190405" +pandora_version="7.0NG.733-190406" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 5674b70177..44bcf1341b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190405'; +use constant AGENT_BUILD => '190406'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index eaf92c3ca5..a50e12a81b 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190405 +%define release 190406 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a12a113b92..3984ad75b7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190405 +%define release 190406 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2b6ba8babf..8d69d1e8f5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190405" +PI_BUILD="190406" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9dadbf90fd..a10e82038d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190405} +{190406} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f4f3ddac52..9cbdae765c 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190405)") +#define PANDORA_VERSION ("7.0NG.733(Build 190406)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4bdc9a4096..817b23b55f 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190405))" + VALUE "ProductVersion", "(7.0NG.733(Build 190406))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9a41b31fe5..d078f84cec 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190405 +Version: 7.0NG.733-190406 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 3907e8f72c..079ae70b3d 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190405" +pandora_version="7.0NG.733-190406" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a72e7ee8ab..6b480bd26f 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190405'; +$build_version = 'PC190406'; $pandora_version = 'v7.0NG.733'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b7d52c5106..e09c554f22 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 4176856dfe..daf2635951 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190405 +%define release 190406 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6b55058a13..1645a3510b 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190405 +%define release 190406 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 961e2132c0..1590b9d6b3 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190405" +PI_BUILD="190406" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0fadb363c7..d7b001478f 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.733 PS190405"; +my $version = "7.0NG.733 PS190406"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9c2a3f5047..43a7a6d9ff 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.733 PS190405"; +my $version = "7.0NG.733 PS190406"; # save program name for logging my $progname = basename($0); From d35e9dbaae8cc98398e666ca29f439a5e77346ea Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 7 Apr 2019 00:01:25 +0200 Subject: [PATCH 13/18] Auto-updated build strings. Former-commit-id: 007ce79a077f515323355d6656c9e14dd9c99c73 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 667c5c9433..0ba57c7902 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190406 +Version: 7.0NG.733-190407 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index a05f3544b4..93a29f90b8 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190406" +pandora_version="7.0NG.733-190407" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 44bcf1341b..86c26d5b26 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190406'; +use constant AGENT_BUILD => '190407'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index a50e12a81b..904efc721c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190406 +%define release 190407 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3984ad75b7..a7388d91b9 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190406 +%define release 190407 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 8d69d1e8f5..4a7736fc3e 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190406" +PI_BUILD="190407" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a10e82038d..1e4bb5b516 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190406} +{190407} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9cbdae765c..3588a12122 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190406)") +#define PANDORA_VERSION ("7.0NG.733(Build 190407)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 817b23b55f..a0540bd8be 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190406))" + VALUE "ProductVersion", "(7.0NG.733(Build 190407))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d078f84cec..424aec1a3f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190406 +Version: 7.0NG.733-190407 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 079ae70b3d..de925a4f9e 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190406" +pandora_version="7.0NG.733-190407" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6b480bd26f..706c9c8684 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190406'; +$build_version = 'PC190407'; $pandora_version = 'v7.0NG.733'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e09c554f22..2ccb08c6b6 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index daf2635951..c1b95c0cb4 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190406 +%define release 190407 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 1645a3510b..e616cc14c0 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190406 +%define release 190407 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 1590b9d6b3..f68e9e035f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190406" +PI_BUILD="190407" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d7b001478f..4cfeb6373b 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.733 PS190406"; +my $version = "7.0NG.733 PS190407"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 43a7a6d9ff..7c1fb0c5a3 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.733 PS190406"; +my $version = "7.0NG.733 PS190407"; # save program name for logging my $progname = basename($0); From 9fd5d3bf5a2ac386f7ab020a589b76a459e74516 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 8 Apr 2019 00:01:23 +0200 Subject: [PATCH 14/18] Auto-updated build strings. Former-commit-id: 0ec578931463f0c72468bd36a22842e1c3ada363 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0ba57c7902..54ebf8cf07 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190407 +Version: 7.0NG.733-190408 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 93a29f90b8..524dc594b4 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190407" +pandora_version="7.0NG.733-190408" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 86c26d5b26..140d575a32 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190407'; +use constant AGENT_BUILD => '190408'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 904efc721c..8507c645a4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190407 +%define release 190408 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a7388d91b9..e0ba5a19a2 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190407 +%define release 190408 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 4a7736fc3e..b288c50b15 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190407" +PI_BUILD="190408" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1e4bb5b516..ab12a0570e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190407} +{190408} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3588a12122..9a24e535b1 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190407)") +#define PANDORA_VERSION ("7.0NG.733(Build 190408)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a0540bd8be..06f8499446 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190407))" + VALUE "ProductVersion", "(7.0NG.733(Build 190408))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 424aec1a3f..7c24a49d3e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190407 +Version: 7.0NG.733-190408 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index de925a4f9e..a47506ca13 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190407" +pandora_version="7.0NG.733-190408" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 706c9c8684..5991d4c623 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190407'; +$build_version = 'PC190408'; $pandora_version = 'v7.0NG.733'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2ccb08c6b6..f8b3e72857 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index c1b95c0cb4..d182fb20e1 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190407 +%define release 190408 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e616cc14c0..92060413e7 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190407 +%define release 190408 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index f68e9e035f..ab8fcc39f1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190407" +PI_BUILD="190408" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 4cfeb6373b..ec41f419f5 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.733 PS190407"; +my $version = "7.0NG.733 PS190408"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 7c1fb0c5a3..9fd1fa1c02 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.733 PS190407"; +my $version = "7.0NG.733 PS190408"; # save program name for logging my $progname = basename($0); From 0d05d5c8425d1d5d4004d32855ab19133bb15382 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 9 Apr 2019 00:01:31 +0200 Subject: [PATCH 15/18] Auto-updated build strings. Former-commit-id: dc883b86ccb845e022637413e334d4886805bc6b --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 54ebf8cf07..b0f0461a88 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190408 +Version: 7.0NG.733-190409 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 524dc594b4..02db73fe56 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190408" +pandora_version="7.0NG.733-190409" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 140d575a32..d97872c6f4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190408'; +use constant AGENT_BUILD => '190409'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 8507c645a4..07f1be162c 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190408 +%define release 190409 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index e0ba5a19a2..6c6de13829 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190408 +%define release 190409 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index b288c50b15..2135af1d06 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190408" +PI_BUILD="190409" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ab12a0570e..9f0e4bd92a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190408} +{190409} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9a24e535b1..7864892980 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190408)") +#define PANDORA_VERSION ("7.0NG.733(Build 190409)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 06f8499446..0a7a254710 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190408))" + VALUE "ProductVersion", "(7.0NG.733(Build 190409))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7c24a49d3e..65e114ca98 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190408 +Version: 7.0NG.733-190409 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index a47506ca13..397b82a4b9 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190408" +pandora_version="7.0NG.733-190409" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 5991d4c623..f19760ef18 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190408'; +$build_version = 'PC190409'; $pandora_version = 'v7.0NG.733'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f8b3e72857..0bb26e8b29 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index d182fb20e1..4cc5b4b396 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190408 +%define release 190409 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 92060413e7..a52f0d47ae 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190408 +%define release 190409 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index ab8fcc39f1..004a322043 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190408" +PI_BUILD="190409" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ec41f419f5..49099dd208 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.733 PS190408"; +my $version = "7.0NG.733 PS190409"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9fd1fa1c02..1c62f4232f 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.733 PS190408"; +my $version = "7.0NG.733 PS190409"; # save program name for logging my $progname = basename($0); From 3e4a7bfdbf4bf5864b75e6c4362fb9b03bd56d43 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 9 Apr 2019 09:51:03 +0200 Subject: [PATCH 16/18] fixed error autocomplete input module Former-commit-id: c9fca2ba51b3b0872d39e658f18c5d3c5e917dbd --- pandora_console/include/functions_html.php | 28 ++-------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 4a24d5a964..30b86478f8 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2744,28 +2744,7 @@ function html_print_autocomplete_modules( global $config; if ($id_agents === false) { - $groups = []; - if ($ACL) { - $groups = users_get_groups($config['id_user'], 'AW', false); - $groups = array_keys($groups); - - if (empty($groups)) { - $id_groups = 0; - } else { - $id_groups = implode(',', $groups); - } - - $agents = db_get_all_rows_sql( - 'SELECT id_agente - FROM tagente - WHERE id_grupo IN ('.$id_groups.')' - ); - } else { - $agents = db_get_all_rows_sql( - 'SELECT id_agente - FROM tagente' - ); - } + $agents = agents_get_agents(); if ($agents === false) { $agents = []; @@ -2777,10 +2756,7 @@ function html_print_autocomplete_modules( } } else { if ($ACL) { - $groups = users_get_groups($config['id_user'], 'AW', false); - $groups = array_keys($groups); - - $agents = db_get_all_rows_sql('SELECT id_agente FROM tagente WHERE id_grupo IN ('.implode(',', $groups).')'); + $agents = agents_get_agents(); if ($agents === false) { $agents = []; From 6585a4736b73f74c1a48d2cf6e36c05450f9dcb3 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 9 Apr 2019 10:19:51 +0200 Subject: [PATCH 17/18] fixed minor error local companent with keep counters Former-commit-id: f9864be72f448885b2da118585f1bbb92319bd18 --- pandora_console/include/javascript/pandora_modules.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 7d81facfe8..d6a8e1bfe0 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -184,7 +184,12 @@ function configure_modules_form() { data["min_ff_event"] == 0 ? 0 : data["min_ff_event"] ); - $("#checkbox-ff_type").prop("checked", data["ff_type"]); + if (data["ff_type"] != 0) { + $("#checkbox-ff_type").prop("checked", 1); + } else { + $("#checkbox-ff_type").prop("checked", 0); + } + $("#text-post_process").attr( "value", data["post_process"] == 0 ? 0 : data["post_process"] From 765ca945a0d93f7cc7712de0609b7c459393ffb1 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 10 Apr 2019 00:01:25 +0200 Subject: [PATCH 18/18] Auto-updated build strings. Former-commit-id: d69449b4f4ca214bdd3e37e660e0c8d7f0dc9817 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b0f0461a88..b195339553 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.733-190409 +Version: 7.0NG.733-190410 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 02db73fe56..4608351263 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190409" +pandora_version="7.0NG.733-190410" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 23c8e5a328..7e4da86bfd 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.733'; -use constant AGENT_BUILD => '190409'; +use constant AGENT_BUILD => '190410'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 07f1be162c..06214821b2 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190409 +%define release 190410 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 6c6de13829..5c88e01c6b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.733 -%define release 190409 +%define release 190410 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 2135af1d06..83e1fc3cdd 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190409" +PI_BUILD="190410" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9f0e4bd92a..fc121aea1e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190409} +{190410} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7864892980..a270672ab4 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.733(Build 190409)") +#define PANDORA_VERSION ("7.0NG.733(Build 190410)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 0a7a254710..4ad9ae2aec 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.733(Build 190409))" + VALUE "ProductVersion", "(7.0NG.733(Build 190410))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 65e114ca98..f5e1c15e3a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.733-190409 +Version: 7.0NG.733-190410 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 397b82a4b9..95de63e21a 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.733-190409" +pandora_version="7.0NG.733-190410" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f19760ef18..f312ae2e7d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190409'; +$build_version = 'PC190410'; $pandora_version = 'v7.0NG.733'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0bb26e8b29..454ee879b9 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 4cc5b4b396..2fa2a2ccfc 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190409 +%define release 190410 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a52f0d47ae..02befd3046 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.733 -%define release 190409 +%define release 190410 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 004a322043..f4def92b06 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.733" -PI_BUILD="190409" +PI_BUILD="190410" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 49099dd208..56dad39390 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.733 PS190409"; +my $version = "7.0NG.733 PS190410"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1c62f4232f..b0715d5029 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.733 PS190409"; +my $version = "7.0NG.733 PS190410"; # save program name for logging my $progname = basename($0);