From 829ca31e883561250495b77b889cc8fe70fb50aa Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 20 Oct 2021 10:52:40 +0200 Subject: [PATCH 01/12] #8114 Fixed history_data --- pandora_server/lib/PandoraFMS/Core.pm | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index ca6be12607..22452ca529 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4469,18 +4469,28 @@ sub on_demand_macro($$$$$$;$) { my $field_number = $1; my $id_mod = get_db_value ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ? AND nombre = ?', $module->{'id_agente'}, $field_number); - my $type_mod = get_db_value ($dbh, 'SELECT id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod); - my $unit_mod = get_db_value ($dbh, 'SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod); + my $module_data = get_db_single_row ($dbh, 'SELECT id_tipo_modulo, unit, history_data FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod); + my $type_mod = $module_data->{'id_tipo_modulo'}; + my $unit_mod = $module_data->{'unit'}; + my $history_data = $module_data->{'history_data'}; my $field_value = ""; if (defined($type_mod) - && ($type_mod eq 3 || $type_mod eq 23|| $type_mod eq 17 || $type_mod eq 10 || $type_mod eq 33 ) + && ($type_mod eq 3 || $type_mod eq 10 || $type_mod eq 17 || $type_mod eq 23 || $type_mod eq 33 || $type_mod eq 36) ) { - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos_string where id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); + if (defined($history_data) && $history_data eq 0 ) { + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); + } else { + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos_string WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); + } } else{ - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos where id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); - + if (defined($history_data) && $history_data eq 0 ) { + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); + } else { + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); + } + my $data_precision = $pa_config->{'graph_precision'}; $field_value = sprintf("%.$data_precision" . "f", $field_value); $field_value =~ s/0+$//; From bbbbbdd2bc7138bd98f52e82d21ffdd5ef08def5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 20 Oct 2021 14:50:47 +0200 Subject: [PATCH 02/12] #8114 remove history_data --- pandora_server/lib/PandoraFMS/Core.pm | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 22452ca529..6fb8abdb84 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4467,29 +4467,20 @@ sub on_demand_macro($$$$$$;$) { return(defined($field_value)) ? $field_value : ''; } elsif ($macro =~ /_moduledata_(\S+)_/) { my $field_number = $1; - + my $id_mod = get_db_value ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ? AND nombre = ?', $module->{'id_agente'}, $field_number); - my $module_data = get_db_single_row ($dbh, 'SELECT id_tipo_modulo, unit, history_data FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod); + my $module_data = get_db_single_row ($dbh, 'SELECT id_tipo_modulo, unit FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod); my $type_mod = $module_data->{'id_tipo_modulo'}; my $unit_mod = $module_data->{'unit'}; - my $history_data = $module_data->{'history_data'}; my $field_value = ""; if (defined($type_mod) && ($type_mod eq 3 || $type_mod eq 10 || $type_mod eq 17 || $type_mod eq 23 || $type_mod eq 33 || $type_mod eq 36) ) { - if (defined($history_data) && $history_data eq 0 ) { - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); - } else { - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos_string WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); - } + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); } else{ - if (defined($history_data) && $history_data eq 0 ) { - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); - } else { - $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod); - } + $field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod); my $data_precision = $pa_config->{'graph_precision'}; $field_value = sprintf("%.$data_precision" . "f", $field_value); From 4dd931f2772491f3d0adfd053e85093de573f594 Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 24 Nov 2021 11:33:36 +0100 Subject: [PATCH 03/12] Modules percentage threshold form --- pandora_console/extras/mr/51.sql | 16 + .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 20 + .../godmode/agentes/agent_template.php | 2 + .../godmode/agentes/configurar_agente.php | 6 + .../godmode/agentes/module_manager.php | 2 + .../godmode/agentes/module_manager_editor.php | 8 + .../agentes/module_manager_editor_common.php | 16 + .../godmode/massive/massive_edit_modules.php | 49 +++ .../modules/manage_network_components.php | 7 + .../manage_network_components_form.php | 6 + .../manage_network_components_form_common.php | 14 + .../manage_network_components_form_wizard.php | 5 + .../include/class/AgentWizard.class.php | 383 +++++++++++------- .../include/functions_network_components.php | 2 + .../include/functions_snmp_browser.php | 6 + .../include/javascript/pandora_modules.js | 21 + pandora_console/include/styles/wizard.css | 6 + pandora_console/pandoradb.sql | 8 + 18 files changed, 434 insertions(+), 143 deletions(-) create mode 100644 pandora_console/extras/mr/51.sql diff --git a/pandora_console/extras/mr/51.sql b/pandora_console/extras/mr/51.sql new file mode 100644 index 0000000000..7449c0abc2 --- /dev/null +++ b/pandora_console/extras/mr/51.sql @@ -0,0 +1,16 @@ +START TRANSACTION; + +ALTER TABLE `tagente_modulo` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tagente_modulo` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tlocal_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tlocal_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; + + + + + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 99ccb20643..579cf37b51 100644 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -172,6 +172,8 @@ ALTER TABLE tagente_modulo ADD COLUMN `dynamic_min` bigint(20) default '0'; ALTER TABLE tagente_modulo ADD COLUMN `prediction_sample_window` int(10) default 0; ALTER TABLE tagente_modulo ADD COLUMN `prediction_samples` int(4) default 0; ALTER TABLE tagente_modulo ADD COLUMN `prediction_threshold` int(4) default 0; +ALTER TABLE tagente_modulo ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE tagente_modulo ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; -- --------------------------------------------------------------------- -- Table `tagente_estado` @@ -189,3 +191,21 @@ ALTER TABLE tgraph_source ADD COLUMN `id_server` int(11) NOT NULL default 0; -- --------------------------------------------------------------------- ALTER TABLE tevent_filter ADD COLUMN `id_agent_module` int(25) DEFAULT 0; ALTER TABLE tevent_filter ADD COLUMN `id_agent` int(25) DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `tevent_filter` +-- --------------------------------------------------------------------- +ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `tevent_filter` +-- --------------------------------------------------------------------- +ALTER TABLE `tlocal_component` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tlocal_component` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; + +-- --------------------------------------------------------------------- +-- Table `tevent_filter` +-- --------------------------------------------------------------------- +ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tpolicy_modules` ADD COLUMN `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0; diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 20edd4e555..31e6de29b5 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -96,6 +96,8 @@ if (isset($_POST['template_id'])) { 'str_critical' => $row2['str_critical'], 'critical_inverse' => $row2['critical_inverse'], 'warning_inverse' => $row2['warning_inverse'], + 'percentage_warning' => $row2['percentage_warning'], + 'percentage_critical' => $row2['percentage_critical'], 'critical_instructions' => $row2['critical_instructions'], 'warning_instructions' => $row2['warning_instructions'], 'unknown_instructions' => $row2['unknown_instructions'], diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7383ba4506..b9304f4d2d 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1541,6 +1541,8 @@ if ($update_module || $create_module) { $unknown_instructions = (string) get_parameter('unknown_instructions'); $critical_inverse = (int) get_parameter('critical_inverse'); $warning_inverse = (int) get_parameter('warning_inverse'); + $percentage_critical = (int) get_parameter('percentage_critical'); + $percentage_warning = (int) get_parameter('percentage_warning'); $id_category = (int) get_parameter('id_category'); @@ -1694,6 +1696,8 @@ if ($update_module) { 'unknown_instructions' => $unknown_instructions, 'critical_inverse' => $critical_inverse, 'warning_inverse' => $warning_inverse, + 'percentage_critical' => $percentage_critical, + 'percentage_warning' => $percentage_warning, 'cron_interval' => $cron_interval, 'id_category' => $id_category, 'disabled_types_event' => addslashes($disabled_types_event), @@ -1900,6 +1904,8 @@ if ($create_module) { 'unknown_instructions' => $unknown_instructions, 'critical_inverse' => $critical_inverse, 'warning_inverse' => $warning_inverse, + 'percentage_critical' => $percentage_critical, + 'percentage_warning' => $percentage_warning, 'cron_interval' => $cron_interval, 'id_category' => $id_category, 'disabled_types_event' => addslashes($disabled_types_event), diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index f8bbc7802a..e8805a7adc 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -704,6 +704,8 @@ if ((bool) $checked === true) { 'quiet', 'critical_inverse', 'warning_inverse', + 'percentage_critical', + 'percentage_warning', 'id_policy_module', ] ); diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 1310fa80bb..c4e62816cb 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -99,6 +99,9 @@ if (is_ajax()) { $component['str_critical'] = io_safe_output($component['str_critical']); $component['warning_inverse'] = (bool) $component['warning_inverse']; $component['critical_inverse'] = (bool) $component['critical_inverse']; + $component['percentage_warning'] = (bool) $component['percentage_warning']; + $component['percentage_critical'] = (bool) $component['percentage_critical']; + echo io_json_mb_encode($component); return; @@ -328,6 +331,9 @@ if ($id_agent_module) { $critical_inverse = $module['critical_inverse']; $warning_inverse = $module['warning_inverse']; + $percentage_critical = $module['percentage_critical']; + $percentage_warning = $module['percentage_warning']; + $id_category = $module['id_category']; @@ -467,6 +473,8 @@ if ($id_agent_module) { $critical_inverse = ''; $warning_inverse = ''; + $percentage_critical = ''; + $percentage_warning = ''; $each_ff = 0; $ff_event_normal = ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index d64d2662fb..7f97a7d1ec 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -459,6 +459,12 @@ if (modules_is_string_type($id_module_type) || $edit) { $table_simple->data[2][1] .= '
'.__('Inverse interval').''; $table_simple->data[2][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true, $disabledBecauseInPolicy); +if (modules_is_string_type($id_module_type) === false) { + $table_simple->data[2][1] .= '
'.__('Percentage').''; + $table_simple->data[2][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true, $disabledBecauseInPolicy); + $table_simple->data[2][1] .= '
'; +} + if (!modules_is_string_type($id_module_type) || $edit) { $table_simple->data[2][2] = ' '; } @@ -512,6 +518,12 @@ if (modules_is_string_type($id_module_type) || $edit) { $table_simple->data[3][1] .= '
'.__('Inverse interval').''; $table_simple->data[3][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy); +if (modules_is_string_type($id_module_type) === false) { + $table_simple->data[3][1] .= '
'.__('Percentage').''; + $table_simple->data[3][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true, $disabledBecauseInPolicy); + $table_simple->data[3][1] .= '
'; +} + $table_simple->data[4][0] = __('Historical data'); if ($disabledBecauseInPolicy) { // If is disabled, we send a hidden in his place and print a false @@ -1551,6 +1563,8 @@ $(document).ready (function () { $('#minmax_critical').show(); $('#minmax_warning').show(); $('#svg_dinamic').show(); + $('#percentage_warning').show(); + $('#percentage_critical').show(); } else { // String types @@ -1559,6 +1573,8 @@ $(document).ready (function () { $('#minmax_critical').hide(); $('#minmax_warning').hide(); $('#svg_dinamic').hide(); + $('#percentage_warning').hide(); + $('#percentage_critical').hide(); } if (type_name_selected.match(/async/) == null) { diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index e64abcd413..ba1e7e7869 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -613,6 +613,26 @@ $table->data['edit1'][1] = ''; ); $table->data['edit1'][1] .= ''; $table->data['edit1'][1] .= ''; + $table->data['edit1'][1] .= ''; + $table->data['edit1'][1] .= ''; + $table->data['edit1'][1] .= ''; + $table->data['edit1'][1] .= ''; $table->data['edit1'][1] .= '
'; + $table->data['edit1'][1] .= ''.__('Percentage').''; + $table->data['edit1'][1] .= ''; + $table->data['edit1'][1] .= html_print_select( + [ + '' => __('No change'), + '1' => __('Yes'), + '0' => __('No'), + ], + 'percentage_warning', + '', + '', + '', + '', + true + ); + $table->data['edit1'][1] .= '
'; $table->data['edit1'][2] = __('Critical status'); @@ -682,6 +702,27 @@ $table->data['edit1'][1] = ''; ); $table->data['edit1'][3] .= ''; $table->data['edit1'][3] .= ''; + + $table->data['edit1'][3] .= ''; + $table->data['edit1'][3] .= ''; + $table->data['edit1'][3] .= ''; + $table->data['edit1'][3] .= ''; $table->data['edit1'][3] .= '
'; + $table->data['edit1'][3] .= ''.__('Percentage').''; + $table->data['edit1'][3] .= ''; + $table->data['edit1'][3] .= html_print_select( + [ + '' => __('No change'), + '1' => __('Yes'), + '0' => __('No'), + ], + 'percentage_critical', + '', + '', + '', + '', + true + ); + $table->data['edit1'][3] .= '
'; $table->data['edit1_1'][0] = ''.__('Description').''; @@ -1571,6 +1612,12 @@ $(document).ready (function () { else if (this.id == "checkbox-warning_inverse") { return; //Do none } + else if (this.id == "checkbox-percentage_critical") { + return; //Do none + } + else if (this.id == "checkbox-percentage_warning") { + return; //Do none + } else if (this.id == "checkbox-critical_inverse") { return; //Do none } @@ -1950,6 +1997,8 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' 'history_data', 'critical_inverse', 'warning_inverse', + 'percentage_warning', + 'percentage_critical', 'critical_instructions', 'warning_instructions', 'unknown_instructions', diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 4b3fdab1be..4ab509dbc0 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -130,6 +130,9 @@ $warning_instructions = (string) get_parameter('warning_instructions'); $unknown_instructions = (string) get_parameter('unknown_instructions'); $critical_inverse = (int) get_parameter('critical_inverse'); $warning_inverse = (int) get_parameter('warning_inverse'); +$percentage_critical = (int) get_parameter('percentage_critical'); +$percentage_warning = (int) get_parameter('percentage_warning'); + $id_category = (int) get_parameter('id_category'); $id_tag_selected = (array) get_parameter('id_tag_selected'); $pure = get_parameter('pure', 0); @@ -383,6 +386,8 @@ if ($is_management_allowed === true && $create_component) { 'unknown_instructions' => $unknown_instructions, 'critical_inverse' => $critical_inverse, 'warning_inverse' => $warning_inverse, + 'percentage_warning' => $percentage_warning, + 'percentage_critical' => $percentage_critical, 'id_category' => $id_category, 'tags' => $tags, 'disabled_types_event' => $disabled_types_event, @@ -482,6 +487,8 @@ if ($is_management_allowed === true && $update_component) { 'unknown_instructions' => $unknown_instructions, 'critical_inverse' => $critical_inverse, 'warning_inverse' => $warning_inverse, + 'percentage_warning' => $percentage_warning, + 'percentage_critical' => $percentage_critical, 'id_category' => $id_category, 'tags' => $tags, 'disabled_types_event' => $disabled_types_event, diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 6776316d54..b26af8bbbe 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -93,6 +93,8 @@ if ($create_network_from_module) { $unknown_instructions = $data_module['unknown_instructions']; $critical_inverse = $data_module['critical_inverse']; $warning_inverse = $data_module['warning_inverse']; + $percentage_critical = $data_module['percentage_critical']; + $percentage_warning = $data_module['percentage_warning']; $id_category = $data_module['id_category']; $ff_event_normal = $data_module['min_ff_event_normal']; $ff_event_warning = $data_module['min_ff_event_warning']; @@ -150,7 +152,9 @@ if (isset($id)) { $warning_instructions = $component['warning_instructions']; $unknown_instructions = $component['unknown_instructions']; $critical_inverse = $component['critical_inverse']; + $percentage_critical = $component['percentage_critical']; $warning_inverse = $component['warning_inverse']; + $percentage_warning = $component['percentage_warning']; $id_category = $component['id_category']; $tags = $component['tags']; $ff_event_normal = $component['min_ff_event_normal']; @@ -233,6 +237,8 @@ if (isset($id)) { $unknown_instructions = ''; $critical_inverse = 0; $warning_inverse = 0; + $percentage_critical = 0; + $percentage_warning = 0; $id_category = 0; $tags = ''; $ff_event_normal = 0; 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 d6d6a3ed46..c10b48a4f0 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -188,6 +188,10 @@ $table->data[4][1] .= html_print_input_text( $table->data[4][1] .= '
'.__('Inverse interval').''; $table->data[4][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); +$table->data[4][1] .= '
'.__('Percentage').''; +$table->data[4][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); +$table->data[4][1] .= '
'; + $table->data[4][2] = ' '; $table->colspan[4][2] = 2; $table->rowspan[4][2] = 3; @@ -223,6 +227,11 @@ $table->data[5][1] .= html_print_input_text( $table->data[5][1] .= '
'.__('Inverse interval').''; $table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); +$table->data[5][1] .= '
'.__('Percentage').''; +$table->data[5][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); +$table->data[5][1] .= '
'; + + $table->data[6][0] = __('FF threshold'); $table->colspan[6][1] = 3; @@ -518,6 +527,9 @@ $next_row++; $('#string_warning').hide(); $('#minmax_critical').show(); $('#minmax_warning').show(); + $('#percentage_warning').show(); + $('#percentage_critical').show(); + } else { // String types @@ -525,6 +537,8 @@ $next_row++; $('#string_warning').show(); $('#minmax_critical').hide(); $('#minmax_warning').hide(); + $('#percentage_warning').hide(); + $('#percentage_critical').hide(); } }); diff --git a/pandora_console/godmode/modules/manage_network_components_form_wizard.php b/pandora_console/godmode/modules/manage_network_components_form_wizard.php index 4ee77bafb5..9c2ec3c27d 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_wizard.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wizard.php @@ -391,6 +391,8 @@ $data[1] .= html_print_input_text('str_warning', $str_warning, '', 5, 1024, true // Warning inverse values. $data[1] .= '
'.__('Inverse interval').' '; $data[1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); +$data[1] .= '
'.__('Percentage').' '; +$data[1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); $data[2] = ' '; $table->colspan['warning-svg-row'][2] = 2; @@ -427,6 +429,9 @@ $data[1] .= html_print_input_text('str_critical', $str_critical, '', 5, 1024, tr // Critical inverse values. $data[1] .= '
'.__('Inverse interval').' '; $data[1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); +$data[1] .= '
'.__('Percentage').' '; +$data[1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); + push_table_row($data, 'critical-row'); diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 13e4264e23..f6b7afdd97 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -1441,6 +1441,10 @@ class AgentWizard extends HTML $result[$value]['criticalInv'] = $data[$k]; } else if (empty(preg_match('/module-warning-inv/', $k)) === false) { $result[$value]['warningInv'] = $data[$k]; + } else if (empty(preg_match('/module-warning-perc/', $k)) === false) { + $result[$value]['warningPerc'] = $data[$k.'_sent']; + } else if (empty(preg_match('/module-critical-perc/', $k)) === false) { + $result[$value]['criticalPerc'] = $data[$k.'_sent']; } else if (empty(preg_match('/module-type/', $k)) === false) { $result[$value]['moduleType'] = $data[$k]; } else if (empty(preg_match('/module-unit/', $k)) === false) { @@ -1856,6 +1860,8 @@ class AgentWizard extends HTML $values['max_warning'] = $candidate['warningMax']; $values['min_critical'] = $candidate['criticalMin']; $values['max_critical'] = $candidate['criticalMax']; + $values['percentage_warning'] = $candidate['warningPerc']; + $values['percentage_critical'] = $candidate['criticalPerc']; } $values['warning_inverse'] = $candidate['warningInv']; @@ -2292,6 +2298,8 @@ class AgentWizard extends HTML $tmp->max_warning($candidate['warningMax']); $tmp->min_critical($candidate['criticalMin']); $tmp->max_critical($candidate['criticalMax']); + $tmp->percentage_warning($candidate['warningPerc']); + $tmp->percentage_critical($candidate['criticalPerc']); } $tmp->warning_inverse($candidate['warningInv']); @@ -2457,6 +2465,8 @@ class AgentWizard extends HTML 'min_critical' => $moduleData['module_thresholds']['min_critical'], 'max_critical' => $moduleData['module_thresholds']['max_critical'], 'inv_critical' => $moduleData['module_thresholds']['inv_critical'], + 'perc_warning' => $moduleData['module_thresholds']['perc_warning'], + 'perc_critical' => $moduleData['module_thresholds']['perc_critical'], 'module_enabled' => $moduleData['default_enabled'], 'name_oid' => $moduleData['value'], 'value' => $moduleData['value'], @@ -2636,6 +2646,8 @@ class AgentWizard extends HTML 'min_critical' => $moduleData['module_thresholds']['min_critical'], 'max_critical' => $moduleData['module_thresholds']['max_critical'], 'inv_critical' => $moduleData['module_thresholds']['inv_critical'], + 'perc_warning' => $moduleData['module_thresholds']['perc_warning'], + 'perc_critical' => $moduleData['module_thresholds']['perc_critical'], 'module_enabled' => $moduleData['module_enabled'], 'current_value' => $currentValue, 'name_oid' => $moduleData['value'], @@ -3280,6 +3292,8 @@ class AgentWizard extends HTML nc.min_critical, nc.max_critical, nc.critical_inverse AS `inv_critical`, + nc.percentage_warning AS `perc_warning`, + nc.percentage_critical AS `perc_critical`, nc.module_enabled, %s, nc.scan_type, @@ -3867,9 +3881,11 @@ class AgentWizard extends HTML $table->width = '100%'; $table->class = 'info_table'; // Subheaders for Warning and Critical columns. - $subheaders = 'Min.'; - $subheaders .= 'Max.'; - $subheaders .= 'Inv.'; + $subheaders = 'Min.'; + $subheaders .= 'Max.'; + $subheaders .= 'Inv.'; + $subheaders .= '%.'; + // Warning header. $warning_header = html_print_div( [ @@ -4081,7 +4097,7 @@ class AgentWizard extends HTML ); $data_warning .= html_print_div( [ - 'class' => 'wizard-column-levels', + 'class' => 'wizard-column-levels-check', 'style' => 'margin-top: 0.3em;', 'content' => html_print_checkbox( 'module-warning-inv-'.$uniqueId, @@ -4096,6 +4112,23 @@ class AgentWizard extends HTML ], true ); + $data_warning .= html_print_div( + [ + 'class' => 'wizard-column-levels-check', + 'style' => 'margin-top: 0.3em;', + 'content' => html_print_checkbox( + 'module-warning-perc-'.$uniqueId, + $module['perc_warning'], + $module['perc_warning'], + true, + false, + '', + false, + 'form="form-create-modules"' + ), + ], + true + ); $data[3] = $data_warning; // Critical column. $data[4] = ''; @@ -4148,7 +4181,7 @@ class AgentWizard extends HTML $data[4] .= html_print_div( [ - 'class' => 'wizard-column-levels', + 'class' => 'wizard-column-levels-check', 'style' => 'margin-top: 0.3em;', 'content' => html_print_checkbox( 'module-critical_inv_'.$uniqueId, @@ -4164,6 +4197,24 @@ class AgentWizard extends HTML true ); + $data[4] .= html_print_div( + [ + 'class' => 'wizard-column-levels-check', + 'style' => 'margin-top: 0.3em;', + 'content' => html_print_checkbox( + 'module-critical-perc-'.$uniqueId, + $module['perc_critical'], + $module['perc_critical'], + true, + false, + '', + false, + 'form="form-create-modules"' + ), + ], + true + ); + if (is_string($module['module_enabled']) === true) { if ($module['module_enabled'] === false || $module['module_enabled'] === '0') { $module['module_enabled'] = false; @@ -4528,12 +4579,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => $min_warning, - 'max_warning' => $max_warning, - 'inv_warning' => $inv_warning, - 'min_critical' => $min_critical, - 'max_critical' => $max_critical, - 'inv_critical' => $inv_critical, + 'min_warning' => $min_warning, + 'max_warning' => $max_warning, + 'inv_warning' => $inv_warning, + 'min_critical' => $min_critical, + 'max_critical' => $max_critical, + 'inv_critical' => $inv_critical, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -4583,12 +4636,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -4635,12 +4690,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => $minc, - 'max_critical' => $maxc, - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => $minc, + 'max_critical' => $maxc, + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; } @@ -4723,12 +4780,14 @@ class AgentWizard extends HTML 'module_enabled' => false, 'module_unit' => '%', 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '85', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '85', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -4760,12 +4819,14 @@ class AgentWizard extends HTML 'module_enabled' => false, 'module_unit' => '%', 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -4797,12 +4858,14 @@ class AgentWizard extends HTML 'module_enabled' => false, 'module_unit' => '%', 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; } @@ -4826,12 +4889,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfInDiscards. @@ -4851,12 +4916,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfOutDiscards. @@ -4876,12 +4943,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfInErrors. @@ -4901,12 +4970,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfOutErrors. @@ -4926,12 +4997,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -4994,12 +5067,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5020,12 +5095,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5046,12 +5123,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfOutUcastPkts. @@ -5071,12 +5150,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfInNUcastPkts. @@ -5096,12 +5177,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfOutNUcastPkts. @@ -5121,12 +5204,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5189,12 +5274,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5215,12 +5302,14 @@ class AgentWizard extends HTML 'default_enabled' => true, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5241,12 +5330,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; @@ -5267,12 +5358,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfHCInNUcastPkts. @@ -5292,12 +5385,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; // IfOutNUcastPkts. @@ -5317,12 +5412,14 @@ class AgentWizard extends HTML 'default_enabled' => false, 'module_enabled' => false, 'module_thresholds' => [ - 'min_warning' => '0', - 'max_warning' => '0', - 'inv_warning' => false, - 'min_critical' => '0', - 'max_critical' => '0', - 'inv_critical' => false, + 'min_warning' => '0', + 'max_warning' => '0', + 'inv_warning' => false, + 'min_critical' => '0', + 'max_critical' => '0', + 'inv_critical' => false, + 'perc_warning' => false, + 'perc_critical' => false, ], ]; diff --git a/pandora_console/include/functions_network_components.php b/pandora_console/include/functions_network_components.php index d85f6d4251..25542ec4bf 100644 --- a/pandora_console/include/functions_network_components.php +++ b/pandora_console/include/functions_network_components.php @@ -532,6 +532,8 @@ function network_components_create_module_from_network_component($id_network_com 'min_ff_event', 'critical_inverse', 'warning_inverse', + 'percentage_warning', + 'percentage_critical', 'module_critical_instructions', 'module_warning_instructions', 'module_unknown_instructions', diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 10bd84ae14..bc0d48137f 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -1279,6 +1279,8 @@ function snmp_browser_create_modules_snmp( 'unknown_instructions' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, + 'percentage_warning' => 0, + 'percentage_critical' => 0, 'id_category' => 0, 'tags' => '', 'disabled_types_event' => '{"going_unknown":1}', @@ -1336,6 +1338,8 @@ function snmp_browser_create_modules_snmp( 'unknown_instructions' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, + 'percentage_warning' => 0, + 'percentage_critical' => 0, 'id_category' => 0, 'disabled_types_event' => '{"going_unknown":1}', 'min_ff_event_normal' => 0, @@ -1394,6 +1398,8 @@ function snmp_browser_create_modules_snmp( 'unknown_instructions' => '', 'critical_inverse' => 0, 'warning_inverse' => 0, + 'percentage_warning' => 0, + 'percentage_critical' => 0, 'id_category' => 0, 'disabled_types_event' => '{"going_unknown":1}', 'min_ff_event_normal' => 0, diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index d1b4df6ea5..4a2361d050 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -105,6 +105,8 @@ function configure_modules_form() { $("#text-unit").attr("value", ""); $("#checkbox-critical_inverse").attr("value", 0); $("#checkbox-warning_inverse").attr("value", 0); + $("#checkbox-percentage_warning").attr("value", 0); + $("#checkbox-percentage_critical").attr("value", 0); $("#checkbox-ff_type").attr("value", 0); $("#textarea_critical_instructions").attr("value", ""); $("#textarea_warning_instructions").attr("value", ""); @@ -205,6 +207,16 @@ function configure_modules_form() { data["critical_inverse"] ); $("#checkbox-warning_inverse").prop("uncheck", data["warning_inverse"]); + + $("#checkbox-percentage_warning").prop( + "uncheck", + data["percentage_warning"] + ); + $("#checkbox-percentage_critical").prop( + "uncheck", + data["percentage_critical"] + ); + $("#component_loading").hide(); $("#id_module_type").change(); if ($("#id_category").is("select")) { @@ -464,6 +476,15 @@ function configure_modules_form() { data["critical_inverse"] ); $("#checkbox-warning_inverse").prop("checked", data["warning_inverse"]); + $("#checkbox-percentage_warning").prop( + "uncheck", + data["percentage_warning"] + ); + $("#checkbox-percentage_critical").prop( + "uncheck", + data["percentage_critical"] + ); + $("#component_loading").hide(); $("#id_module_type").change(); if ($("#id_category").is("select")) { diff --git a/pandora_console/include/styles/wizard.css b/pandora_console/include/styles/wizard.css index e47bc9d2ca..4f55f19e3e 100644 --- a/pandora_console/include/styles/wizard.css +++ b/pandora_console/include/styles/wizard.css @@ -148,6 +148,12 @@ ul.wizard li > textarea { text-align: center; } +.wizard-column-levels-check { + float: left; + width: 17%; + text-align: center; +} + .action_button_list { height: 60px; } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index d8cb8d1d0b..80744b632d 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -267,6 +267,8 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( `parent_module_id` int(10) unsigned NOT NULL default 0, `cps` int NOT NULL default 0, `debug_content` varchar(200), + `percentage_critical` tinyint(1) unsigned default '0', + `percentage_warning` tinyint(1) unsigned default '0', PRIMARY KEY (`id_agente_modulo`), KEY `main_idx` (`id_agente_modulo`,`id_agente`), KEY `tam_agente` (`id_agente`), @@ -982,6 +984,8 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` ( `scan_filters` text NOT NULL, `query_filters` text NOT NULL, `enabled` tinyint(1) UNSIGNED DEFAULT 1, + `percentage_critical` tinyint(1) unsigned default '0', + `percentage_warning` tinyint(1) unsigned default '0', PRIMARY KEY (`id_nc`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -2420,6 +2424,8 @@ CREATE TABLE IF NOT EXISTS `tlocal_component` ( `prediction_sample_window` int(10) default 0, `prediction_samples` int(4) default 0, `prediction_threshold` int(4) default 0, + `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0, + `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0, PRIMARY KEY (`id`), FOREIGN KEY (`id_network_component_group`) REFERENCES tnetwork_component_group(`id_sg`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2500,6 +2506,8 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `prediction_samples` int(4) default 0, `prediction_threshold` int(4) default 0, `cps` int NOT NULL DEFAULT 0, + `percentage_warning` tinyint(1) UNSIGNED DEFAULT 0, + `percentage_critical` tinyint(1) UNSIGNED DEFAULT 0, PRIMARY KEY (`id`), KEY `main_idx` (`id_policy`), UNIQUE (`id_policy`, `name`) From 33a24533e1f49dbe8ebb261961b46f35ae00f69d Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 24 Nov 2021 13:27:33 +0100 Subject: [PATCH 04/12] Added new token percentage_warning and percentage_critical to pandoradb_data on tpolicy_modules --- pandora_console/pandoradb_data.sql | 84 +++++++++++++++--------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 69802ec826..2d523e7462 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1209,48 +1209,48 @@ INSERT INTO `tpolicies` VALUES (4,'Basic AIX Local Monitoring','B INSERT INTO `tpolicies` VALUES (5,'Basic HP-UX Local Monitoring','Basic local checks to monitoring HP/UX systems.',2,0,0); INSERT INTO `tpolicies` VALUES (6,'Basic Remote Checks','Basic Remote Checks (ping, latency, ports).',9,0,0); -INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum ReceivedBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Received)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Sent)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_min_warning 79.00 module_end ',1,'CPU usage (%)','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin module_name Total processes module_type generic_data module_exec tasklist | wc -l | gawk "{print $1}" module_end ',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000" module_end ',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin module_name WMI Service module_type generic_proc module_service winmgmt module_end ',2,'WMI Service enabled','WMI Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$2}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Received)','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$10}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Sent)','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (9,2,'module_begin module_name CPU % module_type generic_data module_exec vmstat 1 1 | tail -1 | awk '{ print $13 + $14 }' module_unit % module_end ',1,'Current use of CPU (System + User).','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (10,2,'module_begin module_name I/O Lock module_type generic_data module_exec vmstat 1 1 | tail -1 | awk '{print $16}' module_description I/O Wait Disk module_end ',1,'','I/O Lock','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (11,2,'module_begin module_name Load Average module_type generic_data module_exec cat /proc/loadavg |awk '{print $2}' module_end ',1,'Average process in CPU (Last 5 minutes).','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (12,2,'module_begin module_name Port 22 Open (SSH) module_type generic_proc module_exec echo > /dev/tcp/127.0.0.1/22 >/dev/null 2>&1 && echo 1 || echo 0 module_end ',2,'Checks if port 22 (SSH) is listening.','Port 22 Open (SSH)','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (13,2,'module_begin module_name Total processes module_type generic_data module_exec ps ax | tail -n +2 | wc -l module_description Total processes module_end',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (14,2,'module_begin module_name Uptime module_type generic_data module_exec awk '{print $1*100}' /proc/uptime module_end ',1,'Host Up time (Timeticks)','Uptime','_timeticks_',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (15,3,'module_begin module_name CPU % module_type generic_data module_exec vmstat 1 1 | tail -1| awk '{print (100-$NF)}' module_unit % module_end ',1,'CPU usage %','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (16,3,'module_begin module_name Disk / usage (%) module_type generic_data module_exec df -k / | tail -1 | tr -d "%" | awk '{print $5}' module_end ',1,'Disk use percentage for root partition (/)','Disk / usage (%)','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (17,3,'module_begin module_name Disk /var usage (%) module_type generic_data module_exec df -k /var | tail -1 | tr -d "%" | awk '{print $5}' module_end ',1,'Disk use percentage for var partition (/var)','Disk /var usage (%)','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (18,3,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)}' | tr -d ',' module_end ',1,'Load average','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (19,3,'module_begin module_name Memory Free % module_type generic_data module_freepercentmemory module_end ',1,'Percentage Mem Free','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,8.00,15.00,'',0.00,7.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (20,3,'module_begin module_name Port 22 Open (SSH) module_type generic_proc module_exec timeout 1 bash -c "echo > /dev/tcp/127.0.0.1/22" >/dev/null 2>&1 && echo 1 || echo 0 module_end ',2,'Checks if port 22 (SSH) is listening.','Port 22 Open (SSH)','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (21,3,'module_begin module_name Swap Used % module_type generic_data module_exec swap -l |tail -1 | awk '{print 100 - ($NF / $(NF-1) * 100)}' module_unit % module_end ',1,'Swap memory available in %','Swap Used %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (22,3,'module_begin module_name Total processes module_type generic_data module_exec ps -A | wc -l | awk '{print $1}' module_end',1,'Total processes','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (23,3,'module_beg module_name Uptime module_type generic_data module_exec perl -e "print 100*(time - $(kstat -p unix:0:system_misc:boot_time |awk '{print $2}'))" module_end ',1,'Host Up time (Timeticks)','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (24,4,'module_begin module_name CPU % module_type generic_data module_exec sar 1 | tail -1 | awk '{print 100 - $5}' module_description CPU usage in % module_unit % module_end',1,'','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (25,4,'module_begin module_name CPU User module_type generic_data module_exec sar 1 | tail -1 | awk '{print $2}' module_description CPU usage in % module_unit % module_end',1,'','CPU User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (26,4,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)*1}' module_description Average process in CPU (Last minute) module_end',1,'','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (27,4,'module_begin module_name Memory Free % module_type generic_data module_exec svmon -G|grep memory | awk '{print (1- $3/$2 )*100}' module_description Percentage Mem Free module_end ',1,'','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (28,4,'module_begin module_name Pagination use module_type generic_data module_exec lsps -s | tail -1 | awk '{print $2+0}' module_end',1,'','Pagination use','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (29,4,'module_begin module_name Service sshd status module_type generic_proc module_exec lssrc -a | grep ssh | grep active module_end',2,'','Service sshd status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (30,4,'module_begin module_name Uptime module_type generic_data_string module_exec uptime |sed "s/us\.*$//g" | sed "s/,\.*$//g" module_description Host Up time module_end ',1,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (31,5,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_end ',1,'','CPU %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (32,5,'module_begin module_name CPU User module_type generic_data module_exec vmstat 1 2 | tail -1 | awk '{ print $(16) }' module_description % of User CPU module_unit % module_end ',1,'','CPU User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (33,5,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)}' | tr -d ',' module_description System load average module_end ',1,'','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (34,5,'module_begin module_name Memory Free % module_type generic_data module_exec echo "" > /tmp/hpvm_toptest; top -d 1 -f /tmp/hpvm_toptest 2>/dev/null 1>/dev/null; cat /tmp/hpvm_toptest | grep -i Memory | head -1 | awk '{print $8/($2+$5) * 100}' module_end ',1,'','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (35,5,'module_begin module_name Service sshd status module_type generic_proc module_exec ps -ef | grep -v grep | grep "/opt/ssh/sbin/sshd" | wc -l module_description SSH running module_end ',2,'','Service sshd status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (36,5,'module_begin module_name Total processes module_type generic_data module_exec echo $(((`ps -e | wc -l`)-1)) | tr -d “\n” module_description Total processes module_end ',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (37,5,'module_begin module_name Uptime module_type generic_data_string module_exec uptime |sed s/us\.*$//g | sed s/,\.*$//g module_description Host Up time module_end ',3,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (38,5,'module_begin module_name Zombie processes module_type generic_data module_exec ps -­elf | awk '$2~/'Z'/{print $2}' | wc -l | tr -d "\n" module_description Zombie processes module_end ',1,'','Zombie processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (39,6,'',6,'','Host Alive','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (40,6,'',7,'','Host Latency','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,80.00,149.00,'',150.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (41,6,'',2,'Checks if port 161 is open and reachable for Pandora FMS server.','SNMP Available','',0,0,300,'',0,'','','','',1,1,4,0,0,'','','_field1_;Target IP;;_address_--_field2_;Port;;161',3,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"_address_\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\"}}','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -INSERT INTO `tpolicy_modules` VALUES (42,6,'',9,'Checks if port 22 is open and reachable for Pandora FMS server.','SSH Reachable','',0,0,300,'',22,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (1,1,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum ReceivedBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Received)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (2,1,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec powershell -c "Get-NetAdapterStatistics |Measure-Object -Sum SentBytes |Select -ExpandProperty Sum" module_end ',4,'','Bytes per second (Sent)','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (3,1,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_min_warning 79.00 module_end ',1,'CPU usage (%)','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,79.00,90.00,'',91.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (4,1,'module_begin module_name Total processes module_type generic_data module_exec tasklist | wc -l | gawk "{print $1}" module_end ',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (5,1,'module_begin module_name Uptime module_type generic_data module_exec powershell -c "((get-date) - (gcim Win32_OperatingSystem).LastBootUpTime | Select -ExpandProperty Ticks) / 100000" module_end ',1,'','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (6,1,'module_begin module_name WMI Service module_type generic_proc module_service winmgmt module_end ',2,'WMI Service enabled','WMI Service','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (7,2,'module_begin module_name Bytes per second (Received) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$2}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Received)','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (8,2,'module_begin module_name Bytes per second (Sent) module_type generic_data_inc module_exec awk '!/lo:/ {s+=$10}END{print s}' /proc/net/dev module_min_warning 0 module_max_warning 0 module_min_critical 0 module_max_critical 0 module_end ',4,'','Bytes per second (Sent)','bytes/sec',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (9,2,'module_begin module_name CPU % module_type generic_data module_exec vmstat 1 1 | tail -1 | awk '{ print $13 + $14 }' module_unit % module_end ',1,'Current use of CPU (System + User).','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (10,2,'module_begin module_name I/O Lock module_type generic_data module_exec vmstat 1 1 | tail -1 | awk '{print $16}' module_description I/O Wait Disk module_end ',1,'','I/O Lock','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (11,2,'module_begin module_name Load Average module_type generic_data module_exec cat /proc/loadavg |awk '{print $2}' module_end ',1,'Average process in CPU (Last 5 minutes).','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (12,2,'module_begin module_name Port 22 Open (SSH) module_type generic_proc module_exec echo > /dev/tcp/127.0.0.1/22 >/dev/null 2>&1 && echo 1 || echo 0 module_end ',2,'Checks if port 22 (SSH) is listening.','Port 22 Open (SSH)','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (13,2,'module_begin module_name Total processes module_type generic_data module_exec ps ax | tail -n +2 | wc -l module_description Total processes module_end',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (14,2,'module_begin module_name Uptime module_type generic_data module_exec awk '{print $1*100}' /proc/uptime module_end ',1,'Host Up time (Timeticks)','Uptime','_timeticks_',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (15,3,'module_begin module_name CPU % module_type generic_data module_exec vmstat 1 1 | tail -1| awk '{print (100-$NF)}' module_unit % module_end ',1,'CPU usage %','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (16,3,'module_begin module_name Disk / usage (%) module_type generic_data module_exec df -k / | tail -1 | tr -d "%" | awk '{print $5}' module_end ',1,'Disk use percentage for root partition (/)','Disk / usage (%)','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (17,3,'module_begin module_name Disk /var usage (%) module_type generic_data module_exec df -k /var | tail -1 | tr -d "%" | awk '{print $5}' module_end ',1,'Disk use percentage for var partition (/var)','Disk /var usage (%)','',0,0,1,'',0,'','','','',1,1,1,0,0,'','','',0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','','{\"going_unknown\":0}','W10=',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (18,3,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)}' | tr -d ',' module_end ',1,'Load average','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (19,3,'module_begin module_name Memory Free % module_type generic_data module_freepercentmemory module_end ',1,'Percentage Mem Free','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,8.00,15.00,'',0.00,7.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (20,3,'module_begin module_name Port 22 Open (SSH) module_type generic_proc module_exec timeout 1 bash -c "echo > /dev/tcp/127.0.0.1/22" >/dev/null 2>&1 && echo 1 || echo 0 module_end ',2,'Checks if port 22 (SSH) is listening.','Port 22 Open (SSH)','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (21,3,'module_begin module_name Swap Used % module_type generic_data module_exec swap -l |tail -1 | awk '{print 100 - ($NF / $(NF-1) * 100)}' module_unit % module_end ',1,'Swap memory available in %','Swap Used %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (22,3,'module_begin module_name Total processes module_type generic_data module_exec ps -A | wc -l | awk '{print $1}' module_end',1,'Total processes','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (23,3,'module_beg module_name Uptime module_type generic_data module_exec perl -e "print 100*(time - $(kstat -p unix:0:system_misc:boot_time |awk '{print $2}'))" module_end ',1,'Host Up time (Timeticks)','Uptime','_timeticks_',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (24,4,'module_begin module_name CPU % module_type generic_data module_exec sar 1 | tail -1 | awk '{print 100 - $5}' module_description CPU usage in % module_unit % module_end',1,'','CPU %','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (25,4,'module_begin module_name CPU User module_type generic_data module_exec sar 1 | tail -1 | awk '{print $2}' module_description CPU usage in % module_unit % module_end',1,'','CPU User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (26,4,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)*1}' module_description Average process in CPU (Last minute) module_end',1,'','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (27,4,'module_begin module_name Memory Free % module_type generic_data module_exec svmon -G|grep memory | awk '{print (1- $3/$2 )*100}' module_description Percentage Mem Free module_end ',1,'','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (28,4,'module_begin module_name Pagination use module_type generic_data module_exec lsps -s | tail -1 | awk '{print $2+0}' module_end',1,'','Pagination use','',0,0,1,'',0,'','','','',1,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (29,4,'module_begin module_name Service sshd status module_type generic_proc module_exec lssrc -a | grep ssh | grep active module_end',2,'','Service sshd status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (30,4,'module_begin module_name Uptime module_type generic_data_string module_exec uptime |sed "s/us\.*$//g" | sed "s/,\.*$//g" module_description Host Up time module_end ',1,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (31,5,'module_begin module_name CPU % module_type generic_data module_cpuusage all module_unit % module_end ',1,'','CPU %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (32,5,'module_begin module_name CPU User module_type generic_data module_exec vmstat 1 2 | tail -1 | awk '{ print $(16) }' module_description % of User CPU module_unit % module_end ',1,'','CPU User','%',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (33,5,'module_begin module_name Load Average module_type generic_data module_exec uptime | awk '{print $(NF-2)}' | tr -d ',' module_description System load average module_end ',1,'','Load Average','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (34,5,'module_begin module_name Memory Free % module_type generic_data module_exec echo "" > /tmp/hpvm_toptest; top -d 1 -f /tmp/hpvm_toptest 2>/dev/null 1>/dev/null; cat /tmp/hpvm_toptest | grep -i Memory | head -1 | awk '{print $8/($2+$5) * 100}' module_end ',1,'','Memory Free %','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (35,5,'module_begin module_name Service sshd status module_type generic_proc module_exec ps -ef | grep -v grep | grep "/opt/ssh/sbin/sshd" | wc -l module_description SSH running module_end ',2,'','Service sshd status','',0,0,1,'',0,'','','','',3,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (36,5,'module_begin module_name Total processes module_type generic_data module_exec echo $(((`ps -e | wc -l`)-1)) | tr -d “\n” module_description Total processes module_end ',1,'','Total processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (37,5,'module_begin module_name Uptime module_type generic_data_string module_exec uptime |sed s/us\.*$//g | sed s/,\.*$//g module_description Host Up time module_end ',3,'','Uptime','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (38,5,'module_begin module_name Zombie processes module_type generic_data module_exec ps -­elf | awk '$2~/'Z'/{print $2}' | wc -l | tr -d "\n" module_description Zombie processes module_end ',1,'','Zombie processes','',0,0,1,'',0,'','','','',4,1,1,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (39,6,'',6,'','Host Alive','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (40,6,'',7,'','Host Latency','',0,0,300,'',0,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,80.00,149.00,'',150.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (41,6,'',2,'Checks if port 161 is open and reachable for Pandora FMS server.','SNMP Available','',0,0,300,'',0,'','','','',1,1,4,0,0,'','','_field1_;Target IP;;_address_--_field2_;Port;;161',3,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target IP\",\"help\":\"\",\"value\":\"_address_\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\"}}','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +INSERT INTO `tpolicy_modules` VALUES (42,6,'',9,'Checks if port 22 is open and reachable for Pandora FMS server.','SSH Reachable','',0,0,300,'',22,'','','','',2,1,2,0,0,NULL,NULL,NULL,0,0.000000000000000,0,0,0,'',1,0.00,0.00,'',0.00,0.00,'',0,NULL,NULL,NULL,0,0,0,'','','',0,0,0,0,0,'* * * * *',NULL,'{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tpolicy_plugins` VALUES (1,1,'cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\df_percent_used.vbs"',0); INSERT INTO `tpolicy_plugins` VALUES (2,1,'cscript.exe //B "%ProgramFiles%\Pandora_Agent\util\mem_percent_used.vbs"',0); From 5bf83bcc81e0815c83ec529510f5cf7405c8b611 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Thu, 25 Nov 2021 12:58:21 +0100 Subject: [PATCH 05/12] Add support for percentage module status thresholds. --- pandora_server/lib/PandoraFMS/Core.pm | 42 +++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 3347eca41a..219114f7c2 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1945,7 +1945,7 @@ sub pandora_process_module ($$$$$$$$$;$) { } # Get new status - my $new_status = get_module_status ($processed_data, $module, $module_type); + my $new_status = get_module_status ($processed_data, $module, $module_type, $last_data_value); my $last_status_change = $agent_status->{'last_status_change'}; # Set the last status change macro. Even if its value changes later, whe want the original value. @@ -4793,8 +4793,8 @@ sub log4x_get_severity_num($) { ########################################################################## # Returns the status of the module: 0 (NORMAL), 1 (CRITICAL), 2 (WARNING). ########################################################################## -sub get_module_status ($$$) { - my ($data, $module, $module_type) = @_; +sub get_module_status ($$$$) { + my ($data, $module, $module_type, $last_data_value) = @_; my ($critical_min, $critical_max, $warning_min, $warning_max) = ($module->{'min_critical'}, $module->{'max_critical'}, $module->{'min_warning'}, $module->{'max_warning'}); my ($critical_str, $warning_str) = ($module->{'str_critical'}, $module->{'str_warning'}); @@ -4811,6 +4811,42 @@ sub get_module_status ($$$) { $critical_str = (defined ($critical_str) && valid_regex ($critical_str) == 1) ? safe_output($critical_str) : ''; $warning_str = (defined ($warning_str) && valid_regex ($warning_str) == 1) ? safe_output($warning_str) : ''; + # Adjust percentage max/min values. + if ($module->{'percentage_critical'} == 1) { + if ($critical_max != 0 && $critical_min != 0) { + $critical_max = $last_data_value * (1 + $critical_max / 100.0); + $critical_min = $last_data_value * (1 - $critical_min / 100.0); + $module->{'critical_inverse'} = 1; + } + elsif ($critical_min != 0) { + $critical_max = $last_data_value * (1 - $critical_min / 100.0); + $critical_min = 0; + $module->{'critical_inverse'} = 0; + } + elsif ($critical_max != 0) { + $critical_min = $last_data_value * (1 + $critical_max / 100.0); + $critical_max = 0; + $module->{'critical_inverse'} = 0; + } + } + if ($module->{'percentage_warning'} == 1) { + if ($warning_max != 0 && $warning_min != 0) { + $warning_max = $last_data_value * (1 + $warning_max / 100.0); + $warning_min = $last_data_value * (1 - $warning_min / 100.0); + $module->{'warning_inverse'} = 1; + } + elsif ($warning_min != 0) { + $warning_max = $last_data_value * (1 - $warning_min / 100.0); + $warning_min = 0; + $module->{'warning_inverse'} = 0; + } + elsif ($warning_max != 0) { + $warning_min = $last_data_value * (1 + $warning_max / 100.0); + $warning_max = 0; + $module->{'warning_inverse'} = 0; + } + } + if (($module_type =~ m/_proc$/ || $module_type =~ /web_analysis/) && ($critical_min eq $critical_max)) { ($critical_min, $critical_max) = (0, 1); } From 54755db59b16aedff388ea2861cf807a61b6ac90 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 26 Nov 2021 11:55:38 +0100 Subject: [PATCH 06/12] Control inverse and percentege cannot be selected at same time --- .../agentes/module_manager_editor_common.php | 101 +++++++++++++++++- .../godmode/massive/massive_edit_modules.php | 25 +++++ .../manage_network_components_form.php | 54 ++++++++++ .../manage_network_components_form_common.php | 100 ++++++++++++++++- .../manage_network_components_form_wizard.php | 14 ++- .../include/class/AgentWizard.class.php | 33 +++++- 6 files changed, 311 insertions(+), 16 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 7f97a7d1ec..ecdc0e7926 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -456,8 +456,9 @@ if (modules_is_string_type($id_module_type) || $edit) { ).''; } - $table_simple->data[2][1] .= '
'.__('Inverse interval').''; - $table_simple->data[2][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true, $disabledBecauseInPolicy); +$table_simple->data[2][1] .= '
'.__('Inverse interval').''; +$table_simple->data[2][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true, $disabledBecauseInPolicy); +$table_simple->data[2][1] .= '
'; if (modules_is_string_type($id_module_type) === false) { $table_simple->data[2][1] .= '
'.__('Percentage').''; @@ -515,8 +516,10 @@ if (modules_is_string_type($id_module_type) || $edit) { ).''; } -$table_simple->data[3][1] .= '
'.__('Inverse interval').''; +$table_simple->data[3][1] .= '
'.__('Inverse interval').''; $table_simple->data[3][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true, $disabledBecauseInPolicy); +$table_simple->data[3][1] .= '
'; + if (modules_is_string_type($id_module_type) === false) { $table_simple->data[3][1] .= '
'.__('Percentage').''; @@ -1644,11 +1647,64 @@ $(document).ready (function () { $('#text-max_critical').val(0); } }); + + if ($('#checkbox-warning_inverse').prop('checked') === true) { + $('#percentage_warning').hide(); + } + + if ($('#checkbox-critical_inverse').prop('checked') === true) { + $('#percentage_critical').hide(); + } + + if ($('#checkbox-percentage_warning').prop('checked') === true) { + $('#warning_inverse').hide(); + } + + if ($('#checkbox-percentage_critical').prop('checked') === true) { + $('#critical_inverse').hide(); + } + $('#checkbox-warning_inverse').change (function() { paint_graph_values(); - }); + if ($('#checkbox-warning_inverse').prop('checked') === true){ + $('#checkbox-percentage_warning').prop('checked', false); + $('#percentage_warning').hide(); + } else { + $('#percentage_warning').show(); + } + }); + $('#checkbox-critical_inverse').change (function() { paint_graph_values(); + + if ($('#checkbox-critical_inverse').prop('checked') === true){ + $('#checkbox-percentage_critical').prop('checked', false); + $('#percentage_critical').hide(); + } else { + $('#percentage_critical').show(); + } + }); + + $('#checkbox-percentage_warning').change (function() { + paint_graph_values(); + if ($('#checkbox-percentage_warning').prop('checked') === true){ + $('#checkbox-warning_inverse').prop('checked', false); + $('#warning_inverse').hide(); + } else { + $('#warning_inverse').show(); + } + }); + + $('#checkbox-percentage_critical').change (function() { + paint_graph_values(); + if ($('#checkbox-percentage_critical').prop('checked') === true){ + $('#checkbox-critical_inverse').prop('checked', false); + $('#critical_inverse').hide(); + } + else { + $('#critical_inverse').show(); + } + }); }); @@ -1931,6 +1987,43 @@ function paint_graph_values(){ //messages error var message_error_warning = ''; var message_error_critical = ''; + var message_error_percentage = ''; + + + //Percentage selector + var percentage_w = $('#checkbox-percentage_warning').prop('checked'); + var percentage_c = $('#checkbox-percentage_critical').prop('checked'); + + if(percentage_w == true || percentage_c == true) { + d3.select("#svg_dinamic rect").remove(); + //create svg + var svg = d3.select("#svg_dinamic"); + svg.selectAll("g").remove(); + if (percentage_w === true) { + if(max_w < 0 || min_w < 0) { + paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); + } else { + $("#text-max_warning").removeClass("input_error"); + $("#text-min_warning").removeClass("input_error"); + } + + } + + if(percentage_c === true) { + if(max_c < 0 || min_c < 0) { + paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); + } else { + $("#text-min-critical").removeClass("input_error"); + $("#text-max_critical").removeClass("input_error"); + + } + } + + return; + + } else { + $('#svg_dinamic').show(); + } //if haven't error if(max_w == 0 || max_w > min_w){ diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index ba1e7e7869..6fb13482e0 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -1876,6 +1876,31 @@ $(document).ready (function () { } } }); + + $('#warning_inverse').change(function() { + if($(this).val() == 1) { + $("#percentage_warning").val('0').change() + } + }); + + $('#critical_inverse').change(function() { + if($(this).val() == 1) { + $("#percentage_critical").val('0').change(); + } + }); + + $('#percentage_warning').change(function() { + if($(this).val() == 1) { + $("#warning_inverse").val('0').change() + } + }); + + $('#percentage_critical').change(function() { + if($(this).val() == 1) { + $("#critical_inverse").val('0').change() + } + }); + }); diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index b26af8bbbe..559ca0a376 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -829,6 +829,60 @@ $(document).ready (function () { }); $("#snmp_version" ).trigger("change"); + + if ($('#checkbox-warning_inverse').prop('checked') === true) { + $('#percentage_warning').hide(); + } + + if ($('#checkbox-critical_inverse').prop('checked') === true) { + $('#percentage_critical').hide(); + } + + if ($('#checkbox-percentage_warning').prop('checked') === true) { + $('#warning_inverse').hide(); + } + + if ($('#checkbox-percentage_critical').prop('checked') === true) { + $('#critical_inverse').hide(); + } + + $('#checkbox-warning_inverse').change (function() { + if ($('#checkbox-warning_inverse').prop('checked') === true){ + $('#checkbox-percentage_warning').prop('checked', false); + $('#percentage_warning').hide(); + } else { + $('#percentage_warning').show(); + } + }); + + $('#checkbox-critical_inverse').change (function() { + if ($('#checkbox-critical_inverse').prop('checked') === true){ + $('#checkbox-percentage_critical').prop('checked', false); + $('#percentage_critical').hide(); + } else { + $('#percentage_critical').show(); + } + }); + + $('#checkbox-percentage_warning').change (function() { + if ($('#checkbox-percentage_warning').prop('checked') === true){ + $('#checkbox-warning_inverse').prop('checked', false); + $('#warning_inverse').hide(); + } else { + $('#warning_inverse').show(); + } + }); + + $('#checkbox-percentage_critical').change (function() { + if ($('#checkbox-percentage_critical').prop('checked') === true){ + $('#checkbox-critical_inverse').prop('checked', false); + $('#critical_inverse').hide(); + } + else { + $('#critical_inverse').show(); + } + }); + }); data[4][1] .= html_print_input_text( 1024, true ).''; -$table->data[4][1] .= '
'.__('Inverse interval').''; +$table->data[4][1] .= '
'.__('Inverse interval').''; $table->data[4][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); +$table->data[4][1] .= '
'; $table->data[4][1] .= '
'.__('Percentage').''; $table->data[4][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); @@ -224,8 +227,9 @@ $table->data[5][1] .= html_print_input_text( 1024, true ).''; -$table->data[5][1] .= '
'.__('Inverse interval').''; +$table->data[5][1] .= '
'.__('Inverse interval').''; $table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); +$table->data[5][1] .= '
'; $table->data[5][1] .= '
'.__('Percentage').''; $table->data[5][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); @@ -580,11 +584,64 @@ $next_row++; $('#text-max_critical').val(0); } }); + + if ($('#checkbox-warning_inverse').prop('checked') === true) { + $('#percentage_warning').hide(); + } + + if ($('#checkbox-critical_inverse').prop('checked') === true) { + $('#percentage_critical').hide(); + } + + if ($('#checkbox-percentage_warning').prop('checked') === true) { + $('#warning_inverse').hide(); + } + + if ($('#checkbox-percentage_critical').prop('checked') === true) { + $('#critical_inverse').hide(); + } + $('#checkbox-warning_inverse').change (function() { paint_graph_values(); - }); + if ($('#checkbox-warning_inverse').prop('checked') === true){ + $('#checkbox-percentage_warning').prop('checked', false); + $('#percentage_warning').hide(); + } else { + $('#percentage_warning').show(); + } + }); + $('#checkbox-critical_inverse').change (function() { paint_graph_values(); + + if ($('#checkbox-critical_inverse').prop('checked') === true){ + $('#checkbox-percentage_critical').prop('checked', false); + $('#percentage_critical').hide(); + } else { + $('#percentage_critical').show(); + } + }); + + $('#checkbox-percentage_warning').change (function() { + paint_graph_values(); + if ($('#checkbox-percentage_warning').prop('checked') === true){ + $('#checkbox-warning_inverse').prop('checked', false); + $('#warning_inverse').hide(); + } else { + $('#warning_inverse').show(); + } + }); + + $('#checkbox-percentage_critical').change (function() { + paint_graph_values(); + if ($('#checkbox-percentage_critical').prop('checked') === true){ + $('#checkbox-critical_inverse').prop('checked', false); + $('#critical_inverse').hide(); + } + else { + $('#critical_inverse').show(); + } + }); }); @@ -648,6 +705,43 @@ $next_row++; //messages error var message_error_warning = ''; var message_error_critical = ''; + var message_error_percentage = ''; + + + //Percentage selector + var percentage_w = $('#checkbox-percentage_warning').prop('checked'); + var percentage_c = $('#checkbox-percentage_critical').prop('checked'); + + if(percentage_w == true || percentage_c == true) { + d3.select("#svg_dinamic rect").remove(); + //create svg + var svg = d3.select("#svg_dinamic"); + svg.selectAll("g").remove(); + if (percentage_w === true) { + if(max_w < 0 || min_w < 0) { + paint_graph_status(0,0,0,0,0,0,1,0,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); + } else { + $("#text-max_warning").removeClass("input_error"); + $("#text-min_warning").removeClass("input_error"); + } + + } + + if(percentage_c === true) { + if(max_c < 0 || min_c < 0) { + paint_graph_status(0,0,0,0,0,0,0,1,legend_normal,legend_warning,legend_critical,message_error_percentage,message_error_percentage); + } else { + $("#text-min-critical").removeClass("input_error"); + $("#text-max_critical").removeClass("input_error"); + + } + } + + return; + +} else { + $('#svg_dinamic').show(); +} //if haven't error if(max_w == 0 || max_w > min_w){ diff --git a/pandora_console/godmode/modules/manage_network_components_form_wizard.php b/pandora_console/godmode/modules/manage_network_components_form_wizard.php index 9c2ec3c27d..d3d4b6e4d3 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_wizard.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wizard.php @@ -389,10 +389,13 @@ $data[1] .= ''; $data[1] .= ''.__('String').'  '; $data[1] .= html_print_input_text('str_warning', $str_warning, '', 5, 1024, true).''; // Warning inverse values. -$data[1] .= '
'.__('Inverse interval').' '; +$data[1] .= '
'.__('Inverse interval').' '; $data[1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); -$data[1] .= '
'.__('Percentage').' '; +$data[1] .= '
'; + +$data[1] .= '
'.__('Percentage').' '; $data[1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); +$data[1] .= '
'; $data[2] = ' '; $table->colspan['warning-svg-row'][2] = 2; @@ -427,10 +430,13 @@ $data[1] .= ''; $data[1] .= ''.__('String').'  '; $data[1] .= html_print_input_text('str_critical', $str_critical, '', 5, 1024, true).''; // Critical inverse values. -$data[1] .= '
'.__('Inverse interval').' '; +$data[1] .= '
'.__('Inverse interval').' '; $data[1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); -$data[1] .= '
'.__('Percentage').' '; +$data[1] .= '
'; + +$data[1] .= ''.__('Percentage').' '; $data[1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); +$data[1] .= '
'; push_table_row($data, 'critical-row'); diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index f6b7afdd97..79c9af84c5 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -4105,7 +4105,7 @@ class AgentWizard extends HTML $module['inv_warning'], true, false, - '', + 'change_control(this, \''.$uniqueId.'\')', false, 'form="form-create-modules"' ), @@ -4122,7 +4122,7 @@ class AgentWizard extends HTML $module['perc_warning'], true, false, - '', + 'change_control(this, \''.$uniqueId.'\')', false, 'form="form-create-modules"' ), @@ -4184,12 +4184,12 @@ class AgentWizard extends HTML 'class' => 'wizard-column-levels-check', 'style' => 'margin-top: 0.3em;', 'content' => html_print_checkbox( - 'module-critical_inv_'.$uniqueId, + 'module-critical-inv-'.$uniqueId, $module['inv_critical'], $module['inv_critical'], true, false, - '', + 'change_control(this, \''.$uniqueId.'\')', false, 'form="form-create-modules"' ), @@ -4207,7 +4207,7 @@ class AgentWizard extends HTML $module['perc_critical'], true, false, - '', + 'change_control(this,\''.$uniqueId.'\')', false, 'form="form-create-modules"' ), @@ -5922,6 +5922,29 @@ class AgentWizard extends HTML }); } + + function change_control(checkbox, uniqueId) { + var checkbox_name = $(checkbox).attr('name'); + + if($(checkbox).prop('checked', true)) { + if(checkbox_name.match(/warning-inv/gm) !== null) { + $('#checkbox-module-warning-perc-'+uniqueId).prop('checked', false); + } + + if(checkbox_name.match(/critical-inv/gm) !== null) { + $('#checkbox-module-critical-perc-'+uniqueId).prop('checked', false); + } + + if(checkbox_name.match(/warning-perc/gm) !== null) { + $('#checkbox-module-warning-inv-'+uniqueId).prop('checked', false); + } + + if(checkbox_name.match(/critical-perc/gm) !== null) { + $('#checkbox-module-critical-inv-'+uniqueId).prop('checked', false); + } + } + + } Date: Tue, 30 Nov 2021 12:12:24 +0100 Subject: [PATCH 07/12] Added help tip to percentage token --- .../godmode/agentes/module_manager_editor_common.php | 2 ++ pandora_console/godmode/massive/massive_edit_modules.php | 3 +++ .../godmode/modules/manage_network_components_form_common.php | 2 ++ .../godmode/modules/manage_network_components_form_wizard.php | 2 ++ 4 files changed, 9 insertions(+) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index ecdc0e7926..58d38e48fb 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -463,6 +463,7 @@ $table_simple->data[2][1] .= '
'; if (modules_is_string_type($id_module_type) === false) { $table_simple->data[2][1] .= '
'.__('Percentage').''; $table_simple->data[2][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true, $disabledBecauseInPolicy); + $table_simple->data[2][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table_simple->data[2][1] .= '
'; } @@ -523,6 +524,7 @@ $table_simple->data[3][1] .= '
'; if (modules_is_string_type($id_module_type) === false) { $table_simple->data[3][1] .= '
'.__('Percentage').''; + $table_simple->data[3][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table_simple->data[3][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true, $disabledBecauseInPolicy); $table_simple->data[3][1] .= '
'; } diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 6fb13482e0..9d0544b649 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -616,6 +616,8 @@ $table->data['edit1'][1] = ''; $table->data['edit1'][1] .= ''; $table->data['edit1'][1] .= ''; $table->data['edit1'][1] .= '
'; $table->data['edit1'][1] .= ''.__('Percentage').''; + $table->data['edit1'][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); + $table->data['edit1'][1] .= ''; $table->data['edit1'][1] .= html_print_select( @@ -706,6 +708,7 @@ $table->data['edit1'][1] = ''; $table->data['edit1'][3] .= ''; $table->data['edit1'][3] .= ''; $table->data['edit1'][3] .= '
'; $table->data['edit1'][3] .= ''.__('Percentage').''; + $table->data['edit1'][3] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->data['edit1'][3] .= ''; $table->data['edit1'][3] .= html_print_select( 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 417868f183..c924eefb2f 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -192,6 +192,7 @@ $table->data[4][1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse $table->data[4][1] .= ''; $table->data[4][1] .= '
'.__('Percentage').''; +$table->data[4][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->data[4][1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); $table->data[4][1] .= '
'; @@ -232,6 +233,7 @@ $table->data[5][1] .= html_print_checkbox('critical_inverse', 1, $critical_inver $table->data[5][1] .= ''; $table->data[5][1] .= '
'.__('Percentage').''; +$table->data[5][1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $table->data[5][1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); $table->data[5][1] .= '
'; diff --git a/pandora_console/godmode/modules/manage_network_components_form_wizard.php b/pandora_console/godmode/modules/manage_network_components_form_wizard.php index d3d4b6e4d3..990390fe47 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_wizard.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wizard.php @@ -394,6 +394,7 @@ $data[1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); $data[1] .= ''; $data[1] .= '
'.__('Percentage').' '; +$data[1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $data[1] .= html_print_checkbox('percentage_warning', 1, $percentage_warning, true); $data[1] .= '
'; @@ -435,6 +436,7 @@ $data[1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); $data[1] .= ''; $data[1] .= ''.__('Percentage').' '; +$data[1] .= ui_print_help_tip('Defines threshold as a percentage of value decrease/increment', true); $data[1] .= html_print_checkbox('percentage_critical', 1, $percentage_critical, true); $data[1] .= ''; From c2348fdc3ee3009731ad15dc9c74182b0a591074 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 Dec 2021 01:00:22 +0100 Subject: [PATCH 08/12] Auto-updated build strings. --- 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 3343300263..ae8b407d18 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1-211202 +Version: 7.0NG.758.1-211203 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 75c10e62a9..8c009f7568 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.758.1-211202" +pandora_version="7.0NG.758.1-211203" 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 5191dfd441..23ef00b565 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211202'; +use constant AGENT_BUILD => '211203'; # 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 7a368a719d..d29c6e88b8 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.758.1 -%define release 211202 +%define release 211203 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 9ac41f09cf..fd9dd981c7 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.758.1 -%define release 211202 +%define release 211203 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 848ba856f3..6e45d1b568 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211202" +PI_BUILD="211203" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 573dd22140..618bb4e212 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211202} +{211203} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index fd2590629e..616fea8762 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.758.1 Build 211202") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211203") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 2922e23115..14ce57afe9 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.758.1(Build 211202))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211203))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 289fe3e3f6..8fd44b55ba 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1-211202 +Version: 7.0NG.758.1-211203 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 fb9cce6203..006c39e6ae 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.758.1-211202" +pandora_version="7.0NG.758.1-211203" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 94506faddd..21ea8273d4 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 = 'PC211202'; +$build_version = 'PC211203'; $pandora_version = 'v7.0NG.758.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 89b8ca722b..ea6c0b2066 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 add1a657e4..e10a249cc7 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.758.1 -%define release 211202 +%define release 211203 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index bec3a1a955..dc4e168199 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.758.1 -%define release 211202 +%define release 211203 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2c0b2d6447..6a303d3ee2 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211202" +PI_BUILD="211203" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 23987ea7f8..54c666adc8 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.758.1 Build 211202"; +my $version = "7.0NG.758.1 Build 211203"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5141f28aea..991ddf3abe 100755 --- 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.758.1 Build 211202"; +my $version = "7.0NG.758.1 Build 211203"; # save program name for logging my $progname = basename($0); From fcff0eeafdcaa213e704df2fb9526fe9706f5fa7 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 4 Dec 2021 01:00:20 +0100 Subject: [PATCH 09/12] Auto-updated build strings. --- 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 ae8b407d18..9e0794812f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1-211203 +Version: 7.0NG.758.1-211204 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 8c009f7568..914e3c4668 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.758.1-211203" +pandora_version="7.0NG.758.1-211204" 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 23ef00b565..9288106557 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211203'; +use constant AGENT_BUILD => '211204'; # 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 d29c6e88b8..e11576ecaa 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.758.1 -%define release 211203 +%define release 211204 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 fd9dd981c7..312689313c 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.758.1 -%define release 211203 +%define release 211204 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 6e45d1b568..68a945d7a6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211203" +PI_BUILD="211204" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 618bb4e212..7653ef4edd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211203} +{211204} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 616fea8762..63786bbb92 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.758.1 Build 211203") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211204") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 14ce57afe9..2de41ef564 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.758.1(Build 211203))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211204))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8fd44b55ba..3ad36ef6c9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1-211203 +Version: 7.0NG.758.1-211204 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 006c39e6ae..42a20eea53 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.758.1-211203" +pandora_version="7.0NG.758.1-211204" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 21ea8273d4..36ae7d06c1 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 = 'PC211203'; +$build_version = 'PC211204'; $pandora_version = 'v7.0NG.758.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ea6c0b2066..d9557c5c60 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 e10a249cc7..1c1699487c 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.758.1 -%define release 211203 +%define release 211204 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index dc4e168199..a1af933ae9 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.758.1 -%define release 211203 +%define release 211204 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6a303d3ee2..2e13e28a50 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211203" +PI_BUILD="211204" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 54c666adc8..5072eff907 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.758.1 Build 211203"; +my $version = "7.0NG.758.1 Build 211204"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 991ddf3abe..0dd5073691 100755 --- 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.758.1 Build 211203"; +my $version = "7.0NG.758.1 Build 211204"; # save program name for logging my $progname = basename($0); From f1482dc8125c195c999caaf3cc5259d68cee1515 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 5 Dec 2021 01:00:17 +0100 Subject: [PATCH 10/12] Auto-updated build strings. --- 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 9e0794812f..d3344a98fd 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1-211204 +Version: 7.0NG.758.1-211205 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 914e3c4668..8adbd715f1 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.758.1-211204" +pandora_version="7.0NG.758.1-211205" 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 9288106557..81dfcfe42d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211204'; +use constant AGENT_BUILD => '211205'; # 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 e11576ecaa..57586aa13f 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.758.1 -%define release 211204 +%define release 211205 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 312689313c..185d9b9220 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.758.1 -%define release 211204 +%define release 211205 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 68a945d7a6..268b8b9846 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211204" +PI_BUILD="211205" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7653ef4edd..6b9b3e7fb9 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211204} +{211205} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 63786bbb92..1482608073 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.758.1 Build 211204") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211205") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 2de41ef564..1a6255e7d1 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.758.1(Build 211204))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211205))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3ad36ef6c9..9f5645639b 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1-211204 +Version: 7.0NG.758.1-211205 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 42a20eea53..49dc6f6917 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.758.1-211204" +pandora_version="7.0NG.758.1-211205" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 36ae7d06c1..d68d8fadfa 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 = 'PC211204'; +$build_version = 'PC211205'; $pandora_version = 'v7.0NG.758.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index d9557c5c60..cea5c02a9b 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 1c1699487c..69d64ac73f 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.758.1 -%define release 211204 +%define release 211205 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a1af933ae9..9eaa616b19 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.758.1 -%define release 211204 +%define release 211205 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 2e13e28a50..d142f95de1 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211204" +PI_BUILD="211205" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5072eff907..5cfe5731d3 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.758.1 Build 211204"; +my $version = "7.0NG.758.1 Build 211205"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 0dd5073691..455ef6058a 100755 --- 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.758.1 Build 211204"; +my $version = "7.0NG.758.1 Build 211205"; # save program name for logging my $progname = basename($0); From 3e0e41038f25c71235cdd80fb0a4baf967e475ae Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 6 Dec 2021 01:00:16 +0100 Subject: [PATCH 11/12] Auto-updated build strings. --- 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 d3344a98fd..c81c8b6ac5 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1-211205 +Version: 7.0NG.758.1-211206 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 8adbd715f1..433f8ebe34 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.758.1-211205" +pandora_version="7.0NG.758.1-211206" 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 81dfcfe42d..de24080e4b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211205'; +use constant AGENT_BUILD => '211206'; # 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 57586aa13f..53410df6ba 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.758.1 -%define release 211205 +%define release 211206 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 185d9b9220..a41d9b92e7 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.758.1 -%define release 211205 +%define release 211206 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 268b8b9846..9e7ad912c6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211205" +PI_BUILD="211206" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 6b9b3e7fb9..9198cbe2ba 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211205} +{211206} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1482608073..32415e7c03 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.758.1 Build 211205") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211206") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1a6255e7d1..19fd9a6c67 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.758.1(Build 211205))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211206))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9f5645639b..1fbd04a7cf 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1-211205 +Version: 7.0NG.758.1-211206 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 49dc6f6917..9872278c5b 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.758.1-211205" +pandora_version="7.0NG.758.1-211206" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d68d8fadfa..c4a5976eda 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 = 'PC211205'; +$build_version = 'PC211206'; $pandora_version = 'v7.0NG.758.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index cea5c02a9b..516077a6f9 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 69d64ac73f..813940bed1 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.758.1 -%define release 211205 +%define release 211206 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 9eaa616b19..79fcf43456 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.758.1 -%define release 211205 +%define release 211206 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d142f95de1..d1ab50cf73 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211205" +PI_BUILD="211206" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5cfe5731d3..1d497af6a2 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.758.1 Build 211205"; +my $version = "7.0NG.758.1 Build 211206"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 455ef6058a..2f46ed936a 100755 --- 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.758.1 Build 211205"; +my $version = "7.0NG.758.1 Build 211206"; # save program name for logging my $progname = basename($0); From 4925aaae18c043c66271a8b1af434701e2f8acd1 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 7 Dec 2021 01:00:17 +0100 Subject: [PATCH 12/12] Auto-updated build strings. --- 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 c81c8b6ac5..c702a48c9a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1-211206 +Version: 7.0NG.758.1-211207 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 433f8ebe34..a63da23a2d 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.758.1-211206" +pandora_version="7.0NG.758.1-211207" 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 de24080e4b..93d9273cbd 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211206'; +use constant AGENT_BUILD => '211207'; # 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 53410df6ba..8ad4e37a1b 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.758.1 -%define release 211206 +%define release 211207 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 a41d9b92e7..e01fef3ae4 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.758.1 -%define release 211206 +%define release 211207 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 9e7ad912c6..9845156651 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211206" +PI_BUILD="211207" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9198cbe2ba..e601f56be2 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211206} +{211207} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 32415e7c03..51c9616f07 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.758.1 Build 211206") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211207") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 19fd9a6c67..2a472c876f 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.758.1(Build 211206))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211207))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 1fbd04a7cf..f80f9658dd 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1-211206 +Version: 7.0NG.758.1-211207 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 9872278c5b..554868af7e 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.758.1-211206" +pandora_version="7.0NG.758.1-211207" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index c4a5976eda..8d481c2f15 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 = 'PC211206'; +$build_version = 'PC211207'; $pandora_version = 'v7.0NG.758.1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 516077a6f9..aa9d082d38 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 813940bed1..0f24a658d6 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.758.1 -%define release 211206 +%define release 211207 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 79fcf43456..e5edbb43d0 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.758.1 -%define release 211206 +%define release 211207 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d1ab50cf73..7fc10138d6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211206" +PI_BUILD="211207" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 1d497af6a2..324410f0c0 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.758.1 Build 211206"; +my $version = "7.0NG.758.1 Build 211207"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 2f46ed936a..e957384fa4 100755 --- 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.758.1 Build 211206"; +my $version = "7.0NG.758.1 Build 211207"; # save program name for logging my $progname = basename($0);