diff --git a/extras/deploy-scripts/pandora_agent_deploy.sh b/extras/deploy-scripts/pandora_agent_deploy.sh index 88bfe4dd83..30bfc82632 100644 --- a/extras/deploy-scripts/pandora_agent_deploy.sh +++ b/extras/deploy-scripts/pandora_agent_deploy.sh @@ -184,14 +184,14 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset} # Insatall pandora agent - [ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm " + [ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm" execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package' #[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection" fi if [[ $OS_RELEASE == 'debian' ]]; then - [ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz' + [ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz' execute_cmd "apt update" 'Updating repos' execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies' execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package' diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index c16729bca0..44be2d8fb9 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -11,7 +11,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf -S_VERSION='2023062901' +S_VERSION='2023101101' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables @@ -185,7 +185,7 @@ extra_repos=" \ tar \ yum-utils \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ -http://rpms.remirepo.net/enterprise/remi-release-7.rpm \ +https://rpms.remirepo.net/enterprise/remi-release-7.rpm \ https://repo.percona.com/yum/percona-release-latest.noarch.rpm" execute_cmd "yum install -y $extra_repos" "Installing extra repositories" @@ -285,6 +285,7 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ + https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \ chromium" execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies" @@ -312,7 +313,7 @@ server_dependencies=" \ bind-utils \ whois \ cpanminus \ - http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ https://firefly.pandorafms.com/centos7/pandorawmic-1.0.0-1.x86_64.rpm" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -322,13 +323,13 @@ execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore" # SDK VMware perl dependencies vmware_dependencies=" \ - http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \ perl-JSON \ perl-Archive-Zip \ openssl-devel \ perl-Crypt-CBC \ perl-Digest-SHA \ - http://firefly.pandorafms.com/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm" + https://firefly.pandorafms.com/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm" execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" # Instant client Oracle @@ -410,7 +411,7 @@ skip-character-set-client-handshake # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Mysql optimizations for Pandora FMS -# Please check the documentation in http://pandorafms.com for better results +# Please check the documentation in https://pandorafms.com for better results max_allowed_packet = 64M innodb_buffer_pool_size = $POOL_SIZE @@ -461,20 +462,20 @@ export MYSQL_PWD=$DBPASS #Define packages #Define packages if [ "$PANDORA_LTS" -eq '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm" + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm" elif [ "$PANDORA_LTS" -ne '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.x86_64.rpm" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.x86_64.rpm" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" fi # if beta is enable if [ "$PANDORA_BETA" -eq '1' ] ; then - PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" - PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm" - PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" + PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" + PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.x86_64.rpm" + PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" fi # Downloading Pandora Packages @@ -710,8 +711,8 @@ systemctl enable tentacle_serverd &>> $LOGFILE execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" # Enabling condole cron -execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" -echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab +execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" +echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab ## Enabling agent systemctl enable pandora_agent_daemon &>> $LOGFILE execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" @@ -729,7 +730,7 @@ Welcome to Pandora FMS appliance on CentOS Go to Public http://$ipplublic/pandora_console to login web console $(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}') -You can find more information at http://pandorafms.com +You can find more information at https://pandorafms.com EOF_banner diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index 32422ab98b..7e2d2524c0 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='2023062901' +S_VERSION='2023101101' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" # define default variables @@ -264,7 +264,7 @@ if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then tar \ dnf-utils \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \ - http://rpms.remirepo.net/enterprise/remi-release-8.rpm \ + https://rpms.remirepo.net/enterprise/remi-release-8.rpm \ https://repo.percona.com/yum/percona-release-latest.noarch.rpm" execute_cmd "dnf install -y $extra_repos" "Installing extra repositories" @@ -275,7 +275,7 @@ else tar \ dnf-utils \ epel-release \ - http://rpms.remirepo.net/enterprise/remi-release-8.rpm \ + https://rpms.remirepo.net/enterprise/remi-release-8.rpm \ https://repo.percona.com/yum/percona-release-latest.noarch.rpm" execute_cmd "dnf install -y $extra_repos" "Installing extra repositories" @@ -391,10 +391,12 @@ console_dependencies=" \ mod_ssl \ libzstd \ openldap-clients \ - http://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ - http://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ - http://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ - http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm" + https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ + https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm \ + https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies" # Server dependencies @@ -421,7 +423,7 @@ server_dependencies=" \ bind-utils \ whois \ libnsl \ - http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ + https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \ https://firefly.pandorafms.com/centos8/pandorawmic-1.0.0-1.x86_64.rpm" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -436,8 +438,8 @@ vmware_dependencies=" \ perl-Math-Random-ISAAC \ perl-JSON \ perl-Crypt-SSLeay \ - http://firefly.pandorafms.com/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \ - http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm" + https://firefly.pandorafms.com/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \ + https://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm" execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" # Instant client Oracle @@ -518,7 +520,7 @@ skip-character-set-client-handshake # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Mysql optimizations for Pandora FMS -# Please check the documentation in http://pandorafms.com for better results +# Please check the documentation in https://pandorafms.com for better results max_allowed_packet = 64M innodb_buffer_pool_size = $POOL_SIZE @@ -567,20 +569,20 @@ export MYSQL_PWD=$DBPASS #Define packages if [ "$PANDORA_LTS" -eq '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm" + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm" elif [ "$PANDORA_LTS" -ne '1' ] ; then - [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" - [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" + [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.x86_64.rpm" + [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.x86_64.rpm" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm" fi # if beta is enable if [ "$PANDORA_BETA" -eq '1' ] ; then - PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" - PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm" - PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm" + PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm" + PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.x86_64.rpm" + PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm" fi # Downloading Pandora Packages @@ -828,8 +830,8 @@ systemctl enable tentacle_serverd &>> "$LOGFILE" execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" # Enabling condole cron -execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" -echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab +execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" +echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab ## Enabling agent systemctl enable pandora_agent_daemon &>> "$LOGFILE" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh index a215808d17..5f240b0a41 100644 --- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh +++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh @@ -344,6 +344,14 @@ execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server execute_cmd "installing_docker" "Installing Docker for debug" +# Installing pandora_gotty +execute_cmd "curl --output pandora_gotty.deb https://firefly.pandorafms.com/ubuntu/pandora_gotty_1.0.0.deb" "Downloading pandora_gotty" +execute_cmd "apt install -y ./pandora_gotty.deb" "Intalling pandora_gotty" + +# Installing MADE +execute_cmd "curl --output pandora_made.deb https://firefly.pandorafms.com/ubuntu/pandorafms-made_0.1.0-2_amd64.deb" "Downloading pandora MADE" +execute_cmd "apt install -y ./pandora_made.deb" "Intalling pandora MADE" + # wmic and pandorawmic execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/wmic" "Downloading wmic" execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic" @@ -514,17 +522,17 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin if [ "$PANDORA_LTS" -eq '1' ] ; then [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz" elif [ "$PANDORA_LTS" -ne '1' ] ; then [ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz" [ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz" - [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" + [ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE=" https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz" fi if [ "$PANDORA_BETA" -eq '1' ] ; then - PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz" + PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.tar.gz" PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz" - PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz" + PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz" fi # Downloading Pandora Packages @@ -819,8 +827,8 @@ execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" systemctl enable tentacle_serverd &>> "$LOGFILE" # Enabling console cron -execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" -echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab +execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron" +echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab # Enabling pandoradb cron execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron" diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 93bae73418..2cbd073e72 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.774-231114 +Version: 7.0NG.774-231127 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 3a20d80471..d22fd0695f 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.774-231114" +pandora_version="7.0NG.774-231127" 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 f9465e3d3c..f942f995b4 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.774'; -use constant AGENT_BUILD => '231114'; +use constant AGENT_BUILD => '231127'; # 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 6167dd5b19..d1eb93e83f 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.774 -%define release 231114 +%define release 231127 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 5cd2d6bdca..d711fb699c 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231114 +%define release 231127 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index c9f432dffd..ea420e44ed 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.774 -%define release 231114 +%define release 231127 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 84f618effd..3796b6ecd8 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.774 -%define release 231114 +%define release 231127 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 394b8f1231..3480ae034d 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.774 -%define release 231114 +%define release 231127 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 0214004491..cdd83702fb 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231114" +PI_BUILD="231127" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 049bc895a7..9cdd7c6d29 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{231114} +{231127} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2dc24060b5..963a3116dc 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.774 Build 231114") +#define PANDORA_VERSION ("7.0NG.774 Build 231127") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 2d159cefe5..ff3ee2a969 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.774(Build 231114))" + VALUE "ProductVersion", "(7.0NG.774(Build 231127))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4e74545734..8bfb3754d1 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.774-231114 +Version: 7.0NG.774-231127 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 a47665be61..ad9d0a7a05 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.774-231114" +pandora_version="7.0NG.774-231127" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/67.sql b/pandora_console/extras/mr/67.sql index d705a84d9a..88082d4a6e 100644 --- a/pandora_console/extras/mr/67.sql +++ b/pandora_console/extras/mr/67.sql @@ -1,8 +1,13 @@ START TRANSACTION; +-- Delete table tagent_access +DROP TABLE tagent_access; + +ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL; + ALTER TABLE `tdashboard` ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`, ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`, ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`; -COMMIT; \ No newline at end of file +COMMIT; diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index e18d278ac8..bbc499661f 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -418,7 +418,7 @@ switch ($login_screen) { } if ($config['enterprise_installed']) { - if ($config['reset_pass_option']) { + if ($config['reset_pass_option'] && $config['auth'] === 'mysql') { $reset_pass_link = 'reset_pass.php'; // Reset password link. echo '
'; diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 25b06e2f5a..53b4995d20 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -217,6 +217,7 @@ foreach ($fields as $field) { array_push($table->data, $data); } +$tablePagination = ''; if ($fields) { html_print_table($table); $tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false); @@ -231,6 +232,9 @@ html_print_action_buttons( [ 'icon' => 'next' ], true ), - ['type' => 'form_action'] + [ + 'type' => 'form_action', + 'right_content' => $tablePagination, + ], ); echo ''; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index de08a299de..9c318b4e9f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -2000,7 +2000,11 @@ ui_require_jquery_file('json'); $('#' + thisLabel).prop('checked', true); $('#' + thisLabel).siblings().prop('checked', false); - if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) { + var type_selected = $("#id_module_type").val(); + var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val())); + var type_name_selected = type_names[type_selected]; + + if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true || type_name_selected == 'generic_data_string') { $("#svg_dinamic").hide(); } else { paint_graph_values(); diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 003ec45d03..8236d1e69c 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -31,13 +31,14 @@ if (is_ajax()) { return; } - echo '

