diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7c20120eae..531601c7c8 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-230831 +Version: 7.0NG.773.3-230901 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 3a6431f20f..542a04b04f 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-230831" +pandora_version="7.0NG.773.3-230901" 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 d712b8efec..9343f15d32 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 => '230831'; +use constant AGENT_BUILD => '230901'; # 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 f6116fcc83..d51ebc07ba 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 230831 +%define release 230901 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 99e1c4900c..a67a92ad5a 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 230831 +%define release 230901 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 613a77c5f2..2234c1c490 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 230831 +%define release 230901 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 7e287a8c08..800e3cf38e 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="230831" +PI_BUILD="230901" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9880384a67..11dece2319 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230831} +{230901} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 9c355f5be7..301a5ada7a 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 230831") +#define PANDORA_VERSION ("7.0NG.773.3 Build 230901") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 20c585892a..3ab1bddfcd 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 230831))" + VALUE "ProductVersion", "(7.0NG.773.3(Build 230901))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4530f088df..4f9353e07a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.773.3-230831 +Version: 7.0NG.773.3-230901 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 33070dbbac..70d87e9db4 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-230831" +pandora_version="7.0NG.773.3-230901" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/66.sql b/pandora_console/extras/mr/66.sql index 94f29a899a..c13461b2fe 100644 --- a/pandora_console/extras/mr/66.sql +++ b/pandora_console/extras/mr/66.sql @@ -1,6 +1,14 @@ -- Active: 1685706586212@@172.16.0.2@3306@pandora START TRANSACTION; +CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` ( +`id` INT NOT NULL auto_increment, +`filter_name` VARCHAR(45) NULL, +`user_id` VARCHAR(255) NULL, +`graph_modules` TEXT NULL, +`interval` INT NULL, +PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; UPDATE `twelcome_tip` SET title = 'Scheduled downtimes', diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 11720e4e9b..af42d21293 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -216,7 +216,9 @@ if ($create_agent) { $server_name = (string) get_parameter_post('server_name'); $id_os = (int) get_parameter_post('id_os'); $disabled = (int) get_parameter_post('disabled'); - $custom_id = (string) get_parameter_post('custom_id', ''); + $custom_id_safe_output = strip_tags(io_safe_output(get_parameter('custom_id', ''))); + $custom_id = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $custom_id_safe_output))); + // $custom_id = (string) get_parameter_post('custom_id', ''); $cascade_protection = (int) get_parameter_post('cascade_protection', 0); $cascade_protection_module = (int) get_parameter_post('cascade_protection_module', 0); $safe_mode = (int) get_parameter_post('safe_mode', 0); @@ -999,7 +1001,9 @@ if ($update_agent) { $disabled = (bool) get_parameter_post('disabled'); $server_name = (string) get_parameter_post('server_name', ''); $id_parent = (int) get_parameter_post('id_agent_parent'); - $custom_id = (string) get_parameter_post('custom_id', ''); + $custom_id_safe_output = strip_tags(io_safe_output(get_parameter('custom_id', ''))); + $custom_id = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $custom_id_safe_output))); + // $custom_id = (string) get_parameter_post('custom_id', ''); $cascade_protection = (int) get_parameter_post('cascade_protection', 0); $cascade_protection_module = (int) get_parameter('cascade_protection_module', 0); $safe_mode_module = (int) get_parameter('safe_mode_module', 0); diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 959db70ed6..6ee46ff7f1 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -89,7 +89,7 @@ if (is_ajax() === true) { [ 'id' => 'agent_modules_affected_planned_downtime', 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => 'godmode/agentes/planned_downtime.list', @@ -730,7 +730,7 @@ if ($downtimes === false && $filter_performed === false) { $table->cellstyle = []; $table->head = []; - $table->head['name'] = __('Name #Ag.'); + $table->head['name'] = __('Name (Ag.)'); $table->head['description'] = __('Description'); $table->head['group'] = __('Group'); $table->head['type'] = __('Type'); diff --git a/pandora_console/images/draggable.svg b/pandora_console/images/draggable.svg new file mode 100644 index 0000000000..3889fef861 --- /dev/null +++ b/pandora_console/images/draggable.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 47631474c7..15ce4e5050 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 = 'PC230831'; +$build_version = 'PC230901'; $pandora_version = 'v7.0NG.773.3'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index e8d4eb3a4f..889e32f693 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -807,6 +807,7 @@ define('AUDIT_LOG_FILE_MANAGER', 'File manager'); define('AUDIT_LOG_ALERT_MANAGEMENT', 'Alert management'); define('AUDIT_LOG_ALERT_CORRELATION_MANAGEMENT', 'Alert correlation management'); define('AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT', 'Visual Console Management'); +define('AUDIT_LOG_GRAPH_ANALYTICS_PUBLIC', 'Graph Analytics Public'); define('AUDIT_LOG_TAG_MANAGEMENT', 'Tag management'); define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management'); define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management'); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4fa87f70cb..0895325ef5 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -270,7 +270,8 @@ function format_for_graph( $dec_point='.', $thousands_sep=',', $divider=1000, - $sufix='' + $sufix='', + $two_lines=false ) { // Exception to exclude modules whose unit is already formatted as KB (satellite modules) if (!empty($sufix) && $sufix == 'KB') { @@ -297,6 +298,10 @@ function format_for_graph( } // This will actually do the rounding and the decimals. + if ($two_lines === true) { + return remove_right_zeros(format_numeric($number, $decimals)).'
'.$shorts[$pos].$sufix; + } + return remove_right_zeros(format_numeric($number, $decimals)).$shorts[$pos].$sufix; } @@ -4046,25 +4051,49 @@ function series_type_graph_array($data, $show_elements_graph) } } else { $name_legend = ''; - if (isset($show_elements_graph['fullscale']) === true - && (int) $show_elements_graph['fullscale'] === 1 - ) { - $name_legend .= 'Tip: '; - } else { - $name_legend .= 'Avg: '; - } - if ($value['unit']) { - $name_legend .= $value['agent_alias']; - $name_legend .= ' / '; - $name_legend .= $value['module_name']; - $name_legend .= ' / '; - $name_legend .= __('Unit ').' '; - $name_legend .= $value['unit'].': '; + if ($show_elements_graph['graph_analytics'] === true) { + $name_legend .= '
'; + $name_legend .= '
'; + $name_legend .= ''; + $name_legend .= format_for_graph( + end(end($value['data'])), + 1, + $config['decimal_separator'], + $config['thousand_separator'], + 1000, + '', + true + ); + $name_legend .= ''; + $name_legend .= ''.$value['unit'].''; + $name_legend .= '
'; + $name_legend .= '
'; + $name_legend .= ''.$value['agent_alias'].''; + $name_legend .= ''.$value['module_name'].''; + $name_legend .= '
'; + $name_legend .= '
'; } else { - $name_legend .= $value['agent_alias']; - $name_legend .= ' / '; - $name_legend .= $value['module_name'].': '; + if (isset($show_elements_graph['fullscale']) === true + && (int) $show_elements_graph['fullscale'] === 1 + ) { + $name_legend .= 'Tip: '; + } else { + $name_legend .= 'Avg: '; + } + + if ($value['unit']) { + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name']; + $name_legend .= ' / '; + $name_legend .= __('Unit ').' '; + $name_legend .= $value['unit'].': '; + } else { + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name'].': '; + } } } } @@ -4085,28 +4114,30 @@ function series_type_graph_array($data, $show_elements_graph) $value['max'] = 0; } - $data_return['legend'][$key] .= ''.__('Min').' '.remove_right_zeros( - number_format( - $value['min'], - $config['graph_precision'], - $config['csv_decimal_separator'], - $config['csv_decimal_separator'] == ',' ? '.' : ',' - ) - ).' '.$value['unit'].' '.__('Max').' '.remove_right_zeros( - number_format( - $value['max'], - $config['graph_precision'], - $config['csv_decimal_separator'], - $config['csv_decimal_separator'] == ',' ? '.' : ',' - ) - ).' '.$value['unit'].' '._('Avg.').' '.remove_right_zeros( - number_format( - $value['avg'], - $config['graph_precision'], - $config['csv_decimal_separator'], - $config['csv_decimal_separator'] == ',' ? '.' : ',' - ) - ).' '.$value['unit'].' '.$str; + if (isset($show_elements_graph['graph_analytics']) === false) { + $data_return['legend'][$key] .= ''.__('Min').' '.remove_right_zeros( + number_format( + $value['min'], + $config['graph_precision'], + $config['csv_decimal_separator'], + $config['csv_decimal_separator'] == ',' ? '.' : ',' + ) + ).' '.$value['unit'].' '.__('Max').' '.remove_right_zeros( + number_format( + $value['max'], + $config['graph_precision'], + $config['csv_decimal_separator'], + $config['csv_decimal_separator'] == ',' ? '.' : ',' + ) + ).' '.$value['unit'].' '._('Avg.').' '.remove_right_zeros( + number_format( + $value['avg'], + $config['graph_precision'], + $config['csv_decimal_separator'], + $config['csv_decimal_separator'] == ',' ? '.' : ',' + ) + ).' '.$value['unit'].' '.$str; + } if ($show_elements_graph['compare'] == 'overlapped' && $key == 'sum2' diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 1892b0cd31..6fa1e2a8d5 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -5540,3 +5540,23 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate $options ); } + + +function graph_analytics_filter_select() +{ + global $config; + + $result = []; + + if (check_acl($config['id_user'], 0, 'RW') === 1 || check_acl($config['id_user'], 0, 'RM') === 1) { + $filters = db_get_all_rows_sql('SELECT id, filter_name FROM tgraph_analytics_filter WHERE user_id = "'.$config['id_user'].'"'); + + if ($filters !== false) { + foreach ($filters as $filter) { + $result[$filter['id']] = $filter['filter_name']; + } + } + } + + return $result; +} diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 13d984eba6..4bacf6c920 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3913,6 +3913,15 @@ function ui_print_datatable(array $parameters) $parameters['toggle_collapsed'] = true; } + $columns_tmp = []; + foreach ($parameters['columns'] as $k_column => $v_column) { + if (isset($parameters['columns'][$k_column]['text']) === true) { + array_push($columns_tmp, $v_column['text']); + } else { + array_push($columns_tmp, $v_column); + } + } + if (!is_array($parameters['order'])) { $order = 0; $direction = 'asc'; @@ -3926,7 +3935,7 @@ function ui_print_datatable(array $parameters) } else { $order = array_search( $parameters['order']['field'], - $parameters['columns'] + $columns_tmp ); if ($order === false) { @@ -3943,7 +3952,7 @@ function ui_print_datatable(array $parameters) foreach ($parameters['no_sortable_columns'] as $key => $find) { $found = array_search( $parameters['no_sortable_columns'][$key], - $parameters['columns'] + $columns_tmp ); if ($found !== false) { @@ -4511,7 +4520,8 @@ function ui_toggle( $switch_on=null, $switch_name=null, $disableToggle=false, - $id_table=false + $id_table=false, + $position_tgl_div=false ) { // Generate unique Id. $uniqid = uniqid(''); @@ -4630,6 +4640,11 @@ function ui_toggle( } if ($disableToggle === false) { + $position_div = 'relative'; + if ($position_tgl_div !== false) { + $position_div = $position_tgl_div; + } + // JQuery Toggle. $output .= ' + "; + + echo $graph_return; + return; + } + + // Save filter. + if (empty($save_filter) === false) { + $graphs = get_parameter('graphs'); + $interval = (int) get_parameter('interval'); + + if (empty($save_filter) === true) { + echo __('Empty name'); + return; + } + + if (empty($graphs) === true) { + echo __('It is not possible to create the filter if you have not made any change'); + return; + } + + $id_filter = db_process_sql_insert( + 'tgraph_analytics_filter', + [ + 'filter_name' => $save_filter, + 'user_id' => $config['id_user'], + 'graph_modules' => json_encode($graphs), + 'interval' => $interval, + ] + ); + + if ($id_filter > 0) { + echo 'saved'; + return; + } else { + echo __('It is not possible to create the filter if you have not made any change'); + return; + } + } + + // Update filter. + if (empty($update_filter) === false) { + $graphs = get_parameter('graphs'); + $interval = (int) get_parameter('interval'); + + if (empty($graphs) === true) { + echo __('It is not possible to update the filter if you have not made any change'); + return; + } + + $update_filter = db_process_sql_update( + 'tgraph_analytics_filter', + [ + 'graph_modules' => json_encode($graphs), + 'interval' => $interval, + ], + ['id' => $update_filter] + ); + + if ($update_filter > 0) { + echo 'updated'; + return; + } else { + echo __('No updated'); + return; + } + + echo $update_filter; + return; + } + + // Load filter. + if (empty($load_filter) === false) { + $data = []; + $data['graphs'] = json_decode(db_get_value('graph_modules', 'tgraph_analytics_filter', 'id', $load_filter)); + $data['interval'] = db_get_value('tgraph_analytics_filter.interval', 'tgraph_analytics_filter', 'id', $load_filter); + + echo json_encode($data); + return; + } + + // Get new values. + if (empty($get_new_values) === false) { + $data = []; + + $agent_module_id = $get_new_values; + $date_array = get_parameter('date_array'); + $data_module_graph = get_parameter('data_module_graph'); + $params = get_parameter('params'); + $suffix = get_parameter('suffix'); + + // Stract data. + $array_data_module = grafico_modulo_sparse_data( + $agent_module_id, + $date_array, + $data_module_graph, + $params, + $suffix + ); + + echo json_encode($array_data_module); + return; + } + + // Export graphs. + if (empty($export_filter) === false) { + $counter = 0; + $filter = get_parameter('export_filter'); + $group = get_parameter('group'); + + $filter_name = db_get_value('filter_name', 'tgraph_analytics_filter', 'id', $filter); + $graphs = json_decode(db_get_value('graph_modules', 'tgraph_analytics_filter', 'id', $filter)); + $interval = db_get_value('tgraph_analytics_filter.interval', 'tgraph_analytics_filter', 'id', $filter); + + foreach ($graphs as $graph) { + $id_graph = db_process_sql_insert( + 'tgraph', + [ + 'id_user' => $config['id_user'], + 'id_group' => $group, + 'name' => $filter_name.' ('.__('Graph').' '.($counter + 1).')', + 'description' => __('Created from Graph analytics. Filter:').' '.$filter_name.'. '.__('Graph').' '.($counter + 1), + 'period' => $interval, + 'stacked' => 2, + ] + ); + + if ($id_graph > 0) { + $counter++; + $field_order = 1; + + foreach ($graph as $module) { + $id_graph_source = db_process_sql_insert( + 'tgraph_source', + [ + 'id_graph' => $id_graph, + 'id_server' => 0, + 'id_agent_module' => $module, + 'weight' => 1, + 'label' => '', + 'field_order' => $field_order, + ] + ); + + $field_order++; + } + } + } + + echo $counter; + } + + return; +} + +// Save filter modal. +echo ''; + +// Load filter modal. +$filters = graph_analytics_filter_select(); + +echo ''; + +// Share modal. +echo ''; + +// Export graphs. +echo ''; + + +// Header & Actions. +$title_tab = __('Start realtime'); +$tab_start_realtime = [ + 'text' => ''.html_print_image( + 'images/change-active.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +$title_tab = __('Pause realtime'); +$tab_pause_realtime = [ + 'text' => ''.html_print_image( + 'images/change-pause.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +$title_tab = __('New'); +$tab_new = [ + 'text' => ''.html_print_image( + 'images/plus-black.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +$title_tab = __('Save'); +$tab_save = [ + 'text' => ''.html_print_image( + 'images/save_mc.png', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +$title_tab = __('Load'); +$tab_load = [ + 'text' => ''.html_print_image( + 'images/logs@svg.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +// Hash for auto-auth in public link. +$hash = User::generatePublicHash(); + +$title_tab = __('Share'); +$tab_share = [ + 'text' => ''.html_print_image( + 'images/responses.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.' + ', +]; + +$title_tab = __('Export to custom graph'); +$tab_export = [ + 'text' => ''.html_print_image( + 'images/module-graph.svg', + true, + [ + 'title' => $title_tab, + 'class' => 'invert_filter main_menu_icon', + ] + ).$title_tab.'', +]; + +ui_print_standard_header( + __('Graph analytics'), + 'images/menu/reporting.svg', + false, + '', + false, + [ + $tab_export, + $tab_share, + $tab_load, + $tab_save, + $tab_new, + $tab_pause_realtime, + $tab_start_realtime, + ], + [ + [ + 'link' => '', + 'label' => __('Reporting'), + ], + ] +); + +// Content. +$left_content = ''; +$right_content = ''; + +$left_content .= ' +
+
+ +
+
+
+ +
+'.ui_toggle( + '', + __('Agents'), + 'agents-toggle', + 'agents-toggle', + true, + true, + '', + 'white-box-content', + 'box-flat white_table_graph', + 'images/arrow@svg.svg', + 'images/arrow@svg.svg', + false, + false, + false, + '', + '', + null, + null, + false, + false, + 'static' +).ui_toggle( + '', + __('Groups'), + 'groups-toggle', + 'groups-toggle', + true, + true, + '', + 'white-box-content', + 'box-flat white_table_graph', + 'images/arrow@svg.svg', + 'images/arrow@svg.svg', + false, + false, + false, + '', + '', + null, + null, + false, + false, + 'static' +).ui_toggle( + '', + __('Modules'), + 'modules-toggle', + 'modules-toggle', + true, + true, + '', + 'white-box-content', + 'box-flat white_table_graph', + 'images/arrow@svg.svg', + 'images/arrow@svg.svg', + false, + false, + false, + '', + '', + null, + null, + false, + false, + 'static' +).' +
+
+ + + +
+
+
+'; + +$intervals = []; +$intervals[SECONDS_1HOUR] = _('Last ').human_time_description_raw(SECONDS_1HOUR, true, 'large'); +$intervals[SECONDS_6HOURS] = _('Last ').human_time_description_raw(SECONDS_6HOURS, true, 'large'); +$intervals[SECONDS_12HOURS] = _('Last ').human_time_description_raw(SECONDS_12HOURS, true, 'large'); +$intervals[SECONDS_1DAY] = _('Last ').human_time_description_raw(SECONDS_1DAY, true, 'large'); +$intervals[SECONDS_2DAY] = _('Last ').human_time_description_raw(SECONDS_2DAY, true, 'large'); +$intervals[SECONDS_1WEEK] = _('Last ').human_time_description_raw(SECONDS_1WEEK, true, 'large'); + +$right_content .= '
'.html_print_select( + $intervals, + 'interval', + SECONDS_12HOURS, + '', + '', + 0, + true, + false, + false, + '' +).'
'; + +$right_content .= ' +
+
'.__('Drop here').'
+
+'; + +$filters_div = html_print_div( + [ + 'class' => 'filters-div-main', + 'content' => $left_content, + ], + true +); + +$graphs_div = html_print_div( + [ + 'class' => 'padding-div graphs-div-main', + 'content' => $right_content, + ], + true +); + +html_print_div( + [ + 'class' => 'white_box main-div', + 'content' => $filters_div.$graphs_div, + ] +); + +ui_require_javascript_file('graph_analytics', 'include/javascript/', true); +?> + + \ No newline at end of file diff --git a/pandora_console/operation/reporting/graph_analytics_public.php b/pandora_console/operation/reporting/graph_analytics_public.php new file mode 100644 index 0000000000..434bb89809 --- /dev/null +++ b/pandora_console/operation/reporting/graph_analytics_public.php @@ -0,0 +1,191 @@ + + + + + + + '.get_product_name().$text_subtitle.' +'; + +// CSS. +ui_require_css_file('common', 'include/styles/', true); +ui_require_css_file('pandora', 'include/styles/', true); +ui_require_css_file('discovery', 'include/styles/', true); +ui_require_css_file('register', 'include/styles/', true); +ui_require_css_file('order_interpreter', 'include/styles/', true); +ui_require_css_file('graph_analytics', 'include/styles/', true); +ui_require_css_file('jquery-ui.min', 'include/styles/js/', true); +ui_require_css_file('jquery-ui_custom', 'include/styles/js/', true); +ui_require_css_file('introjs', 'include/styles/js/', true); +ui_require_css_file('events', 'include/styles/', true); + +// JS. +ui_require_javascript_file('jquery.current', 'include/javascript/', true); +ui_require_javascript_file('jquery.pandora', 'include/javascript/', true); +ui_require_javascript_file('jquery-ui.min', 'include/javascript/', true); +ui_require_javascript_file('jquery.countdown', 'include/javascript/', true); +ui_require_javascript_file('pandora', 'include/javascript/', true); +ui_require_javascript_file('pandora_ui', 'include/javascript/', true); +ui_require_javascript_file('pandora_events', 'include/javascript/', true); +ui_require_javascript_file('select2.min', 'include/javascript/', true); +// ui_require_javascript_file('connection_check', 'include/javascript/', true); +ui_require_javascript_file('encode_decode_base64', 'include/javascript/', true); +ui_require_javascript_file('qrcode', 'include/javascript/', true); +ui_require_javascript_file('intro', 'include/javascript/', true); +ui_require_javascript_file('clippy', 'include/javascript/', true); +ui_require_javascript_file('underscore-min', 'include/javascript/', true); + +echo ' + +'; + + + +ui_require_javascript_file('date', 'include/javascript/timezone/src/', true); +ui_require_javascript_file('jquery.flot.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.time', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.pie', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.crosshair.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.stack.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.selection.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.resize.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.threshold', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.threshold.multiple', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.symbol.min', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.exportdata.pandora', 'include/graphs/flot/', true); +ui_require_javascript_file('jquery.flot.axislabels', 'include/graphs/flot/', true); +ui_require_javascript_file('pandora.flot', 'include/graphs/flot/', true); +ui_require_javascript_file('chart', 'include/graphs/chartjs/', true); +ui_require_javascript_file('chartjs-plugin-datalabels.min', 'include/graphs/chartjs/', true); + + + +ui_require_javascript_file('graph_analytics', 'include/javascript/', true); + + +echo ' + + +'; + +// Content. +$right_content = ''; + +$right_content .= ' +
+
'.__('Drop here').'
+
+'; + +$graphs_div = html_print_div( + [ + 'class' => 'padding-div graphs-div-main', + 'content' => $right_content, + ], + true +); + +html_print_div( + [ + 'class' => 'white_box main-div graph-analytics-public', + 'content' => $graphs_div, + ] +); + +?> + + + + + \ No newline at end of file diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 6f193c05c5..afefdefc8b 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -1149,6 +1149,11 @@ if ($edit_capable === true) { visualConsoleManager.copyItem(item); } }); + setTimeout( + function() + { + visualConsoleManager.forceUpdateVisualConsole(); + }, 500); }); $('.link-create-item').click(function (event){ diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 2edce4e794..7f440a92fb 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.773.3 -%define release 230831 +%define release 230901 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec index 31e7fcefd6..9d5a283bb8 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.773.3 -%define release 230831 +%define release 230901 # User and Group under which Apache is running %define httpd_name httpd diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec index fa67cb0c3c..ae9a068559 100644 --- a/pandora_console/pandora_console.spec +++ b/pandora_console/pandora_console.spec @@ -3,7 +3,7 @@ # %define name pandorafms_console %define version 7.0NG.773.3 -%define release 230831 +%define release 230901 %define httpd_name httpd # User and Group under which Apache is running %define httpd_name apache2 diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 798c285172..278fa2a1d2 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -4423,4 +4423,16 @@ CREATE TABLE IF NOT EXISTS `tsca` ( `remediation` text DEFAULT NULL, `compliance` text DEFAULT NULL, PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; + +-- --------------------------------------------------------------------- +-- Table `tgraph_analytics_filter` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` ( +`id` INT NOT NULL auto_increment, +`filter_name` VARCHAR(45) NULL, +`user_id` VARCHAR(255) NULL, +`graph_modules` TEXT NULL, +`interval` INT NULL, +PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; \ No newline at end of file diff --git a/pandora_console/update_manager_client/views/online.php b/pandora_console/update_manager_client/views/online.php index fdc35caf3b..0adbb9decf 100644 --- a/pandora_console/update_manager_client/views/online.php +++ b/pandora_console/update_manager_client/views/online.php @@ -54,6 +54,23 @@ global $config; listUpdates(); + $text_for_next_version = ''; + $text_for_last_version = ''; + $back_up_url = 'index.php?sec=gextensions&sec2=enterprise/godmode/manage_backups'; + if ($updates[0]['lts'] === true) { + $text_for_next_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an up-to-date backup.'); + } else { + $text_for_next_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year.
Before installing this RRR version, please make sure you have an up-to-date backup.'); + } + + if ($updates[array_key_last($updates)]['lts'] === true) { + $text_for_last_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an up-to-date backup.'); + } else { + $text_for_last_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year.
Before installing this RRR version, please make sure you have an up-to-date backup.'); + } ?>

@@ -122,7 +139,8 @@ global $config; blast.setAttribute('disable', true); result.innerHTML = ''; umConfirm({ - message: " "+nextUpdateVersion+". ", + /*message: " "+nextUpdateVersion+". ",*/ + message: "'.$text_for_next_version.'

'; ?> ", title: " "+nextUpdateVersion, onAccept: function() { updateNext({ @@ -163,7 +181,8 @@ global $config; blast.setAttribute('disable', true); result.innerHTML = ''; umConfirm({ - message: " "+lastUpdateVersion+". ", + /*message: " "+lastUpdateVersion+". ",*/ + message: "'.$text_for_last_version.'

'; ?> ", title: " "+lastUpdateVersion, onAccept: function() { updateLatest({ diff --git a/pandora_console/views/dashboard/cell.php b/pandora_console/views/dashboard/cell.php index ae8545e2ce..919ce9e07e 100644 --- a/pandora_console/views/dashboard/cell.php +++ b/pandora_console/views/dashboard/cell.php @@ -47,6 +47,18 @@ $output .= '
'; if ($manageDashboards !== 0 || $writeDashboards !== 0) { if ((int) $cellData['id_widget'] !== 0) { + $output .= ''; + $output .= html_print_image( + 'images/copy.svg', + true, + [ + 'width' => '16px', + 'title' => __('Copy widget'), + 'class' => 'invert_filter', + ] + ); + $output .= ' '; + $output .= ''; $output .= html_print_image( 'images/configuration@svg.svg', diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index a1facb6541..e214cc03cc 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.773.3-230831 +Version: 7.0NG.773.3-230901 Architecture: all Priority: optional Section: admin diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh index f1701b8ddb..1c02d5d663 100644 --- a/pandora_server/DEBIAN/make_deb_package.sh +++ b/pandora_server/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-230831" +pandora_version="7.0NG.773.3-230901" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 96fc5ca201..641ff4ed8a 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -46,7 +46,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.773.3"; -my $pandora_build = "230831"; +my $pandora_build = "230901"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 284f224023..cbb4ea851e 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -2397,7 +2397,8 @@ sub pandora_planned_downtime_cron_start($$) { $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_set_disabled_elements($pa_config, $dbh, $downtime); } @@ -2448,7 +2449,8 @@ sub pandora_planned_downtime_cron_stop($$) { $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_unset_disabled_elements($pa_config, $dbh, $downtime); } @@ -2856,7 +2858,8 @@ sub pandora_planned_downtime_monthly_start($$) { pandora_planned_downtime_set_quiet_elements($pa_config, $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_set_disabled_elements($pa_config, $dbh, $downtime); } @@ -2934,7 +2937,8 @@ sub pandora_planned_downtime_monthly_stop($$) { $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_unset_disabled_elements($pa_config, $dbh, $downtime); @@ -3044,7 +3048,8 @@ sub pandora_planned_downtime_weekly_start($$) { $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_set_disabled_elements($pa_config, $dbh, $downtime); } @@ -3159,7 +3164,8 @@ sub pandora_planned_downtime_weekly_stop($$) { $dbh, $downtime->{'id'}); } elsif (($downtime->{'type_downtime'} eq "disable_agents") - || ($downtime->{'type_downtime'} eq "disable_agents_alerts")) { + || ($downtime->{'type_downtime'} eq "disable_agents_alerts") + || ($downtime->{'type_downtime'} eq "disable_agent_modules")) { pandora_planned_downtime_unset_disabled_elements($pa_config, $dbh, $downtime); } diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 92e948a593..a6db6692c4 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -34,7 +34,7 @@ our @ISA = qw(Exporter); # version: Defines actual version of Pandora Server for this module only my $pandora_version = "7.0NG.773.3"; -my $pandora_build = "230831"; +my $pandora_build = "230901"; our $VERSION = $pandora_version." ".$pandora_build; our %EXPORT_TAGS = ( 'all' => [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index ea313bbdbb..0c4239f1bd 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.773.3 -%define release 230831 +%define release 230901 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 76aa992548..1e74b2adfc 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 230831 +%define release 230901 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 7b56b641ce..576ae11785 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="230831" +PI_BUILD="230901" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index fec9068706..a4c6d99c39 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.773.3 Build 230831"; +my $version = "7.0NG.773.3 Build 230901"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index aaa3de36da..bfbcf5e30c 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 230831"; +my $version = "7.0NG.773.3 Build 230901"; # save program name for logging my $progname = basename($0);