From 2fc08b7246bf5e142abed3712c80558092ce9ba2 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 31 Aug 2023 18:07:26 +0200 Subject: [PATCH 01/13] 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/13] 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/13] 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/13] 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/13] 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 35db83647a1c03759090be2bd94a5365035d8565 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 10 Oct 2023 11:04:25 +0200 Subject: [PATCH 06/13] 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 07/13] 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 08/13] 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 09/13] 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 10/13] 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 aaea2e59c493f03d9b278f381b8543a8d05c1ef3 Mon Sep 17 00:00:00 2001 From: Calvo Date: Thu, 26 Oct 2023 16:23:07 +0200 Subject: [PATCH 11/13] 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 12/13] 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 13/13] 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);