'.$template['name'].'

'; + echo '

'.$template['name'].'

'; + echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']); + echo ui_print_alert_template_example($template['id'], true, true, false); + echo '
'; + echo '
'; echo ''.__('Type').': '; echo alerts_get_alert_templates_type_name($template['type']); - echo '
'; - echo ui_print_alert_template_example($template['id'], true); - echo '
'; if ($template['description'] != '') { diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 4718689da5..6d33077bf8 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -520,7 +520,7 @@ $(document).ready (function () { name: "id_action", value: "" }); - + jQuery.post (, values, function (data, status) { @@ -552,6 +552,9 @@ $(document).ready (function () { // If the row is empty, hide it if (field_row == '') { + // Clear hidden fields. + $("[name=field" + i + "_value]").val(''); + $("[name=field" + i + "_recovery_value]").val('') $table_macros_field.hide(); continue; } diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index bbd758d9a9..7365339191 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -1240,7 +1240,7 @@ if ($step == 2) { 'priority', $priority, '', - 0, + '', 0, true, false, diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index 9979b2c224..3bd4052ba2 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) { // Get some general DB stats (not very heavy) // NOTE: this is not realtime monitoring stats, are more focused on DB sanity -$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0'); $stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0'); $stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0'); $stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0'); @@ -149,18 +148,6 @@ echo $stat_modules; echo ''; - -echo ''; -echo __('Total agent access records'); -echo ''; -if ($stat_access > $max_access) { - echo "$stat_access"; -} else { - echo $stat_access; -} - -echo ''; - // Sanity echo ''; echo __('Database sanity'); diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index a6f282d2cf..524ab245fb 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -68,7 +68,7 @@ foreach ($layer_ids as $layer_id) { $layer_list[] = [ 'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null, 'layer_name' => $trimmed_name, - 'layer_visible' => ((int) $layers[$layer_id]['visible'] === 1), + 'layer_visible' => ($layers[$layer_id]['visible'] === 'true'), 'layer_group' => (int) $layers[$layer_id]['agents_from_group'], 'layer_agent_list' => $layers[$layer_id]['agents'], 'layer_group_list' => $layers[$layer_id]['groups'], @@ -560,21 +560,23 @@ html_print_table($table); $user_groups = users_get_groups($config['user'], 'AR', false); -echo '

'.__('Layers').'

'; +echo '
'.__('Layers').''; $table->width = '100%'; $table->class = 'databox filters'; $table->valign = []; -$table->valign[0] = 'top'; -$table->valign[1] = 'top'; +$table->valign[0] = 'top; width: 50%'; +$table->valign[1] = 'top; width: 50%'; $table->data = []; $table->data[0][0] = '

'.__('List of layers').'

'; $table->data[0][1] = '
'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'
'; -$table->data[1][0] = '
'; -$table->data[1][1] = '
'; switch ($action) { case 'save_new': @@ -1229,6 +1233,8 @@ function getLayerRow (layerId, layerData) { .append($editCol) .append($deleteCol); + $("#list_layers").removeClass('invisible'); + return $row; } diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 00bbdddb39..201d3cea4e 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -757,6 +757,125 @@ if ($tab == 'tree') { /* * Group tree view. */ + + $table = new stdClass(); + $table->width = '100%'; + $table->class = 'databox filters filter-table-adv'; + if (is_metaconsole() === true) { + $table->cellspacing = 0; + $table->cellpadding = 0; + } + + $search_group_string = get_parameter('search_group_string', ''); + $search_agent_string = get_parameter('search_agent_string', ''); + $agent_status = get_parameter('agent_status', ''); + $show_not_init_agents = get_parameter('show_not_init_agents', 1); + $show_not_init_modules = get_parameter('show_not_init_modules', 1); + $show_full_hirearchy = get_parameter('show_full_hirearchy', 1); + + + $table->data = []; + $table->head = []; + $table->style = []; + + $table->style[0] = 'width: 50%;'; + $table->style[1] = 'width: 50%;'; + + $table->data[0][0] = html_print_label_input_block( + __('Search group'), + html_print_input_text( + 'search_group_string', + $search_group_string, + '', + 25, + 255, + true, + false, + false, + '', + ) + ); + + $agents_status_list = agents_status_list(); + + $table->data[0][1] = html_print_label_input_block( + __('Search by agent status').ui_print_help_tip(__('Shows the groups that contain an agent with the status that has been searched'), true), + html_print_select( + $agents_status_list, + 'agent_status', + $agent_status, + '', + __('All'), + '', + true, + false, + false, + 'w200p', + false, + 'width: 100%;' + ) + ); + + $table->data[1][0] = html_print_label_input_block( + __('Search by agent').ui_print_help_tip(__('Shows groups that contain an agent matching the search'), true), + html_print_input_text( + 'search_agent_string', + $search_agent_string, + '', + 25, + 255, + true, + false, + false, + '', + ) + ); + + $table->data[1][1] = html_print_label_input_block( + __('Show full hierarchy'), + html_print_checkbox_switch_extended( + 'show_full_hirearchy', + 1, + $show_full_hirearchy, + false, + '', + '', + true + ) + ); + + $table->data[3][0] = ' '; + + $table->data[3][1] = html_print_submit_button( + __('Filter'), + 'filter', + false, + [ + 'class' => 'float-right', + 'icon' => 'search', + ], + true + ); + + $form = "
"; + $form .= html_print_table($table, true); + $form .= '
'; + + + + ui_toggle( + $form, + ''.__('Filters').'', + 'filter_form', + '', + true, + false, + '', + 'white-box-content', + 'box-flat white_table_graph fixed_filter_bar' + ); + + echo "
"; } else { /* @@ -826,6 +945,8 @@ if ($tab == 'tree') { ); $form .= ''; + + ui_toggle( $form, ''.__('Filters').'', @@ -1058,87 +1179,119 @@ $tab = 'group_edition'; diff --git a/pandora_console/godmode/massive/massive_edit_users.php b/pandora_console/godmode/massive/massive_edit_users.php index 2ee9030e68..57274dc129 100644 --- a/pandora_console/godmode/massive/massive_edit_users.php +++ b/pandora_console/godmode/massive/massive_edit_users.php @@ -269,15 +269,14 @@ $size_pagination .= '
'; // Home screen. $home_screen = '

'.__('Home screen').ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true).'

