diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index d496b2a15c..5e2d39ecbc 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='202302201' +S_VERSION='202304111' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables @@ -149,8 +149,8 @@ check_root_permissions #advicing BETA PROGRAM INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}" -[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}" [ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}" +[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}" echo -e $INSTALLING_VER # Connectivity @@ -327,12 +327,15 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ - chromium \ + http://firefly.artica.es/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ + http://firefly.artica.es/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" + + # Server dependencies server_dependencies=" \ perl \ @@ -516,9 +519,9 @@ fi # if beta is enable if [ "$PANDORA_BETA" -eq '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" + PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" + PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm" + PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" fi # Downloading Pandora Packages diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index 15e05cc155..ae5e607cae 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -17,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf WORKDIR=/opt/pandora/deploy -S_VERSION='202302201' +S_VERSION='202304111' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" rm -f $LOGFILE &> /dev/null # remove last log before start @@ -153,8 +153,8 @@ check_root_permissions #advicing BETA PROGRAM INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}" -[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}" [ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}" +[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}" echo -e $INSTALLING_VER # Connectivity @@ -304,8 +304,9 @@ ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE" # Chrome rm -f /usr/bin/chromium-browser &>> "$LOGFILE" -execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome" -execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome" +CHROME_VERSION=google-chrome-stable_110.0.5481.177-1_amd64.deb +execute_cmd "wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}" "Downloading google chrome" +execute_cmd "apt install -y ./${CHROME_VERSION}" "Intalling google chrome" execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink" # SDK VMware perl dependencies @@ -466,9 +467,9 @@ elif [ "$PANDORA_LTS" -ne '1' ] ; then fi if [ "$PANDORA_BETA" -eq '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" + PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz" + PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz" + PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" fi # Downloading Pandora Packages diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 87a88442db..c3fabd1a35 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.770-230403 +Version: 7.0NG.770-230411 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 11348cc214..b7fe20c0f4 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.770-230403" +pandora_version="7.0NG.770-230411" 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 97a5bb36df..85023e76f8 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.770'; -use constant AGENT_BUILD => '230403'; +use constant AGENT_BUILD => '230411'; # 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 31c3d1c181..d541b28c16 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.770 -%define release 230403 +%define release 230411 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 71cad24f1c..44020453ef 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.770 -%define release 230403 +%define release 230411 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 ba346ac89f..eff3784e25 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.770" -PI_BUILD="230403" +PI_BUILD="230411" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d61f08596d..4e10bb519b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230403} +{230411} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a8f234db7f..b1b2ed4f6d 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.770 Build 230403") +#define PANDORA_VERSION ("7.0NG.770 Build 230411") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d872c5b795..4a1b832993 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.770(Build 230403))" + VALUE "ProductVersion", "(7.0NG.770(Build 230411))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index e6b49d2f61..6863b260b6 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.770-230403 +Version: 7.0NG.770-230411 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 786198bcaa..6162c7ce85 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.770-230403" +pandora_version="7.0NG.770-230411" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index d0b5ef5e95..b14ce6c8b8 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -224,7 +224,7 @@ function pandora_realtime_graphs() false, '', 'white-box-content', - 'box-flat white_table_graph fixed_filter_bar' + 'box-flat white_table_graph' ); $chart[time()]['graph'] = '0'; diff --git a/pandora_console/extras/mr/62.sql b/pandora_console/extras/mr/62.sql index de8ff4c9d2..f8f611d817 100644 --- a/pandora_console/extras/mr/62.sql +++ b/pandora_console/extras/mr/62.sql @@ -189,6 +189,12 @@ CREATE TABLE IF NOT EXISTS `tfavmenu_user` ( `section` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`)); +ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring` TINYINT UNSIGNED NOT NULL default 0; +ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_max` INTEGER NOT NULL default 0; +ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_critical` float(20,2) NOT NULL default 0; +ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_warning` float(20,2) NOT NULL default 0; +ALTER TABLE `tnetflow_filter` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring_interval` INT UNSIGNED NOT NULL DEFAULT 300; INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1); COMMIT; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index f559b4e3eb..dc27e4b207 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1195,6 +1195,8 @@ if ($update_agent) { ] ); + ui_update_name_fav_element($id_agente, 'Agents', $alias); + ui_print_success_message(__('Successfully updated')); db_pandora_audit( AUDIT_LOG_AGENT_MANAGEMENT, diff --git a/pandora_console/godmode/agentes/inventory_manager.php b/pandora_console/godmode/agentes/inventory_manager.php index 4b6a53df47..77feece220 100644 --- a/pandora_console/godmode/agentes/inventory_manager.php +++ b/pandora_console/godmode/agentes/inventory_manager.php @@ -237,8 +237,9 @@ if (db_get_num_rows($sql) == 0) { $table->head[5] = __('Actions'); $table->align = []; $table->align[5] = 'left'; - + $i = 0; foreach ($result as $row) { + $table->cellclass[$i++][5] = 'table_action_buttons'; $data = []; $sql = sprintf('SELECT id_policy FROM tpolicy_modules_inventory WHERE id = %d', $row['id_policy_module_inventory']); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 0a45a18342..d9453eb931 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -563,7 +563,14 @@ if ($search != '') { if ($id != '') { $aux = $id[0]['id_agent']; $search_sql = sprintf( - ' AND ( `nombre` LIKE "%%%s%%" OR tagente.id_agente = %d', + ' AND ( nombre LIKE "%%%s%%" + OR alias LIKE "%%%s%%" + OR comentarios LIKE "%%%s%%" + OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%") + OR tagente.id_agente = %d', + $search, + $search, + $search, $search, $aux ); diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index a1c9638a48..fbc60c42b0 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -237,6 +237,8 @@ if ($update) { ['id_filter' => $id] ); + ui_update_name_fav_element($id, 'Events', $id_name); + ui_print_result_message( $result, __('Successfully updated'), diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index c998be494a..cbe9cf51f0 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -534,6 +534,7 @@ if ($is_management_allowed === true && $update_group === true) { } if ($result) { + ui_update_name_fav_element($id_group, 'Groups', $name); ui_print_success_message(__('Group successfully updated')); } else { ui_print_error_message(__('There was a problem modifying group')); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 20a977f7fe..f6e4aac358 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -177,9 +177,8 @@ if ($access_console_node === true) { $sub2['godmode/modules/manage_module_templates']['text'] = __('Module templates'); $sub2['godmode/modules/manage_module_templates']['id'] = 'module_templates'; $sub2['godmode/modules/private_enterprise_numbers']['text'] = __('Private Enterprise Numbers'); + enterprise_hook('local_components_menu'); $sub2['godmode/modules/private_enterprise_numbers']['id'] = 'private_Enterprise_Numbers'; - $sub2['enterprise/godmode/modules/local_components']['text'] = __('Local components'); - $sub2['enterprise/godmode/modules/local_components']['id'] = 'local_components'; $sub2['godmode/modules/manage_network_components']['text'] = __('Remote components'); $sub2['godmode/modules/manage_network_components']['id'] = 'network_components'; $sub['templates']['sub2'] = $sub2; diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 2f9e6bd41d..5ad8923ce1 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -26,6 +26,17 @@ * ============================================================================ */ +// Pandora FMS - http://pandorafms.com +// ================================================== +// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas +// Please see http://pandorafms.org for full contribution list +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; version 2 +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. global $config; require_once $config['homedir'].'/include/functions_ui.php'; @@ -94,6 +105,11 @@ if ($id) { $src_port = $filter['src_port']; $aggregate = $filter['aggregate']; $advanced_filter = $filter['advanced_filter']; + $netflow_monitoring = $filter['netflow_monitoring']; + $traffic_max = $filter['traffic_max']; + $traffic_critical = $filter['traffic_critical']; + $traffic_warning = $filter['traffic_warning']; + $netflow_monitoring_interval = $filter['netflow_monitoring_interval']; } else { $name = ''; $assign_group = ''; @@ -103,6 +119,11 @@ if ($id) { $src_port = ''; $aggregate = 'dstip'; $advanced_filter = ''; + $netflow_monitoring = false; + $traffic_max = 0; + $traffic_critical = 0; + $traffic_warning = 0; + $netflow_monitoring_interval = 300; } if ($update) { @@ -114,20 +135,31 @@ if ($update) { $dst_port = get_parameter('dst_port', ''); $src_port = get_parameter('src_port', ''); $advanced_filter = get_parameter('advanced_filter', ''); + $netflow_monitoring = (bool) get_parameter('netflow_monitoring', false); + $traffic_max = get_parameter('traffic_max', 0); + $traffic_critical = get_parameter('traffic_critical', 0); + $traffic_warning = get_parameter('traffic_warning', 0); + $netflow_monitoring_interval = get_parameter('netflow_monitoring_interval', 300); + if ($name == '') { ui_print_error_message(__('Not updated. Blank name')); } else { $values = [ - 'id_sg' => $id, - 'id_name' => $name, - 'id_group' => $assign_group, - 'aggregate' => $aggregate, - 'ip_dst' => $ip_dst, - 'ip_src' => $ip_src, - 'dst_port' => $dst_port, - 'src_port' => $src_port, - 'advanced_filter' => $advanced_filter, + 'id_sg' => $id, + 'id_name' => $name, + 'id_group' => $assign_group, + 'aggregate' => $aggregate, + 'ip_dst' => $ip_dst, + 'ip_src' => $ip_src, + 'dst_port' => $dst_port, + 'src_port' => $src_port, + 'advanced_filter' => $advanced_filter, + 'netflow_monitoring' => $netflow_monitoring, + 'traffic_max' => $traffic_max, + 'traffic_critical' => $traffic_critical, + 'traffic_warning' => $traffic_warning, + 'netflow_monitoring_interval' => $netflow_monitoring_interval, ]; // Save filter args. @@ -152,16 +184,27 @@ if ($create) { $dst_port = get_parameter('dst_port', ''); $src_port = get_parameter('src_port', ''); $advanced_filter = (string) get_parameter('advanced_filter', ''); + $netflow_monitoring = (bool) get_parameter('netflow_monitoring', false); + $traffic_max = get_parameter('traffic_max', 0); + $traffic_critical = get_parameter('traffic_critical', 0); + $traffic_warning = get_parameter('traffic_warning', 0); + $netflow_monitoring_interval = get_parameter('netflow_monitoring_interval', 300); $values = [ - 'id_name' => $name, - 'id_group' => $assign_group, - 'ip_dst' => $ip_dst, - 'ip_src' => $ip_src, - 'dst_port' => $dst_port, - 'src_port' => $src_port, - 'aggregate' => $aggregate, - 'advanced_filter' => $advanced_filter, + 'id_name' => $name, + 'id_group' => $assign_group, + 'ip_dst' => $ip_dst, + 'ip_src' => $ip_src, + 'dst_port' => $dst_port, + 'src_port' => $src_port, + 'aggregate' => $aggregate, + 'advanced_filter' => $advanced_filter, + 'netflow_monitoring' => $netflow_monitoring, + 'traffic_max' => $traffic_max, + 'traffic_critical' => $traffic_critical, + 'traffic_warning' => $traffic_warning, + 'netflow_monitoring_interval' => $netflow_monitoring_interval, + ]; // Save filter args @@ -203,6 +246,8 @@ $table->data['first_line'][] = html_print_label_input_block( false, 20, 80, + true, + false, true ) ); @@ -329,6 +374,77 @@ $table->data['advanced_filters'][] = html_print_label_input_block( ); +// Netflow server options. +$table->colspan['netflow_monitoring'][] = 2; +$table->data['netflow_monitoring'][] = html_print_label_input_block( + __('Enable Netflow monitoring'), + html_print_checkbox_switch( + 'netflow_monitoring', + 1, + (bool) $netflow_monitoring, + true, + false, + 'displayMonitoringFilter()' + ).ui_print_input_placeholder( + __('Allows you to create an agent that monitors the traffic volume of this filter. It also creates a module that measures if the traffic of any IP of this filter exceeds a certain threshold. A text type module will be created with the traffic rate for each IP within this filter every five minutes (the 10 IP\'s with the most traffic). Only available for Enterprise version.'), + true + ) +); + +$table->data['netflow_server_filters'][] = html_print_label_input_block( + __('Netflow monitoring interval'), + html_print_input_number( + [ + 'step' => 1, + 'name' => 'netflow_monitoring_interval', + 'id' => 'netflow_monitoring_interval', + 'value' => $netflow_monitoring_interval, + ] + ).ui_print_input_placeholder(__('Netflow monitoring interval in secs.'), true) +); + +$table->data['netflow_server_filters'][] = html_print_label_input_block( + __('Maximum traffic value of the filter'), + html_print_input_number( + [ + 'step' => 1, + 'name' => 'traffic_max', + 'id' => 'traffic_max', + 'value' => $traffic_max, + ] + ).ui_print_input_placeholder(__('Specifies the maximum rate (in bytes/sec) of traffic in the filter. It is then used to calculate the % of maximum traffic per IP.'), true) +); + +$table->colspan['netflow_thresholds'][] = 1; + +$table->data['netflow_thresholds'][] = html_print_label_input_block( + __('CRITICAL threshold for the maximum % of traffic for an IP.'), + html_print_input_number( + [ + 'step' => 0.01, + 'name' => 'traffic_critical', + 'id' => 'traffic_critical', + 'value' => $traffic_critical, + 'size' => 40, + 'maxlength' => 80, + ] + ).ui_print_input_placeholder(__('If this % is exceeded by any IP within the filter, a CRITICAL status will be generated.'), true) +); + +$table->data['netflow_thresholds'][] = html_print_label_input_block( + __('WARNING threshold for the maximum % of traffic for an IP.'), + html_print_input_number( + [ + 'step' => 0.01, + 'name' => 'traffic_warning', + 'id' => 'traffic_warning', + 'value' => $traffic_warning, + 'size' => 40, + 'maxlength' => 80, + ] + ).ui_print_input_placeholder(__('If this % is exceeded by any IP within the filter, a WARNING status will be generated.'), true) +); + $hiddens = ''; if ($id) { $buttonTitle = __('Update'); @@ -368,10 +484,10 @@ html_print_action_buttons( else { displayAdvancedFilter (); } + displayMonitoringFilter(); }); function displayAdvancedFilter () { - console.log('papapa advanced filter'); // Erase the normal filter document.getElementById("text-ip_dst").value = ''; document.getElementById("text-ip_src").value = ''; @@ -391,9 +507,9 @@ html_print_action_buttons( }; function displayNormalFilter () { - console.log('papapa normal filter'); // Erase the advanced filter document.getElementById("textarea_advanced_filter").value = ''; + // Hide the advanced filter //document.getElementById("table1-7").style.display = 'none'; $("#table1-advanced_filters").css("display", "none"); @@ -407,4 +523,24 @@ html_print_action_buttons( document.getElementById("table1-6").style.display = ''; */ }; + + function displayMonitoringFilter () { + var checked = $('#checkbox-netflow_monitoring').prop('checked'); + + if(checked == false) { + // Reset values. + $("#netflow_monitoring_interval").val(300); + $("#traffic_max").val(0); + $("#traffic_critical").val(0); + $("#traffic_warning").val(0); + + // Hide filters. + $("#table1-netflow_server_filters").hide(); + $("#table1-netflow_thresholds").hide(); + } else { + // Show filters. + $("#table1-netflow_server_filters").show(); + $("#table1-netflow_thresholds").show(); + } + }; diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 24b782a0d4..65e93478e3 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1231,8 +1231,8 @@ $class = 'databox filters'; ?> 'All nodes'], $servers); - if ($meta) { + if (is_metaconsole() === true) { + $servers_all_opt = array_merge(['all' => 'All nodes'], $servers); ?> diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 68ff0baf8e..6fc2056587 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1429,6 +1429,8 @@ switch ($action) { ['id_report' => $idReport] ); + ui_update_name_fav_element($idReport, 'Reporting', $new_values['name']); + $auditMessage = ($resultOperationDB === true) ? 'Update report' : 'Fail try to update report'; db_pandora_audit( AUDIT_LOG_REPORT_MANAGEMENT, diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 6a7f8cba37..f9072d6b31 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -293,6 +293,7 @@ switch ($activeTab) { } if ($result !== false) { + ui_update_name_fav_element($idVisualConsole, 'Visual_Console', $values['name']); db_pandora_audit( AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, sprintf('Update visual console #%s', $idVisualConsole) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index f400961b0c..869a504c8f 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -1045,6 +1045,22 @@ if (!$new_user) { ); $user_id .= $apiTokenContent; + + $CodeQRContent .= html_print_div(['id' => 'qr_container_image', 'class' => 'scale-0-8'], true); + $CodeQRContent .= html_print_anchor( + ['id' => 'qr_code_agent_view'], + true + ); + $CodeQRContent .= '
'.$custom_id_div; + + // QR code div. + $CodeQRTable = html_print_div( + [ + 'class' => 'agent_qr', + 'content' => $CodeQRContent, + ], + true + ); } else { $user_id = '
'.html_print_input_text_extended( 'id_user', diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 9e648a7a03..eaf9032e76 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -258,7 +258,7 @@ if (users_is_admin() === true) { // Password management. $passwordManageTable = new stdClass(); -$passwordManageTable->class = 'table_section full_section'; +$passwordManageTable->class = 'full_section'; $passwordManageTable->id = 'password_manage'; $passwordManageTable->style = []; $passwordManageTable->rowclass = []; @@ -605,7 +605,7 @@ $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_selec if (is_metaconsole() === false) { // Home screen table. $homeScreenTable = new stdClass(); - $homeScreenTable->class = 'w100p table_section full_section'; + $homeScreenTable->class = 'w100p full_section'; $homeScreenTable->id = 'home_screen_table'; $homeScreenTable->style = []; $homeScreenTable->rowclass = []; @@ -736,22 +736,6 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div( true ); -$CodeQRContent .= html_print_div(['id' => 'qr_container_image', 'class' => 'scale-0-8'], true); -$CodeQRContent .= html_print_anchor( - ['id' => 'qr_code_agent_view'], - true -); -$CodeQRContent .= '
'.$custom_id_div; - -// QR code div. -$CodeQRTable = html_print_div( - [ - 'class' => 'agent_qr', - 'content' => $CodeQRContent, - ], - true -); - // QR Code and API Token advice. html_print_div( [ diff --git a/pandora_console/images/netflow@svg.svg b/pandora_console/images/netflow@svg.svg new file mode 100644 index 0000000000..87261e6aa9 --- /dev/null +++ b/pandora_console/images/netflow@svg.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index e4e9dc9937..8b3c15751b 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -37,6 +37,7 @@ require_once 'include/functions_ui.php'; require_once 'include/functions_db.php'; require_once 'include/functions_io.php'; require_once 'include/functions.php'; +require_once $config['homedir'].'/include/class/HTML.class.php'; enterprise_include_once('meta/include/functions_events_meta.php'); enterprise_include_once('include/functions_metaconsole.php'); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 450faa0e9a..cb103c7b8d 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -2065,6 +2065,7 @@ if (check_login()) { if ($result === false) { echo 'error'; } else { + ui_update_name_fav_element($id, 'Modules', $values['ag_modulename']); echo 'ok'; } } diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index 93f391ee73..c16628dd69 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -134,7 +134,7 @@ class AuditLog extends HTML ui_print_standard_header( __('%s audit', get_product_name()).' » '.__('Review Logs'), - 'images/gm_log.png', + 'images/gm_log@svg.svg', false, '', false, diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 2f073fed3a..b2599e7208 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -3245,7 +3245,7 @@ class NetworkMap $table->data['template_row']['node_target'] = ''; $table->data['template_row']['edit'] = ''; - $table->data['template_row']['edit'] .= ''; + $table->data['template_row']['edit'] .= ''; // '.html_print_image('images/edit.svg', true, ['class' => 'invert_filter']).''; $table->data['template_row']['edit'] .= ''.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'style' => 'padding: 10px']).''; diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 3f48eb2c22..5ff370d69c 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -1443,7 +1443,7 @@ class SnmpConsole extends HTML binding_vars.forEach(function(oid) { string += oid+'
'; }); - variableBindings = `${string}`; + variableBindings = `${string}`; } tr.after(`${labelBindings}${variableBindings}`); diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 0dffdb7994..712fc62f0a 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -301,17 +301,6 @@ class TipsWindow } - /** - * Get number of tips in database - * - * @return integer - */ - public function getTotalTips() - { - return db_get_sql('SELECT count(*) FROM twelcome_tip'); - } - - /** * Get totals tips that user can show * @@ -581,7 +570,7 @@ class TipsWindow $sql = sprintf( 'SELECT id, name AS language, title, text, url, enable FROM twelcome_tip t - LEFT JOIN tlanguage l ON t.id_lang = l.id_language + LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci %s %s %s', $filter, $order, @@ -590,6 +579,16 @@ class TipsWindow $data = db_get_all_rows_sql($sql); + $sqlCount = sprintf( + 'SELECT count(*) + FROM twelcome_tip t + LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci + %s', + $filter + ); + + $total = db_get_sql($sqlCount); + foreach ($data as $key => $row) { if ($row['enable'] === '1') { $data[$key]['enable'] = ''; @@ -626,8 +625,6 @@ class TipsWindow if (empty($data) === true) { $total = 0; $data = []; - } else { - $total = $this->getTotalTips(); } echo json_encode( diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index e729b8bf14..798d91bb64 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 = 'PC230403'; +$build_version = 'PC230411'; $pandora_version = 'v7.0NG.770'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 6b86c50c6d..1d11aad151 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -440,6 +440,7 @@ define('SERVER_TYPE_MIGRATION', 20); define('SERVER_TYPE_ALERT', 21); define('SERVER_TYPE_CORRELATION', 22); define('SERVER_TYPE_NCM', 23); +define('SERVER_TYPE_NETFLOW', 24); // REPORTS. define('REPORT_TOP_N_MAX', 1); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 434c16a256..fdf08bbcce 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4934,7 +4934,7 @@ function iterate_group_array($groups, &$data_agents) break; } - $tooltip_content = html_print_image('images/groups_small/'.$group['icon'].'.png', true).' '.__('Group').': '.$group_aux['name'].''; + $tooltip_content = html_print_image('images/'.$group['icon'], true).' '.__('Group').': '.$group_aux['name'].''; $group_aux['tooltip_content'] = $tooltip_content; $group_aux['children'] = []; @@ -4975,10 +4975,10 @@ function graph_monitor_wheel($width=550, $height=600, $filter=false) if ($filter['group'] != 0) { $filter_subgroups = ''; if (!$filter['dont_show_subgroups']) { - $filter_subgroups = ' || parent = '.$filter['group']; + $filter_subgroups = ' || parent IN ('.$filter['group'].')'; } - $groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo = '.$filter['group'].$filter_subgroups); + $groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo IN ('.$filter['group'].') '.$filter_subgroups); $groups_ax = []; foreach ($groups as $g) { diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 305d2c5d7d..37054a3e86 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6912,12 +6912,12 @@ function html_print_label_input_block( function html_print_go_top() { $output = '
'; - $output .= '
'; - $output .= ''; - $output .= 'Dark / 20 / arrow@svg'; + $output .= '
'; + $output .= ''; + // $output .= ''.__('Go to top').''; $output .= 'Created with Sketch.'; - $output .= ''; - $output .= ''; + $output .= ''; + $output .= ''; $output .= ''; $output .= ''; $output .= '
'; diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 7a04cbf30a..921e921172 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -68,6 +68,8 @@ function menu_print_menu(&$menu) $sec2 = 'godmode/alerts/alert_commands'; } else if ($sec2 === 'enterprise/godmode/setup/edit_skin') { $sec2 = 'enterprise/godmode/setup/setup_skins'; + } else if ($sec2 === 'operation/agentes/networkmap.dinamic') { + $sec2 = 'operation/agentes/pandora_networkmap'; } else if ($sec2 === 'godmode/gis_maps/configure_gis_map') { $map_id = (string) get_parameter('map_id'); if (empty($map_id) === false) { diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php index a58342dddb..28daa277e7 100644 --- a/pandora_console/include/functions_servers.php +++ b/pandora_console/include/functions_servers.php @@ -860,6 +860,19 @@ function servers_get_info($id_server=-1) $id_modulo = 0; break; + case SERVER_TYPE_NETFLOW: + $server['img'] = html_print_image( + 'images/netflow@svg.svg', + true, + [ + 'title' => __('Netflow server'), + 'class' => 'main_menu_icon invert_filter', + ] + ); + $server['type'] = 'netflow'; + $id_modulo = 0; + break; + default: $server['img'] = ''; $server['type'] = 'unknown'; diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index e598037684..b366797fd4 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -321,16 +321,20 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals $group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']); - /* - if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) { + if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) { // Actions table - echo '
'; + echo ''; - }*/ + } // id_module and id_agent hidden echo '