From 2fc08b7246bf5e142abed3712c80558092ce9ba2 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 31 Aug 2023 18:07:26 +0200 Subject: [PATCH 01/37] Added enable MADE option to modules and bulk op --- .../DiscoveryApplicationsMigrateCodes.ini | 11 ++++ pandora_console/extras/mr/66.sql | 4 ++ .../godmode/agentes/configurar_agente.php | 8 +++ .../godmode/agentes/module_manager_editor.php | 2 + .../agentes/module_manager_editor_common.php | 22 ++++++++ .../godmode/massive/massive_edit_modules.php | 50 +++++++++++++++---- pandora_console/include/ajax/module.php | 7 +++ pandora_console/include/lib/Module.php | 4 ++ pandora_console/pandoradb.sql | 2 + 9 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini diff --git a/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini new file mode 100644 index 0000000000..c7bd1211f7 --- /dev/null +++ b/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini @@ -0,0 +1,11 @@ +pandorafms.vmware=d41d8cd98f00b204e9800998ecf8427e +pandorafms.mysql=d41d8cd98f00b204e9800998ecf8427e +pandorafms.mssql=d41d8cd98f00b204e9800998ecf8427e +pandorafms.oracle=d41d8cd98f00b204e9800998ecf8427e +pandorafms.db2=d41d8cd98f00b204e9800998ecf8427e +pandorafms.sap.deset=d41d8cd98f00b204e9800998ecf8427e +pandorafms.gcp.ce=d41d8cd98f00b204e9800998ecf8427e +pandorafms.aws.ec2=d41d8cd98f00b204e9800998ecf8427e +pandorafms.aws.s3=d41d8cd98f00b204e9800998ecf8427e +pandorafms.aws.rds=d41d8cd98f00b204e9800998ecf8427e +pandorafms.azure.mc=d41d8cd98f00b204e9800998ecf8427e diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 376a725662..94f29a899a 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -1,3 +1,4 @@ +-- Active: 1685706586212@@172.16.0.2@3306@pandora START TRANSACTION; @@ -9,5 +10,8 @@ UPDATE `twelcome_tip` UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2'; +ALTER TABLE tagente_modulo ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0; +ALTER TABLE tpolicy_modules ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0; + COMMIT; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 44823bfd6d..11720e4e9b 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1333,6 +1333,12 @@ if ($update_module === true || $create_module === true) { */ $post_process = (string) get_parameter('post_process', 0.0); + if (modules_is_string_type($id_module_type) === false) { + $made_enabled = (bool) get_parameter_checkbox('made_enabled', 0); + } else { + $made_enabled = false; + } + $prediction_module = (int) get_parameter('prediction_module'); $max_timeout = (int) get_parameter('max_timeout'); $max_retries = (int) get_parameter('max_retries'); @@ -1711,6 +1717,7 @@ if ($update_module) { 'plugin_parameter' => $plugin_parameter, 'id_plugin' => $id_plugin, 'post_process' => $post_process, + 'made_enabled' => $made_enabled, 'prediction_module' => $prediction_module, 'max_timeout' => $max_timeout, 'max_retries' => $max_retries, @@ -1909,6 +1916,7 @@ if ($create_module) { 'plugin_parameter' => $plugin_parameter, 'id_plugin' => $id_plugin, 'post_process' => $post_process, + 'made_enabled' => $made_enabled, 'prediction_module' => $prediction_module, 'max_timeout' => $max_timeout, 'max_retries' => $max_retries, diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 42aa286c8a..b17ed62239 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -294,6 +294,7 @@ if ($id_agent_module) { $plugin_parameter = $module['plugin_parameter']; $id_plugin = $module['id_plugin']; $post_process = $module['post_process']; + $made_enabled = $module['made_enabled']; $prediction_module = $module['prediction_module']; $custom_integer_1 = $module['custom_integer_1']; $custom_integer_2 = $module['custom_integer_2']; @@ -408,6 +409,7 @@ if ($id_agent_module) { $id_module_group = 1; $id_module_type = 1; $post_process = ''; + $made_enabled = false; $max_timeout = 0; $max_retries = 0; $min = ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index f70af23627..f7da1b7451 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1376,6 +1376,24 @@ $table_advanced->data['process_unit'][1] = html_print_extended_select_for_post_p $disabledBecauseInPolicy ); +$table_advanced->rowclass['caption_made_enabled'] = 'w50p'; +$table_advanced->rowclass['made_enabled'] = 'w50p'; +$table_advanced->data['caption_made_enabled'][0] = __('MADE enabled').ui_print_help_tip( + __('By activating this option, the module data will be processed by the MADE engine (if active), and events will be generated automatically by the IA engine'), + true +); +$table_advanced->data['made_enabled'][0] = html_print_checkbox_switch( + 'made_enabled', + 1, + (bool) $made_enabled, + false, + false, + '', + false, + false, + 'wp100 static' +); + $table_advanced->data['title_5'] = html_print_subtitle_table(__('Notifications and alerts')); $table_advanced->data['caption_export_target'][0] = __('Export target'); @@ -1882,6 +1900,8 @@ $(document).ready (function () { $('#percentage_critical').show(); // Show dinamic reference. $('#svg_dinamic').show(); + $('#advanced-made_enabled').show(); + $('#advanced-caption_made_enabled').show(); } else { // Show string fields. @@ -1902,6 +1922,8 @@ $(document).ready (function () { $('#percentage_critical').hide(); // Hide dinamic reference. $('#svg_dinamic').hide(); + $('#advanced-made_enabled').hide(); + $('#advanced-caption_made_enabled').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 fbb63c49d3..a8b2d248d4 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -916,7 +916,24 @@ $table->data[17][0] = html_print_label_input_block( ) ); -$table->data[17][1] = html_print_label_input_block( +$table->data['made_enabled'][1] = html_print_label_input_block( + __('MADE enabled').ui_print_help_tip( + __('By activating this option, the module data will be processed by the MADE engine (if active), and events will be generated automatically by the IA engine'), + true + ), + html_print_checkbox_switch( + 'made_enabled', + 1, + false, + true, + false, + '', + false, + 'wp100 static' + ) +); + +$table->data[17][2] = html_print_label_input_block( __('SNMP community'), html_print_input_text( 'snmp_community', @@ -1653,7 +1670,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").hide(); var params = { @@ -1728,7 +1746,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").show (); switch($('#module_type').val()) { @@ -1838,7 +1857,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").hide (); $('input[type=checkbox]').attr('checked', false); $('input[type=checkbox]').attr('disabled', true); @@ -1877,7 +1897,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").show(); } else { @@ -1908,7 +1929,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").hide(); } } @@ -1932,6 +1954,9 @@ $(document).ready (function () { else if (this.id == "checkbox-dynamic_two_tailed") { return; //Do none } + else if (this.id == "checkbox-made_enabled") { + return; //Do none + } else { if (this.id == "checkbox-force_group") { $("#checkbox-recursion").prop("checked", false); @@ -1964,7 +1989,7 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + "tr#delete_table-40").show (); } else { @@ -1995,7 +2020,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").hide(); } } @@ -2085,7 +2111,8 @@ $(document).ready (function () { "tr#delete_table-36, " + "tr#delete_table-37, " + "tr#delete_table-38, " + - "tr#delete_table-39, " + + "tr#delete_table-39, " + + "tr#delete_table-made_enabled, " + "tr#delete_table-40").hide(); jQuery.post ("ajax.php", @@ -2315,6 +2342,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' 'module_interval', 'disabled', 'post_process', + 'made_enabled', 'unit_select', 'snmp_community', 'snmp_oid', @@ -2626,6 +2654,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' $values['macros'] = json_encode($module_macros); } + if (modules_is_string_type($module['id_tipo_modulo']) === true) { + $values['made_enabled'] = 0; + } + $result = modules_update_agent_module( $module['id_agente_modulo'], $values, diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 921a1e1bc0..7ade06c9d4 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -482,6 +482,13 @@ if (check_login()) { 'tagente_modulo', ['id_agente_modulo' => $module_id] ); + + $made_enabled = db_get_value_filter( + 'made_enabled', + 'tagente_modulo', + ['id_agente_modulo' => $module_id] + ); + $unit = db_get_value_filter( 'unit', 'tagente_modulo', diff --git a/pandora_console/include/lib/Module.php b/pandora_console/include/lib/Module.php index db4f086eb8..70a8009ce2 100644 --- a/pandora_console/include/lib/Module.php +++ b/pandora_console/include/lib/Module.php @@ -391,6 +391,10 @@ class Module extends Entity $keyName = 'postprocess'; } + if ($methodName === 'made_enabled') { + $keyName = 'madeEnabled'; + } + if ($methodName === 'max_timeout') { $keyName = 'timeout'; } diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 64d0b96813..798c285172 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -174,6 +174,7 @@ CREATE TABLE IF NOT EXISTS `tagente_estado` ( `last_unknown_update` BIGINT NOT NULL DEFAULT 0, `last_status_change` BIGINT NOT NULL DEFAULT 0, `warning_count` INT UNSIGNED DEFAULT 0, + `made_enambled` TINYINT UNSIGNED DEFAULT 0, PRIMARY KEY (`id_agente_estado`), KEY `status_index_1` (`id_agente_modulo`), KEY `idx_agente` (`id_agente`), @@ -2570,6 +2571,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_modules` ( `percentage_warning` TINYINT UNSIGNED DEFAULT 0, `percentage_critical` TINYINT UNSIGNED DEFAULT 0, `warning_time` INT UNSIGNED DEFAULT 0, + `made_enabled` TINYINT UNSIGNED DEFAULT 0, PRIMARY KEY (`id`), KEY `main_idx` (`id_policy`), UNIQUE (`id_policy`, `name`) From a0c01a7ae7e2972f7a962aa565bda6fd4a0d51fb Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 31 Aug 2023 18:10:26 +0200 Subject: [PATCH 02/37] Removed undesired ini file --- .../discovery/DiscoveryApplicationsMigrateCodes.ini | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini diff --git a/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini deleted file mode 100644 index c7bd1211f7..0000000000 --- a/pandora_console/attachment/discovery/DiscoveryApplicationsMigrateCodes.ini +++ /dev/null @@ -1,11 +0,0 @@ -pandorafms.vmware=d41d8cd98f00b204e9800998ecf8427e -pandorafms.mysql=d41d8cd98f00b204e9800998ecf8427e -pandorafms.mssql=d41d8cd98f00b204e9800998ecf8427e -pandorafms.oracle=d41d8cd98f00b204e9800998ecf8427e -pandorafms.db2=d41d8cd98f00b204e9800998ecf8427e -pandorafms.sap.deset=d41d8cd98f00b204e9800998ecf8427e -pandorafms.gcp.ce=d41d8cd98f00b204e9800998ecf8427e -pandorafms.aws.ec2=d41d8cd98f00b204e9800998ecf8427e -pandorafms.aws.s3=d41d8cd98f00b204e9800998ecf8427e -pandorafms.aws.rds=d41d8cd98f00b204e9800998ecf8427e -pandorafms.azure.mc=d41d8cd98f00b204e9800998ecf8427e From 8406fb7d3ee01df53f75f46b0392aebd09a1897a Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 1 Sep 2023 14:12:01 +0200 Subject: [PATCH 03/37] Added missing field to pandoradb_data.sql and fix minor bug --- pandora_console/include/lib/Module.php | 1 + pandora_console/pandoradb_data.sql | 84 +++++++++++++------------- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/pandora_console/include/lib/Module.php b/pandora_console/include/lib/Module.php index 70a8009ce2..476688190e 100644 --- a/pandora_console/include/lib/Module.php +++ b/pandora_console/include/lib/Module.php @@ -412,6 +412,7 @@ class Module extends Entity 'module_max', 'module_min', 'module_postprocess', + 'module_made_enabled', 'module_interval', 'module_timeout', 'module_retries', diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 6eb4ec4249..0208fcaa36 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1228,48 +1228,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,0); INSERT INTO `tpolicies` VALUES (6,'Basic Remote Checks','Basic Remote Checks (ping, latency, ports).',9,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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,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 e28f2b1ec394791d707cfa665f8a208592738fbc Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 1 Sep 2023 14:15:41 +0200 Subject: [PATCH 04/37] Minor fix --- pandora_console/include/lib/Module.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/include/lib/Module.php b/pandora_console/include/lib/Module.php index 476688190e..e408100166 100644 --- a/pandora_console/include/lib/Module.php +++ b/pandora_console/include/lib/Module.php @@ -391,10 +391,6 @@ class Module extends Entity $keyName = 'postprocess'; } - if ($methodName === 'made_enabled') { - $keyName = 'madeEnabled'; - } - if ($methodName === 'max_timeout') { $keyName = 'timeout'; } From f4eedb14a25d42a165613f67321f99a0de19c072 Mon Sep 17 00:00:00 2001 From: Calvo Date: Fri, 1 Sep 2023 14:27:02 +0200 Subject: [PATCH 05/37] Fix module.pho changes --- pandora_console/include/lib/Module.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/include/lib/Module.php b/pandora_console/include/lib/Module.php index e408100166..db4f086eb8 100644 --- a/pandora_console/include/lib/Module.php +++ b/pandora_console/include/lib/Module.php @@ -408,7 +408,6 @@ class Module extends Entity 'module_max', 'module_min', 'module_postprocess', - 'module_made_enabled', 'module_interval', 'module_timeout', 'module_retries', From 14aa8083cbeb8e9dd007fb487ee9561e8d51cd11 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Sun, 1 Oct 2023 14:48:13 -0600 Subject: [PATCH 06/37] Add logs module --- pandora_agents/pc/pandora_agent | 186 ++++++++++++++++++- pandora_agents/unix/Linux/pandora_agent.conf | 10 + pandora_agents/win32/bin/pandora_agent.conf | 9 + 3 files changed, 204 insertions(+), 1 deletion(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index aa8208f5d0..798d0ba5af 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -394,6 +394,8 @@ sub parse_conf_modules($) { 'max_warning' => undef, 'disabled' => undef, 'min_ff_event' => undef, + 'filter' => undef, + 'log_file' => undef, 'save' => '', 'conditions' => [], 'cron' => '', @@ -411,7 +413,7 @@ sub parse_conf_modules($) { $module->{'description'} = $1; } elsif ($line =~ /^\s*module_type\s+(\S+)\s*$/) { $module->{'type'} = $1; - }elsif ($line =~ /^\s*module_precondition\s+(.*)$/) { + } elsif ($line =~ /^\s*module_precondition\s+(.*)$/) { my $action = $1; # Numeric comparison @@ -559,6 +561,16 @@ sub parse_conf_modules($) { # Min ff event } elsif ($line =~ /^\s*module_min_ff_event\s+(.*)\s*$/) { $module->{'min_ff_event'} = $1; + # Log module file + } elsif ($line =~ /^\s*module_logfile\s+(.*)\s*$/) { + $module->{'filter'} = $1; + # Log module filter + } elsif ($line =~ /^\s*module_filter\s+(.*)\s*$/) { + $module->{'log_file'} = $1; + # Log module function + } elsif ($line =~ /^\s*module_logger\s+(.*)\s*$/) { + $module->{'func'} = \&module_logger; + $module->{'params'} = $1; } } return; @@ -1814,6 +1826,178 @@ sub exec_plugin ($) { $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); } +################################################################################ +# Read the logs +################################################################################ +sub module_logger ($) { + + # Return: 0 If all was OK + # 1 If there is an error + my $status = grep_logs( + $module->{'name'}, + $module->{'log_file'}, + $module->{'filter'} + ) + + return ($status); +} + +sub grep_logs { + my ($str_name, $str_file, $str_regex) = @_; + if(!$str_name){ + log_message("module_logger", "Missing module name"); + return; + } + + if(!$str_file){ + log_message("module_logger", "Missing file name"); + return; + } + + if(!$str_regex){ + $str_regex = '\.\*' + } + + my $idx_dir = '/tmp/'; + my $idx_file = ''; + my $idx_pos = 0; + my $idx_ino = ''; + my $module_name = $str_name; + my $log_file = $str_file; + my $reg_exp = $str_regex; + + # Check that log file exists + if (! -e $log_file) { + log_message("module_logger", "File $log_file does not exist"); + return; + } + + # Create index file storage directory + if (! -d $idx_dir) { + if (!mkdir($idx_dir)){ + log_message("module_logger", "Error creating directory $idx_dir: " . $!); + return; + } + } + + # Create index file if it does not exist + my $idx_file = $idx_dir.$module_name."_".basename($log_file).".idx"; + if (! -e $idx_file) { + create_idx(); + } else { + return if load_idx() == 1; + + return if parse_log() == 1; + } + + # Start the function definition + sub create_idx { + my $first_line; + log_message("module_logger", "Creating index file $idx_file"); + if (!open(LOGFILE, $log_file)){ + log_message("module_logger", "Error opening file $log_file: ".$!); + return 1; + } + + # Go to EOF and save the position + seek(LOGFILE, 0, 2); + $idx_pos = tell(LOGFILE); + + close(LOGFILE); + + # Save the file inode number + $idx_ino = (stat($log_file))[1]; + + return 1 if save_idx() == 1; + + return 0; + } + + sub save_idx { + log_message("module_logger", "Saving index file $idx_file"); + + if (!open(IDXFILE, "> $idx_file")){ + log_message("module_logger", "Error opening file $idx_file: ". $!); + return 1; + } + + print (IDXFILE $idx_pos . " " . $idx_ino); + close(IDXFILE); + + return 0; + } + + sub load_idx { + my $line; + my $current_ino; + + log_message("module_logger", "Loading index file $idx_file"); + + if (!open(IDXFILE, $idx_file)){ + log_message("module_logger", "Error opening file $idx_file: " .$!); + return 1; + } + + # Read position and date + $line = ; + ($idx_pos, $idx_ino) = split(' ', $line); + + close(IDXFILE); + + # Reset the file index if the file has changed + $current_ino = (stat($log_file))[1]; + if ($current_ino != $idx_ino) { + log_message("module_logger", "File changed, resetting index"); + + $idx_pos = 0; + $idx_ino = $current_ino; + } + + return 0; + } + + sub parse_log { + my $line; + + log_message("module_logger", "Parsing log file $log_file"); + + # Open log file for reading + if (!open(LOGFILE, $log_file)){ + log_message("module_logger", "Error opening file $log_file: " . $!); + return 1; + } + + # Go to starting position. + seek(LOGFILE, $idx_pos, 0); + + print STDOUT "\n"; + print STDOUT "\n"; + print STDOUT "\n"; + print STDOUT "\n"; + + # Parse log file + while ($line = ) { + if ($line =~ m/$reg_exp/i) { + # Remove the trailing '\n' + chop($line); + + print STDOUT "\n"; + } + } + + print STDOUT "\n"; + print STDOUT "\n"; + + $idx_pos = tell(LOGFILE); + close(LOGFILE); + + # Save the index file + return 1 if save_idx() == 1; + + return 0; + } +} + ################################################################################ # TERM Handler ################################################################################ diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 1b8131a42d..83966e6772 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -315,4 +315,14 @@ module_plugin autodiscover --default #module_begin #module_plugin /usr/share/pandora_agent/plugins/pandora_sca #module_absoluteinterval 7d +#module_end + +# Logs extaction plugin +#module_begin +#module_name Syslog +#module_type log +#module_logfile /var/log/messages +#module_logger syslog +# module_filter uses REGEXP, optional, if not defined, it takes all lines. +#module_filter \.\* #module_end \ No newline at end of file diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index d299325f3b..d19981d179 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -530,3 +530,12 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default #module_absoluteinterval 7d #module_end +# Logs extaction plugin +#module_begin +#module_name Oracle_Server_log +#module_type log +#module_logfile c:\oracle\logs\oraserver.log +#module_logger syslog +#module_filter uses REGEXP, optional, if not defined, it takes all lines. +#module_filter \.\* +#module_end From 0177d1906d774a4b075d7530decc0f6a97f1bbb1 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Mon, 2 Oct 2023 18:13:05 -0600 Subject: [PATCH 07/37] Changes on log result --- pandora_agents/pc/pandora_agent | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index 798d0ba5af..58b415ba0e 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -1883,11 +1883,14 @@ sub grep_logs { # Create index file if it does not exist my $idx_file = $idx_dir.$module_name."_".basename($log_file).".idx"; if (! -e $idx_file) { - create_idx(); - } else { + return if create_idx() == 1; + } else{ return if load_idx() == 1; + my $result = parse_log(); - return if parse_log() == 1; + return if $result == 1; + + return $result; } # Start the function definition @@ -1920,7 +1923,7 @@ sub grep_logs { log_message("module_logger", "Error opening file $idx_file: ". $!); return 1; } - + print (IDXFILE $idx_pos . " " . $idx_ino); close(IDXFILE); @@ -1957,6 +1960,7 @@ sub grep_logs { } sub parse_log { + my $result = ""; my $line; log_message("module_logger", "Parsing log file $log_file"); @@ -1970,10 +1974,10 @@ sub grep_logs { # Go to starting position. seek(LOGFILE, $idx_pos, 0); - print STDOUT "\n"; - print STDOUT "\n"; - print STDOUT "\n"; - print STDOUT "\n"; + $result = $result . "\n"; + $result = $result . "\n"; + $result = $result . "\n"; + $result = $result . "\n"; # Parse log file while ($line = ) { @@ -1981,20 +1985,21 @@ sub grep_logs { # Remove the trailing '\n' chop($line); - print STDOUT "\n"; + $result = $result . "\n"; } } - print STDOUT "\n"; - print STDOUT "\n"; + $result = $result . "\n"; + $result = $result . "\n"; $idx_pos = tell(LOGFILE); close(LOGFILE); + print($result); # Save the index file return 1 if save_idx() == 1; - return 0; + return $result; } } From 3bd306fcf1cb48f095569ddab79fa17b026be896 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 4 Oct 2023 14:00:29 -0600 Subject: [PATCH 08/37] Modify log module --- pandora_agents/pc/pandora_agent | 199 +----------------- pandora_agents/unix/Linux/pandora_agent.conf | 15 +- pandora_agents/unix/pandora_agent | 205 +++++++++++++++++++ 3 files changed, 214 insertions(+), 205 deletions(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index 58b415ba0e..67e603b225 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -54,7 +54,6 @@ if (!$@) { use constant AGENT_VERSION => '4.0.1'; use constant AGENT_BUILD => '111213'; - # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { linux => 'cat /proc/meminfo | grep MemTotal: | awk \'{ print $2 }\'', @@ -117,7 +116,6 @@ my $ConfDir = ''; # Pandora FMS agent configuration file my $ConfFile = 'pandora_agent.conf'; - # Broker agent configuration files my @BrokerPid; @@ -264,7 +262,6 @@ sub valid_regexp ($) { sub rmrf { my $path = shift; local *DIR; - if (-d $path) { opendir (DIR, $path) || return; while (defined (my $file_name = readdir(DIR))) { @@ -348,7 +345,6 @@ sub log_message ($$;$) { } } } - ################################################################################ # Add the given directory to the PATH. ################################################################################ @@ -394,8 +390,6 @@ sub parse_conf_modules($) { 'max_warning' => undef, 'disabled' => undef, 'min_ff_event' => undef, - 'filter' => undef, - 'log_file' => undef, 'save' => '', 'conditions' => [], 'cron' => '', @@ -413,7 +407,7 @@ sub parse_conf_modules($) { $module->{'description'} = $1; } elsif ($line =~ /^\s*module_type\s+(\S+)\s*$/) { $module->{'type'} = $1; - } elsif ($line =~ /^\s*module_precondition\s+(.*)$/) { + }elsif ($line =~ /^\s*module_precondition\s+(.*)$/) { my $action = $1; # Numeric comparison @@ -561,16 +555,6 @@ sub parse_conf_modules($) { # Min ff event } elsif ($line =~ /^\s*module_min_ff_event\s+(.*)\s*$/) { $module->{'min_ff_event'} = $1; - # Log module file - } elsif ($line =~ /^\s*module_logfile\s+(.*)\s*$/) { - $module->{'filter'} = $1; - # Log module filter - } elsif ($line =~ /^\s*module_filter\s+(.*)\s*$/) { - $module->{'log_file'} = $1; - # Log module function - } elsif ($line =~ /^\s*module_logger\s+(.*)\s*$/) { - $module->{'func'} = \&module_logger; - $module->{'params'} = $1; } } return; @@ -594,7 +578,6 @@ sub write_broker_conf($){ } while (my $line = ){ - # Skip broker definitions if ($line =~ m/^\s*broker_agent/) { next; @@ -1822,187 +1805,9 @@ sub exec_plugin ($) { $Sem->down () if (defined ($Sem)); $Xml .= $output; $Sem->up () if (defined ($Sem)); - $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); } -################################################################################ -# Read the logs -################################################################################ -sub module_logger ($) { - - # Return: 0 If all was OK - # 1 If there is an error - my $status = grep_logs( - $module->{'name'}, - $module->{'log_file'}, - $module->{'filter'} - ) - - return ($status); -} - -sub grep_logs { - my ($str_name, $str_file, $str_regex) = @_; - if(!$str_name){ - log_message("module_logger", "Missing module name"); - return; - } - - if(!$str_file){ - log_message("module_logger", "Missing file name"); - return; - } - - if(!$str_regex){ - $str_regex = '\.\*' - } - - my $idx_dir = '/tmp/'; - my $idx_file = ''; - my $idx_pos = 0; - my $idx_ino = ''; - my $module_name = $str_name; - my $log_file = $str_file; - my $reg_exp = $str_regex; - - # Check that log file exists - if (! -e $log_file) { - log_message("module_logger", "File $log_file does not exist"); - return; - } - - # Create index file storage directory - if (! -d $idx_dir) { - if (!mkdir($idx_dir)){ - log_message("module_logger", "Error creating directory $idx_dir: " . $!); - return; - } - } - - # Create index file if it does not exist - my $idx_file = $idx_dir.$module_name."_".basename($log_file).".idx"; - if (! -e $idx_file) { - return if create_idx() == 1; - } else{ - return if load_idx() == 1; - my $result = parse_log(); - - return if $result == 1; - - return $result; - } - - # Start the function definition - sub create_idx { - my $first_line; - log_message("module_logger", "Creating index file $idx_file"); - if (!open(LOGFILE, $log_file)){ - log_message("module_logger", "Error opening file $log_file: ".$!); - return 1; - } - - # Go to EOF and save the position - seek(LOGFILE, 0, 2); - $idx_pos = tell(LOGFILE); - - close(LOGFILE); - - # Save the file inode number - $idx_ino = (stat($log_file))[1]; - - return 1 if save_idx() == 1; - - return 0; - } - - sub save_idx { - log_message("module_logger", "Saving index file $idx_file"); - - if (!open(IDXFILE, "> $idx_file")){ - log_message("module_logger", "Error opening file $idx_file: ". $!); - return 1; - } - - print (IDXFILE $idx_pos . " " . $idx_ino); - close(IDXFILE); - - return 0; - } - - sub load_idx { - my $line; - my $current_ino; - - log_message("module_logger", "Loading index file $idx_file"); - - if (!open(IDXFILE, $idx_file)){ - log_message("module_logger", "Error opening file $idx_file: " .$!); - return 1; - } - - # Read position and date - $line = ; - ($idx_pos, $idx_ino) = split(' ', $line); - - close(IDXFILE); - - # Reset the file index if the file has changed - $current_ino = (stat($log_file))[1]; - if ($current_ino != $idx_ino) { - log_message("module_logger", "File changed, resetting index"); - - $idx_pos = 0; - $idx_ino = $current_ino; - } - - return 0; - } - - sub parse_log { - my $result = ""; - my $line; - - log_message("module_logger", "Parsing log file $log_file"); - - # Open log file for reading - if (!open(LOGFILE, $log_file)){ - log_message("module_logger", "Error opening file $log_file: " . $!); - return 1; - } - - # Go to starting position. - seek(LOGFILE, $idx_pos, 0); - - $result = $result . "\n"; - $result = $result . "\n"; - $result = $result . "\n"; - $result = $result . "\n"; - - # Parse log file - while ($line = ) { - if ($line =~ m/$reg_exp/i) { - # Remove the trailing '\n' - chop($line); - - $result = $result . "\n"; - } - } - - $result = $result . "\n"; - $result = $result . "\n"; - - $idx_pos = tell(LOGFILE); - close(LOGFILE); - - print($result); - # Save the index file - return 1 if save_idx() == 1; - - return $result; - } -} - ################################################################################ # TERM Handler ################################################################################ @@ -2476,4 +2281,4 @@ This is released under the GNU Lesser General Public License. Copyright (c) 2005-2023 Pandora FMS -=cut +=cut \ No newline at end of file diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 83966e6772..4659fa9f78 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -317,12 +317,11 @@ module_plugin autodiscover --default #module_absoluteinterval 7d #module_end -# Logs extaction plugin -#module_begin -#module_name Syslog -#module_type log -#module_logfile /var/log/messages -#module_logger syslog -# module_filter uses REGEXP, optional, if not defined, it takes all lines. -#module_filter \.\* +# Logs extaction +#module_begin +#module_name Syslog +#module_description Logs extaction module +#module_type log +#module_regexp /var/log/logfile.log +#module_pattern .* #module_end \ No newline at end of file diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 919bbbc64f..1988db1bae 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1562,6 +1562,9 @@ sub parse_conf_modules($) { } elsif ($line =~ /^\s*module_occupiedpercentdisk\s+(.*)$/) { $module->{'func'} = \&module_occupiedpercentdisk; $module->{'params'} = $1; + }elsif ($line =~ /^\s*module_regexp\s+(.*)$/) { + $module->{'func'} = \&module_logger; + $module->{'params'} = $1; } elsif ($line =~ /^\s*module_max\s+(.*)\s*$/) { $module->{'max'} = $1; } elsif ($line =~ /^\s*module_min\s+(.*)\s*$/) { @@ -1817,7 +1820,11 @@ sub parse_conf_modules($) { # Macros } elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) { $module->{'macros'}{$1} = $2; + # Regexp } + elsif ($line =~ /^\s*module_pattern(\S+)\s+(.*)\s*$/) { + $module->{'filter'} = $1; + } } return; } @@ -3860,6 +3867,203 @@ sub module_plugin ($) { return ($output); } +################################################################################ +# Read the logs +################################################################################ +sub module_logger ($) { + my $module = shift; + + my $status = grep_logs( + $module->{'name'}, + $module->{'params'}, + $module->{'filter'} + ); + + print($status); + + return ($status); +} + +sub grep_logs { + my ($str_name, $str_file, $str_regex) = @_; + + if(!$str_name){ + log_message("module_logger", "Missing module name"); + return; + } + + if(!$str_file){ + log_message("module_logger", "Missing file name"); + return; + } + + if(!$str_regex){ + $str_regex = '.*'; + } + + my $idx_dir = '/tmp/'; + my $idx_file = ''; + my $idx_pos = 0; + my $idx_ino = ''; + my $module_name = $str_name; + my $log_file = $str_file; + my $reg_exp = $str_regex; + + # Check that log file exists + if (! -e $log_file) { + log_message("module_logger", "File $log_file does not exist"); + return; + } + + # Create index file storage directory + if (! -d $idx_dir) { + if (!mkdir($idx_dir)){ + log_message("module_logger", "Error creating directory $idx_dir: " . $!); + return; + } + } + + # Create index file if it does not exist + $idx_file = $idx_dir.$module_name."_".basename($log_file).".idx"; + if (! -e $idx_file) { + return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file) == 1; + return "" + } else{ + + return if load_idx(\$idx_pos, \$idx_ino, \$idx_file) == 1; + my $result = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp); + + if (looks_like_number($result)) { + return if $result == 1; + } + + return $result; + } + + # Start the function definition + sub create_idx { + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref) = @_; + my $first_line; + + + + log_message("module_logger", "Creating index file $$idx_file_ref"); + + if (!open(LOGFILE, $$log_file_ref)){ + log_message("module_logger", "Error opening file $$log_file_ref: ".$!); + return 1; + } + + # Go to EOF and save the position + seek(LOGFILE, 0, 2); + $$idx_pos_ref = tell(LOGFILE); + + ################### + + close(LOGFILE); + + # Save the file inode number + $$idx_ino_ref = (stat($$log_file_ref))[1]; + + return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref) == 1; + + return 0; + } + + sub save_idx { + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref) = @_; + + log_message("module_logger", "Saving index file $$idx_file_ref"); + + if (!open(IDXFILE, "> $$idx_file_ref")){ + log_message("module_logger", "Error opening file $$idx_file_ref: ". $!); + return 1; + } + + print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref); + close(IDXFILE); + + return 0; + } + + sub load_idx { + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref) = @_; + my $line; + my $current_ino; + + log_message("module_logger", "Loading index file $$idx_file_ref"); + + if (!open(IDXFILE, $$idx_file_ref)){ + log_message("module_logger", "Error opening file $$idx_file_ref: " .$!); + return 1; + } + + # Read position and date + $line = ; + ($$idx_pos_ref, $$idx_ino_ref) = split(' ', $line); + + close(IDXFILE); + + print($$idx_pos_ref); + print($$idx_pos_ref); + + # Reset the file index if the file has changed + $current_ino = (stat($$idx_file_ref))[1]; + + if ($current_ino != $$idx_ino_ref) { + log_message("module_logger", "File changed, resetting index"); + + $$idx_pos_ref = 0; + $$idx_ino_ref = $current_ino; + } + + return 0; + } + + sub parse_log { + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref) = @_; + my $result = ""; + my $line; + + log_message("module_logger", "Parsing log file $$log_file_ref"); + + # Open log file for reading + if (!open(LOGFILE, $$log_file_ref)){ + log_message("module_logger", "Error opening file $$log_file_ref: " . $!); + return 1; + } + + # Go to starting position. + seek(LOGFILE, $$idx_pos_ref, 0); + + $result = $result . "\n"; + $result = $result . "\n"; + $result = $result . "\n"; + $result = $result . "\n"; + + # Parse log file + while ($line = ) { + if ($line =~ m/$$reg_exp_ref/i) { + # Remove the trailing '\n' + chop($line); + + $result = $result . "\n"; + } + } + + $result = $result . "\n"; + $result = $result . "\n"; + + $$idx_pos_ref = tell(LOGFILE); + close(LOGFILE); + + # Save the index file + return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref) == 1; + + return $result; + } +} + ################################################################################ # TERM Handler ################################################################################ @@ -4030,6 +4234,7 @@ sub init_module ($) { $module->{'module_ff_interval'} = undef; $module->{'macros'} = {}; $module->{'alert_template'} = undef; + $module->{'filter'} = undef; } ################################################################################ From 0ab1570b7d382e3add01bb8d248b76512047286b Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 4 Oct 2023 14:07:31 -0600 Subject: [PATCH 09/37] Modify conf --- pandora_agents/win32/bin/pandora_agent.conf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index d19981d179..4325eaa6ce 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -530,12 +530,11 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default #module_absoluteinterval 7d #module_end -# Logs extaction plugin -#module_begin -#module_name Oracle_Server_log -#module_type log -#module_logfile c:\oracle\logs\oraserver.log -#module_logger syslog -#module_filter uses REGEXP, optional, if not defined, it takes all lines. -#module_filter \.\* -#module_end +# Logs extaction +#module_begin +#module_name X_Server_log +#module_description Logs extaction module +#module_type log +#module_regexp C:\server\logs\xserver.log +#module_pattern .* +#module_end \ No newline at end of file From a5b6b3e0f32585d2b076cd0160ffe78544fe480b Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 4 Oct 2023 14:10:50 -0600 Subject: [PATCH 10/37] Modify conf files --- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/win32/bin/pandora_agent.conf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 4659fa9f78..10705b3e7e 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -317,7 +317,7 @@ module_plugin autodiscover --default #module_absoluteinterval 7d #module_end -# Logs extaction +# Logs extraction #module_begin #module_name Syslog #module_description Logs extaction module diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 4325eaa6ce..0438696681 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -530,11 +530,11 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default #module_absoluteinterval 7d #module_end -# Logs extaction +# Logs extraction #module_begin #module_name X_Server_log #module_description Logs extaction module #module_type log #module_regexp C:\server\logs\xserver.log #module_pattern .* -#module_end \ No newline at end of file +#module_end From ff81e3a68cf20c45d7d7aa29ff3e26c7fe06e09d Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 4 Oct 2023 14:16:30 -0600 Subject: [PATCH 11/37] Remove extra prints --- pandora_agents/unix/pandora_agent | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1988db1bae..6310c3466b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3879,8 +3879,6 @@ sub module_logger ($) { $module->{'filter'} ); - print($status); - return ($status); } @@ -4003,9 +4001,6 @@ sub grep_logs { ($$idx_pos_ref, $$idx_ino_ref) = split(' ', $line); close(IDXFILE); - - print($$idx_pos_ref); - print($$idx_pos_ref); # Reset the file index if the file has changed $current_ino = (stat($$idx_file_ref))[1]; From ea8fe5744adf5af051a748ce0f11a57dbff4c4ac Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Fri, 6 Oct 2023 12:15:24 -0600 Subject: [PATCH 12/37] Fix Linux log module --- pandora_agents/unix/pandora_agent | 115 ++++++++++++++++++++---------- 1 file changed, 77 insertions(+), 38 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 6310c3466b..e6f0d97521 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3879,9 +3879,39 @@ sub module_logger ($) { $module->{'filter'} ); - return ($status); + return; } +my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub { + my ($str, $endl) = @_; + + my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/'); + my $str_len = length($str); + my $str_base64 = ''; + + for (my $i = 0; $i < $str_len; $i += 3) { + my $chunk = substr($str, $i, 3); + my $chunk_len = length($chunk); + + my $num = 0; + $num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1); + $num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2); + $num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3); + + my $enc_1 = ($num & 0xfc0000) >> 18; + my $enc_2 = ($num & 0x03f000) >> 12; + my $enc_3 = ($num & 0x000fc0) >> 6; + my $enc_4 = ($num & 0x00003f); + + $str_base64 .= $ALPHABET[$enc_1]; + $str_base64 .= $ALPHABET[$enc_2]; + $str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '='; + $str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '='; + } + + return $str_base64; +}; + sub grep_logs { my ($str_name, $str_file, $str_regex) = @_; @@ -3902,6 +3932,7 @@ sub grep_logs { my $idx_dir = '/tmp/'; my $idx_file = ''; my $idx_pos = 0; + my $idx_size = 0; my $idx_ino = ''; my $module_name = $str_name; my $log_file = $str_file; @@ -3924,27 +3955,24 @@ sub grep_logs { # Create index file if it does not exist $idx_file = $idx_dir.$module_name."_".basename($log_file).".idx"; if (! -e $idx_file) { - return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file) == 1; - return "" + return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$idx_size) == 1; + return } else{ - return if load_idx(\$idx_pos, \$idx_ino, \$idx_file) == 1; - my $result = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp); + return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1; + my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size); - if (looks_like_number($result)) { - return if $result == 1; - } + print_log (@data); - return $result; + return; } # Start the function definition + sub create_idx { - my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref) = @_; + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $idx_size_ref) = @_; my $first_line; - - log_message("module_logger", "Creating index file $$idx_file_ref"); if (!open(LOGFILE, $$log_file_ref)){ @@ -3956,20 +3984,18 @@ sub grep_logs { seek(LOGFILE, 0, 2); $$idx_pos_ref = tell(LOGFILE); - ################### - close(LOGFILE); # Save the file inode number $$idx_ino_ref = (stat($$log_file_ref))[1]; - return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref) == 1; + return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1; return 0; } sub save_idx { - my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref) = @_; + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_; log_message("module_logger", "Saving index file $$idx_file_ref"); @@ -3978,16 +4004,17 @@ sub grep_logs { return 1; } - print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref); + print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref . " " . $$idx_size_ref); close(IDXFILE); return 0; } sub load_idx { - my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref) = @_; + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_; my $line; my $current_ino; + my $current_size; log_message("module_logger", "Loading index file $$idx_file_ref"); @@ -3998,26 +4025,27 @@ sub grep_logs { # Read position and date $line = ; - ($$idx_pos_ref, $$idx_ino_ref) = split(' ', $line); + ($$idx_pos_ref, $$idx_ino_ref, $$idx_size_ref) = split(' ', $line); close(IDXFILE); # Reset the file index if the file has changed $current_ino = (stat($$idx_file_ref))[1]; - - if ($current_ino != $$idx_ino_ref) { + $current_size = -s "$$idx_file_ref"; + if ($current_ino != $$idx_ino_ref || $current_size < $$idx_size_ref) { log_message("module_logger", "File changed, resetting index"); $$idx_pos_ref = 0; $$idx_ino_ref = $current_ino; } + $$idx_size_ref = $current_size; return 0; } sub parse_log { - my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref) = @_; - my $result = ""; + my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref, $idx_size_ref) = @_; + my $line; log_message("module_logger", "Parsing log file $$log_file_ref"); @@ -4031,32 +4059,43 @@ sub grep_logs { # Go to starting position. seek(LOGFILE, $$idx_pos_ref, 0); - $result = $result . "\n"; - $result = $result . "\n"; - $result = $result . "\n"; - $result = $result . "\n"; - # Parse log file - while ($line = ) { + my @data; + while ($line = ) { if ($line =~ m/$$reg_exp_ref/i) { - # Remove the trailing '\n' - chop($line); - - $result = $result . "\n"; + push (@data, $line); } } - $result = $result . "\n"; - $result = $result . "\n"; - $$idx_pos_ref = tell(LOGFILE); close(LOGFILE); # Save the index file - return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref) == 1; + return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1; - return $result; + return @data; } + + sub print_log (@) { + my (@data, $module_name) = @_; + + # No data + if ($#data < 0) { + return; + } + + # Log module + my $output = "\n"; + $output .= "\n"; + $output .= "base64\n"; + $output .= ""; + $output .= "\n"; + + print stdout $output; + } + } ################################################################################ From 8742bfb0cb5f7f22e1b55215231039d3df3e6320 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Sat, 7 Oct 2023 18:58:51 -0600 Subject: [PATCH 13/37] Changes on function response --- pandora_agents/unix/pandora_agent | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index e6f0d97521..acd8883682 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -39,6 +39,14 @@ BEGIN { use File::Copy; use Scalar::Util qw(looks_like_number); + use File::Basename; + + BEGIN { + eval { + require MIME::Base64; + }; + } + BEGIN { push @INC, '/usr/lib/perl5'; } ################################################################################ @@ -3670,6 +3678,11 @@ sub write_module_xml ($@) { return; } + if ($module->{'func'} == \&module_logger) { + $Xml .= $data[0]; + return + } + # Critical section $Sem->down () if (defined ($Sem)); @@ -3872,14 +3885,14 @@ sub module_plugin ($) { ################################################################################ sub module_logger ($) { my $module = shift; - + my $status = grep_logs( $module->{'name'}, $module->{'params'}, $module->{'filter'} ); - return; + return $status; } my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub { @@ -3962,9 +3975,9 @@ sub grep_logs { return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1; my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size); - print_log (@data); - - return; + my $output = create_log(@data); + + return $output; } # Start the function definition @@ -4076,7 +4089,7 @@ sub grep_logs { return @data; } - sub print_log (@) { + sub create_log (@) { my (@data, $module_name) = @_; # No data @@ -4090,10 +4103,10 @@ sub grep_logs { $output .= "base64\n"; $output .= ""; + $output .= "]]>\n"; $output .= "\n"; - print stdout $output; + return $output; } } From 35db83647a1c03759090be2bd94a5365035d8565 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 10 Oct 2023 11:04:25 +0200 Subject: [PATCH 14/37] Integrate MADE with Pandora FMS. --- pandora_server/conf/pandora_server.conf.new | 30 +++++++++++++++++++ pandora_server/lib/PandoraFMS/Config.pm | 5 ++++ pandora_server/lib/PandoraFMS/Core.pm | 2 ++ pandora_server/lib/PandoraFMS/Tools.pm | 8 +++++- pandora_server/util/pandora_ha.pl | 32 +++++++++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 816fcc4244..4d64634349 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -770,3 +770,33 @@ netflowserver 0 # Number of threads for the Pandora FMS Netflow Server (PANDORA FMS ENTERPRISE ONLY). netflowserver_threads 1 +# Enable (1) or disable (0) the Monitoring Anomaly Detection Engine (PANDORA FMS ENTERPRISE ONLY). +madeserver 0 + +# Directory where models will be stored (PANDORA FMS ENTERPRISE ONLY). +madeserver_path /var/spool/pandora/data_in/models + +# Number of server threads for MADE (PANDORA FMS ENTERPRISE ONLY). +madeserver_threads 2 + +# Model backend: 'prophet' or 'iforest' (PANDORA FMS ENTERPRISE ONLY). +# 'prophet' is better suited for temporal series and supports forecasting. +# 'iforest' is faster and more efficient (cpu, memory...). +madeserver_backend prophet + +# MADE will query the Pandora FMS database every madeserver_interval seconds +# to look for new data (PANDORA FMS ENTERPRISE ONLY). +madeserver_interval 60 + +# Minimum number of data required to train a model (e.g., '7d' for seven days) (PANDORA FMS ENTERPRISE ONLY). +madeserver_min_train 7d + +# Maximum number of data kept to train models (e.g., '90d' for 90 days) (PANDORA FMS ENTERPRISE ONLY). +madeserver_max_history 90d + +# Model automatic retraining period (e.g., '7d' for seven days) (PANDORA FMS ENTERPRISE ONLY). +madeserver_autofit 7d + +# Model sensitivity. A lower value triggers less anomalies (PANDORA FMS ENTERPRISE ONLY). +madeserver_sensitivity 0.1 + diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 86c4c3a4a5..be4c3c7154 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -579,6 +579,8 @@ sub pandora_load_config { $pa_config->{"repl_dbuser"} = undef; # 7.0.770 $pa_config->{"repl_dbpass"} = undef; # 7.0.770 + $pa_config->{"madeserver"} = 0; # 774. + # Check for UID0 if ($pa_config->{"quiet"} != 0){ if ($> == 0){ @@ -1387,6 +1389,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^repl_dbpass\s(.*)/i) { $pa_config->{'repl_dbpass'} = clean_blank($1); } + elsif ($parametro =~ m/^madeserver\s+([0-1])/i){ + $pa_config->{'madeserver'}= clean_blank($1); + } } # end of loop for parameter # # The DB host was overridden by pandora_ha. diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index e7ac485a1d..b796b651ea 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -317,6 +317,8 @@ our @ServerTypes = qw ( correlationserver ncmserver netflowserver + logserver + madeserver ); our @AlertStatus = ('Execute the alert', 'Do not execute the alert', 'Do not execute the alert, but increment its internal counter', 'Cease the alert', 'Recover the alert', 'Reset internal counter'); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 326e4692ad..70164e84dd 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -79,6 +79,8 @@ our @EXPORT = qw( MIGRATIONSERVER NCMSERVER NETFLOWSERVER + LOGSERVER + MADESERVER METACONSOLE_LICENSE OFFLINE_LICENSE DISCOVERY_HOSTDEVICES @@ -201,9 +203,11 @@ use constant SYSLOGSERVER => 18; use constant PROVISIONINGSERVER => 19; use constant MIGRATIONSERVER => 20; use constant ALERTSERVER => 21; -use constant CORRELATIONSERVER => 22; +use constant CORRELATIONSERVER => 22; # Deprecated. use constant NCMSERVER => 23; use constant NETFLOWSERVER => 24; +use constant LOGSERVER => 25; +use constant MADESERVER => 26; # Module status use constant MODULE_NORMAL => 0; @@ -2855,6 +2859,8 @@ sub get_server_name { return "CORRELATIONSERVER" if ($server_type eq CORRELATIONSERVER); return "NCMSERVER" if ($server_type eq NCMSERVER); return "NETFLOWSERVER" if ($server_type eq NETFLOWSERVER); + return "LOGSERVER" if ($server_type eq LOGSERVER); + return "MADESERVER" if ($server_type eq MADESERVER); return "UNKNOWN"; } diff --git a/pandora_server/util/pandora_ha.pl b/pandora_server/util/pandora_ha.pl index 941b6dc854..23bc79189a 100755 --- a/pandora_server/util/pandora_ha.pl +++ b/pandora_server/util/pandora_ha.pl @@ -168,6 +168,7 @@ sub ha_load_pandora_conf($) { $conf->{'pandora_service_cmd'} = 'service pandora_server' unless defined($conf->{'pandora_service_cmd'}); $conf->{'tentacle_service_cmd'} = 'service tentacle_serverd' unless defined ($conf->{'tentacle_service_cmd'}); $conf->{'tentacle_service_watchdog'} = 1 unless defined ($conf->{'tentacle_service_watchdog'}); + $conf->{'made_service_cmd'} = 'service pandora_made' unless defined($conf->{'made_service_cmd'}); } ############################################################################## @@ -257,6 +258,31 @@ sub ha_keep_pandora_running($$) { } } +############################################################################## +# Keep MADE running +############################################################################## +sub ha_keep_made_running($$) { + my ($conf, $dbh) = @_; + + # Is MADE enabled? + return unless (defined($conf->{'madeserver'}) && $conf->{'madeserver'} == 1); + + # Is MADE installed? + `$conf->{'made_service_cmd'} status 2>/dev/null`; + if (($? >> 8) == 4) { + log_message($conf, 'LOG', "Pandora FMS MADE is not installed."); + return; + } + + # Try to get the PID of the service. + my $pid = `systemctl show --property MainPID pandora_made | cut -d= -f2`; + chomp($pid); + if ($pid eq "0") { + log_message($conf, 'LOG', 'MADE service not running.'); + `$conf->{'made_service_cmd'} start 2>/dev/null`; + } +} + ############################################################################## # Keep the Tentacle server running ############################################################################## @@ -535,6 +561,9 @@ sub ha_main_pacemaker($) { # Keep Tentacle running ha_keep_tentacle_running($conf, $dbh); + # Keep MADE running + ha_keep_made_running($conf, $dbh); + # Are we the master? pandora_set_master($conf, $dbh); if (!pandora_is_master($conf)) { @@ -627,6 +656,9 @@ sub ha_main_pandora($) { # Keep Tentacle running ha_keep_tentacle_running($conf, $dbh); + # Keep MADE running + ha_keep_made_running($conf, $dbh); + # Are we the master? pandora_set_master($conf, $dbh); if (!pandora_is_master($conf)) { From 6612fe96bde53c401d7fe5da70d174f59150e7f8 Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 11 Oct 2023 17:43:28 +0200 Subject: [PATCH 15/37] MADE only on compatible module types --- .../godmode/agentes/configurar_agente.php | 2 +- .../agentes/module_manager_editor_common.php | 1087 +++++++++-------- .../godmode/massive/massive_edit_modules.php | 2 +- pandora_console/include/functions_modules.php | 27 + 4 files changed, 578 insertions(+), 540 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 856a5d30cd..0f5741e6c7 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1337,7 +1337,7 @@ if ($update_module === true || $create_module === true) { */ $post_process = (string) get_parameter('post_process', 0.0); - if (modules_is_string_type($id_module_type) === false) { + if (modules_made_compatible($id_module_type) === false) { $made_enabled = (bool) get_parameter_checkbox('made_enabled', 0); } else { $made_enabled = false; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index f7da1b7451..453997541f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1,4 +1,5 @@ data['switch_warning_threshold'][0] .= html_print_switch_ html_print_radio_button_extended('warning_thresholds_checks', 'warning_inverse', __('Inverse interval'), ($warning_inverse) ? 'warning_inverse' : false, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-warning_inverse'), html_print_radio_button_extended('warning_thresholds_checks', 'percentage_warning', __('Percentage'), ($percentage_warning) ? 'percentage_warning' : false, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_warning'), ], - [ 'class' => 'margin-top-10' ], + ['class' => 'margin-top-10'], true ); @@ -565,7 +566,7 @@ $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_switch html_print_radio_button_extended('critical_thresholds_checks', 'critical_inverse', __('Inverse interval'), ($critical_inverse) ? 'critical_inverse' : false, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-critical_inverse'), html_print_radio_button_extended('critical_thresholds_checks', 'percentage_critical', __('Percentage'), ($percentage_critical) ? 'percentage_critical' : false, $disabledBecauseInPolicy, '', '', true, false, '', 'radius-percentage_critical'), ], - [ 'class' => 'margin-top-10' ], + ['class' => 'margin-top-10'], true ); @@ -722,14 +723,14 @@ if ($cps_module > 0) { ob_start(); ?> data['ff_main_thresholds'][0] = html_print_switch_radio_butto html_print_radio_button_extended('each_ff', 0, __('All state changing'), $each_ff, false, 'ffStateChange(0)', '', true, false, '', 'ff_all_state'), html_print_radio_button_extended('each_ff', 1, __('Each state changing'), $each_ff, false, 'ffStateChange(1)', '', true, false, '', 'ff_each_state'), ], - [ 'add_content' => $ffThresholdsScript ], + ['add_content' => $ffThresholdsScript], true ); @@ -1684,41 +1685,42 @@ ui_require_jquery_file('json'); ?> + /* ]]> */ + \ No newline at end of file diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index a8b2d248d4..156ca507d8 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -2654,7 +2654,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status=' $values['macros'] = json_encode($module_macros); } - if (modules_is_string_type($module['id_tipo_modulo']) === true) { + if (modules_made_compatible($module['id_tipo_modulo']) === false) { $values['made_enabled'] = 0; } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index e82fca400b..31c89025f7 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -4762,3 +4762,30 @@ function export_agents_module_csv($filters) return $result; } + + +/** + * Check if modules are compatible with MADE server. + * + * @param integer $id_tipo_modulo + * @retur boolean True if compatible, false otherwise. + */ +function modules_made_compatible($id_tipo_modulo) +{ + $compatible_types = [ + 1, + 4, + 5, + 15, + 16, + 22, + 30, + 34, + ]; + + if (array_search($id_tipo_modulo, $compatible_types) === false) { + return false; + } else { + return true; + } +} From 98003c81f997ac14efe73750430b837a17f67549 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 16 Oct 2023 16:32:35 +0200 Subject: [PATCH 16/37] Added MADE server and icons to server list --- .../godmode/servers/modificar_server.php | 4 ++++ pandora_console/images/anomaly_detection.png | Bin 0 -> 803 bytes pandora_console/images/anomaly_detection@2x.png | Bin 0 -> 1898 bytes pandora_console/images/anomaly_detection@svg.svg | 14 ++++++++++++++ pandora_console/include/constants.php | 1 + pandora_console/include/functions_servers.php | 13 +++++++++++++ 6 files changed, 32 insertions(+) create mode 100644 pandora_console/images/anomaly_detection.png create mode 100644 pandora_console/images/anomaly_detection@2x.png create mode 100644 pandora_console/images/anomaly_detection@svg.svg diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 4b3f26606a..c51c0476d3 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -151,6 +151,10 @@ if (isset($_GET['server']) === true) { $title .= __('Netflow server').' ID: '.$id_server; break; + case SERVER_TYPE_MADE: + $title .= __('MADE server').' ID: '.$id_server; + break; + default: $title = __('Update server').' ID: '.$id_server; break; diff --git a/pandora_console/images/anomaly_detection.png b/pandora_console/images/anomaly_detection.png new file mode 100644 index 0000000000000000000000000000000000000000..cf3c346138dae8f0503df8756518fb48f64e9b22 GIT binary patch literal 803 zcmV+;1Kj+HP)qAPK2 zv&om>T7_6aSK1at7uvr=(t;L2>q-i0x-S-Nl2yBx>_ZfU1aYAth%@8wyqWhh87aN+ z=6;=f-hFr8jOQVZM&qY+AR~_BA99@3>-E@cHk+4SWZtkTihC`@Wvx@I)xIlO&;zz% zrBYcMjYc2kD-f}#pW2~x;QRgs_#)P_d{WO`+9%aEQnO1h(-^wq^?R2iX#LN&tFaUsxMTP^7_Mk}WCfp&k)4 zL-bL`-%?(pfp3$%H5d#oCLzynAz>KmFoQIf44iFW0DfeH=!j+7g6IwdfA8j)0U49x z6^h@<0etgBpa2#O@T&uA@YCtE1It4&ZW=1cNJP=gQmM4zu3si8(-3CP@~u!P+_Uq~ zVRc=v@ebY+Ux0XIpCGHTPxR0*EgYKax*zmEvQYgZLH1Ys9yRKecgb z9c@(x#pVU4wvX>_gKU-?PX=phRbwR}IhMn2?gvA6x@L>4PP!J;814*fYfUhH_`1Nl z^}@|1e80~KT8e==q_~mIW5@oHMYX^G?>>k?uLRFU~{*TZSpQf4V3Ygs-@$6!sMsQLd h;v3|iE6=Fb{{itrMZD~BlHD zmj@rh56lel8|fh>dWa(PLA26IoT;2Cb&|RC`|mmHxX%90`DPrU183IS>+;`guf5LN z`_}lohF%uIL{oA*1pB$S7bkGa}HH*&9&Yc;B4OXvSJyFpBX4lfCOUKTh zJ$pJRrSVqctEEzDUT~>Yy2r-GCiQuiC36)ugCJbHcI_jhqodygwF})=-jgh*{n)W% z*PZa##bQ2`H?(R98hgH4E|+WLt!DUi^Ut_4oDlb;b_C(7dYE>ixvIjO2ZR!#N!8N*!3~KNud60KUT%a%Q;L#$^!Z zveNYuz}HcReb?$4|DGBeV-)2A<2}vfjJWn;xX~Nf?kM5!knlH6fKjgu6=S7RX*Z{^ zYU26^q*W&L6rff0di_M2N3Rr5&8}poux$Jja%fA7)l7B^(Tt)$k8VkXRf$>z+NGb=CB za#ALt$+6^$2Ls>~`VIl;Nt#AYytC{bRxDZm8uFUu+4c>9!q+I?o;#zs8{ zK*P~0(41$O<$uCNJ1DCQIr?dfasyOQAbidQp^;A;t-z24>f-v$OoGh>m<0AMfu(or zWX^sjd8@6h?W6dEjAPObXkcLA1u))5m$_bnp$p8THxg(XV8IE$6ZsZ@a>W5P8>=wdm8!j@OBoPByXJ#yQxT zxy{Z~WzY`tAg4L{t@F0x_h6r1p4hT|dd(=&6>fEm9nWnzo+^V!ynqYUD}HQzytM?T z3z<&YO$i@NnY3`LbFedW+gzU7ujB!Q(>*1EKiNosIV*T3&)mKIBnA91A5I&!d96Sn z#G%b34f+hLpViDb(VZk?n`tS1-WH4w{C6XJ(9839{6~=AJDrA|HtOWRAbm^{A8$2! z;`39qorXA)-uE$zo(3fXg1p45TknZHy~)x5O`!h{vRwxWwB2Mz0n|}-fOc^Z{xo*s z15@#1zl^W+Y4q#!d<`R};0*D07X{i7paCeOBO@bkFxhLoh5uVJ`#j3Tmyw^re|etX z%ZdUm4A47^*Du4t!NE?l)C1TdR=R>2vllpv* kw^MpDSLc15f1#fL53NW{HG#t`0ssI207*qoM6N<$f?K$CZ~y=R literal 0 HcmV?d00001 diff --git a/pandora_console/images/anomaly_detection@svg.svg b/pandora_console/images/anomaly_detection@svg.svg new file mode 100644 index 0000000000..45abb1db7a --- /dev/null +++ b/pandora_console/images/anomaly_detection@svg.svg @@ -0,0 +1,14 @@ + + + Anomaly detection@svg + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 889e32f693..ae8c921319 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -441,6 +441,7 @@ define('SERVER_TYPE_ALERT', 21); define('SERVER_TYPE_CORRELATION', 22); define('SERVER_TYPE_NCM', 23); define('SERVER_TYPE_NETFLOW', 24); +define('SERVER_TYPE_MADE', 26); // REPORTS. define('REPORT_TOP_N_MAX', 1); diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index 3a4273efa4..0b441a19c6 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -979,6 +979,19 @@ function servers_get_info($id_server=-1, $sql_limit=-1) $id_modulo = 0; break; + case SERVER_TYPE_MADE: + $server['img'] = html_print_image( + 'images/anomaly_detection@svg.svg', + true, + [ + 'title' => __('MADE server'), + 'class' => 'main_menu_icon invert_filter', + ] + ); + $server['type'] = 'made'; + $id_modulo = 0; + break; + default: $server['img'] = ''; $server['type'] = 'unknown'; From 16cecdf82ba7c6913ad2eed63e77cabde7c2639c Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 16 Oct 2023 16:39:01 +0200 Subject: [PATCH 17/37] Fix image names --- ...{anomaly_detection.png => Anomaly-detection.png} | Bin ...ly_detection@2x.png => Anomaly-detection@2x.png} | Bin ..._detection@svg.svg => Anomaly-detection@svg.svg} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename pandora_console/images/{anomaly_detection.png => Anomaly-detection.png} (100%) rename pandora_console/images/{anomaly_detection@2x.png => Anomaly-detection@2x.png} (100%) rename pandora_console/images/{anomaly_detection@svg.svg => Anomaly-detection@svg.svg} (100%) diff --git a/pandora_console/images/anomaly_detection.png b/pandora_console/images/Anomaly-detection.png similarity index 100% rename from pandora_console/images/anomaly_detection.png rename to pandora_console/images/Anomaly-detection.png diff --git a/pandora_console/images/anomaly_detection@2x.png b/pandora_console/images/Anomaly-detection@2x.png similarity index 100% rename from pandora_console/images/anomaly_detection@2x.png rename to pandora_console/images/Anomaly-detection@2x.png diff --git a/pandora_console/images/anomaly_detection@svg.svg b/pandora_console/images/Anomaly-detection@svg.svg similarity index 100% rename from pandora_console/images/anomaly_detection@svg.svg rename to pandora_console/images/Anomaly-detection@svg.svg From b27ae3ef2bcf81131f2ec220b65fb76d938e7e4c Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 16 Oct 2023 16:39:16 +0200 Subject: [PATCH 18/37] Fix image names --- pandora_console/include/functions_servers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index 0b441a19c6..6fbe8a8d71 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -981,7 +981,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1) case SERVER_TYPE_MADE: $server['img'] = html_print_image( - 'images/anomaly_detection@svg.svg', + 'images/Anomaly-detection@svg.svg', true, [ 'title' => __('MADE server'), From 3261b1c27961d60ff0d7aea2f20cc04a45b1677d Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 23 Oct 2023 15:11:23 +0200 Subject: [PATCH 19/37] Automonitoration modules fixes --- pandora_server/lib/PandoraFMS/Core.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 58815a4ff9..ea57005351 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -6674,24 +6674,22 @@ sub pandora_installation_monitoring($$) { my $data_size = get_db_value($dbh, 'SELECT SUM(data_length)/(1024*1024) FROM information_schema.TABLES'); my $index_size = get_db_value($dbh, 'SELECT SUM(index_length)/(1024*1024) FROM information_schema.TABLES'); my $writes = $insert->{'Value'} + $update->{'Value'} + $replace->{'Value'} + $delete->{'Value'} ; - + # Mysql Questions - Reads $module->{'name'} = "mysql_questions_reads"; $module->{'description'} = 'MySQL: Questions - Reads (#): Number of read questions'; $module->{'data'} = $select->{'Value'}; $module->{'unit'} = 'qu'; + $module->{'type'} = 'generic_data_inc'; push(@modules, $module); undef $module; - +s # Mysql Questions - Writes - my $question_writes = 0; - if(($writes + $select) > 0) { - $question_writes = (($writes * 10000) / ($select + $writes)) / 100; - } $module->{'name'} = "mysql_questions_writes"; $module->{'description'} = 'MySQL: Questions - Writes (#): Number of writed questions'; - $module->{'data'} = $question_writes; + $module->{'data'} = $writes; $module->{'unit'} = 'qu'; + $module->{'type'} = 'generic_data_inc'; push(@modules, $module); undef $module; @@ -6831,7 +6829,7 @@ sub pandora_installation_monitoring($$) { $dbh, 'SELECT COUNT(id_evento) FROM tevento - WHERE timestamp >=UNIX_TIMESTAMP(NOW() - INTERVAL 1 DAY)' + WHERE utimestamp >=UNIX_TIMESTAMP(NOW() - INTERVAL 1 DAY)' ); $module->{'name'} = "last_events_24h"; $module->{'description'} = 'Last 24h events'; From fe599ab55d15ecec7c8af18fdd2f2c9f55b63a73 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 23 Oct 2023 15:22:07 +0200 Subject: [PATCH 20/37] Automonitoration modules fixes --- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index ea57005351..63b45f621f 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -6683,7 +6683,7 @@ sub pandora_installation_monitoring($$) { $module->{'type'} = 'generic_data_inc'; push(@modules, $module); undef $module; -s + # Mysql Questions - Writes $module->{'name'} = "mysql_questions_writes"; $module->{'description'} = 'MySQL: Questions - Writes (#): Number of writed questions'; From 13eb1e92f738803c9735789114cc03e2c4b5a2bb Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Mon, 23 Oct 2023 08:59:06 -0500 Subject: [PATCH 21/37] Fix: Add module_name in output log --- pandora_agents/unix/pandora_agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index acd8883682..a8fb9a51c9 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3975,7 +3975,7 @@ sub grep_logs { return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1; my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size); - my $output = create_log(@data); + my $output = create_log(@data, $module_name); return $output; } From e81aadc812c1e6c052e352a8d7be91077d1d713c Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Mon, 23 Oct 2023 11:47:58 -0600 Subject: [PATCH 22/37] Fix on module name --- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/unix/pandora_agent | 8 +++++--- pandora_agents/win32/bin/pandora_agent.conf | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 10705b3e7e..1a6eb562ee 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -320,7 +320,7 @@ module_plugin autodiscover --default # Logs extraction #module_begin #module_name Syslog -#module_description Logs extaction module +#module_description Logs extraction module #module_type log #module_regexp /var/log/logfile.log #module_pattern .* diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a8fb9a51c9..886d0cdaa0 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3975,7 +3975,7 @@ sub grep_logs { return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1; my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size); - my $output = create_log(@data, $module_name); + my $output = create_log($module_name, @data); return $output; } @@ -4089,8 +4089,10 @@ sub grep_logs { return @data; } - sub create_log (@) { - my (@data, $module_name) = @_; + sub create_log($$){ + my ($module_name, @data) = @_; + log_message("Debug", $module_name); + log_message("Debug", join('', @data)); # No data if ($#data < 0) { diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 0438696681..949d630851 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -533,7 +533,7 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default # Logs extraction #module_begin #module_name X_Server_log -#module_description Logs extaction module +#module_description Logs extraction module #module_type log #module_regexp C:\server\logs\xserver.log #module_pattern .* From b7cad880283d053516f57f137263c84915203bec Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Mon, 23 Oct 2023 11:53:38 -0600 Subject: [PATCH 23/37] Remove debug logs --- pandora_agents/unix/pandora_agent | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 886d0cdaa0..041ee0e5da 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -4091,8 +4091,6 @@ sub grep_logs { sub create_log($$){ my ($module_name, @data) = @_; - log_message("Debug", $module_name); - log_message("Debug", join('', @data)); # No data if ($#data < 0) { From 0d0ea46f7dcd33952f5032a4b7097df473f37746 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Tue, 24 Oct 2023 15:50:37 +0200 Subject: [PATCH 24/37] Added messaging alerts to pandoradb_data.sql and 66.sql --- pandora_console/extras/mr/66.sql | 77 ++++++++++++++++++++++++++++++ pandora_console/pandoradb_data.sql | 11 +++++ 2 files changed, 88 insertions(+) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index b7b2b400d7..53b1525563 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -268,4 +268,81 @@ INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `d SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os); +-- Add messaging alerts + +SET @command_name = 'Pandora Google chat'; +SET @action_name = 'Pandora Google chat'; + +-- Get command ID in case it exists +SET @id_command = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-gchat-cli -u "_field1_" -d "_field2_" -t "_field3_" -D "_field4_"', 'Send messages using Google chat API', 0, '["Google chat webhook URL","Data in coma separate keypairs","Title","Description"]', '["","","",""]'); + +-- Get command ID again in case it has been created +SET @id_command = NULL; +SET @id_action = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name; +INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); + +SET @command_name = 'Pandora Slack'; +SET @action_name = 'Pandora Slack'; + +-- Get command ID in case it exists +SET @id_command = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-slack-cli -t "TOKEN" -d "_field1_" -c "_field2_" -e "_field3_" -T "_field4_" -D "_field5_"', 'Send messages using Slack API', 0, '["Data in coma separate keypairs","Slack channel id/name","Title emoji","Title","Description"]', '["","",":red_circle:,Red circle;:green_circle:,Green circle","",""]'); + +-- Get command ID again in case it has been created +SET @id_command = NULL; +SET @id_action = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name; +INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", ""); + +SET @command_name = 'Pandora Telegram'; +SET @action_name = 'Pandora Telegram'; + +-- Get command ID in case it exists +SET @id_command = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]'); + +-- Get command ID again in case it has been created +SET @id_command = NULL; +SET @id_action = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name; +INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); + +SET @command_name = 'Pandora ilert'; +SET @action_name = 'Pandora ilert'; + +-- Get command ID in case it exists +SET @id_command = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_ilert -a "API_KEY" -t "_field1_" -k "_field2_" -T "_field3_" -d "_field4_" -A "_agentname_" -m "_module_" -p "_alert_text_severity_" -D "_data_" -C "_timestamp_"', 'Send SMS using ilert API: https://docs.ilert.com/integrations/pandorafms/', 0, '["Event type","Event title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]'); + +-- Get command ID again in case it has been created +SET @id_command = NULL; +SET @id_action = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name; +INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); + +SET @command_name = 'Pandora Vonage'; +SET @action_name = 'Pandora Vonage'; + +-- Get command ID in case it exists +SET @id_command = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_vonage -a "API_KEY" -s "SECRET" -f "FROM_ALIAS" -n "_field1_" -m "_field2_"', 'Send SMS using Vonage API: https://www.vonage.com/communications-apis/sms/', 0, '["Phone number","Message"]', '["",""]'); + +-- Get command ID again in case it has been created +SET @id_command = NULL; +SET @id_action = NULL; +SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name; +SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name; +INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); + COMMIT; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index b6c361a393..e84f23bbfd 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -27,6 +27,11 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (14,'Send report by e-mail','Internal type','This command allows you to send a report by email.',1,'[\"Report\",\"e-mail address\",\"Subject\",\"Text\",\"Report type\",\"\",\"\",\"\",\"\",\"\"]','[\"_reports_\",\"\",\"\",\"_html_editor_\",\"xml,XML;pdf,PDF;json,JSON;csv,CSV\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (15,'Send report by e-mail (from template)','Internal type','This command allows you to send a report generated from a template by email.',1,'[\"Template\",\"Regexp agent filter\",\"e-mail address\",\"Subject\",\"Text\",\"Report type\",\"\",\"\",\"\",\"\"]','[\"_report_templates_\",\"\",\"\",\"\",\"_html_editor_\",\"xml,XML;pdf,PDF;json,JSON;csv,CSV\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (16,'Pandora ITSM Ticket','Internal type','Create a ticket in Pandora ITSM',1,'["Ticket title","Ticket group ID","Ticket priority","Ticket owner","Ticket type","Ticket status","Ticket description","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]','["", "_ITSM_groups_", "_ITSM_priorities_","_ITSM_users_","_ITSM_types_","_ITSM_status_","_html_editor_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (17, 'Pandora Google chat', '/usr/share/pandora_server/util/plugin/pandora-gchat-cli -u "_field1_" -d "_field2_" -t "_field3_" -D "_field4_"', 'Send messages using Google chat API', 0, '["Google chat webhook URL","Data in coma separate keypairs","Title","Description"]', '["","","",""]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (18, 'Pandora Slack', '/usr/share/pandora_server/util/plugin/pandora-slack-cli -t "TOKEN" -d "_field1_" -c "_field2_" -e "_field3_" -T "_field4_" -D "_field5_"', 'Send messages using Slack API', 0, '["Data in coma separate keypairs","Slack channel id/name","Title emoji","Title","Description"]', '["","",":red_circle:,Red circle;:green_circle:,Green circle","",""]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (19, 'Pandora Telegram' '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (20, 'Pandora ilert', '/usr/share/pandora_server/util/plugin/pandora_ilert -a "API_KEY" -t "_field1_" -k "_field2_" -T "_field3_" -d "_field4_" -A "_agentname_" -m "_module_" -p "_alert_text_severity_" -D "_data_" -C "_timestamp_"', 'Send SMS using ilert API: https://docs.ilert.com/integrations/pandorafms/', 0, '["Event type","Event title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (21, 'Pandora Vonage', '/usr/share/pandora_server/util/plugin/pandora_vonage -a "API_KEY" -s "SECRET" -f "FROM_ALIAS" -n "_field1_" -m "_field2_"', 'Send SMS using Vonage API: https://www.vonage.com/communications-apis/sms/', 0, '["Phone number","Message"]', '["",""]'); -- -- Dumping data for table `tconfig` @@ -1160,6 +1165,12 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (5,'Send Report by e-mail (from template)',15,'','','yourmail@domain.es','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;"><table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"><thead><tr><td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td><td style="padding: 0px 0px 5px;"><p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p></td></tr><tr><td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td></tr></thead><tbody><tr><td colspan="2"><img onerror="this.style.display=&quot;none&quot;;" src="_statusimage_" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td></tr><tr><td colspan="2"><p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have bad news for you, something is on <span style="text-transform: uppercase; font-weight: 800;">_modulestatus_</span> status!</p><div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div></td></tr><tr><td colspan="2"><div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;"><p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p></div></td></tr><tr><td style="padding: 20px 0px;" colspan="2"><p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p><p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p></td></tr></tbody></table><div style="text-align: center; margin-top: 10px;"><p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p></div></div>','','','','','',0,0,'','','','','<div style="background-color: #eaf0f6; font-family: Arial, Helvetica, sans-serif; padding: 30px; margin: 0;"> <table style="max-width: 560px; background-color: white; border-radius: 10px; padding: 10px 20px 40px;" cellspacing="0" cellpadding="0" align="center"> <thead> <tr> <td style="padding: 0px 0px 5px;"><a href="https://pandorafms.com/en/" target="_blank"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Pandora-FMS.png" width="206px"></a></td> <td style="padding: 0px 0px 5px;"> <p style="text-align: right; color: #223549; font-weight: bold; line-height: 36px; padding: 0px; font-size: 12px;">Automatic alert system</p> </td> </tr> <tr> <td style="padding: 0px 0px 5px;" colspan="2"><hr style="border: 1px solid #f5f5f5; width: 100%; margin: 0px;"></td> </tr> </thead> <tbody> <tr> <td colspan="2"><img src="https://pandorafms.com/wp-content/uploads/2022/03/System-email-Good-news.png" style="display: block; margin-left: auto; margin-right: auto; width: 105px; margin-top: 20px; padding: 0px;" width="105px"></td> </tr> <tr> <td colspan="2"> <p style="font-size: 24px; text-align: center; color: #223549; padding: 0px 10%; line-height: 34px; margin: 20px 0px;">We have good news for you, alert has been <span style="text-transform: uppercase; font-weight: 800;">recovered</span></p> <div><!--[if mso]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:33px;v-text-anchor:middle;width:100px;" stroke="f" fillcolor="#D84A38"><w:anchorlock/><center><![endif]--><a style="background-color: #223549; border: none; color: white; padding: 15px 30px; text-align: center; text-decoration: none; display: block; font-size: 16px; margin-left: auto; margin-right: auto; border-radius: 100px; max-width: 50%; margin-top: 0px; font-weight: bold;" href="_homeurl_">Go to Pandora FMS Console</a><!--[if mso]></center></v:rect><![endif]--></div> </td> </tr> <tr> <td colspan="2"> <div style="background-color: #f6f6f6; border-radius: 10px; padding: 10px 20px; margin-top: 40px;"> <p style="font-size: 18px; line-height: 30px; color: #223549;">Monitoring details</p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Data: <span style="font-weight: 400!important;">_data_ <em>(_modulestatus_)</em></span></p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Agent: <span style="font-weight: 400!important;">_agent_ <em>_address_</em></span></p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Module: <span style="font-weight: 400!important;">_module_ <em>_moduledescription_</em></span></p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Timestamp: <span style="font-weight: 400!important;">_timestamp_</span></p> </div> </td> </tr> <tr> <td style="padding: 20px 0px;" colspan="2"> <p style="font-size: 18px; line-height: 30px; color: #223549;">Report details</p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Generated:&nbsp;<span style="font-weight: 400!important;">_report_generated_date_<em><br></em></span></p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Report date:&nbsp;<span style="font-weight: 400!important;">_report_date_<em><br></em></span></p> <p style="font-size: 15px; color: #333333; font-weight: 800; line-height: 15px;">Description:&nbsp;<span style="font-weight: 400!important;">_report_description_</span></p> </td> </tr> </tbody> </table> <div style="text-align: center; margin-top: 10px;"> <p style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;"><a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/en/contact/">Contact Us</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/community/forums/forum/english/">Support</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a style="font-size: 12px; text-decoration: none; font-weight: 400; color: #777;" href="https://pandorafms.com/manual/en/start">Docs</a></p> </div> </div>','','','','',''); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`) VALUES (6,'Create Pandora ITSM ticket',16); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (7, 'Pandora Google chat', 17, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (8, 'Pandora Slack', 18, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", ""); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (9, 'Pandora Telegram', 19, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (10, 'Pandora ilert', 20, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (11, 'Pandora Vonage', 21, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); + -- alert templates (default) INSERT INTO `talert_templates` (`id`,`name`,`description`,`id_alert_action`,`field1`,`field2`,`field3`,`field4`,`field5`,`field6`,`field7`,`field8`,`field9`,`field10`,`field11`,`field12`,`field13`,`field14`,`field15`,`field16`,`field17`,`field18`,`field19`,`field20`,`type`,`value`,`matches_value`,`max_value`,`min_value`,`time_threshold`,`max_alerts`,`min_alerts`,`time_from`,`time_to`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`,`recovery_notify`,`field1_recovery`,`field2_recovery`,`field3_recovery`,`field4_recovery`,`field5_recovery`,`field6_recovery`,`field7_recovery`,`field8_recovery`,`field9_recovery`,`field10_recovery`,`field11_recovery`,`field12_recovery`,`field13_recovery`,`field14_recovery`,`field15_recovery`,`field16_recovery`,`field17_recovery`,`field18_recovery`,`field19_recovery`,`field20_recovery`,`priority`,`id_group`,`special_day`,`wizard_level`,`min_alerts_reset_counter`,`disable_event`,`previous_name`, `schedule`) From 08140b87a752f85aacbc9751702bdeba80e272cd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 25 Oct 2023 12:29:55 +0200 Subject: [PATCH 25/37] #12286 no enable click user not logged public VC --- pandora_console/operation/visual_console/public_view.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 6fd892b76f..46dd4e43b4 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -321,6 +321,15 @@ $visualConsoleItems = VisualConsole::getItemsFromDB( } } }); + + + // No click enabled when user not logged. + $( "a" ).on( "click", function( event ) { + event.preventDefault(); + $('#visual-console-container').removeClass('is-updating'); + $('.div-visual-console-spinner').remove(); + }); + Date: Wed, 25 Oct 2023 13:05:31 +0200 Subject: [PATCH 26/37] Fix default value and unit for mysql questions modules --- pandora_server/lib/PandoraFMS/Core.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 63b45f621f..30bb4f09ed 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -6676,19 +6676,21 @@ sub pandora_installation_monitoring($$) { my $writes = $insert->{'Value'} + $update->{'Value'} + $replace->{'Value'} + $delete->{'Value'} ; # Mysql Questions - Reads + $reads = 0 unless defined($reads); $module->{'name'} = "mysql_questions_reads"; $module->{'description'} = 'MySQL: Questions - Reads (#): Number of read questions'; $module->{'data'} = $select->{'Value'}; - $module->{'unit'} = 'qu'; + $module->{'unit'} = 'qu/s'; $module->{'type'} = 'generic_data_inc'; push(@modules, $module); undef $module; # Mysql Questions - Writes + $writes = 0 unless defined($writes); $module->{'name'} = "mysql_questions_writes"; $module->{'description'} = 'MySQL: Questions - Writes (#): Number of writed questions'; $module->{'data'} = $writes; - $module->{'unit'} = 'qu'; + $module->{'unit'} = 'qu/s'; $module->{'type'} = 'generic_data_inc'; push(@modules, $module); undef $module; From 078081be4e9836830e2c1ba52bb844d6ca52515b Mon Sep 17 00:00:00 2001 From: Calvo Date: Wed, 25 Oct 2023 13:22:46 +0200 Subject: [PATCH 27/37] Missing var declaration --- pandora_server/lib/PandoraFMS/Core.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 30bb4f09ed..a313fabfac 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -6674,12 +6674,13 @@ sub pandora_installation_monitoring($$) { my $data_size = get_db_value($dbh, 'SELECT SUM(data_length)/(1024*1024) FROM information_schema.TABLES'); my $index_size = get_db_value($dbh, 'SELECT SUM(index_length)/(1024*1024) FROM information_schema.TABLES'); my $writes = $insert->{'Value'} + $update->{'Value'} + $replace->{'Value'} + $delete->{'Value'} ; + my $reads = $select->{'Value'}; # Mysql Questions - Reads - $reads = 0 unless defined($reads); + my $reads = 0 unless defined($reads); $module->{'name'} = "mysql_questions_reads"; $module->{'description'} = 'MySQL: Questions - Reads (#): Number of read questions'; - $module->{'data'} = $select->{'Value'}; + $module->{'data'} = $reads; $module->{'unit'} = 'qu/s'; $module->{'type'} = 'generic_data_inc'; push(@modules, $module); From 235701edb9cd67dbaabdfaa51ac160aa19284fc9 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 26 Oct 2023 10:21:49 +0200 Subject: [PATCH 28/37] Fix mysql questions reads/writes module undef value --- pandora_server/lib/PandoraFMS/Core.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index a313fabfac..e05906ff3c 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -6677,7 +6677,6 @@ sub pandora_installation_monitoring($$) { my $reads = $select->{'Value'}; # Mysql Questions - Reads - my $reads = 0 unless defined($reads); $module->{'name'} = "mysql_questions_reads"; $module->{'description'} = 'MySQL: Questions - Reads (#): Number of read questions'; $module->{'data'} = $reads; @@ -6687,7 +6686,6 @@ sub pandora_installation_monitoring($$) { undef $module; # Mysql Questions - Writes - $writes = 0 unless defined($writes); $module->{'name'} = "mysql_questions_writes"; $module->{'description'} = 'MySQL: Questions - Writes (#): Number of writed questions'; $module->{'data'} = $writes; From aaea2e59c493f03d9b278f381b8543a8d05c1ef3 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 26 Oct 2023 16:23:07 +0200 Subject: [PATCH 29/37] Fix MADE minor bugs --- pandora_console/extras/mr/66.sql | 1 - pandora_console/godmode/agentes/configurar_agente.php | 2 +- .../godmode/agentes/module_manager_editor_common.php | 2 +- pandora_console/include/functions_modules.php | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 774ebd7ec3..8925d79506 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -1,4 +1,3 @@ --- Active: 1685706586212@@172.16.0.2@3306@pandora START TRANSACTION; ALTER TABLE tevent_filter ADD private_filter_user text NULL; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index e0905b05d7..88d4b0e4ed 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1326,7 +1326,7 @@ if ($update_module === true || $create_module === true) { */ $post_process = (string) get_parameter('post_process', 0.0); - if (modules_made_compatible($id_module_type) === false) { + if (modules_made_compatible($id_module_type) === true) { $made_enabled = (bool) get_parameter_checkbox('made_enabled', 0); } else { $made_enabled = false; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 0334ceab90..ca74b7d171 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1933,7 +1933,7 @@ ui_require_jquery_file('json'); $('#ff_timeout_disable').hide(); } - var madeCompatibleTypes = ["1", "4", "5", "15", "16", "22", "30", "34"]; + var madeCompatibleTypes = ["1", "4", "5", "8", "15", "16", "22", "30", "34"]; if (madeCompatibleTypes.includes(type_selected)) { $('#advanced-made_enabled').show(); $('#advanced-caption_made_enabled').show(); diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 31c89025f7..de618605c8 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -4776,6 +4776,7 @@ function modules_made_compatible($id_tipo_modulo) 1, 4, 5, + 8, 15, 16, 22, From 936508174ffe1f84efe2c7fda3333c5309d42f77 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 26 Oct 2023 16:24:49 +0200 Subject: [PATCH 30/37] Fix merge errors --- pandora_server/lib/PandoraFMS/Core.pm | 1 - pandora_server/lib/PandoraFMS/Tools.pm | 1 - 2 files changed, 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 90b039a078..51ab5b3462 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -325,7 +325,6 @@ our @ServerTypes = qw ( ncmserver netflowserver logserver - logserver madeserver ); our @AlertStatus = ('Execute the alert', 'Do not execute the alert', 'Do not execute the alert, but increment its internal counter', 'Cease the alert', 'Recover the alert', 'Reset internal counter'); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 7c5a823a1d..70d697dab4 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -79,7 +79,6 @@ our @EXPORT = qw( NCMSERVER NETFLOWSERVER LOGSERVER - LOGSERVER MADESERVER METACONSOLE_LICENSE OFFLINE_LICENSE From c97d62ff0e411cfe5f881b74e2027845a4cf2af7 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 27 Oct 2023 01:00:24 +0200 Subject: [PATCH 31/37] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6d673eaefa..17cbefa9e7 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231026 +Version: 7.0NG.773.3-231027 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 716132f5a2..364313f7e6 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.773.3-231026" +pandora_version="7.0NG.773.3-231027" 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 46eed564d4..12f9727cf9 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231026'; +use constant AGENT_BUILD => '231027'; # 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 536059c848..3cb42f5867 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231026 +%define release 231027 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 400ddccc6a..559a2af21f 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231026 +%define release 231027 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index d62a9d45ca..8e68cd1cec 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231026 +%define release 231027 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 88579ca477..c559873da6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231026" +PI_BUILD="231027" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index c1ee50b183..a050066ed0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231026} +{231027} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index eb1897b531..e0796da150 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.773.3 Build 231026") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231027") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index c9af1ee5b0..ed2ffec642 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 231026))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231027))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6acf4f9204..841ee2b46d 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231026 +Version: 7.0NG.773.3-231027 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 2aa7db42ef..8a887e1db3 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.773.3-231026" +pandora_version="7.0NG.773.3-231027" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ebb9da98fa..848e4e15c7 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 = 'PC231026'; +$build_version = 'PC231027'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index f0cf6d8b6a..41da3c621c 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index f26dda1f90..58c28b261d 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231026 +%define release 231027 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 5971f2f9d7..db57ffe814 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231026 +%define release 231027 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b15547900d..a4db913884 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231026" +PI_BUILD="231027" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 493f1a89f4..87fd4b65f9 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 231026"; +my $version = "7.0NG.773.3 Build 231027"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6f65473ecf..9785bf60c7 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.773.3 Build 231026"; +my $version = "7.0NG.773.3 Build 231027"; # save program name for logging my $progname = basename($0); From c8bab9032d9840a89f62af6e8e47086002e10a45 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 27 Oct 2023 12:09:56 +0200 Subject: [PATCH 32/37] #12349 Fixed csv --- .../reporting_builder.item_editor.php | 175 ++++++++---------- 1 file changed, 73 insertions(+), 102 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index e6032de2f6..bb06d3a800 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1932,33 +1932,8 @@ if (is_metaconsole() === true) { $a) { - if ($index == 0) { - $sql_log .= ' AND (id_agente = '.$key; - } else { - $sql_log .= ' OR id_agente = '.$key; - } - - $index++; - } - - $sql_log .= ')'; - } - - html_print_select_from_sql( - $sql_log, + html_print_select( + [], 'source', $source, 'onselect=source_change_agents();', @@ -1966,7 +1941,7 @@ if (is_metaconsole() === true) { '', false, false, - false + false, ); ?> @@ -6702,68 +6677,41 @@ function loadGeneralAgents(agent_group) { function loadLogAgents() { var params = []; - params.push("get_log_agents=1"); - params.push("source="); - params.push('id_agents='); - params.push("page=include/ajax/reporting.ajax"); + let source = ''; + let agent = ''; + agent = JSON.parse(agent); - $('#id_agents3') - .find('option') - .remove(); + var params = {}; + params["get_agent_source"] = 1; + params["log_alert"] = 1; + params["page"] = "enterprise/include/ajax/log_viewer.ajax"; - $('#id_agents3') - .append(''); - - jQuery.ajax ({ - data: params.join ("&"), - type: 'POST', - url: action= - - + "/ajax.php", - timeout: 300000, - dataType: 'json', - success: function (data) { - if (data['correct']) { - $('#id_agents3') - .find('option') - .remove(); - - var selectElements = []; - var selectedStr = 'selected="selected"'; - - if (data['select_agents'] === null) { - return; - } - - if (Array.isArray(data['select_agents'])) { - data['select_agents'].forEach(function(agentAlias, agentID) { - var optionAttr = ''; - if (typeof data['agents_selected'][agentID] !== 'undefined') { - optionAttr = ' selected="selected"'; - } - - $('#id_agents3') - .append(''); - }); + jQuery.ajax({ + data: params, + dataType: "json", + type: "POST", + url: "ajax.php", + async: true, + success: function(data) { + $('#id_agents3') + .find('option') + .remove(); + $.each(data['source'],function(key,value) { + if (value === source) { + $('#source').append( ``); } else { - for (const [agentID, agentAlias] of Object.entries(data['select_agents'])) { - var optionAttr = ''; - if (typeof data['agents_selected'][agentID] !== 'undefined') { - optionAttr = ' selected="selected"'; - } - - $('#id_agents3') - .append(''); - } + $('#source').append( ``); } - } + }); + + $.each(data['agent'],function(key,value) { + const result = agent.includes(key); + if (result === true) { + $('#id_agents3').append( ``); + } else { + $('#id_agents3').append( ``); + } + }); } }); } @@ -7948,23 +7896,46 @@ function set_last_value_period() { } function source_change_agents() { - $("#id_agents3").empty(); - $("#spinner_hack").show(); - jQuery.post ("ajax.php", - {"page" : "operation/agentes/ver_agente", - "get_agents_source_json" : 1, - "source" : $("#source").val() - }, - function (data, status) { - for (var clave in data) { - $("#id_agents3").append( - '' - ); + const source = $("#source").val(); + if (source === '') { + $("#id_agents3 option[value!=0]").attr("style","display:"); + } else { + $("#spinner_hack").show(); + $("#id_agents3 option").attr("style","display:none"); + + var params = {}; + params["get_agent_source"] = 1; + params["page"] = "enterprise/include/ajax/log_viewer.ajax"; + + jQuery.ajax({ + data: params, + dataType: "json", + type: "POST", + url: "ajax.php", + async: true, + success: function(data) { + let source_array = []; + $.each(data['source'],function(key,value) { + if (value === source) { + const split = key.split('-'); + source_array.push(split[1]); + } + }); + + $.each(data['agent'],function(key,value) { + const result = source_array.includes(key); + if (result === true) { + $(`#id_agents3 option[value*='${key}']`).attr("style","display:"); + } + }); + + $("#spinner_hack").hide(); + }, + error: function(error){ + $("#spinner_hack").hide(); } - $("#spinner_hack").hide(); - }, - "json" - ); + }); + } } function dialog_message(message_id) { From 2f07f59a7b4286bb062d95ec027d45c83607ad71 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 28 Oct 2023 01:00:20 +0200 Subject: [PATCH 33/37] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 17cbefa9e7..2dec15588c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231027 +Version: 7.0NG.773.3-231028 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 364313f7e6..7a26cb3768 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.773.3-231027" +pandora_version="7.0NG.773.3-231028" 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 12f9727cf9..e327fb5ff4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231027'; +use constant AGENT_BUILD => '231028'; # 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 3cb42f5867..69dfbc29ff 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231027 +%define release 231028 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 559a2af21f..c5d20d33c8 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231027 +%define release 231028 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 8e68cd1cec..16cd6019ba 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231027 +%define release 231028 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 c559873da6..de8da20bf4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231027" +PI_BUILD="231028" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index a050066ed0..6c27e680c0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231027} +{231028} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index e0796da150..19db355835 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.773.3 Build 231027") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231028") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ed2ffec642..fa0b7c897b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 231027))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231028))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 841ee2b46d..3262c6ac10 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231027 +Version: 7.0NG.773.3-231028 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 8a887e1db3..31b7e1a8a0 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.773.3-231027" +pandora_version="7.0NG.773.3-231028" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 848e4e15c7..f752bedd90 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 = 'PC231027'; +$build_version = 'PC231028'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 41da3c621c..b5a2ba89a2 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 58c28b261d..54719d2179 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231027 +%define release 231028 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index db57ffe814..ec857f6fc4 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231027 +%define release 231028 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a4db913884..c90ac3272e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231027" +PI_BUILD="231028" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 87fd4b65f9..274c6726b4 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 231027"; +my $version = "7.0NG.773.3 Build 231028"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9785bf60c7..08a00e7c9f 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.773.3 Build 231027"; +my $version = "7.0NG.773.3 Build 231028"; # save program name for logging my $progname = basename($0); From d43b7d14fadd49746ee91c73cc227dcae308707c Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 29 Oct 2023 01:00:20 +0200 Subject: [PATCH 34/37] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2dec15588c..0cac064f06 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231028 +Version: 7.0NG.773.3-231029 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 7a26cb3768..fdc621cf06 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.773.3-231028" +pandora_version="7.0NG.773.3-231029" 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 e327fb5ff4..f0c611b40b 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231028'; +use constant AGENT_BUILD => '231029'; # 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 69dfbc29ff..3346b4fd9b 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231028 +%define release 231029 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index c5d20d33c8..a2a302b641 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231028 +%define release 231029 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 16cd6019ba..5013d872f7 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231028 +%define release 231029 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 de8da20bf4..b6f348fa92 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231028" +PI_BUILD="231029" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 6c27e680c0..9e7fa9a32f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231028} +{231029} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 19db355835..25b89c0d9c 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.773.3 Build 231028") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231029") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fa0b7c897b..5bb0fb71ac 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 231028))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231029))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 3262c6ac10..08efb5ecea 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231028 +Version: 7.0NG.773.3-231029 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 31b7e1a8a0..c748fbbb77 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.773.3-231028" +pandora_version="7.0NG.773.3-231029" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f752bedd90..2e16b96143 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 = 'PC231028'; +$build_version = 'PC231029'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b5a2ba89a2..e2eb7e6e5c 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 54719d2179..cbf43cf0a6 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231028 +%define release 231029 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index ec857f6fc4..dd46cb1e7f 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231028 +%define release 231029 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index c90ac3272e..d118537bc4 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231028" +PI_BUILD="231029" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 274c6726b4..e39c990014 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 231028"; +my $version = "7.0NG.773.3 Build 231029"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 08a00e7c9f..a3edbd5b59 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.773.3 Build 231028"; +my $version = "7.0NG.773.3 Build 231029"; # save program name for logging my $progname = basename($0); From 9cc5937c96d7a5e5dd7fd554da843190ed206450 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 30 Oct 2023 01:00:18 +0100 Subject: [PATCH 35/37] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0cac064f06..b2136a6b38 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231029 +Version: 7.0NG.773.3-231030 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 fdc621cf06..b7d9a12761 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.773.3-231029" +pandora_version="7.0NG.773.3-231030" 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 f0c611b40b..5dff06e9c4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1031,7 +1031,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231029'; +use constant AGENT_BUILD => '231030'; # 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 3346b4fd9b..05e1abdda7 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231029 +%define release 231030 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index a2a302b641..3e3f3a4882 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231029 +%define release 231030 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 5013d872f7..fe363dd7d4 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231029 +%define release 231030 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 b6f348fa92..35551e23df 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231029" +PI_BUILD="231030" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9e7fa9a32f..7961a3028d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231029} +{231030} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 25b89c0d9c..1623d31492 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.773.3 Build 231029") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231030") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 5bb0fb71ac..67f7830d3b 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 231029))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231030))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 08efb5ecea..9594583b12 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231029 +Version: 7.0NG.773.3-231030 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 c748fbbb77..1701342a8b 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.773.3-231029" +pandora_version="7.0NG.773.3-231030" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 2e16b96143..1cddf36ca1 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 = 'PC231029'; +$build_version = 'PC231030'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e2eb7e6e5c..1b461bc6ee 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index cbf43cf0a6..3be877d948 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231029 +%define release 231030 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index dd46cb1e7f..740cdbc7cd 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231029 +%define release 231030 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d118537bc4..11ad249853 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231029" +PI_BUILD="231030" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index e39c990014..3e2355f2a4 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 231029"; +my $version = "7.0NG.773.3 Build 231030"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a3edbd5b59..df3a6fbeb8 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.773.3 Build 231029"; +my $version = "7.0NG.773.3 Build 231030"; # save program name for logging my $progname = basename($0); From f8c56c5c5c952fad5ec20b8f8e88d6a3c372e2c3 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Mon, 30 Oct 2023 13:40:11 +0100 Subject: [PATCH 36/37] Fixed misstype in pandoradb_data.sql --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index e84f23bbfd..d182083683 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -29,7 +29,7 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (16,'Pandora ITSM Ticket','Internal type','Create a ticket in Pandora ITSM',1,'["Ticket title","Ticket group ID","Ticket priority","Ticket owner","Ticket type","Ticket status","Ticket description","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]','["", "_ITSM_groups_", "_ITSM_priorities_","_ITSM_users_","_ITSM_types_","_ITSM_status_","_html_editor_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (17, 'Pandora Google chat', '/usr/share/pandora_server/util/plugin/pandora-gchat-cli -u "_field1_" -d "_field2_" -t "_field3_" -D "_field4_"', 'Send messages using Google chat API', 0, '["Google chat webhook URL","Data in coma separate keypairs","Title","Description"]', '["","","",""]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (18, 'Pandora Slack', '/usr/share/pandora_server/util/plugin/pandora-slack-cli -t "TOKEN" -d "_field1_" -c "_field2_" -e "_field3_" -T "_field4_" -D "_field5_"', 'Send messages using Slack API', 0, '["Data in coma separate keypairs","Slack channel id/name","Title emoji","Title","Description"]', '["","",":red_circle:,Red circle;:green_circle:,Green circle","",""]'); -INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (19, 'Pandora Telegram' '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (19, 'Pandora Telegram', '/usr/share/pandora_server/util/plugin/pandora-telegram-cli -t "TOKEN" -c "_field1_" -m "_field2_"', 'Send messages using Telegram API', 0, '["Chat ID","Message"]', '["",""]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (20, 'Pandora ilert', '/usr/share/pandora_server/util/plugin/pandora_ilert -a "API_KEY" -t "_field1_" -k "_field2_" -T "_field3_" -d "_field4_" -A "_agentname_" -m "_module_" -p "_alert_text_severity_" -D "_data_" -C "_timestamp_"', 'Send SMS using ilert API: https://docs.ilert.com/integrations/pandorafms/', 0, '["Event type","Event title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (21, 'Pandora Vonage', '/usr/share/pandora_server/util/plugin/pandora_vonage -a "API_KEY" -s "SECRET" -f "FROM_ALIAS" -n "_field1_" -m "_field2_"', 'Send SMS using Vonage API: https://www.vonage.com/communications-apis/sms/', 0, '["Phone number","Message"]', '["",""]'); From b5098ab0e5d7c0b7c170f9621241b7a6d1f6aa73 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 31 Oct 2023 01:00:26 +0100 Subject: [PATCH 37/37] 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.redhat_bin.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 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b2136a6b38..a70887de92 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.773.3-231030 +Version: 7.0NG.773.3-231031 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 b7d9a12761..93fe95d24c 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.773.3-231030" +pandora_version="7.0NG.773.3-231031" 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 62d2a4e4ff..49599efa4d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.773.3'; -use constant AGENT_BUILD => '231030'; +use constant AGENT_BUILD => '231031'; # 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 05e1abdda7..9c81eadedd 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231030 +%define release 231031 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 3e3f3a4882..68966f1a94 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231030 +%define release 231031 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index fe363dd7d4..3086bd4102 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.773.3 -%define release 231030 +%define release 231031 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 35551e23df..888a2ab4fa 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231030" +PI_BUILD="231031" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 7961a3028d..ae71b2bf45 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231030} +{231031} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 1623d31492..b9ab0f5d2e 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.773.3 Build 231030") +#define PANDORA_VERSION ("7.0NG.773.3 Build 231031") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 67f7830d3b..b57a00dfbc 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.773.3(Build 231030))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 231031))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9594583b12..db922b6538 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-231030 +Version: 7.0NG.773.3-231031 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 1701342a8b..ec26a38525 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.773.3-231030" +pandora_version="7.0NG.773.3-231031" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1cddf36ca1..8ffdc71c33 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 = 'PC231030'; +$build_version = 'PC231031'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 1b461bc6ee..fb0b661943 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 3be877d948..0936210692 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231030 +%define release 231031 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 740cdbc7cd..8e48063d08 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.773.3 -%define release 231030 +%define release 231031 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 11ad249853..b3d6c4d8bf 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.773.3" -PI_BUILD="231030" +PI_BUILD="231031" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3e2355f2a4..383422d602 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.773.3 Build 231030"; +my $version = "7.0NG.773.3 Build 231031"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index df3a6fbeb8..6ad0c4b85b 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.773.3 Build 231030"; +my $version = "7.0NG.773.3 Build 231031"; # save program name for logging my $progname = basename($0);