'; $values = [ - '-1' => __('No change'), - 'Default' => __('Default'), - 'Visual console' => __('Visual console'), - 'Event list' => __('Event list'), - 'Group view' => __('Group view'), - 'Tactical view' => __('Tactical view'), - 'Alert detail' => __('Alert detail'), - 'Other' => __('Other'), - 'Dashboard' => __('Dashboard'), + HOME_SCREEN_DEFAULT => __('Default'), + HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'), + HOME_SCREEN_EVENT_LIST => __('Event list'), + HOME_SCREEN_GROUP_VIEW => __('Group view'), + HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'), + HOME_SCREEN_ALERT_DETAIL => __('Alert detail'), + HOME_SCREEN_OTHER => __('Other'), + HOME_SCREEN_DASHBOARD => __('Dashboard'), ]; $home_screen .= html_print_select( diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index b91f1dfa94..be396d2a1b 100755 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -80,12 +80,17 @@ $options_agents = [ ]; if (check_acl($config['id_user'], 0, 'UM')) { - $options_users['edit_users'] = __('Edit users in bulk'); + $options_users = [ + 'edit_users' => __('Edit users in bulk'), + ]; + if (is_metaconsole() === false) { - $options_users = [ + $options_profiles = [ 'add_profiles' => __('Bulk profile add'), 'delete_profiles' => __('Bulk profile delete'), ]; + + $options_users = array_merge(array_slice($options_users, 0, count($options_users)), $options_profiles, array_slice($options_users, count($options_users))); } } else { $options_users = []; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index d879bb5a5a..7a8d2df32c 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) { $data = []; if (is_metaconsole() === false) { - $data[0] = ''.$map['name'].''; + $data[0] = ''.io_safe_output($map['name']).''; } else { - $data[0] = ''.$map['name'].''; + $data[0] = ''.io_safe_output($map['name']).''; } $data[1] = ui_print_group_icon($map['id_group'], true); @@ -541,7 +541,7 @@ if (!$maps && is_metaconsole() === false) { true, ['class' => 'main_menu_icon invert_filter'] ).''; - $data[4] = ''.html_print_image( + $data[4] = ''.html_print_image( 'images/delete.svg', true, ['class' => 'main_menu_icon invert_filter'] @@ -552,7 +552,7 @@ if (!$maps && is_metaconsole() === false) { true, ['class' => 'main_menu_icon invert_filter'] ).''; - $data[4] = ''.html_print_image( + $data[4] = ''.html_print_image( 'images/delete.svg', true, ['class' => 'main_menu_icon invert_filter'] diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index bb06d3a800..bf2f9fae24 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -150,6 +150,7 @@ $fullscale = false; $percentil = false; $image_threshold = false; $time_compare_overlapped = false; +$unknowns_graph = false; // Added for events items. $server_multiple = [0]; @@ -354,6 +355,7 @@ switch ($action) { $percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0; $image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false; $graph_render = $item['graph_render']; + $unknowns_graph = $item['check_unknowns_graph']; // The break hasn't be forgotten. case 'simple_baseline_graph': case 'projection_graph': @@ -1589,7 +1591,7 @@ if (is_metaconsole() === true) { + + + + + + + + + + + + + + + + + ${value}`); @@ -6725,10 +6777,10 @@ function chooseType() { $("#row_period_range").hide(); $("#row_agent").hide(); $("#row_module").hide(); - $("#row_period").hide(); $("#row_search").hide(); $("#row_log_number").hide(); $("#row_period1").hide(); + $("#row_period2").hide(); $("#row_estimate").hide(); $("#row_interval").hide(); $("#row_custom_graph").hide(); @@ -6844,6 +6896,7 @@ function chooseType() { $("#row_group_by").hide(); $("#row_type_show").hide(); $("#row_use_prefix_notation").hide(); + $("#row_unknowns_graph").hide(); $("#row_os_selector").hide(); $("#row_os_version_regexp").hide(); $("#row_os_end_of_life").hide(); @@ -6895,7 +6948,7 @@ function chooseType() { case 'event_report_log': $("#log_help_tip").css("visibility", "visible"); $("#row_description").show(); - $("#row_period").show(); + $("#row_period2").show(); $("#row_search").show(); $("#row_log_number").show(); $("#agents_row").show(); @@ -6909,7 +6962,7 @@ function chooseType() { case 'event_report_log_table': $("#log_help_tip").css("visibility", "visible"); $("#row_description").show(); - $("#row_period").show(); + $("#row_period2").show(); $("#row_period_range").show(); $("#row_search").show(); $("#row_log_number").show(); @@ -6936,6 +6989,7 @@ function chooseType() { $("#row_image_threshold").show(); $("#row_graph_render").show(); $("#row_percentil").show(); + $("#row_unknowns_graph").show(); // Force type. if('' === 'new'){ @@ -7904,8 +7958,10 @@ function source_change_agents() { $("#id_agents3 option").attr("style","display:none"); var params = {}; - params["get_agent_source"] = 1; + params["get_agents_by_source"] = 1; params["page"] = "enterprise/include/ajax/log_viewer.ajax"; + params["date"] = ''; + params["sources"] = JSON.stringify(source); jQuery.ajax({ data: params, @@ -7914,19 +7970,8 @@ function source_change_agents() { url: "ajax.php", async: true, success: function(data) { - let source_array = []; - $.each(data['source'],function(key,value) { - if (value === source) { - const split = key.split('-'); - source_array.push(split[1]); - } - }); - - $.each(data['agent'],function(key,value) { - const result = source_array.includes(key); - if (result === true) { - $(`#id_agents3 option[value*='${key}']`).attr("style","display:"); - } + $.each(data,function(key,value) { + $(`#id_agents3 option[value*='${value}']`).attr("style","display:"); }); $("#spinner_hack").hide(); @@ -7955,7 +8000,7 @@ function dialog_message(message_id) { } function control_period_range() { let value_period_range = $('#row_period_range #hidden-period_range').val(); - let current_value = $('#row_period #hidden-period').val(); + let current_value = $('#row_period2 #hidden-period').val(); let min_range = (current_value/12); if(min_range > value_period_range) { $('#row_period_range div:nth-child(2) select option').removeAttr("selected"); @@ -8003,10 +8048,10 @@ function control_period_range() { $(document).ready(function () { $('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0); - $('#row_period input').change(function(e){ + $('#row_period2 input').change(function(e){ control_period_range(); }); - $('#row_period select').change(function(e){ + $('#row_period2 select').change(function(e){ control_period_range(); }); $('#row_period_range input').change(function(e){ diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index d3fd439181..e92e038dfe 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block( ) ); $table->data[0][1] = html_print_label_input_block( - __('Poisition'), + __('Position'), html_print_input_text_extended( 'position_to_delete', 1, diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 095f79b14a..e0e06f0f42 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1928,6 +1928,7 @@ switch ($action) { $values['graph_render'] = (int) get_parameter( 'graph_render' ); + $values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0); case 'simple_baseline_graph': // HACK it is saved in show_graph field. $values['show_graph'] = (int) get_parameter( @@ -2867,6 +2868,7 @@ switch ($action) { $values['graph_render'] = (int) get_parameter( 'graph_render' ); + $values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0); case 'simple_baseline_graph': // HACK it is saved in show_graph field. $values['show_graph'] = (int) get_parameter( diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index 5ce3c3f679..f5cc8d059c 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -151,7 +151,7 @@ $table->data[0][] = html_print_label_input_block( __('Name'), html_print_input_text( 'name', - $visualConsoleName, + io_safe_output($visualConsoleName), '', 80, 100, diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index 986dcb423b..694a2a6ea3 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -163,7 +163,7 @@ switch ($activeTab) { $background_color = (string) get_parameter('background_color'); $width = (int) get_parameter('width'); $height = (int) get_parameter('height'); - $visualConsoleName = (string) get_parameter('name'); + $visualConsoleName = (string) io_safe_input(get_parameter('name')); $is_favourite = (int) get_parameter('is_favourite_sent'); $auto_adjust = (int) get_parameter('auto_adjust_sent'); @@ -239,7 +239,7 @@ switch ($activeTab) { if ($uploadOK == 1) { if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) { $background = $nameImage; - $values['background'] = $background; + $values['background'] = io_safe_input($background); $error2 = chmod($target_file, 0644); $uploadOK = $error2; } else { @@ -872,7 +872,7 @@ $buttons[$activeTab]['active'] = true; $tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : ''; ui_print_standard_header( - ($visualConsoleName ?? ''), + (io_safe_output($visualConsoleName) ?? ''), 'images/visual_console.png', false, $tab_builder, diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 101a99d955..95b831b86c 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -64,32 +64,33 @@ $table->style = []; // $table->style[0] = 'font-weight: bold'; $table->align = []; $table->align[1] = 'center'; -$table->align[3] = 'center'; -$table->align[8] = 'right'; +$table->align[4] = 'center'; +$table->align[9] = 'right'; $table->headstyle[1] = 'text-align:center'; -$table->headstyle[3] = 'text-align:center'; -$table->headstyle[8] = 'text-align:right;width: 120px;'; +$table->headstyle[4] = 'text-align:center'; +$table->headstyle[9] = 'text-align:right;width: 120px;'; $table->titleclass = 'tabletitle'; $table->titlestyle = 'text-transform:uppercase;'; -$table->style[6] = 'display: flex;align-items: center;'; +$table->style[7] = 'display: flex;align-items: center;'; $table->head = []; $table->head[0] = __('Name'); $table->head[1] = __('Status'); $table->head[2] = __('Type'); -$table->head[3] = __('Version'); -$table->head[4] = __('Modules'); -$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true); -$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true); +$table->head[3] = __('Master'); +$table->head[4] = __('Version'); +$table->head[5] = __('Modules'); +$table->head[6] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true); +$table->head[7] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true); // This will have a column of data such as "6 hours". -$table->head[7] = __('Updated'); +$table->head[8] = __('Updated'); // Only Pandora Administrator can delete servers. if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { - $table->head[8] = ''.__('Op.').''; + $table->head[9] = ''.__('Op.').''; } $table->data = []; @@ -143,9 +144,11 @@ foreach ($servers as $server) { } // Type. - $data[2] = ''.$server['img']; + $data[2] = ''.$server['img'].'    '.$server['name']; if ($server['master'] == $master) { - $data[2] .= ui_print_help_tip(__('This is a master server'), true); + $data[3] .= __('Yes', true); + } else { + $data[3] .= __('-'); } if ((int) $server['exec_proxy'] === 1) { @@ -157,27 +160,27 @@ foreach ($servers as $server) { case 'event': case 'autoprovision': case 'migration': - $data[3] = $server['version']; - $data[4] = __('N/A'); + $data[4] = $server['version']; $data[5] = __('N/A'); + $data[6] = __('N/A'); break; case 'export': - $data[3] = $server['version']; - $data[4] = $server['modules'].' '.__('of').' '.$server['modules_total']; - $data[5] = __('N/A'); + $data[4] = $server['version']; + $data[5] = $server['modules'].' '.__('of').' '.$server['modules_total']; + $data[6] = __('N/A'); break; default: - $data[3] = $server['version']; - $data[4] = $server['modules'].' '.__('of').' '.$server['modules_total']; - $data[5] = ''.$server['lag_txt'].''; + $data[4] = $server['version']; + $data[5] = $server['modules'].' '.__('of').' '.$server['modules_total']; + $data[6] = ''.$server['lag_txt'].''; break; } - $data[6] = ''; + $data[7] = ''; if ($server['queued_modules'] > 500) { - $data[6] .= '
'.html_print_image( + $data[7] .= '  '; } - $data[6] .= $server['threads'].' : '.$server['queued_modules']; + $data[7] .= $server['threads'].' : '.$server['queued_modules']; - $data[7] = ui_print_timestamp($server['keepalive'], true); + $data[8] = ui_print_timestamp($server['keepalive'], true); if ($server['type'] === 'data') { $ext = '_server'; @@ -208,11 +211,11 @@ foreach ($servers as $server) { // Only Pandora Administrator can delete servers. if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { - $data[8] = ''; + $data[9] = ''; if ($server['type'] === 'recon') { - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/snmp-trap@svg.svg', true, [ @@ -221,12 +224,12 @@ foreach ($servers as $server) { ] ); - $data[8] .= ''; + $data[9] .= ''; } if ($server['type'] === 'data') { - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/force@svg.svg', true, [ @@ -234,10 +237,10 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; } else if ($server['type'] === 'enterprise snmp') { - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/force@svg.svg', true, [ @@ -245,12 +248,12 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; } if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) { - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/alert@svg.svg', true, [ @@ -258,11 +261,11 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; } - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/edit.svg', true, [ @@ -270,11 +273,11 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) { - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/agents@svg.svg', true, [ @@ -282,10 +285,10 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/remote-configuration@svg.svg', true, [ @@ -293,12 +296,12 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; $names_servers[$safe_server_name] = false; } - $data[8] .= ''; - $data[8] .= html_print_image( + $data[9] .= ''; + $data[9] .= html_print_image( 'images/delete.svg', true, [ @@ -307,14 +310,14 @@ foreach ($servers as $server) { 'class' => 'main_menu_icon invert_filter', ] ); - $data[8] .= ''; + $data[9] .= ''; } if ($tiny) { - unset($data[4]); - unset($data[6]); + unset($data[5]); unset($data[7]); unset($data[8]); + unset($data[9]); } $ext = ''; @@ -323,10 +326,10 @@ foreach ($servers as $server) { } if ($tiny) { - unset($table->head[4]); - unset($table->head[6]); + unset($table->head[5]); unset($table->head[7]); unset($table->head[8]); + unset($table->head[9]); } if ($tiny) { diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index cfcf3c0827..211af66cb7 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) { $fallback_directory = 'images'; // Get directory. $directory = (string) get_parameter('directory'); +$directory = str_replace('<', '', $text); +$directory = str_replace('>', '', $text); if (empty($directory) === true) { $directory = $fallback_directory; } else { diff --git a/pandora_console/godmode/setup/os.builder.php b/pandora_console/godmode/setup/os.builder.php index 2d0e54a681..6313aa3edd 100644 --- a/pandora_console/godmode/setup/os.builder.php +++ b/pandora_console/godmode/setup/os.builder.php @@ -46,7 +46,7 @@ if ($idOS > 0) { $description = $os['description']; $icon = $os['icon_name']; } else { - $name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name')))); + $name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name'))))); $description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description')))); $icon = get_parameter('icon', 0); } @@ -87,9 +87,16 @@ if ($is_management_allowed === true) { if (in_array($file_ext, $allowed_extensions) === false) { $message = 9; + } else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') { + $message = 10; } else { $message = 8; - move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name); + + $file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name); + + if ($file_uploaded !== true) { + $message = 10; + } } } } else { @@ -108,7 +115,7 @@ if ($is_management_allowed === true) { if ($resultOrId === false) { $message = 2; - $tab = 'builder'; + $tab = 'manage_os'; $actionHidden = 'save'; $textButton = __('Create'); $classButton = ['icon' => 'wand']; @@ -144,13 +151,19 @@ if ($is_management_allowed === true) { if (in_array($file_ext, $allowed_extensions) === false) { $message = 9; + } else if (exif_imagetype($file_tmp) === false) { + $message = 10; } else { $message = 8; - move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name); + $file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name); + + if ($file_uploaded !== true) { + $message = 10; + } } } } else { - $name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name')))); + $name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name'))))); $description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description')))); $icon = get_parameter('icon', 0); @@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv'; $table->data[0][] = html_print_label_input_block( __('Name'), - html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px') + html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px') ); $table->data[0][] = html_print_label_input_block( @@ -290,6 +303,28 @@ html_print_action_buttons( echo ''; +$id_message = get_parameter('id_message', 0); + +if ($id_message !== 0) { + switch ($id_message) { + case 8: + echo ui_print_success_message(__('Icon successfuly uploaded'), '', true); + break; + + case 9: + echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true); + break; + + case 10: + echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true); + break; + + default: + // Nothing to do. + break; + } +} + function get_list_os_icons_dir() { diff --git a/pandora_console/godmode/setup/os.php b/pandora_console/godmode/setup/os.php index 99402ff30a..dcfe95ecdb 100644 --- a/pandora_console/godmode/setup/os.php +++ b/pandora_console/godmode/setup/os.php @@ -162,11 +162,15 @@ if (empty($id_message) === false) { break; case 8: - echo ui_print_success_message(__('Icon successfuly uploaded'), '', true); + header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8'); break; case 9: - echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true); + header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9'); + break; + + case 10: + header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10'); break; default: diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 51cd554a66..870c4c283a 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -154,8 +154,7 @@ 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; - +// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false; $table_status = new StdClass(); $table_status->width = '100%'; $table_status->class = 'databox filters'; @@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block( true ) ); - -$table_other->data[3][0] = html_print_label_input_block( +/* + $table_other->data[3][0] = html_print_label_input_block( __('Use agent access graph'), html_print_checkbox_switch( 'agentaccess', @@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block( true, $disable_agentaccess ) -); - -$table_other->data[3][1] = html_print_label_input_block( + ); +*/ +$table_other->data[3][0] = html_print_label_input_block( __('Max. recommended number of files in attachment directory'), html_print_input_text( 'num_files_attachment', diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 0fd6bebff8..6732612c9d 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -370,7 +370,7 @@ switch ($section) { break; default: - $subpage = 'seccion: '.$section; + $subpage = 'seccion: '; // Default. break; } diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index 40a816a6fa..f9f2afcd14 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -535,16 +535,47 @@ html_print_action_buttons( __('Update'), 'update_button', false, - [ 'icon' => 'update' ], + [ + 'icon' => 'update', + 'onclick' => 'onFormSubmit()', + ], true ) ); echo ''; +echo ui_print_warning_message( + [ + 'message' => __('Session timeout must be a number'), + 'force_class' => 'invisible js_warning_msg', + ], + '', + true +); ?> diff --git a/pandora_console/operation/messages/message_edit.php b/pandora_console/operation/messages/message_edit.php index d2d3520b2b..cc197960ed 100644 --- a/pandora_console/operation/messages/message_edit.php +++ b/pandora_console/operation/messages/message_edit.php @@ -38,7 +38,7 @@ $send_mes = (bool) get_parameter('send_mes', false); $new_msg = (string) get_parameter('new_msg'); $dst_user = get_parameter('dst_user'); $dst_group = get_parameter('dst_group'); -$subject = io_safe_html_tags(get_parameter('subject')); +$subject = io_safe_input(get_parameter('subject')); $message = (string) get_parameter('message'); $read_message = (bool) get_parameter('read_message', false); $reply = (bool) get_parameter('reply', false); @@ -132,7 +132,7 @@ if ($read_message) { echo '

Conversation with '.$user_name.'

'; } - echo '

Subject: '.$message['subject'].'

'; + echo '

Subject: '.io_safe_output($message['subject']).'

'; $conversation = messages_get_conversation($message); diff --git a/pandora_console/operation/messages/message_list.php b/pandora_console/operation/messages/message_list.php index d7dc2881da..26ffbc5bfe 100644 --- a/pandora_console/operation/messages/message_list.php +++ b/pandora_console/operation/messages/message_list.php @@ -259,7 +259,7 @@ if (empty($messages) === true) { $pathSubject = 'index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id; } - $contentSubject = (empty($message['subject']) === true) ? __('No Subject') : $message['subject']; + $contentSubject = (empty($message['subject']) === true) ? __('No Subject') : io_safe_output($message['subject']); if ((int) $message['read'] !== 1) { $contentSubject = ''.$contentSubject.''; diff --git a/pandora_console/operation/search_agents.getdata.php b/pandora_console/operation/search_agents.getdata.php index bdeea391a1..d8182385b2 100644 --- a/pandora_console/operation/search_agents.getdata.php +++ b/pandora_console/operation/search_agents.getdata.php @@ -72,6 +72,7 @@ if ($searchAgents) { $has_secondary = enterprise_hook('agents_is_using_secondary_groups'); $stringSearchSQL = str_replace('&', '&', $stringSearchSQL); + $stringSearchSQL = str_replace('\', '\\', $stringSearchSQL); $sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress INNER JOIN taddress_agent ON taddress.id_a = taddress_agent.id_a diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec index 9cc8b153c7..ff98edb48f 100644 --- a/pandora_console/pandora_console.redhat.spec +++ b/pandora_console/pandora_console.redhat.spec @@ -6,7 +6,7 @@ %define debug_package %{nil} %define name pandorafms_console %define version 7.0NG.774 -%define release 231114 +%define release 231127 # 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 40bf38bebc..9f828af5fe 100644 --- a/pandora_console/pandora_console.rhel7.spec +++ b/pandora_console/pandora_console.rhel7.spec @@ -6,7 +6,7 @@ %define debug_package %{nil} %define name pandorafms_console %define version 7.0NG.774 -%define release 231114 +%define release 231127 # 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 85cd826051..eb68cdae6a 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.774 -%define release 231114 +%define release 231127 %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 6eede81d86..2d8a258f42 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -293,12 +293,12 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` ( -- ----------------------------------------------------- -- Table `tagent_access` -- ----------------------------------------------------- -CREATE TABLE IF NOT EXISTS `tagent_access` ( - `id_agent` INT UNSIGNED NOT NULL DEFAULT 0, - `utimestamp` BIGINT NOT NULL DEFAULT 0, - KEY `agent_index` (`id_agent`), - KEY `idx_utimestamp` USING BTREE (`utimestamp`) -) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; +-- CREATE TABLE IF NOT EXISTS `tagent_access` ( +-- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0, +-- `utimestamp` BIGINT NOT NULL DEFAULT 0, +-- KEY `agent_index` (`id_agent`), +-- KEY `idx_utimestamp` USING BTREE (`utimestamp`) +-- ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- ----------------------------------------------------- -- Table `talert_snmp` @@ -1646,6 +1646,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` ( `cat_security_hardening` INT NOT NULL DEFAULT 0, `ignore_skipped` INT NOT NULL DEFAULT 0, `status_of_check` TINYTEXT, + `check_unknowns_graph` tinyint DEFAULT '0', PRIMARY KEY(`id_rc`), FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`) ON UPDATE CASCADE ON DELETE CASCADE diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 9ce5355361..bfb1d0ee96 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -2648,6 +2648,82 @@ INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable` SELECT @last_id := LAST_INSERT_ID(); INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/'); +INSERT INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`page`) VALUES + (1,'AgentHive','AgentHive','Agents hive','','AgentHive.php'), + (2,'AvgSumMaxMinModule','AvgSumMaxMinModule','Avg|Sum|Max|Min Module Data','','AvgSumMaxMinModule.php'), + (3,'BasicChart','BasicChart','Basic chart','','BasicChart.php'), + (4,'BlockHistogram','BlockHistogram','Block histogram','','BlockHistogram.php'), + (5,'ColorModuleTabs','ColorModuleTabs','Color tabs modules','','ColorModuleTabs.php'), + (6,'DataMatrix','DataMatrix','Data Matrix','','DataMatrix.php'), + (7,'EventCardboard','EventCardboard','Event cardboard','','EventCardboard.php'), + (8,'GroupedMeterGraphs','GroupedMeterGraphs','Grouped meter graphs','','GroupedMeterGraphs.php'), + (9,'ModulesByStatus','ModulesByStatus','Modules by status','','ModulesByStatus.php'), + (10,'AgentModuleWidget','agent_module','Agent/Module View','','agent_module.php'), + (11,'AlertsFiredWidget','alerts_fired','Triggered alerts report','','alerts_fired.php'), + (12,'ClockWidget','clock','Clock','','clock.php'), + (13,'CustomGraphWidget','custom_graph','Defined custom graph','','custom_graph.php'), + (14,'EventsListWidget','events_list','List of latest events','','events_list.php'), + (15,'WelcomeWidget','example','Welcome message to Pandora FMS','','example.php'), + (16,'GraphModuleHistogramWidget','graph_module_histogram','Module histogram','','graph_module_histogram.php'), + (17,'GroupsStatusWidget','groups_status','General group status','','groups_status.php'), + (18,'GroupsStatusMapWidget','groups_status_map','Group status map','','groups_status_map.php'), + (19,'HeatmapWidget','heatmap','Heatmap','','heatmap.php'), + (20,'InventoryWidget','inventory','Inventory','','inventory.php'), + (21,'MapsMadeByUser','maps_made_by_user','Visual Console','','maps_made_by_user.php'), + (22,'MapsStatusWidget','maps_status','General visual maps report','','maps_status.php'), + (23,'ModuleIconWidget','module_icon','Icon and module value','','module_icon.php'), + (24,'ModuleStatusWidget','module_status','Module status','','module_status.php'), + (25,'ModuleTableValueWidget','module_table_value','Module in a table','','module_table_value.php'), + (26,'ModuleValueWidget','module_value','Module value','','module_value.php'), + (27,'MonitorHealthWidget','monitor_health','Global health info','','monitor_health.php'), + (28,'Netflow','netflow','Netflow','','netflow.php'), + (29,'NetworkMapWidget','network_map','Network map','','network_map.php'), + (30,'OsQuickReportWidget','os_quick_report','OS quick report','','os_quick_report.php'), + (31,'PostWidget','post','Panel with a message','','post.php'), + (32,'ReportsWidget','reports','Custom report','','reports.php'), + (33,'ServiceMapWidget','service_map','Service map','','service_map.php'), + (34,'ServiceViewWidget','service_view','Services view','','service_view.php'), + (35,'SingleGraphWidget','single_graph','Agent module graph','','single_graph.php'), + (36,'SLAPercentWidget','sla_percent','SLA percentage','','sla_percent.php'), + (37,'SystemGroupStatusWidget','system_group_status','Groups status','','system_group_status.php'), + (38,'TacticalWidget','tactical','Tactical view','','tactical.php'), + (39,'TopNWidget','top_n','Top N of agent modules','','top_n.php'), + (40,'TopNEventByGroupWidget','top_n_events_by_group','Top N events by agent','','top_n_events_by_group.php'), + (41,'TopNEventByModuleWidget','top_n_events_by_module','Top N events by module','','top_n_events_by_module.php'), + (42,'TreeViewWidget','tree_view','Tree view','','tree_view.php'), + (43,'UrlWidget','url','URL content','','url.php'), + (44,'WuxWidget','wux_transaction','Agent WUX transaction','','wux_transaction.php'), + (45,'WuxStatsWidget','wux_transaction_stats','WUX transaction stats','','wux_transaction_stats.php'), + (46,'SecurityHardening','security_hardening','Security Hardening','','security_hardening.php'); + +INSERT INTO `tmap` (`id`,`id_group`,`id_user`,`type`,`subtype`,`name`,`description`,`height`,`width`,`center_x`,`center_y`,`background`,`background_options`,`source_period`,`source`,`source_data`,`generation_method`,`generated`,`filter`,`id_group_map`,`refresh_time`) VALUES (1,'0','admin',0,0,'Sample dynamic map','This is a sample dynamic map.',900,900,0,0,'',0,60,0,'0',6,0,'{\"dont_show_subgroups\":0,\"node_radius\":40,\"x_offs\":\"0\",\"y_offs\":\"0\",\"z_dash\":\"1\",\"node_sep\":\"0.25\",\"rank_sep\":\"0.5\",\"mindist\":\"1\",\"kval\":\"0.3\"}',0,300); +INSERT INTO `treport` (`id_report`,`id_user`,`name`,`description`,`private`,`id_group`,`custom_logo`,`header`,`first_page`,`footer`,`custom_font`,`id_template`,`id_group_edit`,`metaconsole`,`non_interactive`,`hidden`,`orientation`,`cover_page_render`,`index_render`) VALUES (1,'admin','Sample report #1','This is a sample report, just to show you some general report items.',0,0,NULL,NULL,'<p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;"><img src="http://localhost/pandora_console//images/pandora_report_logo.png" alt="" width="800" /></p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p> <p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>',NULL,'Lato-Regular.ttf',0,0,0,0,0,'vertical',1,1); +INSERT INTO `treport_content` (`id_rc`,`id_report`,`id_gs`,`id_agent_module`,`type`,`period`,`period_range`,`order`,`name`,`description`,`id_agent`,`text`,`external_source`,`treport_custom_sql_id`,`header_definition`,`column_separator`,`line_separator`,`time_from`,`time_to`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`,`only_display_wrong`,`top_n`,`top_n_value`,`exception_condition`,`exception_condition_value`,`show_resume`,`order_uptodown`,`show_graph`,`group_by_agent`,`style`,`id_group`,`id_module_group`,`server_name`,`historical_db`,`lapse_calc`,`lapse`,`visual_format`,`hide_no_data`,`recursion`,`show_extended_events`,`total_time`,`time_failed`,`time_in_ok_status`,`time_in_warning_status`,`time_in_unknown_status`,`time_of_not_initialized_module`,`time_of_downtime`,`total_checks`,`checks_failed`,`checks_in_ok_status`,`checks_in_warning_status`,`unknown_checks`,`agent_max_value`,`agent_min_value`,`current_month`,`failover_mode`,`failover_type`,`uncompressed_module`,`summary`,`landscape`,`pagebreak`,`compare_work_time`,`graph_render`,`ipam_network_filter`,`ipam_alive_ips`,`ipam_ip_not_assigned_to_agent`,`macros_definition`,`render_definition`,`use_prefix_notation`,`cat_security_hardening`,`ignore_skipped`,`status_of_check`) VALUES + (1,1,0,0,'agents_inventory',300,0,1,'General agent inventory','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>','{\"agent_server_filter\":\"\",\"agents_inventory_display_options\":[\"alias\",\"comentarios\",\"id_grupo\",\"direccion\",\"id_os\",\"estado\"],\"agent_custom_field_filter\":\"\",\"agent_os_filter\":[\"0\"],\"agent_custom_fields\":[\"3\",\"2\",\"1\"],\"agent_status_filter\":[\"-1\"],\"agent_version_filter\":\"\",\"agent_module_search_filter\":\"\",\"agent_group_filter\":\"0\",\"agent_remote_conf\":\"\"}',0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250"}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL), + (2,1,0,0,'top_n',28800,0,2,'Top CPU per agent','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,3,10,0,10,0,1,1,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","text_agent":"Lio=","text_agent_module":"Y3B1Lio="}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL), + (3,1,0,0,'event_report_group',21600,0,3,'General event report','This is a sample of not normal events for any agent available in the last 6 hours',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","server_multiple":"\"\"","show_summary_group":0,"filter_event_severity":"[\"20\"]","filter_event_type":"[\"all\"]","filter_event_status":"[\"-1\"]","event_graph_by_agent":"1","event_graph_by_user_validator":"1","event_graph_by_criticity":"1","event_graph_validated_vs_unvalidated":0,"event_filter_search":"","event_filter_exclude":"","custom_data_events":"1","label":""}',0,0,'',0,0,300,0,0,NULL,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL); +INSERT INTO `tdashboard` (`id`,`name`,`id_user`,`id_group`,`active`,`cells`,`cells_slideshow`) VALUES + (1,'Sample Dashboard #1','',0,0,0,0), + (2,'Sample Dashboard #2','',0,0,0,0); +INSERT INTO `twidget_dashboard` (`id`,`position`,`options`,`order`,`id_dashboard`,`id_widget`,`prop_width`,`prop_height`) VALUES + (1,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Agents hive\",\"background\":\"#ffffff\",\"groups\":[\"12,8,4,9,2,10,13,11\"]}',0,1,1,0.32,0.32), + (2,'{\"x\":\"4\",\"y\":\"0\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Clock\",\"background\":\"#ffffff\",\"clockType\":\"analogic\"}',1,1,12,0.32,0.32), + (3,'{\"x\":\"7\",\"y\":\"0\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Event cardboard\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"8\",\"eventStatus\":\"-1\",\"groupId\":[\"0\"],\"severity\":\"4,1,0,5,2,3\",\"nodes\":0}',2,1,7,0.32,0.32), + (4,'{\"x\":\"7\",\"y\":\"2\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Heatmap\",\"background\":\"#ffffff\",\"search\":\"\",\"type\":\"3\",\"groups\":[\"0\"]}',3,1,19,0.32,0.32), + (5,'{\"x\":\"0\",\"y\":\"4\",\"width\":\"4\",\"height\":\"6\"}','{\"title\":\"Groups status\",\"background\":\"#ffffff\",\"groupId\":[\"0\"],\"status\":[\"4,1,0,2\"],\"groupRecursion\":false}',4,1,37,0.32,0.32), + (6,'{\"x\":\"4\",\"y\":\"4\",\"width\":\"3\",\"height\":\"6\"}','{\"title\":\"Unknown Group overview\",\"background\":\"#ffffff\",\"groupId\":\"10\",\"groupRecursion\":0}',5,1,17,0.32,0.32), + (7,'{\"x\":\"7\",\"y\":\"4\",\"width\":\"5\",\"height\":\"6\"}','{\"title\":\"CPU Status\",\"background\":\"#ffffff\",\"search\":\"cpu\",\"status\":\"1,0,2\",\"limit\":\"5\",\"nodes\":\"\",\"disabled_modules\":1}',6,1,9,0.32,0.32), + (8,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"6\",\"height\":\"13\"}','{\"title\":\"Last event view\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"24\",\"limit\":40,\"eventStatus\":\"-1\",\"severity\":\"-1\",\"groupId\":[\"0\"],\"tagsId\":[\"\"],\"groupRecursion\":0,\"customFilter\":\"-1\",\"columns_events_widget\":[\"mini_severity,evento,estado,agent_name,timestamp\",\"\"]}',0,2,14,0.32,0.32), + (9,'{\"x\":\"6\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Tactical view\",\"background\":\"#ffffff\",\"statusMonitor\":1,\"serverPerformance\":1,\"summary\":1,\"groupId\":[\"0\"]}',1,2,38,0.32,0.32), + (10,'{\"x\":\"6\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Top N events per agent\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\",\"show_total_data\":0}',3,2,40,0.32,0.32), + (11,'{\"x\":\"10\",\"y\":\"0\",\"width\":\"2\",\"height\":\"4\"}','{\"title\":\"Dynamic map\",\"background\":\"#ffffff\",\"networkmapId\":\"1\",\"xOffset\":\"0\",\"yOffset\":\"0\",\"zoomLevel\":0.6}',2,2,29,0.32,0.32), + (12,'{\"x\":\"9\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Fired alerts\",\"background\":\"#ffffff\",\"groupId\":\"0\",\"group_recursion\":\"\"}',4,2,11,0.32,0.32), + (13,'{\"x\":\"0\",\"y\":\"13\",\"width\":\"6\",\"height\":\"3\"}','{\"title\":\"Infrastructure treeview\",\"background\":\"#ffffff\",\"typeTree\":\"group\",\"groupId\":\"0\",\"openAllGroups\":1,\"agentStatus\":\"-1\",\"filterAgent\":\"\",\"moduleStatus\":\"6\",\"filterModule\":\"\"}',7,2,42,0.32,0.32), + (14,'{\"x\":\"6\",\"y\":\"8\",\"width\":\"6\",\"height\":\"4\"}','{\"title\":\"Top N events per module\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\"}',5,2,41,0.32,0.32), + (15,'{\"x\":\"6\",\"y\":\"12\",\"width\":\"6\",\"height\":\"4\"}',NULL,6,2,30,0.32,0.32), + (16,'{\"x\":\"0\",\"y\":\"16\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"\",\"background\":\"#ffffff\",\"agentId\":0}',8,2,15,0.32,0.32), + (17,'{\"x\":\"4\",\"y\":\"16\",\"width\":\"8\",\"height\":\"4\"}','{\"title\":\"Top10 CPU Modules per agent\",\"background\":\"#ffffff\",\"agent\":\".*\",\"module\":\"CPU\",\"period\":\"86400\",\"quantity\":\"10\",\"order\":\"1\",\"display\":\"0\",\"type_graph\":\"bar_vertical\",\"legend\":\"agent\"}',9,2,39,0.32,0.32); + -- Insert new VMware APP SET @short_name = 'pandorafms.vmware'; SET @name = 'VMware'; diff --git a/pandora_console/update_manager_client/lib/UpdateManager/Client.php b/pandora_console/update_manager_client/lib/UpdateManager/Client.php index 42d9e6367a..c75c84fefb 100644 --- a/pandora_console/update_manager_client/lib/UpdateManager/Client.php +++ b/pandora_console/update_manager_client/lib/UpdateManager/Client.php @@ -763,6 +763,126 @@ class Client } + /** + * Executes a curl request. + * + * @param string $url Url to be called. + * @param array $request Options. + * @param string $destiny Path. + * + * @return mixed Response given by curl. + */ + private function curlSaveToDisk(string $url, array $request, string $destiny) + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt( + $ch, + CURLOPT_POSTFIELDS, + $request + ); + + // Abre el archivo en modo escritura para guardar la respuesta. + $archivo = fopen($destiny, 'w'); + + // Configura cURL para guardar la respuesta directamente en el archivo. + curl_setopt($ch, CURLOPT_FILE, $archivo); + + if ($this->insecure === true) { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + } + + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_TCP_KEEPALIVE, true); + + if (is_array($this->proxy) === true) { + curl_setopt($ch, CURLOPT_PROXY, $this->proxy['host']); + if (isset($this->proxy['port']) === true) { + curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy['port']); + } + + if (isset($this->proxy['user']) === true) { + curl_setopt( + $ch, + CURLOPT_PROXYUSERPWD, + $this->proxy['user'].':'.$this->proxy['password'] + ); + } + } + + // Track progress. + if ((empty($request) === true + || $request['action'] === 'get_package' + || $request['action'] === 'get_server_package') + ) { + curl_setopt( + $ch, + CURLOPT_NOPROGRESS, + false + ); + } + + $target = ''; + if ($request['action'] === 'get_server_package') { + $target = __('server update %s', $request['version']); + } else if ($request['action'] === 'get_package') { + $target = __('console update %s', $request['version']); + } + + // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found + // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed + // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed + curl_setopt( + $ch, + CURLOPT_PROGRESSFUNCTION, + function ( + $ch, + $total_bytes, + $current_bytes, + $total_sent_bytes, + $current_sent_bytes + ) use ($target) { + if ($total_bytes > 0) { + $this->notify( + (100 * $current_bytes / $total_bytes), + __( + 'Downloading %s %.2f/ %.2f MB.', + $target, + ($current_bytes / (1024 * 1024)), + ($total_bytes / (1024 * 1024)) + ), + true + ); + } else { + $this->notify( + 0, + __( + 'Downloading %.2f MB', + ($current_bytes / (1024 * 1024)) + ), + true + ); + } + } + ); + + // Call. + curl_exec($ch); + + $erro_no = curl_errno($ch); + if ($erro_no > 0) { + $this->lastError = $erro_no.':'.curl_error($ch); + return null; + } + + fclose($archivo); + curl_close($ch); + return true; + } + + /** * Make a request to Update manager. * @@ -810,14 +930,26 @@ class Client } } - // Initialize. - $response = $this->curl( - $this->url, - array_merge( - ['action' => $request['action']], - $request['arguments'] - ) - ); + if ($request['action'] === 'get_server_package') { + // Initialize. + $response = $this->curlSaveToDisk( + $this->url, + array_merge( + ['action' => $request['action']], + $request['arguments'] + ), + ($request['destiny'] ?? '') + ); + } else { + // Initialize. + $response = $this->curl( + $this->url, + array_merge( + ['action' => $request['action']], + $request['arguments'] + ) + ); + } if ($literal === true) { return $response; @@ -1393,10 +1525,6 @@ class Client ) { unlink($file); $processed[$file] = 'removed'; - } else if (is_dir($file) === true) { - $processed[$file] = 'skipped, is a directory'; - } else { - $processed[$file] = 'skipped. Unreachable.'; } } @@ -1836,6 +1964,9 @@ class Client return false; } + $this->notify(100, 'Updated files', true, ['reload' => true]); + sleep(2); + if ($this->globalTask === null && $this->offline === false) { $this->percentage = 90; $this->currentTask = __('Retrieving server update'); @@ -1985,6 +2116,10 @@ class Client } while ($rc !== null); } + if ($this->lock() !== true) { + return null; + } + $last_error = $this->lastError; $this->updateServerPackage(null, $this->currentPackage); @@ -1995,6 +2130,7 @@ class Client $this->percentage = 100; $this->notify(100, 'Updated to '.$this->getVersion().'.'); + $this->unlock(); return $this->currentPackage; } @@ -2133,30 +2269,21 @@ class Client } if ($package === null) { - // Retrieve package from UMS. - $this->notify(0, 'Downloading server update '.$version); - $file = $this->post( - [ - 'action' => 'get_server_package', - 'arguments' => ['version' => $version], - ], - 1 - ); - - if (empty($file) === true) { - // No content. - return false; - } - $file_name = 'pandorafms_server-'.$version.'.tar.gz'; $official_name = 'pandorafms_server_enterprise-7.0NG.%s_x86_64.tar.gz'; $filename_repo = sprintf($official_name, $version); $official_path = $file_path.$filename_repo; - if (file_put_contents($official_path, $file) === false) { - $this->lastError = 'Failed to store server update package.'; - return false; - } + // Retrieve package from UMS. + $this->notify(0, 'Downloading server update '.$version); + $this->post( + [ + 'action' => 'get_server_package', + 'arguments' => ['version' => $version], + 'destiny' => $official_path, + ], + 1 + ); $signature = $this->post( [ diff --git a/pandora_console/update_manager_client/resources/javascript/umc.js b/pandora_console/update_manager_client/resources/javascript/umc.js index ec87cf2c63..8cc3a2a971 100644 --- a/pandora_console/update_manager_client/resources/javascript/umc.js +++ b/pandora_console/update_manager_client/resources/javascript/umc.js @@ -328,11 +328,11 @@ function updateProgress(url, auth) { } if (general_label.innerText == "100.00 %") { - cleanExit(); + window.onbeforeunload = undefined; if (_auxIntervalReference != null) { window.clearInterval(_auxIntervalReference); } - return; + window.location.reload(); } ajax({ @@ -375,6 +375,19 @@ function updateProgress(url, auth) { general_action.innerText = d.result.processing; task_action.innerText = d.result.message; + + // Reload to update console. + if ( + d.result.extra != undefined && + d.result.extra.reload != undefined && + d.result.extra.reload === true + ) { + window.onbeforeunload = undefined; + if (_auxIntervalReference != null) { + window.clearInterval(_auxIntervalReference); + } + window.location.reload(); + } }, error: function(d) { dprog.innerHTML = umErrorMsg(d.error); diff --git a/pandora_console/update_manager_client/views/online.php b/pandora_console/update_manager_client/views/online.php index 0adbb9decf..ad071bb8c4 100644 --- a/pandora_console/update_manager_client/views/online.php +++ b/pandora_console/update_manager_client/views/online.php @@ -27,7 +27,9 @@ * GNU General Public License for more details. * ============================================================================ */ + global $config; + ?> @@ -57,16 +59,25 @@ global $config; $settings = update_manager_get_config_values(); $umc = new \UpdateManager\Client($settings); $updates = $umc->listUpdates(); + if ($updates === null) { + $updates = []; + } + $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) { + if (isset($updates[0]['lts']) === true + && $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) { + if (isset($updates[array_key_last($updates)]) === true + && isset($updates[array_key_last($updates)]['lts']) === true + && $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.'); @@ -160,14 +171,19 @@ global $config; } }, error: function(e, r) { - if (typeof r != "undefined" ) { - result.innerHTML = umErrorMsg( - '' + nextUpdateVersion+' '+r - ); + if(e != '504') { + if (typeof r != "undefined" ) { + result.innerHTML = umErrorMsg( + '' + nextUpdateVersion+' '+r + ); + } else { + result.innerHTML = umErrorMsg( + '' + nextUpdateVersion+' RC'+e + ); + } } else { - result.innerHTML = umErrorMsg( - '' + nextUpdateVersion+' RC'+e - ); + cleanExit(); + window.location.reload(); } }, }); @@ -202,12 +218,17 @@ global $config; } }, error: function(e, r) { - if (typeof r != "undefined" ) { - result.innerHTML = umErrorMsg(r); + if(e != '504') { + if (typeof r != "undefined" ) { + result.innerHTML = umErrorMsg(r); + } else { + result.innerHTML = umErrorMsg( + ' RC'+e + ); + } } else { - result.innerHTML = umErrorMsg( - ' RC'+e - ); + cleanExit(); + window.location.reload(); } }, }); diff --git a/pandora_console/views/dashboard/list.php b/pandora_console/views/dashboard/list.php index 2645724a6e..aae6778f6d 100644 --- a/pandora_console/views/dashboard/list.php +++ b/pandora_console/views/dashboard/list.php @@ -75,144 +75,69 @@ if (empty($dashboards) === true) { ] ); } else { - $table = new stdClass(); - $table->width = '100%'; - $table->class = 'info_table'; - $table->headstyle['name'] = 'text-align: left;'; - $table->headstyle['cells'] = 'text-align: center;'; - $table->headstyle['groups'] = 'text-align: center;'; - $table->headstyle['favorite'] = 'text-align: center;'; - $table->headstyle['full_screen'] = 'text-align: center;'; - - $table->style = []; - $table->style['name'] = 'text-align: left;'; - $table->style['cells'] = 'text-align: center;'; - $table->style['groups'] = 'text-align: center;'; - $table->style['favorite'] = 'text-align: center;'; - $table->style['full_screen'] = 'text-align: center;'; - - $table->size = []; - $table->size['name'] = '40%'; - $table->size['full_screen'] = '30px'; - - $table->head = []; - $table->head['name'] = __('Name'); - $table->head['cells'] = __('Cells'); - $table->head['groups'] = __('Group'); - $table->head['favorite'] = __('Favorite'); - $table->head['full_screen'] = __('Full screen'); + $id_table = 'dashboards_list'; + $columns = [ + 'name', + 'cells', + 'groups', + 'favorite', + 'full_screen', + ]; + $column_names = [ + __('Name'), + __('Cells'), + __('Group'), + __('Favorite'), + __('Full screen'), + ]; if ($manageDashboards === 1) { - $table->head['copy'] = __('Copy'); - $table->head['delete'] = __('Delete'); - $table->headstyle['copy'] = 'text-align: center;'; - $table->headstyle['delete'] = 'text-align: center;'; - $table->style['copy'] = 'text-align: center;'; - $table->style['delete'] = 'text-align: center;'; - $table->size['cells'] = '30px'; - $table->size['groups'] = '30px'; - $table->size['favorite'] = '30px'; - $table->size['copy'] = '30px'; - $table->size['delete'] = '30px'; - } else { - $table->size['cells'] = '60px'; - $table->size['groups'] = '60px'; - $table->size['favorite'] = '60px'; + $columns[] = 'copy'; + $columns[] = 'delete'; + $column_names[] = __('Copy'); + $column_names[] = __('Delete'); } - $table->data = []; - - foreach ($dashboards as $dashboard) { - $data = []; - - $dataQuery = ['dashboardId' => $dashboard['id']]; - - $url = $urlDashboard.'&'.http_build_query($dataQuery); - $data['name'] = ''; - $data['name'] .= $dashboard['name']; - $data['name'] .= ''; - - $data['cells'] = $dashboard['cells']; - - if (empty($dashboard['id_user']) === false) { - $data['groups'] = __( - 'Private for (%s)', - $dashboard['id_user'] - ); - } else { - $data['groups'] = ui_print_group_icon( - $dashboard['id_group'], - true - ); - } - - $data['favorite'] = $dashboard['active']; - - $dataQueryFull = [ - 'dashboardId' => $dashboard['id'], - 'pure' => 1, - ]; - - $urlFull = $urlDashboard; - $urlFull .= '&'.\http_build_query($dataQueryFull); - $data['full_screen'] = ''; - $data['full_screen'] .= \html_print_image( - 'images/fullscreen@svg.svg', - true, - ['class' => 'main_menu_icon invert_filter'] - ); - $data['full_screen'] .= ''; - - if ($manageDashboards === 1) { - $data['copy'] = ''; - $data['delete'] = ''; - } - - if (check_acl_restricted_all($config['id_user'], $dashboard['id_group'], 'RM')) { - $dataQueryCopy = [ - 'dashboardId' => $dashboard['id'], - 'copyDashboard' => 1, - ]; - $urlCopy = $urlDashboard.'&'.\http_build_query($dataQueryCopy); - $data['copy'] = ''; - $data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']); - $data['copy'] .= ''; - - $dataQueryDelete = [ - 'dashboardId' => $dashboard['id'], - 'deleteDashboard' => 1, - ]; - $urlDelete = $urlDashboard; - $urlDelete .= '&'.\http_build_query($dataQueryDelete); - $data['delete'] = ''; - $data['delete'] .= \html_print_image( - 'images/delete.svg', - true, - ['class' => 'main_menu_icon invert_filter'] - ); - $data['delete'] .= ''; - } - - $table->cellclass[] = [ - 'full_screen' => 'table_action_buttons', - 'copy' => 'table_action_buttons', - 'delete' => 'table_action_buttons', - ]; - - $table->data[] = $data; - } - - \html_print_table($table); - $tablePagination = \ui_pagination( - $count, - false, - $offset, - 0, - true, - 'offset', - false, - '' + ui_print_datatable( + [ + 'id' => $id_table, + 'class' => 'info_table', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $column_names, + 'ajax_url' => 'include/ajax/dashboard.ajax', + 'ajax_data' => [ + 'method' => 'draw', + 'urlDashboard' => $urlDashboard, + 'manageDashboards' => $manageDashboards, + ], + 'default_pagination' => $config['block_size'], + 'no_sortable_columns' => [], + 'order' => [ + 'field' => 'name', + 'direction' => 'desc', + ], + 'search_button_class' => 'sub filter float-right', + 'form' => [ + 'inputs' => [ + [ + 'label' => __('Name'), + 'type' => 'text', + 'class' => 'w80p', + 'id' => 'free_search', + 'name' => 'free_search', + ], + [ + 'label' => __('Group'), + 'type' => 'select_groups', + 'id' => 'group', + 'name' => 'group', + ], + ], + ], + 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', + 'csv' => false, + ] ); } diff --git a/pandora_console/views/dashboard/tipsWindow.php b/pandora_console/views/dashboard/tipsWindow.php index b9ff3f2420..573a11abcc 100644 --- a/pandora_console/views/dashboard/tipsWindow.php +++ b/pandora_console/views/dashboard/tipsWindow.php @@ -72,37 +72,36 @@ $output .= '

'.$title.'

'; $output .= '

'; $output .= $text; $output .= '

'; - -$link_class = 'invisible'; +$disabled_class = 'disabled_button'; +$disabled = true; if (empty($url) === false && $url !== '') { - $link_class = ''; + $disabled_class = ''; + $disabled = false; } -$output .= ''.__('See more info').''; - $output .= '
'; $output .= '
'; - +$output .= ''; $output .= html_print_button( - __('Maybe later'), + __('Learn more'), + 'learn_more', + $disabled, '', - false, - '', - [ - 'onclick' => 'close_dialog()', - 'class' => 'secondary mini', - ], + ['class' => 'secondary mini '.$disabled_class], true ); +$output .= ''; $output .= '
'; -$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter']); -$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter']); + +$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'previous_tip()']); +$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'next_tip()']); +$output .= html_print_input_hidden('tip_position', 0, true); $output .= '
'; if ($preview === true) { $output .= html_print_button( - __('Ok'), - 'next_tip', + __('Close'), + 'close_dialog', false, '', [ @@ -113,12 +112,12 @@ if ($preview === true) { ); } else { $output .= html_print_button( - __('Ok'), - 'next_tip', + __('Close'), + 'close_dialog', false, '', [ - 'onclick' => 'next_tip()', + 'onclick' => 'close_dialog()', 'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini', ], true diff --git a/pandora_console/views/dashboard/widget.php b/pandora_console/views/dashboard/widget.php index 2f0bfe7364..a2fbdc1783 100644 --- a/pandora_console/views/dashboard/widget.php +++ b/pandora_console/views/dashboard/widget.php @@ -43,7 +43,7 @@ if ((int) $cellData['id_widget'] !== 0 || $widgetId !== 0) { true ); - $output .= '
'; + $output .= '
'; $output .= \ui_print_info_message( __('Please select widget'), '', diff --git a/pandora_console/views/tacticalView/view.php b/pandora_console/views/tacticalView/view.php index 308c9626e9..29b1c923fc 100644 --- a/pandora_console/views/tacticalView/view.php +++ b/pandora_console/views/tacticalView/view.php @@ -268,7 +268,7 @@
loading(); ?>
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control index 633f2ee654..8d422e0662 100644 --- a/pandora_server/DEBIAN/control +++ b/pandora_server/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-server -Version: 7.0NG.774-231114 +Version: 7.0NG.774-231127 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 9012b5beaf..2275cef4e6 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.774-231114" +pandora_version="7.0NG.774-231127" package_cpan=0 package_pandora=1 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 736992ad43..61ba9d7f9b 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.774"; -my $pandora_build = "231114"; +my $pandora_build = "231127"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash @@ -128,7 +128,6 @@ sub pandora_get_sharedconfig ($$) { my ($pa_config, $dbh) = @_; # Agentaccess option - $pa_config->{"agentaccess"} = pandora_get_tconfig_token ($dbh, 'agentaccess', 1); # Realtimestats 0 disabled, 1 enabled. # Master servers will generate all the information (global tactical stats). @@ -466,7 +465,6 @@ sub pandora_load_config { # don't get an error later. $pa_config->{"realtimestats"} = 0; $pa_config->{"stats_interval"} = 300; - $pa_config->{"agentaccess"} = 1; $pa_config->{"event_storm_protection"} = 0; $pa_config->{"use_custom_encoding"} = 0; $pa_config->{"node_metaconsole"} = 0; # > 7.0NG diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 420a49426b..baabc7d047 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -2159,24 +2159,6 @@ sub send_console_notification { } } -########################################################################## -=head2 C<< pandora_access_update (I<$pa_config>, I<$agent_id>, I<$dbh>) >> - -Update agent access table. - -=cut -########################################################################## -sub pandora_access_update ($$$) { - my ($pa_config, $agent_id, $dbh) = @_; - - return if ($agent_id < 0); - - if ($pa_config->{"agentaccess"} == 0){ - return; - } - db_do ($dbh, "INSERT INTO tagent_access (id_agent, utimestamp) VALUES (?, ?)", $agent_id, time ()); -} - ########################################################################## =head2 C<< pandora_process_module (I<$pa_config>, I<$data>, I<$agent>, I<$module>, I<$module_type>, I<$timestamp>, I<$utimestamp>, I<$server_id>, I<$dbh>) >> @@ -2413,10 +2395,8 @@ sub pandora_process_module ($$$$$$$$$;$) { } else { if($new_status == 0 && $ff_normal > $min_ff_event) { - # Reached normal FF but status have not changed, reset counters. + # Reached normal FF but status have not changed, reset counter. $ff_normal = 0; - $ff_critical = 0; - $ff_warning = 0; } # Active ff interval @@ -3428,14 +3408,10 @@ sub pandora_update_agent ($$$$$$$;$$$) { # No access update for data without interval. # Single modules from network server, for example. This could be very Heavy for Pandora FMS - if ($agent_interval != -1){ - pandora_access_update ($pa_config, $agent_id, $dbh); - } else { - - # Do not update the agent interval + if ($agent_interval == -1){ $agent_interval = undef; } - + # Update tagente my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime()); my ($set, $values) = db_update_get_values ({'agent_version' => $agent_version, @@ -4240,9 +4216,6 @@ sub pandora_delete_agent ($$;$) { # Delete the agent db_do ($dbh, 'DELETE FROM tagente WHERE id_agente = ?', $agent_id); - # Delete agent access data - db_do ($dbh, 'DELETE FROM tagent_access WHERE id_agent = ?', $agent_id); - # Delete addresses db_do ($dbh, 'DELETE FROM taddress_agent WHERE id_ag = ?', $agent_id); @@ -6711,8 +6684,7 @@ sub pandora_installation_monitoring($$) { FROM information_schema.tables WHERE - table_schema not in ('information_schema', 'mysql') - AND table_name NOT IN ('tagent_access, tevento')" + table_schema not in ('information_schema', 'mysql')" ); $module->{'unit'} = '%'; push(@modules, $module); diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 11f0f8cf4f..84603be125 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.774"; -my $pandora_build = "231114"; +my $pandora_build = "231127"; 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 7142807c89..0880d75291 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.774 -%define release 231114 +%define release 231127 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 33a70ab3e2..8405c53f30 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.774 -%define release 231114 +%define release 231127 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b95e4d2092..a43cbbee8a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.774" -PI_BUILD="231114" +PI_BUILD="231127" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 880bdd6523..23a93790f5 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.774 Build 231114"; +my $version = "7.0NG.774 Build 231127"; # Pandora server configuration my %conf; @@ -279,25 +279,7 @@ sub pandora_purgedb ($$$) { log_message ('PURGE', "Deleting old access data (More than 24hr)"); - $first_mark = get_db_value_limit ($dbh, 'SELECT utimestamp FROM tagent_access ORDER BY utimestamp ASC', 1); - if (defined ($first_mark)) { - $total_time = $ulimit_access_timestamp - $first_mark; - $purge_steps = int( $total_time / $BIG_OPERATION_STEP); - if ($purge_steps > 0) { - for (my $ax = 1; $ax <= $BIG_OPERATION_STEP; $ax++){ - db_do ($dbh, "DELETE FROM tagent_access WHERE utimestamp < ". ( $first_mark + ($purge_steps * $ax)) . " AND utimestamp >= ". $first_mark); - log_message ('PURGE', "Agent access deletion progress %$ax", "\r"); - # Do a nanosleep here for 0,01 sec - usleep (10000); - } - log_message ('', "\n"); - } else { - log_message ('PURGE', "No agent access data to purge."); - } - } else { - log_message ('PURGE', "No agent access data."); - } - + # Purge the reports if (defined($conf->{'_enterprise_installed'}) && $conf->{'_enterprise_installed'} eq '1' && defined($conf->{'_metaconsole'}) && $conf->{'_metaconsole'} eq '1'){ diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1146c4a0c1..0d7a37ce21 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.774 Build 231114"; +my $version = "7.0NG.774 Build 231127"; # save program name for logging my $progname = basename($0); diff --git a/pandora_server/util/pandora_perf_report.pl b/pandora_server/util/pandora_perf_report.pl index cbc11219c7..cdad51d9ab 100644 --- a/pandora_server/util/pandora_perf_report.pl +++ b/pandora_server/util/pandora_perf_report.pl @@ -212,7 +212,6 @@ sub stress_agent { sub table_stats { my ($dbh, $conf) = @_; my $stats = { - tagent_access => 'N/A', tagente => 'N/A', tagente_datos => 'N/A', tagente_datos_string => 'N/A', @@ -225,8 +224,7 @@ sub table_stats { FROM information_schema.TABLES WHERE TABLE_SCHEMA=? AND TABLE_NAME IN (?, ?, ?, ?, ?, ?, ?)", - $conf->{'dbname'}, - 'tagent_access', + $conf->{'dbname'},, 'tagente', 'tagente_datos', 'tagente_datos_string', @@ -309,7 +307,6 @@ sub generate_optimized_my_cnf { sub table_comments { my ($stats) = @_; my $comments = { - tagent_access => 'OK', tagente => 'OK', tagente_datos => 'OK', tagente_datos_string => 'OK', @@ -319,12 +316,6 @@ sub table_comments { tsesion => 'OK', }; - if ($stats->{'tagent_access'} > $stats->{'tagente'} * 24 * 250) { - $comments->{'tagent_access'} = 'CRITICAL: Table too big. Please contact our support team at: support@artica.es'; - } elsif ($stats->{'tagent_access'} > $stats->{'tagente'} * 24 * 100) { - $comments->{'tagent_access'} = 'WARNING: Table too big. Please contact our support team at: support@artica.es'; - } - if ($stats->{'tagente_datos'} > 5000000) { $comments->{'tagente_datos'} = 'CRITICAL: Table too big. Please use a history database or decrease the purge period.'; } elsif ($stats->{'tagente_datos'} > 1000000) { @@ -474,7 +465,6 @@ Module table $table_stats->{'tagente_modulo'} $tab Data table $table_stats->{'tagente_datos'} $table_comments->{'tagente_datos'} String data table $table_stats->{'tagente_datos_string'} $table_comments->{'tagente_datos_string'} Event table $table_stats->{'tevento'} $table_comments->{'tevento'} -Access stats $table_stats->{'tagent_access'} $table_comments->{'tagent_access'} Audit information $table_stats->{'tsesion'} $table_comments->{'tsesion'} diff --git a/tests/console/Views.py b/tests/console/Views.py index b4ad48134e..f4967e3db7 100644 --- a/tests/console/Views.py +++ b/tests/console/Views.py @@ -305,7 +305,7 @@ class viewAppear(PandoraWebDriverTestCase): click_menu_element(driver,"CSV import") time.sleep(2) self.assertEqual("Upload file" in driver.page_source,True) - click_menu_element(driver,"CSV import group") + click_menu_element(driver,"Import groups with CSV file") time.sleep(2) self.assertEqual("Upload file" in driver.page_source,True) click_menu_element(driver,"IPAM")