diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5a22f8ecae..f60763b69b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230228 +Version: 7.0NG.769-230301 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 ac85303303..4f52b3aa35 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.769-230228" +pandora_version="7.0NG.769-230301" 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 a994aabc8b..4fa07035d2 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230228'; +use constant AGENT_BUILD => '230301'; # 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 1e35d4443c..f8ab9c7e41 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.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3519ff8837..6a16d883fd 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.769 -%define release 230228 +%define release 230301 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 ec3075858c..46e66a8170 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230228" +PI_BUILD="230301" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2f2c4f1324..79687a6d2e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230228} +{230301} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9d41d77811..8264d0e9c8 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.769 Build 230228") +#define PANDORA_VERSION ("7.0NG.769 Build 230301") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ab42fb366e..ece56bd837 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.769(Build 230228))" + VALUE "ProductVersion", "(7.0NG.769(Build 230301))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 12ed651bf5..c9f3c45a17 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230228 +Version: 7.0NG.769-230301 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 32b28e5e53..90ab3e8133 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.769-230228" +pandora_version="7.0NG.769-230301" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index 4d21f9bb2a..9d9c14656f 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -60,4 +60,7 @@ UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-incremental-data@svg.svg' W UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 38; UPDATE `ttipo_modulo` SET `icon` = 'keepalive@svg.svg' WHERE `id_tipo` = 100; +CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule); +CREATE INDEX idx_disabled ON talert_template_modules (disabled); + COMMIT; diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql new file mode 100644 index 0000000000..401d4a748c --- /dev/null +++ b/pandora_console/extras/mr/63.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0'); + +COMMIT; diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index e7c61be8f8..2139118ff1 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -151,6 +151,8 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) { } } +$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); + $total_agents = db_get_value('count(*)', 'tagente'); $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false; @@ -264,104 +266,140 @@ $table->data[1][1] = html_print_input( [ 'type' => 'number', 'size' => 5, - 'max' => 99999, + 'max' => $performance_variables_control['event_purge']->max, 'name' => 'event_purge', 'value' => $config['event_purge'], 'return' => true, - 'min' => ((((bool) $config['history_event_enabled'] === true) && $config['history_event_days'] > 0) ? $config['history_event_days'] + 1 : null), + 'min' => $performance_variables_control['event_purge']->min, 'style' => 'width:43px', ] ); $table->data[2][0] = __('Max. days before delete traps'); -$table->data[2][1] = html_print_input_text( - 'trap_purge', - $config['trap_purge'], - '', - 5, - 5, - true +$table->data[2][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['trap_purge']->max, + 'name' => 'trap_purge', + 'value' => $config['trap_purge'], + 'return' => true, + 'min' => $performance_variables_control['trap_purge']->min, + 'style' => 'width:43px', + ] ); $table->data[3][0] = __('Max. days before delete audit events'); -$table->data[3][1] = html_print_input_text( - 'audit_purge', - $config['audit_purge'], - '', - 5, - 5, - true +$table->data[3][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['audit_purge']->max, + 'name' => 'audit_purge', + 'value' => $config['audit_purge'], + 'return' => true, + 'min' => $performance_variables_control['audit_purge']->min, + 'style' => 'width:43px', + ] ); $table->data[4][0] = __('Max. days before delete string data'); -$table->data[4][1] = html_print_input_text( - 'string_purge', - $config['string_purge'], - '', - 5, - 5, - true +$table->data[4][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['string_purge']->max, + 'name' => 'string_purge', + 'value' => $config['string_purge'], + 'return' => true, + 'min' => $performance_variables_control['string_purge']->min, + 'style' => 'width:43px', + ] ); $table->data[5][0] = __('Max. days before delete GIS data'); -$table->data[5][1] = html_print_input_text( - 'gis_purge', - $config['gis_purge'], - '', - 5, - 5, - true +$table->data[5][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['gis_purge']->max, + 'name' => 'gis_purge', + 'value' => $config['gis_purge'], + 'return' => true, + 'min' => $performance_variables_control['gis_purge']->min, + 'style' => 'width:43px', + ] ); $table->data[6][0] = __('Max. days before purge'); -$table->data[6][1] = html_print_input_text( - 'days_purge', - $config['days_purge'], - '', - 5, - 5, - true +$table->data[6][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['days_purge']->max, + 'name' => 'days_purge', + 'value' => $config['days_purge'], + 'return' => true, + 'min' => $performance_variables_control['days_purge']->min, + 'style' => 'width:43px', + ] ); $table->data[7][0] = __('Max. days before compact data'); -$table->data[7][1] = html_print_input_text( - 'days_compact', - $config['days_compact'], - '', - 5, - 5, - true +$table->data[7][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['days_compact']->max, + 'name' => 'days_compact', + 'value' => $config['days_compact'], + 'return' => true, + 'min' => $performance_variables_control['days_compact']->min, + 'style' => 'width:43px', + ] ); $table->data[8][0] = __('Max. days before delete unknown modules'); -$table->data[8][1] = html_print_input_text( - 'days_delete_unknown', - $config['days_delete_unknown'], - '', - 5, - 5, - true +$table->data[8][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['days_delete_unknown']->max, + 'name' => 'days_delete_unknown', + 'value' => $config['days_delete_unknown'], + 'return' => true, + 'min' => $performance_variables_control['days_delete_unknown']->min, + 'style' => 'width:43px', + ] ); $table->data[9][0] = __('Max. days before delete not initialized modules'); -$table->data[9][1] = html_print_input_text( - 'days_delete_not_initialized', - $config['days_delete_not_initialized'], - '', - 5, - 5, - true +$table->data[9][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['days_delete_not_initialized']->max, + 'name' => 'days_delete_not_initialized', + 'value' => $config['days_delete_not_initialized'], + 'return' => true, + 'min' => $performance_variables_control['days_delete_not_initialized']->min, + 'style' => 'width:43px', + ] ); $table->data[10][0] = __('Max. days before delete autodisabled agents'); -$table->data[10][1] = html_print_input_text( - 'days_autodisable_deletion', - $config['days_autodisable_deletion'], - '', - 5, - 5, - true +$table->data[10][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['days_autodisable_deletion']->max, + 'name' => 'days_autodisable_deletion', + 'value' => $config['days_autodisable_deletion'], + 'return' => true, + 'min' => $performance_variables_control['days_autodisable_deletion']->min, + 'style' => 'width:43px', + ] ); $table->data[11][0] = __('Retention period of past special days'); @@ -502,13 +540,17 @@ $table->data[] = [ $table->data[] = [ __('Max. days before delete old network matrix data'), - html_print_input_text( - 'delete_old_network_matrix', - $config['delete_old_network_matrix'], - '', - 5, - 5, - true + html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['delete_old_network_matrix']->max, + 'name' => 'delete_old_network_matrix', + 'value' => $config['delete_old_network_matrix'], + 'return' => true, + 'min' => $performance_variables_control['delete_old_network_matrix']->min, + 'style' => 'width:43px', + ] ), ]; @@ -522,13 +564,17 @@ $table_other->size[0] = '70%'; $table_other->size[1] = '30%'; $i = 0; $table_other->data[$i][0] = __('Item limit for realtime reports'); -$table_other->data[$i++][1] = html_print_input_text( - 'report_limit', - $config['report_limit'], - '', - 5, - 5, - true +$table_other->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['report_limit']->max, + 'name' => 'report_limit', + 'value' => $config['report_limit'], + 'return' => true, + 'min' => $performance_variables_control['report_limit']->min, + 'style' => 'width:43px', + ] ); $table_other->data[$i][0] = __('Limit of events per query'); @@ -565,13 +611,17 @@ $intervals[SECONDS_2WEEK] = __('2 weeks'); $intervals[SECONDS_1MONTH] = __('Last month'); $table_other->data[$i][0] = __('Default hours for event view'); -$table_other->data[$i++][1] = html_print_input_text( - 'event_view_hr', - $config['event_view_hr'], - '', - 5, - 5, - true +$table_other->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['event_view_hr']->max, + 'name' => 'event_view_hr', + 'value' => $config['event_view_hr'], + 'return' => true, + 'min' => $performance_variables_control['event_view_hr']->min, + 'style' => 'width:43px', + ] ); $table_other->data[$i][0] = __('Use realtime statistics'); @@ -609,23 +659,33 @@ $table_other->data[$i][0] = __('Delete not init modules'); $table_other->data[$i++][1] = html_print_checkbox_switch('delete_notinit', 1, $config['delete_notinit'], true); $table_other->data[$i][0] = __('Big Operation Step to purge old data'); -$table_other->data[$i++][1] = html_print_input_text( - 'big_operation_step_datos_purge', - $config['big_operation_step_datos_purge'], - '', - 5, - 5, - true +$table_other->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['big_operation_step_datos_purge']->max, + 'name' => 'big_operation_step_datos_purge', + 'value' => $config['big_operation_step_datos_purge'], + 'return' => true, + 'min' => $performance_variables_control['big_operation_step_datos_purge']->min, + 'style' => 'width:50px', + ] ); + + $table_other->data[$i][0] = __('Small Operation Step to purge old data'); -$table_other->data[$i++][1] = html_print_input_text( - 'small_operation_step_datos_purge', - $config['small_operation_step_datos_purge'], - '', - 5, - 5, - true +$table_other->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['small_operation_step_datos_purge']->max, + 'name' => 'small_operation_step_datos_purge', + 'value' => $config['small_operation_step_datos_purge'], + 'return' => true, + 'min' => $performance_variables_control['small_operation_step_datos_purge']->min, + 'style' => 'width:50px', + ] ); $table_other->data[$i][0] = __('Graph container - Max. Items'); @@ -649,13 +709,17 @@ $table_other->data[$i++][1] = html_print_input_text( ); $table_other->data[$i][0] = __('Row limit in csv log'); -$table_other->data[$i++][1] = html_print_input_text( - 'row_limit_csv', - $config['row_limit_csv'], - '', - 5, - 10, - true +$table_other->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['row_limit_csv']->max, + 'name' => 'row_limit_csv', + 'value' => $config['row_limit_csv'], + 'return' => true, + 'min' => $performance_variables_control['row_limit_csv']->min, + 'style' => 'width:63px', + ] ); $table_other->data[$i][0] = __('SNMP walk binary'); diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index e1d67c86ae..fc169f91a2 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -47,6 +47,8 @@ if (is_ajax()) { exit(); } +$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); + $table = new StdClass(); $table->class = 'databox filters'; $table->id = 'setup_general'; @@ -512,13 +514,17 @@ $table->data[$i++][1] = html_print_checkbox_switch( ); $table->data[$i][0] = __('Limit for bulk operations'); -$table->data[$i++][1] = html_print_input_text( - 'limit_parameters_massive', - $config['limit_parameters_massive'], - '', - 10, - 10, - true +$table->data[$i++][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['limit_parameters_massive']->max, + 'name' => 'limit_parameters_massive', + 'value' => $config['limit_parameters_massive'], + 'return' => true, + 'min' => $performance_variables_control['limit_parameters_massive']->min, + 'style' => 'width:50px', + ] ); $table->data[$i][0] = __('Include agents manually disabled'); diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 67577f68ed..73b2511b2b 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -53,6 +53,8 @@ $row = 0; echo '
'; html_print_input_hidden('update_config', 1); +$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); + // ---------------------------------------------------------------------- // BEHAVIOUR CONFIGURATION // ---------------------------------------------------------------------- @@ -64,7 +66,18 @@ $table_behaviour->size[0] = '50%'; $table_behaviour->data = []; $table_behaviour->data[$row][0] = __('Block size for pagination'); -$table_behaviour->data[$row][1] = html_print_input_text('block_size', $config['global_block_size'], '', 5, 5, true); +$table_behaviour->data[$row][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['block_size']->max, + 'name' => 'block_size', + 'value' => $config['global_block_size'], + 'return' => true, + 'min' => $performance_variables_control['block_size']->min, + 'style' => 'width:50px', + ] +); $row++; $values = []; @@ -904,16 +917,19 @@ if (enterprise_installed() === false) { } $table_chars->data[$row][0] = __('Data precision'); -$table_chars->data[$row][1] = html_print_input_text( - 'graph_precision', - $config['graph_precision'], - '', - 5, - 5, - true, - $disabled_graph_precision, - false, - 'onChange="change_precision()"' +$table_chars->data[$row][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['graph_precision']->max, + 'name' => 'graph_precision', + 'value' => $config['graph_precision'], + 'return' => true, + 'min' => $performance_variables_control['graph_precision']->min, + 'style' => 'width:50px', + ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', + 'onchange' => 'change_precision()', + ] ); $row++; @@ -922,17 +938,21 @@ if (isset($config['short_module_graph_data']) === false) { } $table_chars->data[$row][0] = __('Data precision in graphs'); -$table_chars->data[$row][1] = html_print_input_text( - 'short_module_graph_data', - $config['short_module_graph_data'], - '', - 5, - 5, - true, - $disabled_graph_precision, - false, - 'onChange="change_precision()"' +$table_chars->data[$row][1] = html_print_input( + [ + 'type' => 'number', + 'size' => 5, + 'max' => $performance_variables_control['short_module_graph_data']->max, + 'name' => 'short_module_graph_data', + 'value' => $config['short_module_graph_data'], + 'return' => true, + 'min' => $performance_variables_control['short_module_graph_data']->min, + 'style' => 'width:50px', + ($disabled_graph_precision) ? 'readonly' : '' => 'readonly', + 'onchange' => 'change_precision()', + ] ); + $row++; $table_chars->data[$row][0] = __( diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 3d804e31f7..b942bba283 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -955,29 +955,42 @@ class DiscoveryTaskList extends HTML ) ) { if ($ipam === true) { - $data[9] .= ''.html_print_image( - 'images/config.png', - true, - [ - 'title' => __('Edit task'), - 'class' => 'invert_filter', - ] - ).''; - $data[9] .= ''.html_print_image( - 'images/cross.png', - true, - [ - 'title' => __('Delete task'), - 'class' => 'invert_filter', - ] - ).''; + if (empty($tipam_task_id) === false) { + $data[9] .= ''.html_print_image( + 'images/config.png', + true, + [ + 'title' => __('Edit task'), + 'class' => 'invert_filter', + ] + ).''; + $data[9] .= ''.html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete task'), + 'class' => 'invert_filter', + ] + ).''; + } else { + $data[9] .= ''.html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Delete task'), + 'class' => 'invert_filter', + ] + ).''; + } } else { // Check if is a H&D, Cloud or Application or IPAM. $data[9] .= ' 'mw250px', + 'class' => 'mw200px', 'id' => 'filter_user', 'name' => 'filter_user', ], @@ -351,9 +366,12 @@ class AuditLog extends HTML ).ui_print_timestamp($tmp->utimestamp, true); if (enterprise_installed() === true) { - $tmp->security = enterprise_hook('cell1EntepriseAudit', [$tmp->id_sesion]); - $tmp->action = enterprise_hook('cell2EntepriseAudit', []); - $tmp->extendedInfo = enterprise_hook('rowEnterpriseAudit', [$tmp->id_sesion]); + $extendedInfo = enterprise_hook('rowEnterpriseAudit', [$tmp->id_sesion]); + if (empty($extendedInfo) === false) { + $tmp->security = enterprise_hook('cell1EntepriseAudit', [$tmp->id_sesion]); + $tmp->action = enterprise_hook('cell2EntepriseAudit', []); + $tmp->extendedInfo = $extendedInfo; + } } $carry[] = $tmp; diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 837be70906..4e14a73048 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -248,6 +248,11 @@ class ConsoleSupervisor $this->checkAuditLogOldLocation(); + /* + * Check if performance variables are corrects + */ + $this->checkPerformanceVariables(); + /* * Checks if sync queue is longer than limits. * NOTIF.SYNCQUEUE.LENGTH @@ -524,6 +529,11 @@ class ConsoleSupervisor $this->checkAuditLogOldLocation(); + /* + * Check if performance variables are corrects + */ + $this->checkPerformanceVariables(); + /* * Checks if sync queue is longer than limits. * NOTIF.SYNCQUEUE.LENGTH @@ -553,6 +563,91 @@ class ConsoleSupervisor } + /** + * Check if performance variables are corrects + * + * @return void + */ + public function checkPerformanceVariables() + { + global $config; + + $names = [ + 'event_purge' => 'Max. days before events are deleted', + 'trap_purge' => 'Max. days before traps are deleted', + 'audit_purge' => 'Max. days before audited events are deleted', + 'string_purge' => 'Max. days before string data is deleted', + 'gis_purge' => 'Max. days before GIS data is deleted', + 'days_purge' => 'Max. days before purge', + 'days_compact' => 'Max. days before data is compacted', + 'days_delete_unknown' => 'Max. days before unknown modules are deleted', + 'days_delete_not_initialized' => 'Max. days before delete not initialized modules', + 'days_autodisable_deletion' => 'Max. days before autodisabled agents are deleted', + 'delete_old_network_matrix' => 'Max. days before delete old network matrix data', + 'report_limit' => 'Item limit for real-time reports', + 'event_view_hr' => 'Default hours for event view', + 'big_operation_step_datos_purge' => 'Big Operation Step to purge old data', + 'small_operation_step_datos_purge' => 'Small Operation Step to purge old data', + 'row_limit_csv' => 'Row limit in csv log', + 'limit_parameters_massive' => 'Limit for bulk operations', + 'block_size' => 'Block size for pagination', + 'short_module_graph_data' => 'Data precision', + 'graph_precision' => 'Data precision in graphs', + ]; + + $variables = (array) json_decode(io_safe_output($config['performance_variables_control'])); + + foreach ($variables as $variable => $values) { + if (empty($config[$variable]) === true || $config[$variable] === '') { + continue; + } + + $message = ''; + $limit_value = ''; + if ($config[$variable] > $values->max) { + $message = 'Check the setting of %s, a value greater than %s is not recommended'; + $limit_value = $values->max; + } + + if ($config[$variable] < $values->min) { + $message = 'Check the setting of %s, a value less than %s is not recommended'; + $limit_value = $values->min; + } + + if ($limit_value !== '' && $message !== '') { + if (is_metaconsole() === true) { + $this->notify( + [ + 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, + 'title' => __('Incorrect config value'), + 'message' => __( + $message, + $names[$variable], + $limit_value + ), + 'url' => '__url__index.php?sec=advanced&sec2=advanced/metasetup', + ] + ); + } else { + $this->notify( + [ + 'type' => 'NOTIF.VARIABLES.PERFORMANCE.'.$variable, + 'title' => __('Incorrect config value'), + 'message' => __( + $message, + $names[$variable], + $limit_value + ), + 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup', + ] + ); + } + } + } + + } + + /** * Executes console maintenance operations. Executed ALWAYS through CRON. * diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a853e7eef5..e197b66be2 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 = 'PC230228'; +$build_version = 'PC230301'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 5e47040527..24d2de537d 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2317,6 +2317,96 @@ function config_process_config() config_update_value('2Fa_auth', ''); } + if (isset($config['performance_variables_control']) === false) { + config_update_value( + 'performance_variables_control', + json_encode( + [ + 'event_purge' => [ + 'max' => 45, + 'min' => 1, + ], + 'trap_purge' => [ + 'max' => 45, + 'min' => 1, + ], + 'audit_purge' => [ + 'max' => 365, + 'min' => 7, + ], + 'string_purge' => [ + 'max' => 365, + 'min' => 7, + ], + 'gis_purge' => [ + 'max' => 365, + 'min' => 7, + ], + 'days_purge' => [ + 'max' => 365, + 'min' => 7, + ], + 'days_compact' => [ + 'max' => 365, + 'min' => 0, + ], + 'days_delete_unknown' => [ + 'max' => 90, + 'min' => 0, + ], + 'days_delete_not_initialized' => [ + 'max' => 90, + 'min' => 0, + ], + 'days_autodisable_deletion' => [ + 'max' => 90, + 'min' => 0, + ], + 'delete_old_network_matrix' => [ + 'max' => 30, + 'min' => 1, + ], + 'report_limit' => [ + 'max' => 500, + 'min' => 1, + ], + 'event_view_hr' => [ + 'max' => 360, + 'min' => 1, + ], + 'big_operation_step_datos_purge' => [ + 'max' => 10000, + 'min' => 100, + ], + 'small_operation_step_datos_purge' => [ + 'max' => 10000, + 'min' => 100, + ], + 'row_limit_csv' => [ + 'max' => 1000000, + 'min' => 1, + ], + 'limit_parameters_massive' => [ + 'max' => 2000, + 'min' => 100, + ], + 'block_size' => [ + 'max' => 200, + 'min' => 10, + ], + 'short_module_graph_data' => [ + 'max' => 20, + 'min' => 1, + ], + 'graph_precision' => [ + 'max' => 5, + 'min' => 1, + ], + ] + ) + ); + } + if (isset($config['agent_wizard_defaults']) === false) { config_update_value( 'agent_wizard_defaults', diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index 8ed023ddde..657ce1ff35 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -160,6 +160,7 @@ function notifications_get_subtypes(?string $source=null) 'NOTIF.SERVER.QUEUE', 'NOTIF.SERVER.MASTER', 'NOTIF.ACCESSSTASTICS.PERFORMANCE', + 'NOTIF.VARIABLES.PERFORMANCE', ], ]; diff --git a/pandora_console/install.php b/pandora_console/install.php index 2a7bde9bb0..e76fce4a52 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 8fbf6b3a47..8b319376d8 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 2e8dbd979d..931745b212 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.769 -%define release 230228 +%define release 230301 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b4b9a39a65..f4c905a120 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230228" +PI_BUILD="230301" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 95573a89de..cad9bf5993 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -35,7 +35,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.769 Build 230228"; +my $version = "7.0NG.769 Build 230301"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index ea984d2726..5fbf54b2e5 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.769 Build 230228"; +my $version = "7.0NG.769 Build 230301"; # save program name for logging my $progname = basename($0);