mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
#12095 resolved conflict
This commit is contained in:
commit
d8e1dc4e7c
@ -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'
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.774-231107
|
||||
Version: 7.0NG.774-231127
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -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-231107"
|
||||
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
|
||||
|
@ -1039,7 +1039,7 @@ my $Sem = undef;
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.774';
|
||||
use constant AGENT_BUILD => '231107';
|
||||
use constant AGENT_BUILD => '231127';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -4,8 +4,8 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231127
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
@ -4,8 +4,8 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231127
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
@ -5,7 +5,7 @@
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
@ -4,7 +4,7 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231107"
|
||||
PI_BUILD="231127"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{231107}
|
||||
{231127}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231107")
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231127")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -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 231107))"
|
||||
VALUE "ProductVersion", "(7.0NG.774(Build 231127))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.774-231107
|
||||
Version: 7.0NG.774-231127
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -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-231107"
|
||||
pandora_version="7.0NG.774-231127"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,4 +3,6 @@ START TRANSACTION;
|
||||
ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`;
|
||||
ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`;
|
||||
|
||||
COMMIT;
|
||||
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
|
||||
|
||||
COMMIT;
|
||||
|
@ -922,6 +922,23 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
|
||||
)
|
||||
);
|
||||
|
||||
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
||||
__('Vulnerability scanning'),
|
||||
html_print_select(
|
||||
[
|
||||
0 => __('Disabled'),
|
||||
1 => __('Enabled'),
|
||||
2 => __('Use global settings'),
|
||||
],
|
||||
'vul_scan_enabled',
|
||||
$vul_scan_enabled,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
ui_toggle(
|
||||
html_print_table($tableAdvancedAgent, true),
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
|
@ -231,6 +231,7 @@ if ($create_agent) {
|
||||
$quiet = (int) get_parameter('quiet', 0);
|
||||
$cps = (int) get_parameter_switch('cps', -1);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
@ -298,6 +299,7 @@ if ($create_agent) {
|
||||
'quiet' => $quiet,
|
||||
'cps' => $cps,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -610,6 +612,7 @@ if ($id_agente) {
|
||||
$agent_wizard['active'] = false;
|
||||
}
|
||||
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
|
||||
if ($has_remote_conf !== false) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
@ -642,24 +645,26 @@ if ($id_agente) {
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
} else {
|
||||
$onheader = [
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
}
|
||||
|
||||
@ -760,6 +765,11 @@ if ($id_agente) {
|
||||
$help_header = 'gis_tab';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
$tab_name = __('Vulnerabilities');
|
||||
$help_header = 'vulnerabilities_tab';
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
$tab_name = __('Incidents');
|
||||
break;
|
||||
@ -1004,6 +1014,7 @@ if ($update_agent) {
|
||||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$satellite_server = (int) get_parameter('satellite_server', 0);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
if ($fields === false) {
|
||||
$fields = [];
|
||||
@ -1130,6 +1141,7 @@ if ($update_agent) {
|
||||
'safe_mode_module' => $safe_mode_module,
|
||||
'satellite_server' => $satellite_server,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
];
|
||||
|
||||
if ($config['metaconsole_agent_cache'] == 1) {
|
||||
@ -1287,6 +1299,7 @@ if ($id_agente) {
|
||||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||
$satellite_server = (int) $agent['satellite_server'];
|
||||
$fixed_ip = (int) $agent['fixed_ip'];
|
||||
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
|
||||
}
|
||||
|
||||
$update_module = (bool) get_parameter('update_module');
|
||||
@ -2425,6 +2438,10 @@ switch ($tab) {
|
||||
include 'agent_conf_gis.php';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
include enterprise_include('godmode/agentes/vulnerabilities_editor.php');
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
include 'agent_incidents.php';
|
||||
break;
|
||||
|
@ -1387,7 +1387,7 @@ $table_advanced->data['made_enabled'][0] = html_print_checkbox_switch(
|
||||
'made_enabled',
|
||||
1,
|
||||
(bool) $made_enabled,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
@ -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();
|
||||
|
@ -520,7 +520,7 @@ $(document).ready (function () {
|
||||
name: "id_action",
|
||||
value: "<?php echo (int) $id; ?>"
|
||||
});
|
||||
|
||||
|
||||
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
||||
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;
|
||||
}
|
||||
|
@ -269,15 +269,14 @@ $size_pagination .= '</div>';
|
||||
// Home screen.
|
||||
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('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).'</p>';
|
||||
$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(
|
||||
|
@ -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 = [];
|
||||
|
@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) {
|
||||
$data = [];
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||
} else {
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||
}
|
||||
|
||||
$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']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.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']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
@ -571,6 +571,7 @@ if (!$maps && is_metaconsole() === false) {
|
||||
}
|
||||
|
||||
if ($maps || is_metaconsole() === true) {
|
||||
$buttons = '';
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
if (is_metaconsole() === false) {
|
||||
$actionUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder';
|
||||
@ -578,20 +579,22 @@ if ($maps || is_metaconsole() === true) {
|
||||
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
|
||||
}
|
||||
|
||||
echo '<form action="'.$actionUrl.'" method="post">';
|
||||
html_print_input_hidden('edit_layout', 1);
|
||||
$buttons .= '<form action="'.$actionUrl.'" method="post">';
|
||||
$buttons .= html_print_input_hidden('edit_layout', 1, true);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
),
|
||||
[ 'right_content' => $tablePagination ]
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
$buttons,
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
}
|
||||
|
@ -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) {
|
||||
<?php
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
(string) $period,
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
@ -1697,6 +1699,39 @@ if (is_metaconsole() === true) {
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_period2" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Time lapse');
|
||||
ui_print_help_tip(
|
||||
__('This is the range, or period of time over which the report renders the information for this report type. For example, a week means data from a week ago from now. ')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
(string) $period,
|
||||
'onselect=loadLogAgents();',
|
||||
'',
|
||||
'0',
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_estimate" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
@ -2921,6 +2956,23 @@ if (is_metaconsole() === true) {
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_unknowns_graph" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show unknowns in graph');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'unknowns_graph',
|
||||
1,
|
||||
$unknowns_graph
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_time_compare_overlapped" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
@ -6685,7 +6737,7 @@ function loadLogAgents() {
|
||||
params["get_agent_source"] = 1;
|
||||
params["log_alert"] = 1;
|
||||
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
|
||||
|
||||
params["date"] = $('#period_select').val();
|
||||
jQuery.ajax({
|
||||
data: params,
|
||||
dataType: "json",
|
||||
@ -6693,9 +6745,9 @@ function loadLogAgents() {
|
||||
url: "ajax.php",
|
||||
async: true,
|
||||
success: function(data) {
|
||||
$('#id_agents3')
|
||||
.find('option')
|
||||
.remove();
|
||||
$('#id_agents3').find('option').remove();
|
||||
$('#source option[value!=""]').remove();
|
||||
|
||||
$.each(data['source'],function(key,value) {
|
||||
if (value === source) {
|
||||
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
|
||||
@ -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('<?php echo $action; ?>' === '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"] = '<?php echo SECONDS_1MONTH; ?>';
|
||||
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){
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -24,14 +24,6 @@ if (! check_acl($config['id_user'], 0, 'AR')
|
||||
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('pandora_fullcalendar');
|
||||
|
||||
|
||||
/**
|
||||
* Mask class names.
|
||||
@ -212,115 +204,3 @@ if ($classname_selected === null) {
|
||||
|
||||
Wizard::printBigButtonsList($wiz_data);
|
||||
}
|
||||
|
||||
$is_management_allowed = is_management_allowed();
|
||||
$task_id = get_parameter('task', '');
|
||||
if ($task_id !== '') {
|
||||
$task = db_get_row_filter(
|
||||
'tuser_task_scheduled',
|
||||
['id' => $task_id]
|
||||
);
|
||||
$args = unserialize($task['args']);
|
||||
$event_calendar = io_safe_output($args['weekly_schedule']);
|
||||
} else {
|
||||
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#table-new-job-3").hide();
|
||||
var edit = '<?php echo $task_id; ?>';
|
||||
if (edit != '') {
|
||||
exec_calendar();
|
||||
}
|
||||
|
||||
$("#scheduled").change(exec_calendar);
|
||||
|
||||
function exec_calendar() {
|
||||
if ($("#scheduled").val() == "weekly") {
|
||||
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
|
||||
var eventsBBDD = '<?php echo $event_calendar; ?>';
|
||||
var events = loadEventBBDD(eventsBBDD);
|
||||
var calendarEl = document.getElementById('calendar_map');
|
||||
|
||||
var options = {
|
||||
contentHeight: "auto",
|
||||
headerToolbar: {
|
||||
left: "",
|
||||
center: "",
|
||||
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
|
||||
},
|
||||
buttonText: {
|
||||
dayGridWeek: '<?php echo __('Simple'); ?>',
|
||||
timeGridWeek: '<?php echo __('Detailed'); ?>'
|
||||
},
|
||||
dayHeaderFormat: { weekday: "short" },
|
||||
initialView: "dayGridWeek",
|
||||
navLinks: false,
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
slotDuration: "01:00:00",
|
||||
slotLabelInterval: "02:00:00",
|
||||
snapDuration: "01:00:00",
|
||||
slotMinTime: "00:00:00",
|
||||
slotMaxTime: "24:00:00",
|
||||
scrollTime: "01:00:00",
|
||||
locale: "en-GB",
|
||||
firstDay: 1,
|
||||
eventTimeFormat: {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
},
|
||||
eventColor: "#82b92e",
|
||||
editable: is_management_allowed === 0 ? false : true,
|
||||
dayMaxEvents: 3,
|
||||
dayPopoverFormat: { weekday: "long" },
|
||||
defaultAllDay: false,
|
||||
displayEventTime: true,
|
||||
displayEventEnd: true,
|
||||
selectOverlap: false,
|
||||
eventOverlap: false,
|
||||
allDaySlot: true,
|
||||
droppable: false,
|
||||
select: is_management_allowed === 0 ? false : select_alert_template,
|
||||
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
|
||||
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
|
||||
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
|
||||
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
|
||||
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
|
||||
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
|
||||
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
|
||||
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
|
||||
};
|
||||
|
||||
var settings = {
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||
timeText: '<?php echo __('Time'); ?>',
|
||||
hourText: '<?php echo __('Hour'); ?>',
|
||||
minuteText: '<?php echo __('Minute'); ?>',
|
||||
secondText: '<?php echo __('Second'); ?>',
|
||||
currentText: '<?php echo __('Now'); ?>',
|
||||
closeText: '<?php echo __('Close'); ?>',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
removeText: '<?php echo __('Remove'); ?>',
|
||||
userLanguage: '<?php echo get_user_language(); ?>',
|
||||
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
|
||||
tooltipText: '<?php echo __('Drag out to remove'); ?>',
|
||||
alert: '<?php echo __('Alert'); ?>'
|
||||
}
|
||||
|
||||
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
|
||||
calendar.render();
|
||||
|
||||
$("#table-new-job-3").show();
|
||||
$('.fc-event-title').hide();
|
||||
$(".fc-button-active" ).trigger( "click" );
|
||||
} else {
|
||||
$("#calendar_map").html();
|
||||
$("#table-new-job-3").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -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] = '<span title="Operations">'.__('Op.').'</span>';
|
||||
$table->head[9] = '<span title="Operations">'.__('Op.').'</span>';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
@ -143,9 +144,11 @@ foreach ($servers as $server) {
|
||||
}
|
||||
|
||||
// Type.
|
||||
$data[2] = '<span class="nowrap">'.$server['img'];
|
||||
$data[2] = '<span class="nowrap">'.$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] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
||||
$data[4] = $server['version'];
|
||||
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||
$data[6] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
$data[6] = '';
|
||||
$data[7] = '';
|
||||
if ($server['queued_modules'] > 500) {
|
||||
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
$data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
[
|
||||
@ -189,9 +192,9 @@ foreach ($servers as $server) {
|
||||
).'</a></div> ';
|
||||
}
|
||||
|
||||
$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] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/snmp-trap@svg.svg',
|
||||
true,
|
||||
[
|
||||
@ -221,12 +224,12 @@ foreach ($servers as $server) {
|
||||
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
if ($server['type'] === 'data') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
} else if ($server['type'] === 'enterprise snmp') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$data[8] .= '<a class="open-alerts-list-modal" href="">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a class="open-alerts-list-modal" href="">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
|
||||
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
$names_servers[$safe_server_name] = false;
|
||||
}
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||
$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] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -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 {
|
||||
|
@ -97,6 +97,24 @@ try {
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/os',
|
||||
'ajax_data' => ['method' => 'drawOSTable'],
|
||||
'pagination_options' => [
|
||||
[
|
||||
$config['block_size'],
|
||||
10,
|
||||
25,
|
||||
100,
|
||||
200,
|
||||
500,
|
||||
],
|
||||
[
|
||||
$config['block_size'],
|
||||
10,
|
||||
25,
|
||||
100,
|
||||
200,
|
||||
500,
|
||||
],
|
||||
],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'no_sortable_columns' => [
|
||||
-1,
|
||||
@ -137,6 +155,10 @@ if (is_metaconsole() === true) {
|
||||
true
|
||||
);
|
||||
$buttons .= '</form>';
|
||||
} else {
|
||||
$buttons .= '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
|
||||
$buttons .= html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true);
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
@ -150,15 +172,6 @@ html_print_action_buttons(
|
||||
|
||||
echo '<div id="aux" class="invisible"></div>';
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function process_datatables_item(item) {
|
||||
|
@ -767,6 +767,7 @@ $table->data[$i][] = html_print_label_input_block(
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
|
@ -2129,6 +2129,15 @@ $table_other->data[$row][] = html_print_label_input_block(
|
||||
__('Data multiplier to use in graphs/data'),
|
||||
html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 1, true, false, false)
|
||||
);
|
||||
$table_other->data[$row][] = html_print_label_input_block(
|
||||
__('Hide general stats for non admin users in tactical view'),
|
||||
html_print_checkbox_switch(
|
||||
'disable_general_statistics',
|
||||
1,
|
||||
$config['disable_general_statistics'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$row++;
|
||||
|
||||
/*
|
||||
|
@ -53,12 +53,30 @@ try {
|
||||
echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n";
|
||||
}
|
||||
|
||||
global $pandora_version;
|
||||
if (isset($pandora_version) === true
|
||||
&& empty($pandora_version) === false
|
||||
) {
|
||||
$version_array = explode('.', $pandora_version);
|
||||
if (is_array($version_array) === true) {
|
||||
$current_package = $version_array[2];
|
||||
if (count($version_array) > 2) {
|
||||
foreach ($version_array as $key => $value) {
|
||||
if ($key > 2) {
|
||||
$current_package .= '.'.$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$umc = new UpdateManager\Client(
|
||||
[
|
||||
'homedir' => $config['homedir'],
|
||||
'dbconnection' => $config['dbconnection'],
|
||||
'historydb' => $historical_dbh,
|
||||
'MR' => (int) $current_mr,
|
||||
'homedir' => $config['homedir'],
|
||||
'dbconnection' => $config['dbconnection'],
|
||||
'historydb' => $historical_dbh,
|
||||
'MR' => (int) $current_mr,
|
||||
'current_package' => ($current_package ?? ''),
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -33,8 +33,6 @@ check_login();
|
||||
|
||||
require_once $config['homedir'].'/vendor/autoload.php';
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_profile.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_groups.php';
|
||||
@ -1376,72 +1374,6 @@ if (is_metaconsole() === true) {
|
||||
);
|
||||
}
|
||||
|
||||
$values = [
|
||||
-1 => __('Use global conf'),
|
||||
1 => __('Yes'),
|
||||
0 => __('No'),
|
||||
];
|
||||
|
||||
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('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
|
||||
).'</p>';
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_db" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_vc" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$home_screen .= html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$home_screen = '';
|
||||
|
||||
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
|
||||
$size_pagination .= html_print_input_text(
|
||||
'block_size',
|
||||
@ -2078,17 +2010,20 @@ if (is_metaconsole() === false) {
|
||||
}
|
||||
|
||||
function show_data_section() {
|
||||
var $section = $("#section").val();
|
||||
var $allElements = $('div[id^="custom_home_screen_"]');
|
||||
var $elementSelected = $('div[id="custom_home_screen_' + $section + '"]');
|
||||
var section = $("#section").val();
|
||||
if(section === 'other'){
|
||||
section = 'external_link';
|
||||
}
|
||||
var allElements = $('div[id^="custom_home_screen_"]');
|
||||
var elementSelected = $('div[id="custom_home_screen_' + section + '"]');
|
||||
// Hide all elements.
|
||||
$allElements.each(function() {
|
||||
allElements.each(function() {
|
||||
$(this).addClass('invisible');
|
||||
$(this).children().addClass('invisible');
|
||||
})
|
||||
// Show only the selected.
|
||||
$elementSelected.removeClass('invisible');
|
||||
$elementSelected.children().removeClass('invisible');
|
||||
elementSelected.removeClass('invisible');
|
||||
elementSelected.children().removeClass('invisible');
|
||||
}
|
||||
|
||||
function switch_ehorus_conf() {
|
||||
|
@ -26,6 +26,8 @@
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
@ -45,16 +47,75 @@ $homeScreenValues = [
|
||||
HOME_SCREEN_DASHBOARD => __('Dashboard'),
|
||||
];
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Custom Home Screen controls.
|
||||
$customHomeScreenAddition = [];
|
||||
// Home screen. Dashboard.
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
|
||||
$dashboards_aux,
|
||||
'dashboard',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$customHomeScreenDataField = '';
|
||||
foreach ($customHomeScreenAddition as $key => $customField) {
|
||||
$customHomeScreenDataField .= html_print_div(
|
||||
@ -576,7 +637,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
|
||||
true
|
||||
);
|
||||
|
||||
// eHorus conf
|
||||
// EHorus conf.
|
||||
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
|
||||
$userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled');
|
||||
$userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch(
|
||||
@ -791,7 +852,7 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
||||
5,
|
||||
65,
|
||||
$user_info['comments'],
|
||||
($view_mode ? 'readonly="readonly"' : ''),
|
||||
($view_mode) ? 'readonly="readonly"' : '',
|
||||
true,
|
||||
''
|
||||
);
|
||||
@ -945,15 +1006,7 @@ $(document).ready(function () {
|
||||
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
|
||||
})
|
||||
|
||||
var ehorus_user_level_enabled =
|
||||
<?php
|
||||
if (isset($user_info['ehorus_user_level_enabled']) === true) {
|
||||
echo $user_info['ehorus_user_level_enabled'];
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
?>
|
||||
;
|
||||
var ehorus_user_level_enabled = '<?php echo (isset($user_info['ehorus_user_level_enabled']) === true) ? $user_info['ehorus_user_level_enabled'] : 0; ?>';
|
||||
var chk_ehorus_user_level_enabled = ehorus_user_level_enabled;
|
||||
|
||||
if (ehorus_user_level_enabled == 0) {
|
||||
|
7
pandora_console/images/vulnerability_scan@svg.svg
Normal file
7
pandora_console/images/vulnerability_scan@svg.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Vulnerability scanner@svg</title>
|
||||
<g id="Vulnerability-scanner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M1,15 C1.55228475,15 2,15.4477153 2,16 L2,18 L4,18 C4.55228475,18 5,18.4477153 5,19 C5,19.5522847 4.55228475,20 4,20 L1,20 C0.44771525,20 0,19.5522847 0,19 L2.22044605e-16,16 C2.22044605e-16,15.4477153 0.44771525,15 1,15 Z M19,15 C19.5522847,15 20,15.4477153 20,16 L20,19 C20,19.5522847 19.5522847,20 19,20 L16,20 C15.4477153,20 15,19.5522847 15,19 C15,18.4477153 15.4477153,18 16,18 L18,18 L18,16 C18,15.4477153 18.4477153,15 19,15 Z M10,3.054 L10.2249383,3.05813847 C13.4344251,3.17642824 16,5.81560306 16,9.054 L16,14.0937431 L13.104,16.031 L12.0698805,13.7307161 L14.2125487,13.4284958 C14.556044,13.3800462 14.7107272,12.9297411 14.4915053,12.6217094 L10.3337249,6.72755475 C10.2297804,6.58020088 10.0683722,6.50924823 9.91239579,6.53116927 C9.62831588,6.5712384 9.45479699,6.90055719 9.56613598,7.20888317 L10.9914706,11.1541491 L8.78753031,11.4650118 C8.51830424,11.5029857 8.34782116,11.7998997 8.42525378,12.0959539 L9.92,18.054 L4,14.0937431 L4,9.054 C4,5.81560306 6.56557489,3.17642824 9.77506174,3.05813847 L10,3.054 Z M4,0 C4.55228475,-1.01453063e-16 5,0.44771525 5,1 C5,1.55228475 4.55228475,2 4,2 L2,2 L2,4 C2,4.55228475 1.55228475,5 1,5 C0.44771525,5 2.22044605e-16,4.55228475 2.22044605e-16,4 L0,1 C0,0.44771525 0.44771525,1.01453063e-16 1,0 L4,0 Z M19,0 C19.5522847,1.01453063e-16 20,0.44771525 20,1 L20,4 C20,4.55228475 19.5522847,5 19,5 C18.4477153,5 18,4.55228475 18,4 L18,2 L16,2 C15.4477153,2 15,1.55228475 15,1 C15,0.44771525 15.4477153,-1.01453063e-16 16,0 Z" id="Scan" fill="#3F3F3F" transform="translate(10, 10) scale(1, -1) translate(-10, -10)"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
235
pandora_console/include/ajax/dashboard.ajax.php
Normal file
235
pandora_console/include/ajax/dashboard.ajax.php
Normal file
@ -0,0 +1,235 @@
|
||||
<?php
|
||||
/**
|
||||
* Update manager client historical updates backend.
|
||||
*
|
||||
* @category Update Manager
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
$method = get_parameter('method', null);
|
||||
$filter = get_parameter('filter', '');
|
||||
$urlDashboard = get_parameter('urlDashboard', '');
|
||||
$manageDashboards = get_parameter('manageDashboards', 1);
|
||||
|
||||
if ($method === 'draw') {
|
||||
// Datatables offset, limit and order.
|
||||
$filter = get_parameter('filter', []);
|
||||
$start = get_parameter('start', 0);
|
||||
$length = get_parameter('length', $config['block_size']);
|
||||
$orderBy = get_datatable_order(true);
|
||||
|
||||
$sort_field = $orderBy['field'];
|
||||
$order = $orderBy['direction'];
|
||||
|
||||
$pagination = '';
|
||||
$pagination = sprintf(
|
||||
' LIMIT %d OFFSET %d ',
|
||||
$length,
|
||||
$start,
|
||||
);
|
||||
|
||||
try {
|
||||
$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');
|
||||
|
||||
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';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$where_name = '';
|
||||
if (strlen($filter['free_search']) > 0) {
|
||||
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
|
||||
}
|
||||
|
||||
$where_group = '';
|
||||
if (empty($filter['group']) === false && $filter['group'] !== '0') {
|
||||
$where_group = sprintf('id_group = %s', $filter['group']);
|
||||
if (empty($where_name) === false) {
|
||||
$where_group = 'AND '.$where_group;
|
||||
}
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if (empty($where_name) === false || empty($where_group) === false) {
|
||||
$where = sprintf(
|
||||
'WHERE %s %s',
|
||||
$where_name,
|
||||
$where_group
|
||||
);
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;
|
||||
$dashboards = db_get_all_rows_sql($sql);
|
||||
$count = db_get_value_sql('SELECT COUNT(*) FROM tdashboard '.$where);
|
||||
foreach ($dashboards as $dashboard) {
|
||||
$data = [];
|
||||
|
||||
$dataQuery = ['dashboardId' => $dashboard['id']];
|
||||
|
||||
$url = $urlDashboard.'&'.http_build_query($dataQuery);
|
||||
$data['name'] = '<a href="'.$url.'">';
|
||||
$data['name'] .= $dashboard['name'];
|
||||
$data['name'] .= '</a>';
|
||||
|
||||
$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'] = '<a href="'.$urlFull.'">';
|
||||
$data['full_screen'] .= \html_print_image(
|
||||
'images/fullscreen@svg.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
$data['full_screen'] .= '</a>';
|
||||
|
||||
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'] = '<a href="'.$urlCopy.'">';
|
||||
$data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']);
|
||||
$data['copy'] .= '</a>';
|
||||
|
||||
$dataQueryDelete = [
|
||||
'dashboardId' => $dashboard['id'],
|
||||
'deleteDashboard' => 1,
|
||||
];
|
||||
$urlDelete = $urlDashboard;
|
||||
$urlDelete .= '&'.\http_build_query($dataQueryDelete);
|
||||
$data['delete'] = '<a href="'.$urlDelete;
|
||||
$data['delete'] .= '" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data['delete'] .= \html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
$data['delete'] .= '</a>';
|
||||
}
|
||||
|
||||
$table->cellclass[] = [
|
||||
'full_screen' => 'table_action_buttons',
|
||||
'copy' => 'table_action_buttons',
|
||||
'delete' => 'table_action_buttons',
|
||||
];
|
||||
|
||||
$table->data[] = $data;
|
||||
}
|
||||
|
||||
// Datatables format: RecordsTotal && recordsfiltered.
|
||||
echo json_encode(
|
||||
[
|
||||
'data' => $table->data,
|
||||
'recordsTotal' => $count,
|
||||
'recordsFiltered' => $count,
|
||||
]
|
||||
);
|
||||
// Capture output.
|
||||
$response = ob_get_clean();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If not valid, show error with issue.
|
||||
json_decode($response);
|
||||
if (json_last_error() == JSON_ERROR_NONE) {
|
||||
// If valid dump.
|
||||
echo $response;
|
||||
} else {
|
||||
echo json_encode(
|
||||
['error' => $response]
|
||||
);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
@ -92,6 +92,8 @@ $get_id_source_event = get_parameter('get_id_source_event');
|
||||
$node_id = (int) get_parameter('node_id', 0);
|
||||
$settings_modal = get_parameter('settings', 0);
|
||||
$parameters_modal = get_parameter('parameters', 0);
|
||||
$draw_events_graph = get_parameter('drawEventsGraph', false);
|
||||
|
||||
// User private filter.
|
||||
$current_filter = get_parameter('current_filter', 0);
|
||||
$private_filter_event = get_parameter('private_filter_event', 0);
|
||||
@ -2751,3 +2753,10 @@ if ($draw_row_response_info === true) {
|
||||
echo $output;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((bool) $draw_events_graph === true) {
|
||||
$filter = get_parameter('filter');
|
||||
$output = event_print_graph($filter);
|
||||
echo $output;
|
||||
return;
|
||||
}
|
@ -1361,10 +1361,12 @@ if (check_login()) {
|
||||
$additionalLinkAction = '&flag=1';
|
||||
$linkCaption = __('Force checks');
|
||||
$imgaction = 'images/force@svg.svg';
|
||||
$visibility = '';
|
||||
} else {
|
||||
$additionalLinkAction = '';
|
||||
$linkCaption = __('Refresh');
|
||||
$imgaction = 'images/go-back@svg.svg';
|
||||
$visibility = 'visibility: initial;';
|
||||
}
|
||||
|
||||
$moduleActionButtons[] = html_print_anchor(
|
||||
@ -1376,6 +1378,7 @@ if (check_login()) {
|
||||
[
|
||||
'title' => __('Force remote check'),
|
||||
'class' => 'main_menu_icon forced_title',
|
||||
'style' => $visibility,
|
||||
]
|
||||
),
|
||||
],
|
||||
|
@ -70,8 +70,7 @@ $otherSerialize = get_parameter('other');
|
||||
$otherMode = get_parameter('other_mode', 'url_encode');
|
||||
$returnType = get_parameter('return_type', 'string');
|
||||
$info = get_parameter('info', '');
|
||||
$raw_decode = (bool) get_parameter('raw_decode', false);
|
||||
|
||||
$raw_decode = (bool) get_parameter('raw_decode', true);
|
||||
$other = parseOtherParameter($otherSerialize, $otherMode, $raw_decode);
|
||||
$apiPassword = io_output_password(
|
||||
db_get_value_filter(
|
||||
|
@ -732,6 +732,8 @@ class ConsoleSupervisor
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||
}
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||
|
@ -47,6 +47,7 @@ class TipsWindow
|
||||
'renderPreview',
|
||||
'setShowTipsAtStartup',
|
||||
'getTips',
|
||||
'getTipById',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -221,8 +222,13 @@ class TipsWindow
|
||||
*
|
||||
* @return array $tip
|
||||
*/
|
||||
public function getTipById($idTip)
|
||||
public function getTipById($idTip=false, $return=false)
|
||||
{
|
||||
if ($idTip === false) {
|
||||
$idTip = get_parameter('idTip');
|
||||
}
|
||||
|
||||
$return = get_parameter('return', false);
|
||||
$tip = db_get_row(
|
||||
'twelcome_tip',
|
||||
'id',
|
||||
@ -232,9 +238,20 @@ class TipsWindow
|
||||
$tip['title'] = io_safe_output($tip['title']);
|
||||
$tip['text'] = io_safe_output($tip['text']);
|
||||
$tip['url'] = io_safe_output($tip['url']);
|
||||
$tip['files'] = $this->getFilesFromTip($tip['id']);
|
||||
}
|
||||
|
||||
return $tip;
|
||||
if ($return !== false) {
|
||||
if (empty($tip) === false) {
|
||||
echo json_encode(['success' => true, 'data' => $tip]);
|
||||
return;
|
||||
} else {
|
||||
echo json_encode(['success' => false]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return $tip;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -702,7 +702,7 @@ class WelcomeWindow extends Wizard
|
||||
<?php
|
||||
echo html_print_input_hidden('check_connectivity', 1);
|
||||
echo html_print_label_input_block(
|
||||
__('Ip target'),
|
||||
__('IP address target'),
|
||||
html_print_input_text(
|
||||
'ip_target',
|
||||
'',
|
||||
@ -717,7 +717,7 @@ class WelcomeWindow extends Wizard
|
||||
)
|
||||
);
|
||||
echo html_print_label_input_block(
|
||||
__('Agent name'),
|
||||
__('Agent alias'),
|
||||
html_print_input_text(
|
||||
'agent_name',
|
||||
'',
|
||||
@ -732,7 +732,7 @@ class WelcomeWindow extends Wizard
|
||||
)
|
||||
);
|
||||
echo html_print_label_input_block(
|
||||
__('Module group'),
|
||||
__('Agent group'),
|
||||
html_print_select_from_sql(
|
||||
'SELECT * FROM tgrupo ORDER BY nombre',
|
||||
'id_group',
|
||||
@ -747,7 +747,6 @@ class WelcomeWindow extends Wizard
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
echo html_print_submit_button(__('Create'), 'create_conectivity', false, ['icon' => 'next', 'style' => 'margin-top:15px; float:right;']);
|
||||
?>
|
||||
</div>
|
||||
@ -1263,14 +1262,18 @@ class WelcomeWindow extends Wizard
|
||||
});
|
||||
});
|
||||
|
||||
$('#button-create_conectivity').click(function(){
|
||||
$('#button-create_conectivity').click(function(e){
|
||||
if($("#text-ip_target")[0].checkValidity() == false) {
|
||||
$("#text-ip_target")[0].reportValidity();
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: "include/ajax/task_to_perform.php",
|
||||
data: {
|
||||
check_connectivity: 1,
|
||||
id_group: $('#id_group :selected').val(),
|
||||
id_group: $('#id_group1 option:selected').val(),
|
||||
ip_target: $('#text-ip_target').val(),
|
||||
agent_name: $('#text-agent_name').val(),
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC231107';
|
||||
$build_version = 'PC231127';
|
||||
$pandora_version = 'v7.0NG.774';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -45,6 +45,7 @@ define('EVENT_NEW', 0);
|
||||
define('EVENT_VALIDATE', 1);
|
||||
define('EVENT_PROCESS', 2);
|
||||
define('EVENT_NO_VALIDATED', 3);
|
||||
define('EVENT_NO_PROCESS', 4);
|
||||
|
||||
// Events group by constants.
|
||||
define('EVENT_GROUP_REP_ALL', 0);
|
||||
|
@ -4845,6 +4845,48 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
||||
$data[1] = $time_elapsed;
|
||||
$table_contact->data[] = $data;
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
// SecurityMon line.
|
||||
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
[
|
||||
'id_agente' => $agent['id_agente'],
|
||||
'id_module_group' => $id_module_group,
|
||||
]
|
||||
);
|
||||
|
||||
if (is_array($modules) === true && count($modules) > 0) {
|
||||
$secmon_status = secmon_status($agent['id_agente']);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('SecurityMon').'</b>';
|
||||
$data[1] = ui_print_status_secmon_div($secmon_status, __('Total security modules: %s', count($modules)));
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Hardening line.
|
||||
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
|
||||
$hardening = '';
|
||||
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
|
||||
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
|
||||
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Hardening').'</b>';
|
||||
$data[1] = $hardening.' %';
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Vulnerabilities line.
|
||||
$vuls = get_vulnerabilities($agent['id_agente']);
|
||||
if (is_array($vuls) === true && count($vuls) > 0) {
|
||||
$score = get_score($vuls);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Vulnerability').'</b>';
|
||||
$data[1] = ui_print_status_vulnerability_div($score);
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
$agent_contact = html_print_div(
|
||||
[
|
||||
'class' => 'agent_details_header',
|
||||
|
@ -22,7 +22,7 @@ require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
|
||||
|
||||
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0)
|
||||
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0, $only_enabled=false)
|
||||
{
|
||||
$sql = '';
|
||||
$alerts = [];
|
||||
@ -121,6 +121,10 @@ function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby
|
||||
// Only enabled agent.
|
||||
$sql .= ' AND t3.disabled = 0';
|
||||
|
||||
if ($only_enabled === true) {
|
||||
$sql .= ' AND t0.disabled = 0';
|
||||
}
|
||||
|
||||
$row_alerts = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($total) {
|
||||
|
@ -12952,7 +12952,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
||||
$values = [];
|
||||
|
||||
if ($other['data'][0] != '') {
|
||||
$values['event'] = $other['data'][0];
|
||||
$values['event'] = io_safe_input(io_safe_output($other['data'][0]));
|
||||
} else {
|
||||
returnError('Event text required.');
|
||||
return;
|
||||
|
@ -487,6 +487,10 @@ function config_update_config()
|
||||
$error_update[] = __('Legacy database HA');
|
||||
}
|
||||
|
||||
if (config_update_value('agent_vulnerabilities', get_parameter('agent_vulnerabilities'), true) === false) {
|
||||
$error_update[] = __('agent_vulnerabilities');
|
||||
}
|
||||
|
||||
if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) {
|
||||
$error_update[] = __('Ipam Ocuppied Manager Critical');
|
||||
}
|
||||
@ -1568,6 +1572,10 @@ function config_update_config()
|
||||
$error_update[] = __('Use data multiplier');
|
||||
}
|
||||
|
||||
if (config_update_value('disable_general_statistics', get_parameter('disable_general_statistics', 0), true) === false) {
|
||||
$error_update[] = __('Hide general stats for non admin users in tactical view');
|
||||
}
|
||||
|
||||
if (config_update_value('decimal_separator', (string) get_parameter('decimal_separator', '.'), true) === false) {
|
||||
$error_update[] = __('Decimal separator');
|
||||
} else {
|
||||
@ -2441,6 +2449,10 @@ function config_process_config()
|
||||
config_update_value('show_experimental_features', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_vulnerabilities'])) {
|
||||
config_update_value('agent_vulnerabilities', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['console_log_enabled'])) {
|
||||
config_update_value('console_log_enabled', 0);
|
||||
}
|
||||
@ -3703,6 +3715,10 @@ function config_process_config()
|
||||
config_update_value('use_data_multiplier', '1');
|
||||
}
|
||||
|
||||
if (!isset($config['disable_general_statistics'])) {
|
||||
config_update_value('disable_general_statistics', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['command_snapshot'])) {
|
||||
config_update_value('command_snapshot', 1);
|
||||
}
|
||||
|
@ -982,6 +982,9 @@ function events_get_all(
|
||||
|
||||
case EVENT_NO_VALIDATED:
|
||||
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_PROCESS);
|
||||
|
||||
case EVENT_NO_PROCESS:
|
||||
$filter['status'][$key] = (EVENT_NEW.', '.EVENT_VALIDATE);
|
||||
default:
|
||||
// Ignore.
|
||||
break;
|
||||
@ -1027,6 +1030,24 @@ function events_get_all(
|
||||
$validatedState
|
||||
);
|
||||
break;
|
||||
|
||||
case EVENT_NO_PROCESS:
|
||||
// Show comments in validated events.
|
||||
$validatedState = '';
|
||||
if ($validatedEvents === true) {
|
||||
$validatedState = sprintf(
|
||||
'OR estado = %d',
|
||||
EVENT_VALIDATE
|
||||
);
|
||||
}
|
||||
|
||||
$sql_filters[] = sprintf(
|
||||
' AND (estado = %d OR estado = %d %s)',
|
||||
EVENT_NEW,
|
||||
EVENT_VALIDATE,
|
||||
$validatedState
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3204,12 +3225,14 @@ function events_get_all_status($report=false)
|
||||
$fields[1] = __('Only validated');
|
||||
$fields[2] = __('Only in process');
|
||||
$fields[3] = __('Only not validated');
|
||||
$fields[4] = __('Only not in process');
|
||||
} else {
|
||||
$fields[-1] = __('All event');
|
||||
$fields[0] = __('New');
|
||||
$fields[1] = __('Validated');
|
||||
$fields[2] = __('In process');
|
||||
$fields[3] = __('Not Validated');
|
||||
$fields[4] = __('Not in process');
|
||||
}
|
||||
|
||||
return $fields;
|
||||
@ -4039,7 +4062,13 @@ function events_get_response_target(
|
||||
if (empty($event['custom_data']) === false) {
|
||||
$custom_data = json_decode($event['custom_data']);
|
||||
foreach ($custom_data as $key => $value) {
|
||||
$target = str_replace('_customdata_'.$key.'_', $value, $target);
|
||||
if (is_array($value) === true) {
|
||||
foreach ($value as $k => $v) {
|
||||
$target = str_replace('_customdata_'.$k.'_', $v, $target);
|
||||
}
|
||||
} else {
|
||||
$target = str_replace('_customdata_'.$key.'_', $value, $target);
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($target, '_customdata_json_') !== false) {
|
||||
@ -5993,17 +6022,47 @@ function get_count_event_criticity(
|
||||
$type = 'AND event_type = "'.$eventType.'"';
|
||||
}
|
||||
|
||||
$groups = ' ';
|
||||
$groups = ' ';
|
||||
if ((int) $groupId !== 0) {
|
||||
$groups = 'AND id_grupo IN ('.$groupId.')';
|
||||
}
|
||||
|
||||
$status = ' ';
|
||||
if ((int) $eventStatus !== -1) {
|
||||
$status = 'AND estado = '.$eventStatus;
|
||||
$status = ' ';
|
||||
if (empty($eventStatus) === false) {
|
||||
switch ($eventStatus) {
|
||||
case EVENT_ALL:
|
||||
default:
|
||||
// Do not filter.
|
||||
break;
|
||||
|
||||
case EVENT_NEW:
|
||||
case EVENT_VALIDATE:
|
||||
case EVENT_PROCESS:
|
||||
$status = sprintf(
|
||||
' AND estado = %d',
|
||||
$eventStatus
|
||||
);
|
||||
break;
|
||||
|
||||
case EVENT_NO_VALIDATED:
|
||||
$status = sprintf(
|
||||
' AND (estado = %d OR estado = %d)',
|
||||
EVENT_NEW,
|
||||
EVENT_PROCESS
|
||||
);
|
||||
break;
|
||||
|
||||
case EVENT_NO_PROCESS:
|
||||
$status = sprintf(
|
||||
' AND (estado = %d OR estado = %d)',
|
||||
EVENT_NEW,
|
||||
EVENT_VALIDATE
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$criticity = ' ';
|
||||
$criticity = ' ';
|
||||
if (empty($criticityId) === false) {
|
||||
$criticity = 'AND criticity IN ('.$criticityId.')';
|
||||
}
|
||||
@ -6199,3 +6258,144 @@ function event_get_counter_extraId(array $event, ?array $filters)
|
||||
|
||||
return $counters;
|
||||
}
|
||||
|
||||
|
||||
function event_print_graph(
|
||||
$filter,
|
||||
$graph_height=100,
|
||||
) {
|
||||
global $config;
|
||||
$show_all_data = false;
|
||||
$events = events_get_all(['te.id_evento', 'te.timestamp', 'te.utimestamp'], $filter, null, null, 'te.utimestamp', true);
|
||||
|
||||
if (empty($filter['date_from']) === false
|
||||
&& empty($filter['time_from']) === false
|
||||
&& empty($filter['date_to']) === false
|
||||
&& empty($filter['time_to']) === false
|
||||
) {
|
||||
$start_utimestamp = strtotime($filter['date_from'].' '.$filter['time_from']);
|
||||
$end_utimestamp = strtotime($filter['date_to'].' '.$filter['time_to']);
|
||||
} else if ($filter['event_view_hr'] !== '') {
|
||||
$start_utimestamp = strtotime('-'.$filter['event_view_hr'].' hours');
|
||||
$end_utimestamp = strtotime('now');
|
||||
} else {
|
||||
$show_all_data = true;
|
||||
$start_utimestamp = $events[0]['utimestamp'];
|
||||
$end_utimestamp = $events[array_key_last($events)]['utimestamp'];
|
||||
}
|
||||
|
||||
$data_events = [];
|
||||
$control_timestamp = $start_utimestamp;
|
||||
$count = 0;
|
||||
foreach ($events as $event) {
|
||||
if ($event['utimestamp'] === $control_timestamp) {
|
||||
$count++;
|
||||
} else {
|
||||
$control_timestamp = $event['utimestamp'];
|
||||
$count = 1;
|
||||
}
|
||||
|
||||
$data_events[$control_timestamp] = $count;
|
||||
}
|
||||
|
||||
$num_data = count($data_events);
|
||||
|
||||
$num_intervals = $num_data;
|
||||
|
||||
$period = ($end_utimestamp - $start_utimestamp);
|
||||
|
||||
if ($period <= SECONDS_6HOURS) {
|
||||
$chart_time_format = 'H:i:s';
|
||||
} else if ($period < SECONDS_1DAY) {
|
||||
$chart_time_format = 'H:i';
|
||||
} else if ($period < SECONDS_15DAYS) {
|
||||
$chart_time_format = 'M d H:i';
|
||||
} else if ($period < SECONDS_1MONTH) {
|
||||
$chart_time_format = 'M d H\h';
|
||||
} else {
|
||||
$chart_time_format = 'M d H\h';
|
||||
}
|
||||
|
||||
$chart = [];
|
||||
$labels = [];
|
||||
$color = [];
|
||||
$count = 0;
|
||||
|
||||
if ($show_all_data === true) {
|
||||
foreach ($events as $event) {
|
||||
if ($event['utimestamp'] === $control_timestamp) {
|
||||
$count++;
|
||||
} else {
|
||||
$control_timestamp = $event['utimestamp'];
|
||||
$count = 1;
|
||||
}
|
||||
|
||||
$data_events[$control_timestamp] = $count;
|
||||
}
|
||||
|
||||
$data_events = array_reverse($data_events, true);
|
||||
|
||||
foreach ($data_events as $utimestamp => $count) {
|
||||
$labels[] = date($chart_time_format, $utimestamp);
|
||||
$chart[] = [
|
||||
'y' => $count,
|
||||
'x' => date($chart_time_format, $utimestamp),
|
||||
];
|
||||
$color[] = '#82b92f';
|
||||
}
|
||||
} else {
|
||||
$interval_length = (int) ($period / $num_intervals);
|
||||
$intervals = [];
|
||||
$intervals[0] = $start_utimestamp;
|
||||
for ($i = 0; $i < $num_intervals; $i++) {
|
||||
$intervals[($i + 1)] = ($intervals[$i] + $interval_length);
|
||||
}
|
||||
|
||||
$control_data = [];
|
||||
|
||||
foreach ($data_events as $utimestamp => $count_event) {
|
||||
for ($i = 0; $i < $num_intervals; $i++) {
|
||||
if ((int) $utimestamp > (int) $intervals[$i] && (int) $utimestamp < (int) $intervals[($i + 1)]) {
|
||||
$control_data[(string) $intervals[$i]] += $count_event;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $num_intervals; $i++) {
|
||||
$labels[] = date($chart_time_format, $intervals[$i]);
|
||||
$chart[] = [
|
||||
'y' => $control_data[$intervals[$i]],
|
||||
'x' => date($chart_time_format, $intervals[$i]),
|
||||
];
|
||||
$color[] = '#82b92f';
|
||||
}
|
||||
}
|
||||
|
||||
$water_mark = [
|
||||
'file' => $config['homedir'].'/images/logo_vertical_water.png',
|
||||
'url' => ui_get_full_url('/images/logo_vertical_water.png'),
|
||||
];
|
||||
|
||||
$options = [
|
||||
'height' => $graph_height,
|
||||
'waterMark' => $water_mark,
|
||||
'legend' => ['display' => false],
|
||||
'colors' => $color,
|
||||
'border' => false,
|
||||
'scales' => [
|
||||
'x' => [
|
||||
'grid' => ['display' => false],
|
||||
],
|
||||
'y' => [
|
||||
'grid' => ['display' => false],
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
];
|
||||
|
||||
$graph = '<div style="width:100%; height: '.$graph_height.'px;">';
|
||||
$graph .= vbar_graph($chart, $options);
|
||||
$graph .= '</div>';
|
||||
|
||||
return $graph;
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use Models\VisualConsole\Items\Percentile;
|
||||
|
||||
require_once $config['homedir'].'/include/graphs/fgraph.php';
|
||||
require_once $config['homedir'].'/include/functions_reporting.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
@ -2686,7 +2688,9 @@ function graph_agent_status(
|
||||
$return=false,
|
||||
$show_not_init=false,
|
||||
$data_agents=false,
|
||||
$donut_narrow_graph=false
|
||||
$donut_narrow_graph=false,
|
||||
$onClick='',
|
||||
$data_in_percentage=false,
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -2766,6 +2770,25 @@ function graph_agent_status(
|
||||
'labels' => array_keys($data),
|
||||
];
|
||||
|
||||
if (empty($onClick) === false) {
|
||||
$options['onClick'] = $onClick;
|
||||
}
|
||||
|
||||
if ($data_in_percentage === true) {
|
||||
$percentages = [];
|
||||
$total = array_sum($data);
|
||||
foreach ($data as $key => $value) {
|
||||
$percentage = (($value / $total) * 100);
|
||||
if ($percentage < 1 && $percentage > 0) {
|
||||
$percentage = 1;
|
||||
}
|
||||
|
||||
$percentages[$key] = format_numeric($percentage, 0);
|
||||
}
|
||||
|
||||
$data = $percentages;
|
||||
}
|
||||
|
||||
if ($donut_narrow_graph == true) {
|
||||
$out = ring_graph(
|
||||
$data,
|
||||
@ -4625,9 +4648,15 @@ function graph_nodata_image($options)
|
||||
return base64_encode($dataImg);
|
||||
}
|
||||
|
||||
$widthImage = '200px';
|
||||
$style = '';
|
||||
if (isset($options['nodata_image']['width']) === true) {
|
||||
$widthImage = $options['nodata_image']['width'];
|
||||
$style .= 'width: '.$options['nodata_image']['width'].'; ';
|
||||
} else {
|
||||
$style .= 'width: 200px; ';
|
||||
}
|
||||
|
||||
if (isset($options['nodata_image']['height']) === true) {
|
||||
$style .= 'height: '.$options['nodata_image']['height'].'; ';
|
||||
}
|
||||
|
||||
return html_print_image(
|
||||
@ -4635,7 +4664,7 @@ function graph_nodata_image($options)
|
||||
true,
|
||||
[
|
||||
'title' => __('No data'),
|
||||
'style' => 'width: '.$widthImage.';',
|
||||
'style' => $style,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -1745,7 +1745,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
||||
'label' => __('Agents'),
|
||||
'label_class' => 'font-title-font',
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
|
||||
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
|
||||
'name' => 'filtered-module-agents-'.$uniqId,
|
||||
'selected' => explode(',', $data['mAgents']),
|
||||
'return' => true,
|
||||
|
@ -11294,7 +11294,7 @@ function reporting_simple_graph(
|
||||
),
|
||||
'ttl' => $ttl,
|
||||
'compare' => $time_compare_overlapped,
|
||||
'show_unknown' => true,
|
||||
'show_unknown' => $content['check_unknowns_graph'],
|
||||
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
|
||||
'fullscale' => $fullscale,
|
||||
'server_id' => $id_meta,
|
||||
|
@ -665,6 +665,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'data';
|
||||
$id_modulo = 1;
|
||||
$server['name'] = __('Data server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_NETWORK:
|
||||
@ -678,6 +679,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'network';
|
||||
$id_modulo = 2;
|
||||
$server['name'] = __('Network server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_SNMP:
|
||||
@ -691,6 +693,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'snmp';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('SNMP Trap server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_DISCOVERY:
|
||||
@ -704,6 +707,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'recon';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Discovery server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_PLUGIN:
|
||||
@ -717,6 +721,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'plugin';
|
||||
$id_modulo = 4;
|
||||
$server['name'] = __('Plugin server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_PREDICTION:
|
||||
@ -730,6 +735,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'prediction';
|
||||
$id_modulo = 5;
|
||||
$server['name'] = __('Prediction server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_WMI:
|
||||
@ -743,6 +749,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'wmi';
|
||||
$id_modulo = 6;
|
||||
$server['name'] = __('WMI server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_EXPORT:
|
||||
@ -756,6 +763,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'export';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Export server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_INVENTORY:
|
||||
@ -769,6 +777,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'inventory';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Inventory server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_WEB:
|
||||
@ -782,6 +791,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'web';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Web server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_EVENT:
|
||||
@ -795,6 +805,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'event';
|
||||
$id_modulo = 2;
|
||||
$server['name'] = __('Event server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_CORRELATION:
|
||||
@ -808,6 +819,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'correlation';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Correlation server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_ENTERPRISE_ICMP:
|
||||
@ -821,6 +833,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'enterprise icmp';
|
||||
$id_modulo = 2;
|
||||
$server['name'] = __('Enterprise ICMP server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_ENTERPRISE_SNMP:
|
||||
@ -834,6 +847,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'enterprise snmp';
|
||||
$id_modulo = 2;
|
||||
$server['name'] = __('Enterprise SNMP server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_ENTERPRISE_SATELLITE:
|
||||
@ -847,6 +861,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'enterprise satellite';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Enterprise Satellite server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_ENTERPRISE_TRANSACTIONAL:
|
||||
@ -860,6 +875,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'enterprise transactional';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Enterprise Transactional server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_MAINFRAME:
|
||||
@ -873,6 +889,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'mainframe';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Mainframe server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_SYNC:
|
||||
@ -886,6 +903,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'sync';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Sync server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_WUX:
|
||||
@ -899,6 +917,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'wux';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Wux server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_SYSLOG:
|
||||
@ -912,6 +931,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'syslog';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Syslog server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_NCM:
|
||||
@ -925,6 +945,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'ncm';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('NCM server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_AUTOPROVISION:
|
||||
@ -938,6 +959,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'autoprovision';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Autoprovision server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_MIGRATION:
|
||||
@ -951,6 +973,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'migration';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Migration server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_ALERT:
|
||||
@ -964,6 +987,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'alert';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Alert server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_NETFLOW:
|
||||
@ -977,6 +1001,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'netflow';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Netflow server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_LOG:
|
||||
@ -990,6 +1015,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'log';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('Log server');
|
||||
break;
|
||||
|
||||
case SERVER_TYPE_MADE:
|
||||
@ -1003,6 +1029,7 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
|
||||
);
|
||||
$server['type'] = 'made';
|
||||
$id_modulo = 0;
|
||||
$server['name'] = __('MADE server');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -792,7 +792,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'white-box-content mrgn_top_0 mrgn_btn_0px',
|
||||
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px',
|
||||
'white_table_flex'
|
||||
);
|
||||
|
||||
@ -812,7 +812,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
|
||||
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px border-bottom-gray',
|
||||
'white_table_flex'
|
||||
);
|
||||
}
|
||||
@ -987,7 +987,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
||||
true,
|
||||
empty($table_advanced->data),
|
||||
'',
|
||||
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
|
||||
'white-box-content-no-height mrgn_top_0 mrgn_btn_0px border-bottom-gray',
|
||||
'white_table_flex'
|
||||
);
|
||||
|
||||
|
@ -8230,3 +8230,43 @@ function ui_update_name_fav_element($id_element, $section, $label)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function ui_print_status_vulnerability_div(float $score)
|
||||
{
|
||||
$return = '';
|
||||
$class = 'status_rounded_rectangles forced_title';
|
||||
if (((float) $score) <= 5) {
|
||||
return ui_print_div('group_view_ok '.$class, $score);
|
||||
}
|
||||
|
||||
if (((float) $score) > 5 && ((float) $score) <= 7.5) {
|
||||
return ui_print_div('group_view_warn '.$class, $score);
|
||||
}
|
||||
|
||||
if (((float) $score) > 7.5) {
|
||||
return ui_print_div('group_view_crit '.$class, $score);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
function ui_print_status_secmon_div($status, $title=false)
|
||||
{
|
||||
$class = 'status_rounded_rectangles forced_title';
|
||||
if (($status) === 'normal') {
|
||||
$title = ($title === false) ? __('normal') : $title;
|
||||
return ui_print_div('group_view_ok '.$class, $title);
|
||||
}
|
||||
|
||||
if (($status) === 'warning') {
|
||||
$title = ($title === false) ? __('warning') : $title;
|
||||
return ui_print_div('group_view_warn '.$class, $title);
|
||||
}
|
||||
|
||||
if (($status) === 'critical') {
|
||||
$title = ($title === false) ? __('critical') : $title;
|
||||
return ui_print_div('group_view_crit '.$class, $title);
|
||||
}
|
||||
}
|
@ -669,6 +669,12 @@ function get_build_setup_charts($type, $options, $data)
|
||||
|
||||
$chart->setId($id);
|
||||
|
||||
if (isset($options['onClick']) === true
|
||||
&& empty($options['onClick']) === false
|
||||
) {
|
||||
$chart->options()->setOnClick($options['onClick']);
|
||||
}
|
||||
|
||||
// Height is null maximum possible.
|
||||
if (isset($options['height']) === true
|
||||
&& empty($options['height']) === false
|
||||
@ -1019,6 +1025,7 @@ function get_build_setup_charts($type, $options, $data)
|
||||
$chart->setCircumference($options['circumference']);
|
||||
}
|
||||
|
||||
$stacked = false;
|
||||
if (isset($options['scales']) === true
|
||||
&& empty($options['scales']) === false
|
||||
&& is_array($options['scales']) === true
|
||||
@ -1082,6 +1089,13 @@ function get_build_setup_charts($type, $options, $data)
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['scales']['x']['stacked']) === true
|
||||
&& empty($options['scales']['x']['stacked']) === false
|
||||
) {
|
||||
$scales->getX()->setStacked($options['scales']['x']['stacked']);
|
||||
$stacked = true;
|
||||
}
|
||||
|
||||
if (isset($options['scales']['x']['ticks']) === true
|
||||
&& empty($options['scales']['x']['ticks']) === false
|
||||
&& is_array($options['scales']['x']['ticks']) === true
|
||||
@ -1131,6 +1145,13 @@ function get_build_setup_charts($type, $options, $data)
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($options['scales']['y']['stacked']) === true
|
||||
&& empty($options['scales']['y']['stacked']) === false
|
||||
) {
|
||||
$scales->getY()->setStacked($options['scales']['y']['stacked']);
|
||||
$stacked = true;
|
||||
}
|
||||
|
||||
if (isset($options['scales']['y']['ticks']) === true
|
||||
&& empty($options['scales']['y']['ticks']) === false
|
||||
&& is_array($options['scales']['y']['ticks']) === true
|
||||
@ -1207,6 +1228,12 @@ function get_build_setup_charts($type, $options, $data)
|
||||
) {
|
||||
$colors = $options['colors'];
|
||||
$borders = $options['colors'];
|
||||
if (isset($options['border']) === true && (bool) $options['border'] === false) {
|
||||
$borders = [];
|
||||
foreach ($colors as $color) {
|
||||
$borders[] = 'rgba(0, 0, 0, 0)';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Colors.
|
||||
$defaultColor = [];
|
||||
@ -1247,11 +1274,37 @@ function get_build_setup_charts($type, $options, $data)
|
||||
break;
|
||||
|
||||
case 'BAR':
|
||||
$setData->setLabel('data')->setBackgroundColor($colors);
|
||||
$setData->setLabel('data')->setBorderColor($borders);
|
||||
$setData->setLabel('data')->setBorderWidth(2);
|
||||
|
||||
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
|
||||
if (isset($options['multiple']) === true && empty($options['multiple']) === false) {
|
||||
$i = 0;
|
||||
foreach ($options['multiple'] as $key_label => $label) {
|
||||
$dataSet = $chart->createDataSet();
|
||||
$dataSet->setLabel($label);
|
||||
$dataSet->setBackgroundColor($colors[$i]);
|
||||
$dataSet->setBorderColor($borders[$i]);
|
||||
$dataSet->setBorderWidth(2);
|
||||
$dataSet->data()->exchangeArray(array_values($data[$key_label]));
|
||||
$chart->addDataSet($dataSet);
|
||||
$i++;
|
||||
}
|
||||
} else if ($chart->options()->getScales()->getX()->isStacked() === true) {
|
||||
$i = 0;
|
||||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setBackgroundColor($colors[$i]);
|
||||
$dataSet1->setBorderColor($borders[$i]);
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBorderWidth(2);
|
||||
$dataSet1->data()->exchangeArray($dataset['data']);
|
||||
$dataSet1->setStack($dataset['stack']);
|
||||
$chart->addDataSet($dataSet1);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$setData->setLabel('data')->setBackgroundColor($colors);
|
||||
$setData->setLabel('data')->setBorderColor($borders);
|
||||
$setData->setLabel('data')->setBorderWidth(2);
|
||||
$setData->setLabel('data')->data()->exchangeArray(array_values($data));
|
||||
}
|
||||
|
||||
// Para las horizontales.
|
||||
if (isset($options['axis']) === true
|
||||
@ -1266,6 +1319,7 @@ function get_build_setup_charts($type, $options, $data)
|
||||
foreach ($data as $key => $dataset) {
|
||||
$dataSet1 = $chart->createDataSet();
|
||||
$dataSet1->setBackgroundColor($dataset['backgroundColor']);
|
||||
$dataSet1->setLabel($dataset['label']);
|
||||
$dataSet1->setBorderColor($dataset['borderColor']);
|
||||
$dataSet1->setPointBackgroundColor($dataset['pointBackgroundColor']);
|
||||
$dataSet1->setPointBorderColor($dataset['pointBorderColor']);
|
||||
@ -1298,7 +1352,11 @@ function get_build_setup_charts($type, $options, $data)
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type !== 'RADAR' && $type !== 'LINE') {
|
||||
if ($type !== 'RADAR'
|
||||
&& $type !== 'LINE'
|
||||
&& $stacked === false
|
||||
&& (isset($options['multiple']) === false || empty($options['multiple']) === true)
|
||||
) {
|
||||
$chart->addDataSet($setData);
|
||||
}
|
||||
|
||||
|
@ -2223,6 +2223,9 @@ function pandoraFlotArea(
|
||||
}
|
||||
|
||||
var dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
|
||||
if (dataInSelection < 35000) {
|
||||
return;
|
||||
}
|
||||
|
||||
var maxticks_zoom = dataInSelection / 3600000 / number_ticks;
|
||||
if (maxticks_zoom < 0.001) {
|
||||
|
@ -73,8 +73,40 @@ $(document).ready(function() {
|
||||
$("#heatmap-title").html($(title).html());
|
||||
}
|
||||
});
|
||||
rescaling();
|
||||
|
||||
$(window).on("resize", function() {
|
||||
rescaling();
|
||||
});
|
||||
});
|
||||
|
||||
function showLabel(element, event, label) {
|
||||
$(".label_heatmap").remove();
|
||||
const tooltip = $(document.createElement("div"));
|
||||
tooltip.html(label);
|
||||
tooltip.attr("class", "label_heatmap");
|
||||
$("#heatmap-group").append(tooltip);
|
||||
var x = event.clientX;
|
||||
var y = event.clientY;
|
||||
tooltip.attr(
|
||||
"style",
|
||||
"position: fixed; top:" + (y + 15) + "px; left:" + (x + 20) + "px;"
|
||||
);
|
||||
}
|
||||
|
||||
function hideLabel() {
|
||||
$(".label_heatmap").remove();
|
||||
}
|
||||
|
||||
function rescaling() {
|
||||
if (window.innerWidth < 1300) {
|
||||
$(".trigger-100").attr("style", "width: 100%;");
|
||||
$(".trigger-100").addClass("br-b");
|
||||
} else {
|
||||
$(".trigger-100").removeAttr("style");
|
||||
$(".trigger-100").removeClass("br-b");
|
||||
}
|
||||
}
|
||||
function autoRefresh(interval, id, method, php_class) {
|
||||
setInterval(() => {
|
||||
$.ajax({
|
||||
@ -92,3 +124,114 @@ function autoRefresh(interval, id, method, php_class) {
|
||||
});
|
||||
}, interval);
|
||||
}
|
||||
|
||||
function redirectStatus(e, element) {
|
||||
if (element.length > 0) {
|
||||
switch (e.chart.legend.legendItems[element[0].index].text) {
|
||||
case "Critical":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=1&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
|
||||
case "Warning":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=2&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
|
||||
case "Unknown":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=3&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
|
||||
case "Not init":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=5&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
|
||||
case "Normal":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=0&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/status_monitor&refr=0&ag_group=0&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=-1&sort_field=&sort=none&pure=`
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function redirectHeatmap(view, id, id_agente = 0) {
|
||||
switch (view) {
|
||||
case "group":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=godmode/groups/tactical&id_group=${id}`
|
||||
);
|
||||
break;
|
||||
|
||||
case "agent":
|
||||
window.location.assign(
|
||||
`index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=${id}`
|
||||
);
|
||||
break;
|
||||
|
||||
case "module":
|
||||
if (id_agente > 0) {
|
||||
window.location.assign(
|
||||
`index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=${id_agente}&tab=module&id_agent_module=${id}&edit_module=1`
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function redirectAgentStatus(e, element) {
|
||||
if (element.length > 0) {
|
||||
switch (e.chart.legend.legendItems[element[0].index].text) {
|
||||
case "No monitors":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente`
|
||||
);
|
||||
break;
|
||||
|
||||
case "CRITICAL":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente&status=1`
|
||||
);
|
||||
break;
|
||||
|
||||
case "WARNING":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente&status=2`
|
||||
);
|
||||
break;
|
||||
|
||||
case "UKNOWN":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente&status=3`
|
||||
);
|
||||
break;
|
||||
|
||||
case "NORMAL":
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente&status=0`
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
window.location.assign(
|
||||
`index.php?sec=view&sec2=operation/agentes/estado_agente`
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1461,7 +1461,8 @@ function defineTinyMCE(selector) {
|
||||
{ text: "C#", value: "csharp" },
|
||||
{ text: "C++", value: "cpp" }
|
||||
],
|
||||
toolbar: defaultToolbar
|
||||
toolbar: defaultToolbar,
|
||||
relative_urls: false
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -500,16 +500,25 @@ function configure_modules_form() {
|
||||
"checked",
|
||||
data["critical_inverse"]
|
||||
);
|
||||
$("#checkbox-warning_inverse").prop("checked", data["warning_inverse"]);
|
||||
$("#checkbox-percentage_warning").prop(
|
||||
"uncheck",
|
||||
data["percentage_warning"]
|
||||
);
|
||||
$("#checkbox-percentage_critical").prop(
|
||||
"uncheck",
|
||||
data["percentage_critical"]
|
||||
);
|
||||
|
||||
$("#label-radius-normal_warning").trigger("click");
|
||||
$("#label-radius-normal_critical").trigger("click");
|
||||
|
||||
if (data["warning_inverse"] == true) {
|
||||
$("#label-radius-warning_inverse").trigger("click");
|
||||
}
|
||||
|
||||
if (data["critical_inverse"] == true) {
|
||||
$("#label-radius-critical_inverse").trigger("click");
|
||||
}
|
||||
|
||||
if (data["percentage_warning"] == true) {
|
||||
$("#label-radius-percentage_warning").trigger("click");
|
||||
}
|
||||
|
||||
if (data["percentage_critical"] == true) {
|
||||
$("#label-radius-percentage_critical").trigger("click");
|
||||
}
|
||||
$("#component_loading").hide();
|
||||
$("#id_module_type").change();
|
||||
if ($("#id_category").is("select")) {
|
||||
|
@ -81,14 +81,17 @@ function removeInputImage(e) {
|
||||
$("#notices_images").addClass("invisible");
|
||||
}
|
||||
}
|
||||
function render({ title, text, url, files }) {
|
||||
function render({ title, text, url, files, method }) {
|
||||
$("#title_tip").html(title);
|
||||
$("#text_tip").html(text);
|
||||
if (url) {
|
||||
$("#url_tip").removeClass("invisible");
|
||||
$("#button-learn_more").removeAttr("disabled");
|
||||
$("#button-learn_more").removeClass("disabled_button");
|
||||
$("#url_tip").attr("href", url);
|
||||
} else {
|
||||
$("#url_tip").addClass("invisible");
|
||||
$("#button-learn_more").attr("disabled", "disabled");
|
||||
$("#button-learn_more").addClass("disabled_button");
|
||||
$("#url_tip").attr("href", "");
|
||||
}
|
||||
|
||||
$(".carousel").empty();
|
||||
@ -110,7 +113,11 @@ function render({ title, text, url, files }) {
|
||||
if (index >= limitRound - 1) {
|
||||
$($(".count-round-tip")[0]).addClass("active");
|
||||
} else {
|
||||
$($(".count-round-tip")[index + 1]).addClass("active");
|
||||
if (method == "next") {
|
||||
$($(".count-round-tip")[index + 1]).addClass("active");
|
||||
} else {
|
||||
$($(".count-round-tip")[index - 1]).addClass("active");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -147,23 +154,79 @@ function render_counter() {
|
||||
function next_tip() {
|
||||
if (idTips.length >= totalTips) {
|
||||
idTips = [];
|
||||
$("#hidden-tip_position").val(-1);
|
||||
}
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: page,
|
||||
method: "getRandomTip",
|
||||
exclude: JSON.stringify(idTips)
|
||||
},
|
||||
success: function({ success, data }) {
|
||||
if (success) {
|
||||
idTips.push(parseInt(data.id));
|
||||
render(data);
|
||||
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
|
||||
let idTip = idTips[tip_position];
|
||||
if (idTip === undefined) {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: page,
|
||||
method: "getRandomTip",
|
||||
exclude: JSON.stringify(idTips)
|
||||
},
|
||||
success: function({ success, data }) {
|
||||
if (success) {
|
||||
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
|
||||
$("#hidden-tip_position").val(tip_position);
|
||||
idTips.push(parseInt(data.id));
|
||||
data.method = "next";
|
||||
render(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: page,
|
||||
method: "getTipById",
|
||||
idTip: idTip,
|
||||
return: true
|
||||
},
|
||||
success: function({ success, data }) {
|
||||
if (success) {
|
||||
let tip_position = parseInt($("#hidden-tip_position").val()) + 1;
|
||||
$("#hidden-tip_position").val(tip_position);
|
||||
data.method = "next";
|
||||
render(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function previous_tip() {
|
||||
let actual_tip_position = parseInt($("#hidden-tip_position").val());
|
||||
|
||||
if (actual_tip_position != 0) {
|
||||
let tip_position = parseInt($("#hidden-tip_position").val()) - 1;
|
||||
let idTip = idTips[tip_position];
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: page,
|
||||
method: "getTipById",
|
||||
idTip: idTip,
|
||||
return: true
|
||||
},
|
||||
success: function({ success, data }) {
|
||||
if (success) {
|
||||
let tip_position = parseInt($("#hidden-tip_position").val()) - 1;
|
||||
$("#hidden-tip_position").val(tip_position);
|
||||
data.method = "prev";
|
||||
render(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function load_tips_modal(settings) {
|
||||
|
@ -620,9 +620,16 @@ class ClusterManager
|
||||
if (empty($tmp->group) === true) {
|
||||
$tmp->group = __('Not set');
|
||||
} else {
|
||||
// Html div part for csv export.
|
||||
$tmp->group = ui_print_group_icon(
|
||||
$tmp->group,
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'content' => groups_get_name($tmp->group),
|
||||
'class' => 'invisible',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -636,9 +643,16 @@ class ClusterManager
|
||||
}
|
||||
|
||||
// Status.
|
||||
// Html div part for csv export.
|
||||
$tmp->known_status = ui_print_module_status(
|
||||
$tmp->known_status,
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'content' => $tmp->known_status,
|
||||
'class' => 'invisible',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Options. View.
|
||||
|
@ -296,11 +296,7 @@ class EventCardboard extends Widget
|
||||
];
|
||||
|
||||
// Event status.
|
||||
$fields = [
|
||||
-1 => __('All event'),
|
||||
1 => __('Only validated'),
|
||||
0 => __('Only pending'),
|
||||
];
|
||||
$fields = events_get_all_status(true);
|
||||
|
||||
$inputs['inputs']['row1'][] = [
|
||||
'label' => __('Event status'),
|
||||
|
@ -396,6 +396,7 @@ class EventsListWidget extends Widget
|
||||
0 => \__('Only pending'),
|
||||
2 => \__('Only in process'),
|
||||
3 => \__('Only not validated'),
|
||||
4 => \__('Only not in process'),
|
||||
];
|
||||
|
||||
$inputs['inputs']['row1'][] = [
|
||||
|
@ -134,6 +134,9 @@ class SecurityHardening extends Widget
|
||||
|
||||
// Includes.
|
||||
include_once ENTERPRISE_DIR.'/include/functions_security_hardening.php';
|
||||
include_once $config['homedir'].'/include/graphs/fgraph.php';
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
// WARNING: Do not edit. This chunk must be in the constructor.
|
||||
parent::__construct(
|
||||
$cellId,
|
||||
@ -1092,7 +1095,6 @@ class SecurityHardening extends Widget
|
||||
function selectData(e){
|
||||
$(".row_input").hide();
|
||||
dataTypes_'.$id.'[e.value].forEach(element => {
|
||||
console.log(element);
|
||||
$(element).show();
|
||||
});
|
||||
}
|
||||
|
@ -79,11 +79,17 @@ class Element
|
||||
public function __construct(
|
||||
$ajax_controller='include/ajax/general_tactical_view.ajax'
|
||||
) {
|
||||
global $config;
|
||||
$this->interval = 0;
|
||||
$this->title = __('Default element');
|
||||
$this->ajaxController = $ajax_controller;
|
||||
// Without ACL.
|
||||
$agent = db_get_row('tagente', 'nombre', 'pandora.internals', '*');
|
||||
$agent_name = $config['self_monitoring_agent_name'];
|
||||
if (empty($agent_name) === true) {
|
||||
$agent_name = 'pandora.internals';
|
||||
}
|
||||
|
||||
$agent = db_get_row('tagente', 'nombre', $agent_name, '*');
|
||||
if (is_array($agent) === true) {
|
||||
$this->monitoringAgent = $agent;
|
||||
}
|
||||
|
@ -50,6 +50,22 @@ class GeneralTacticalView
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether general statistics are disabled.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function disableGeneralStatistics():bool
|
||||
{
|
||||
global $config;
|
||||
if (users_is_admin($config['id_user']) === true) {
|
||||
return false;
|
||||
} else {
|
||||
return (bool) $config['disable_general_statistics'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiate all the elements that will build the dashboard
|
||||
*
|
||||
@ -109,6 +125,7 @@ class GeneralTacticalView
|
||||
{
|
||||
$data = [];
|
||||
$data['javascript'] = $this->javascript();
|
||||
$data['disableGeneralStatistics'] = $this->disableGeneralStatistics();
|
||||
$data = array_merge($data, $this->elements);
|
||||
View::render(
|
||||
'tacticalView/view',
|
||||
|
@ -429,12 +429,29 @@ class Agents extends Element
|
||||
'cutout' => 80,
|
||||
'nodata_image' => ['width' => '80%'],
|
||||
'colors' => $colors,
|
||||
'onClick' => 'redirectAgentStatus',
|
||||
];
|
||||
|
||||
// To avoid that if a value is too small it is not seen.
|
||||
$percentages = [];
|
||||
$total = array_sum($data);
|
||||
foreach ($data as $key => $value) {
|
||||
$percentage = (($value / $total) * 100);
|
||||
if ($percentage < 1 && $percentage > 0) {
|
||||
$percentage = 1;
|
||||
}
|
||||
|
||||
$percentages[$key] = format_numeric($percentage, 0);
|
||||
}
|
||||
|
||||
$data = $percentages;
|
||||
|
||||
$pie = ring_graph($data, $options);
|
||||
$output = html_print_div(
|
||||
[
|
||||
'content' => $pie,
|
||||
'style' => 'margin: 0 auto; max-width: 80%; max-height: 220px;',
|
||||
'class' => 'clickable',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -83,7 +83,7 @@ class Alerts extends Element
|
||||
*/
|
||||
public function getActiveAlerts():string
|
||||
{
|
||||
$total = alerts_get_alerts(0, '', 'all', -1, 'AR', true);
|
||||
$total = alerts_get_alerts(0, '', 'all', -1, 'AR', true, 0, true);
|
||||
return html_print_div(
|
||||
[
|
||||
'content' => format_numeric($total, 0),
|
||||
|
@ -34,7 +34,9 @@ class Database extends Element
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
global $config;
|
||||
parent::__construct();
|
||||
include_once $config['homedir'].'/include/graphs/fgraph.php';
|
||||
$this->title = __('Database');
|
||||
$this->ajaxMethods = [
|
||||
'getStatus',
|
||||
|
@ -57,23 +57,13 @@ class Events extends Element
|
||||
{
|
||||
global $config;
|
||||
$id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
|
||||
if (in_array(0, $id_groups) === false) {
|
||||
foreach ($id_groups as $key => $id_group) {
|
||||
if ((bool) check_acl_restricted_all($config['id_user'], $id_group, 'AR') === false) {
|
||||
unset($id_groups[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (users_can_manage_group_all() === true) {
|
||||
$id_groups[] = 0;
|
||||
}
|
||||
|
||||
$id_groups = implode(',', $id_groups);
|
||||
$event_view_h = (int) ($config['event_view_hr'] > 24) ? 24 : $config['event_view_hr'];
|
||||
$time_events = ($event_view_h * 3600);
|
||||
$intervalh = (time() - $time_events);
|
||||
$sql = 'SELECT utimestamp from tevento WHERE utimestamp >= '.$intervalh.' ORDER BY utimestamp DESC;';
|
||||
$sql = 'SELECT utimestamp
|
||||
FROM tevento
|
||||
WHERE utimestamp >= '.$intervalh.' AND id_grupo IN ('.$id_groups.') ORDER BY utimestamp DESC;';
|
||||
$rows = db_process_sql($sql);
|
||||
$cut_seconds = ($time_events / 24);
|
||||
$now = (time() - 300);
|
||||
@ -377,6 +367,13 @@ class Events extends Element
|
||||
$data = [];
|
||||
$colors = [];
|
||||
foreach ($rows as $key => $row) {
|
||||
if ($row['criticity'] != EVENT_CRIT_CRITICAL
|
||||
&& $row['criticity'] != EVENT_CRIT_NORMAL
|
||||
&& $row['criticity'] != EVENT_CRIT_WARNING
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($row['criticity']) {
|
||||
case EVENT_CRIT_CRITICAL:
|
||||
$label = __('CRITICAL');
|
||||
@ -394,9 +391,7 @@ class Events extends Element
|
||||
break;
|
||||
|
||||
default:
|
||||
$colors[] = COL_UNKNOWN;
|
||||
$label = __('UNKNOWN');
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
$labels[] = $this->controlSizeText($label);
|
||||
@ -410,6 +405,21 @@ class Events extends Element
|
||||
'nodata_image' => ['width' => '100%'],
|
||||
'colors' => $colors,
|
||||
];
|
||||
|
||||
// To avoid that if a value is too small it is not seen.
|
||||
$percentages = [];
|
||||
$total = array_sum($data);
|
||||
foreach ($data as $key => $value) {
|
||||
$percentage = (($value / $total) * 100);
|
||||
if ($percentage < 1 && $percentage > 0) {
|
||||
$percentage = 1;
|
||||
}
|
||||
|
||||
$percentages[$key] = format_numeric($percentage, 0);
|
||||
}
|
||||
|
||||
$data = $percentages;
|
||||
|
||||
$pie = ring_graph($data, $options);
|
||||
$output = html_print_div(
|
||||
[
|
||||
@ -448,9 +458,10 @@ class Events extends Element
|
||||
'style' => 'width: 90%;',
|
||||
'ajax_url' => 'operation/events/events',
|
||||
'ajax_data' => [
|
||||
'get_events' => 1,
|
||||
'compact_date' => 1,
|
||||
'external_url' => 1,
|
||||
'get_events' => 1,
|
||||
'compact_date' => 1,
|
||||
'external_url' => 1,
|
||||
'compact_name_event' => 1,
|
||||
],
|
||||
'order' => [
|
||||
'field' => 'timestamp',
|
||||
|
@ -118,7 +118,6 @@ class Groups extends Element
|
||||
return graph_nodata_image(['width' => '400']);
|
||||
}
|
||||
|
||||
$groups = $modules;
|
||||
// Best square.
|
||||
$high = (float) max($width, $height);
|
||||
$low = 0.0;
|
||||
@ -147,13 +146,18 @@ class Groups extends Element
|
||||
$x = 0;
|
||||
$y = 0;
|
||||
$cont = 1;
|
||||
foreach ($groups as $key => $value) {
|
||||
foreach ($modules as $key => $value) {
|
||||
$module_id = $value['id_agente_modulo'];
|
||||
$db_status = modules_get_agentmodule_status($module_id);
|
||||
$module_status = db_get_row(
|
||||
'tagente_estado',
|
||||
'id_agente_modulo',
|
||||
$module_id,
|
||||
);
|
||||
|
||||
$module_value = modules_get_last_value($module_id);
|
||||
$status = '';
|
||||
$title = '';
|
||||
modules_get_status($module_id, $db_status, $module_value, $status, $title);
|
||||
modules_get_status($module_id, $module_status['estado'], $module_value, $status, $title);
|
||||
switch ($status) {
|
||||
case STATUS_MODULE_NO_DATA:
|
||||
// Not init status.
|
||||
@ -183,10 +187,16 @@ class Groups extends Element
|
||||
break;
|
||||
}
|
||||
|
||||
$redirect = '';
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
$redirect = 'onclick="redirectHeatmap(\'module\', '.$module_id.', '.$value['id_agente'].')"';
|
||||
}
|
||||
|
||||
$heatmap .= sprintf(
|
||||
'<rect id="%s" x="%s" style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'<rect id="%s" x="%s" onmousemove="showLabel(this, event, \'%s\')" onmouseleave="hideLabel()" '.$redirect.' style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'rect_'.$cont,
|
||||
$x,
|
||||
$value['nombre'],
|
||||
$y,
|
||||
$row,
|
||||
$column,
|
||||
@ -350,9 +360,10 @@ class Groups extends Element
|
||||
}
|
||||
|
||||
$heatmap .= sprintf(
|
||||
'<rect id="%s" x="%s" style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'<rect id="%s" x="%s" onmousemove="showLabel(this, event, \'%s\')" onmouseleave="hideLabel()" onclick="redirectHeatmap(\'agent\', '.$value['id_agente'].')" style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'rect_'.$cont,
|
||||
$x,
|
||||
$value['alias'],
|
||||
$y,
|
||||
$row,
|
||||
$column,
|
||||
@ -490,9 +501,10 @@ class Groups extends Element
|
||||
}
|
||||
|
||||
$heatmap .= sprintf(
|
||||
'<rect id="%s" x="%s" style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'<rect id="%s" x="%s" onmousemove="showLabel(this, event, \'%s\')" onmouseleave="hideLabel()" onclick="redirectHeatmap(\'group\', '.$value['_id_'].')" style="stroke-width:1;stroke:#ffffff" y="%s" row="%s" rx="3" ry="3" col="%s" width="%s" height="%s" class="scuare-status %s_%s"></rect>',
|
||||
'rect_'.$cont,
|
||||
$x,
|
||||
$value['_name_'],
|
||||
$y,
|
||||
$row,
|
||||
$column,
|
||||
|
@ -75,7 +75,10 @@ class MonitoringElements extends Element
|
||||
'display' => false,
|
||||
],
|
||||
'cutout' => 80,
|
||||
'nodata_image' => ['width' => '100%'],
|
||||
'nodata_image' => [
|
||||
'width' => '100%',
|
||||
'height' => '90%',
|
||||
],
|
||||
];
|
||||
$pie = ring_graph($data, $options);
|
||||
$output = html_print_div(
|
||||
@ -139,7 +142,10 @@ class MonitoringElements extends Element
|
||||
'display' => false,
|
||||
],
|
||||
'cutout' => 80,
|
||||
'nodata_image' => ['width' => '100%'],
|
||||
'nodata_image' => [
|
||||
'width' => '100%',
|
||||
'height' => '90%',
|
||||
],
|
||||
];
|
||||
$pie = ring_graph($data, $options);
|
||||
$output = html_print_div(
|
||||
@ -208,7 +214,10 @@ class MonitoringElements extends Element
|
||||
'display' => false,
|
||||
],
|
||||
'cutout' => 80,
|
||||
'nodata_image' => ['width' => '100%'],
|
||||
'nodata_image' => [
|
||||
'width' => '100%',
|
||||
'height' => '90%',
|
||||
],
|
||||
];
|
||||
$pie = ring_graph($data, $options);
|
||||
$output = html_print_div(
|
||||
@ -230,11 +239,12 @@ class MonitoringElements extends Element
|
||||
*/
|
||||
public function getMonitoringStatusGraph():string
|
||||
{
|
||||
$pie = graph_agent_status(false, '', '', true, true, false, true);
|
||||
$pie = graph_agent_status(false, '', '', true, true, false, true, 'redirectStatus', true);
|
||||
$output = html_print_div(
|
||||
[
|
||||
'content' => $pie,
|
||||
'style' => 'margin: 0 auto; max-width: 80%; max-height: 220px;',
|
||||
'class' => 'clickable',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -36,6 +36,7 @@ class Overview extends Element
|
||||
{
|
||||
global $config;
|
||||
parent::__construct();
|
||||
include_once $config['homedir'].'/include/graphs/fgraph.php';
|
||||
if (is_ajax() === true) {
|
||||
include_once $config['homedir'].'/include/functions_servers.php';
|
||||
}
|
||||
@ -163,6 +164,9 @@ class Overview extends Element
|
||||
if ($info['limit'] > $info['count']) {
|
||||
$used = round(($info['count'] / $info['limit']) * 100);
|
||||
$free = (100 - $used);
|
||||
} else if ($info['limit'] <= $info['count']) {
|
||||
$free = 0;
|
||||
$used = 100;
|
||||
} else {
|
||||
$free = 100;
|
||||
$used = 0;
|
||||
|
@ -23,11 +23,12 @@
|
||||
align-items: stretch;
|
||||
}
|
||||
.col-12 {
|
||||
width: 100%;
|
||||
width: 99%;
|
||||
}
|
||||
.col-6,
|
||||
.col-xl-6 {
|
||||
width: 50%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: column;
|
||||
@ -58,6 +59,9 @@
|
||||
border-radius: 10px;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.br-l {
|
||||
border-left: 1px solid #e5e9ed;
|
||||
@ -325,6 +329,22 @@ table.dataTable thead th {
|
||||
background-color: #ec7176;
|
||||
}
|
||||
|
||||
#svg rect {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.trigger-100 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.label_heatmap {
|
||||
position: absolute;
|
||||
background-color: #757575;
|
||||
color: white;
|
||||
padding: 2px 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 1636px) {
|
||||
.col-xl-6 {
|
||||
width: 100%;
|
||||
@ -344,9 +364,7 @@ table.dataTable thead th {
|
||||
.col-7 {
|
||||
width: 56%;
|
||||
}
|
||||
.col-5 {
|
||||
width: 41%;
|
||||
}
|
||||
|
||||
.flex-nowrap {
|
||||
flex-wrap: nowrap !important;
|
||||
}
|
||||
|
@ -6443,6 +6443,18 @@ div#status_pie {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.white-box-content-no-height {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
/*border: 1px solid #e2e2e2;*/
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 10px;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.white-box-content-clean {
|
||||
padding-left: 2em;
|
||||
padding-top: 1em;
|
||||
@ -6720,6 +6732,7 @@ table.table_modal_alternate tr td:first-child {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
line-height: 1.3;
|
||||
max-width: 40px !important;
|
||||
}
|
||||
|
||||
table#agent_interface_info .flot-text .flot-x-axis div {
|
||||
@ -10328,7 +10341,7 @@ select:focus {
|
||||
}
|
||||
|
||||
.dataTables_length > label {
|
||||
color: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
input[type="button"],
|
||||
@ -12741,12 +12754,6 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
|
||||
justify-content: flex-start !important;
|
||||
}
|
||||
|
||||
.dt-buttons {
|
||||
width: auto;
|
||||
position: absolute;
|
||||
margin-left: 90px;
|
||||
}
|
||||
|
||||
.title_tactical {
|
||||
padding: 10px 0px 10px 0px;
|
||||
text-align: center;
|
||||
@ -12777,6 +12784,28 @@ tr.shown td.details-control {
|
||||
background-color: #81b92e3b !important;
|
||||
}
|
||||
|
||||
.ui-dialog .tips_header.ui-dialog-titlebar {
|
||||
height: fit-content !important;
|
||||
}
|
||||
|
||||
.arrow_counter:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.disabled_button {
|
||||
background-color: #ccc !important;
|
||||
border: 2px solid #444 !important;
|
||||
color: #444 !important;
|
||||
}
|
||||
|
||||
.disabled_button:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.counter-tips {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.ui-datepicker-title > span {
|
||||
color: #82b92e !important;
|
||||
}
|
||||
|
@ -1871,3 +1871,8 @@ a.pandora_pagination,
|
||||
#general-tactical-view #horizontalBar .labels .label span {
|
||||
color: black;
|
||||
}
|
||||
|
||||
#score-bar .labels-bar span,
|
||||
#score-bar .labels-bar div {
|
||||
color: white;
|
||||
}
|
||||
|
@ -233,6 +233,10 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#audit_logs > tbody > tr > td > img {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.table_action_buttons > a,
|
||||
.table_action_buttons > img,
|
||||
.table_action_buttons > button,
|
||||
@ -369,8 +373,6 @@ a.pandora_pagination.current:hover {
|
||||
font-size: 20px;
|
||||
height: 38px;
|
||||
width: 80px;
|
||||
margin-left: 90px;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: row;
|
||||
|
@ -21,7 +21,7 @@
|
||||
display: flex !important;
|
||||
padding: 0px 20px;
|
||||
justify-content: space-between;
|
||||
height: fit-content;
|
||||
height: fit-content !important;
|
||||
background-color: white;
|
||||
color: #161628;
|
||||
border-top-left-radius: 25px !important;
|
||||
@ -161,6 +161,7 @@ span.count-round-tip.active {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.arrow_counter {
|
||||
cursor: pointer;
|
||||
width: 7px;
|
||||
margin: 0px 5px;
|
||||
}
|
||||
|
169
pandora_console/include/styles/vulnerabilities.css
Normal file
169
pandora_console/include/styles/vulnerabilities.css
Normal file
@ -0,0 +1,169 @@
|
||||
.details_table b {
|
||||
font-size: 12px;
|
||||
}
|
||||
.details_table {
|
||||
width: 99% !important;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
margin: 10px 0px 20px 20px;
|
||||
}
|
||||
|
||||
.custom-filter {
|
||||
width: 95%;
|
||||
margin: 21px auto;
|
||||
}
|
||||
|
||||
.custom-filter label {
|
||||
font-size: 13px !important;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dataTables_paginate.paging_simple_numbers {
|
||||
margin: 10px 20px 20px 0px;
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.row-graphs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
max-width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.col-md-3 {
|
||||
width: 30%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-6 {
|
||||
width: 35%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-1 {
|
||||
width: 15%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-2 {
|
||||
width: 30%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-7 {
|
||||
width: 40%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.col-md-9 {
|
||||
width: 63%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.pdd_b_40px {
|
||||
padding-bottom: 40px !important;
|
||||
}
|
||||
#reach-metrics {
|
||||
margin-bottom: 45px;
|
||||
}
|
||||
|
||||
#reach-metrics .row-graphs {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
#score-bar {
|
||||
max-width: 85%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#bar {
|
||||
height: 100%;
|
||||
animation: load 2s;
|
||||
}
|
||||
.marks {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
.title {
|
||||
font-size: 19px;
|
||||
font-weight: 600;
|
||||
color: #3f3f3f;
|
||||
}
|
||||
.score {
|
||||
font-weight: 700;
|
||||
font-size: 24px;
|
||||
color: #3f3f3f;
|
||||
}
|
||||
.message {
|
||||
color: #0000008c;
|
||||
}
|
||||
.status {
|
||||
font-size: 15px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.marks {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.labels-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
.date {
|
||||
font-weight: 400;
|
||||
color: #0000008c;
|
||||
margin-left: 13px;
|
||||
}
|
||||
.dt-buttons {
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
margin-left: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.dt-buttons button {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
#content-bar {
|
||||
border: 1px solid #d7d7d7;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 1500px) {
|
||||
.col-md-3 {
|
||||
width: 40%;
|
||||
}
|
||||
.col-md-1 {
|
||||
width: 20%;
|
||||
}
|
||||
.col-md-2 {
|
||||
width: 45%;
|
||||
}
|
||||
.col-md-6 {
|
||||
width: 88%;
|
||||
}
|
||||
.col-md-7 {
|
||||
width: 80%;
|
||||
}
|
||||
.col-sl-12 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.col-sl-4 {
|
||||
width: 33%;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes load {
|
||||
from {
|
||||
width: 0%;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
@ -1057,6 +1057,7 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true
|
||||
|
||||
if ((bool) ($config['maintenance_mode'] ?? false) === true
|
||||
&& $page !== 'advanced/command_center'
|
||||
&& $page !== 'godmode/update_manager/update_manager'
|
||||
&& is_user_admin($config['id_user']) === true
|
||||
) {
|
||||
// Prevent access to metaconsole if not merged.
|
||||
|
@ -131,7 +131,7 @@
|
||||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.774';
|
||||
$build = '231107';
|
||||
$build = '231127';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
@ -56,8 +56,18 @@ function validateAlert($ids)
|
||||
}
|
||||
|
||||
|
||||
function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby=false, $tag_filter=false, $action_filter=false, $return=false, $strict_user=false, $access='AR')
|
||||
{
|
||||
function printFormFilterAlert(
|
||||
$id_group,
|
||||
$filter,
|
||||
$free_search,
|
||||
$alert_agent_view,
|
||||
$filter_standby=false,
|
||||
$tag_filter=false,
|
||||
$action_filter=false,
|
||||
$return=false,
|
||||
$strict_user=false,
|
||||
$access='AR'
|
||||
) {
|
||||
global $config;
|
||||
include_once $config['homedir'].'/include/functions_tags.php';
|
||||
|
||||
@ -69,29 +79,32 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
|
||||
$table->size[1] = '33%';
|
||||
$table->size[2] = '33%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
true,
|
||||
'ag_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo',
|
||||
$strict_user
|
||||
)
|
||||
);
|
||||
|
||||
if ($alert_agent_view === false) {
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
true,
|
||||
'ag_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo',
|
||||
$strict_user
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$alert_status_filter = [];
|
||||
$alert_status_filter['all_enabled'] = __('All (Enabled)');
|
||||
@ -200,45 +213,3 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
|
||||
echo $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printFormFilterAlertAgent($agent_view_page, $free_search, $id_agent, $return=false)
|
||||
{
|
||||
$table_filter = new stdClass();
|
||||
$table_filter->width = '100%';
|
||||
|
||||
if ($agent_view_page === true) {
|
||||
$table_filter->class = 'info_table';
|
||||
$table_filter->styleTable = 'border-radius: 0;padding: 0;margin: 0;';
|
||||
$free_search_name = 'free_search_alert';
|
||||
} else {
|
||||
$table_filter->class = 'databox filters';
|
||||
$free_search_name = 'free_search';
|
||||
}
|
||||
|
||||
$table_filter->style = [];
|
||||
$table_filter->style[0] = 'font-weight: bold';
|
||||
$table_filter->data = [];
|
||||
|
||||
$table_filter->data[0][0] = __('Free text for search (*):').ui_print_help_tip(
|
||||
__('Filter by module name, template name or action name'),
|
||||
true
|
||||
);
|
||||
|
||||
$table_filter->data[0][0] .= '<span class="mrgn_lft_10px">'.html_print_input_text(
|
||||
$free_search_name,
|
||||
$free_search,
|
||||
'',
|
||||
20,
|
||||
100,
|
||||
true
|
||||
).'</span>';
|
||||
|
||||
$form = html_print_table($table_filter, true);
|
||||
|
||||
if ($return === true) {
|
||||
return $form;
|
||||
} else {
|
||||
echo $form;
|
||||
}
|
||||
}
|
||||
|
@ -405,6 +405,12 @@ if ($agent_view_page === true) {
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$tab = get_parameter('tab', 'main');
|
||||
$alert_agent_view = false;
|
||||
if ($tab == 'alert') {
|
||||
$alert_agent_view = true;
|
||||
}
|
||||
|
||||
ui_print_datatable(
|
||||
[
|
||||
'id' => 'alerts_status_datatable',
|
||||
@ -433,7 +439,7 @@ if ($agent_view_page === true) {
|
||||
$id_group,
|
||||
$disabled,
|
||||
$free_search,
|
||||
$url,
|
||||
$alert_agent_view,
|
||||
$filter_standby,
|
||||
$tag_filter,
|
||||
true,
|
||||
@ -441,7 +447,7 @@ if ($agent_view_page === true) {
|
||||
$strict_user
|
||||
),
|
||||
],
|
||||
'start_disabled' => true,
|
||||
'start_disabled' => !$alert_agent_view,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ if (!empty($table->data)) {
|
||||
// Create controlled toggle content.
|
||||
ui_toggle(
|
||||
$html_content,
|
||||
__('Log sources status'),
|
||||
__('Log sources status (last 24h)'),
|
||||
'log_sources_status',
|
||||
!$log_sources_defined,
|
||||
false,
|
||||
|
@ -2348,6 +2348,7 @@ if (empty($result) === false) {
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
echo '<div class="total_pages">'.sprintf(__('Total items: %s'), $count).'</div>';
|
||||
html_print_table($table);
|
||||
|
||||
if ($count_modules > $config['block_size']) {
|
||||
|
@ -45,6 +45,7 @@ ui_require_css_file('agent_view');
|
||||
|
||||
enterprise_include_once('operation/agentes/ver_agente.php');
|
||||
enterprise_include_once('include/functions_security_hardening.php');
|
||||
enterprise_include_once('include/functions_vulnerabilities.php');
|
||||
|
||||
check_login();
|
||||
if (is_ajax()) {
|
||||
@ -1858,7 +1859,6 @@ $external_tools['text'] = html_print_menu_button(
|
||||
$external_tools['active'] = ($tab === 'external_tools');
|
||||
|
||||
if (enterprise_installed() === true && security_hardening_installed() === true) {
|
||||
// External Tools tab.
|
||||
$security_hardening['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=security_hardening&id_agente='.$id_agente,
|
||||
@ -1871,6 +1871,26 @@ if (enterprise_installed() === true && security_hardening_installed() === true)
|
||||
$security_hardening['active'] = ($tab === 'security_hardening');
|
||||
}
|
||||
|
||||
if (function_exists('vulnerabilities_last_scan_agent') === true) {
|
||||
if (enterprise_installed() === true
|
||||
&& (int) $agent['vul_scan_enabled'] !== 0
|
||||
&& ((int) $agent['vul_scan_enabled'] === 1 || (int) $config['agent_vulnerabilities'] === 1)
|
||||
&& vulnerabilities_last_scan_agent($id_agente) !== 0
|
||||
) {
|
||||
$vulnerabilities['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=vulnerabilities&id_agente='.$id_agente,
|
||||
'image' => 'images/vulnerability_scan@svg.svg',
|
||||
'title' => __('Vulnerabilities'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$vulnerabilities['active'] = ($tab === 'vulnerabilities');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$onheader = [
|
||||
'manage' => ($managetab ?? null),
|
||||
'main' => ($maintab ?? null),
|
||||
@ -1889,6 +1909,7 @@ $onheader = [
|
||||
'ncm_view' => ($ncm_tab ?? null),
|
||||
'external_tools' => ($external_tools ?? null),
|
||||
'security_hardening' => ($security_hardening ?? null),
|
||||
'vulnerabilities' => ($vulnerabilities ?? null),
|
||||
'incident' => ($incidenttab ?? null),
|
||||
'omnishell' => ($omnishellTab ?? null),
|
||||
];
|
||||
@ -2073,6 +2094,10 @@ switch ($tab) {
|
||||
$tab_name = __('Security hardening');
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
$tab_name = __('Vulnerabilities');
|
||||
break;
|
||||
|
||||
default:
|
||||
$tab_name = '';
|
||||
$help_header = '';
|
||||
@ -2222,6 +2247,10 @@ switch ($tab) {
|
||||
enterprise_include('operation/agentes/security_hardening.php');
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
enterprise_include('operation/agentes/vulnerabilities.php');
|
||||
break;
|
||||
|
||||
case 'extension':
|
||||
$found = false;
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
|
@ -342,6 +342,7 @@ if (is_ajax() === true) {
|
||||
$table_id = get_parameter('table_id', '');
|
||||
$groupRecursion = (bool) get_parameter('groupRecursion', false);
|
||||
$compact_date = (int) get_parameter('compact_date', 0);
|
||||
$compact_name_event = (int) get_parameter('compact_name_event', 0);
|
||||
|
||||
// Datatables offset, limit.
|
||||
$start = (int) get_parameter('start', 0);
|
||||
@ -471,7 +472,7 @@ if (is_ajax() === true) {
|
||||
|
||||
$data = array_reduce(
|
||||
$events,
|
||||
function ($carry, $item) use ($table_id, &$redirection_form_id, $filter, $compact_date, $external_url) {
|
||||
function ($carry, $item) use ($table_id, &$redirection_form_id, $filter, $compact_date, $external_url, $compact_name_event) {
|
||||
global $config;
|
||||
|
||||
$tmp = (object) $item;
|
||||
@ -518,7 +519,7 @@ if (is_ajax() === true) {
|
||||
|
||||
$tmp->evento = ui_print_truncate_text(
|
||||
$tmp->evento,
|
||||
'description',
|
||||
(empty($compact_name_event) === true) ? 'description' : GENERIC_SIZE_TEXT,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
@ -2603,6 +2604,27 @@ try {
|
||||
// Open current filter quick reference.
|
||||
$active_filters_div = '<div class="filter_summary">';
|
||||
|
||||
$active_filters_div .= '<div>';
|
||||
$active_filters_div .= '<div class="label box-shadow">'.__('Show graph').'</div>';
|
||||
|
||||
$active_filters_div .= html_print_div(
|
||||
[
|
||||
'class' => 'content',
|
||||
'style' => 'padding-top: 5px !important;',
|
||||
'content' => html_print_checkbox_switch_extended(
|
||||
'show_event_graph',
|
||||
1,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$active_filters_div .= '</div>';
|
||||
|
||||
// Current filter.
|
||||
$active_filters_div .= '<div>';
|
||||
$active_filters_div .= '<div class="label box-shadow">'.__('Current filter').'</div>';
|
||||
@ -2641,6 +2663,10 @@ try {
|
||||
case EVENT_NO_VALIDATED:
|
||||
$active_filters_div .= __('Not validated.');
|
||||
break;
|
||||
|
||||
case EVENT_NO_PROCESS:
|
||||
$active_filters_div .= __('Not in process.');
|
||||
break;
|
||||
}
|
||||
|
||||
$active_filters_div .= '</div>';
|
||||
@ -2689,6 +2715,42 @@ try {
|
||||
$show_hide_filters = 'invisible';
|
||||
}
|
||||
|
||||
|
||||
// Print graphs
|
||||
$graph_background = '';
|
||||
if ($config['style'] === 'pandora') {
|
||||
$graph_background = ' background-color: #fff;';
|
||||
} else if ($config['style'] === 'pandora_black') {
|
||||
$graph_background = ' background-color: #222;';
|
||||
}
|
||||
|
||||
$graph_div = html_print_div(
|
||||
[
|
||||
'id' => 'events-graph',
|
||||
'class' => 'invisible',
|
||||
'style' => 'margin-bottom: 10px; text-align: left;'.$graph_background,
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$graph_div .= html_print_div(
|
||||
[
|
||||
'id' => 'events-graph-loading',
|
||||
'class' => 'center invisible',
|
||||
'content' => html_print_image(
|
||||
'images/spinner.gif',
|
||||
true,
|
||||
[
|
||||
'title' => __('Loading'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Print datatable.
|
||||
html_print_div(
|
||||
[
|
||||
@ -2712,7 +2774,7 @@ try {
|
||||
'inputs' => [],
|
||||
'extra_buttons' => $buttons,
|
||||
],
|
||||
'extra_html' => $active_filters_div,
|
||||
'extra_html' => $active_filters_div.$graph_div,
|
||||
'pagination_options' => [
|
||||
[
|
||||
$config['block_size'],
|
||||
@ -3260,6 +3322,19 @@ function reorder_tags_inputs() {
|
||||
}
|
||||
/* Tag management ends */
|
||||
$(document).ready( function() {
|
||||
|
||||
let hidden_graph = true;
|
||||
$('#checkbox-show_event_graph').on('change', function(){
|
||||
if (hidden_graph == true) {
|
||||
hidden_graph = false;
|
||||
$('#events-graph').removeClass('invisible');
|
||||
show_events_graph();
|
||||
} else {
|
||||
hidden_graph = true;
|
||||
$('#events-graph').html();
|
||||
$('#events-graph').addClass('invisible');
|
||||
}
|
||||
});
|
||||
|
||||
let refresco = <?php echo get_parameter('refr', 0); ?>;
|
||||
$('#refresh option[value='+refresco+']').attr('selected', 'selected');
|
||||
@ -3425,6 +3500,10 @@ $(document).ready( function() {
|
||||
$("#button-remove_without").click(function() {
|
||||
click_button_remove_tag("without");
|
||||
});
|
||||
|
||||
$("#button-events_form_search_bt").click(function(){
|
||||
show_events_graph();
|
||||
});
|
||||
|
||||
|
||||
//Autorefresh in fullscreen
|
||||
@ -3640,4 +3719,27 @@ function show_event_dialo(event, dialog_page) {
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
function show_events_graph(){
|
||||
var inputs = $("#events_form :input");
|
||||
var values = {};
|
||||
inputs.each(function() {
|
||||
values[this.name] = $(this).val();
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/events',
|
||||
drawEventsGraph: true,
|
||||
filter: values
|
||||
},
|
||||
success: function (data){
|
||||
$('#events-graph')
|
||||
.empty()
|
||||
.html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
@ -6,7 +6,7 @@
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -6,7 +6,7 @@
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.774
|
||||
%define release 231107
|
||||
%define release 231127
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -91,6 +91,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
|
||||
`satellite_server` INT NOT NULL DEFAULT 0,
|
||||
`fixed_ip` TINYINT NOT NULL DEFAULT 0,
|
||||
`disabled_by_downtime` TINYINT NOT NULL DEFAULT 0,
|
||||
`vul_scan_enabled` TINYINT NOT NULL DEFAULT 2,
|
||||
PRIMARY KEY (`id_agente`),
|
||||
KEY `nombre` (`nombre`(255)),
|
||||
KEY `direccion` (`direccion`),
|
||||
@ -1645,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
|
||||
@ -3550,6 +3552,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
|
||||
`satellite_server` INT NOT NULL DEFAULT 0,
|
||||
`fixed_ip` TINYINT NOT NULL DEFAULT 0,
|
||||
`disabled_by_downtime` TINYINT NOT NULL DEFAULT 0,
|
||||
`vul_scan_enabled` TINYINT NOT NULL DEFAULT 2,
|
||||
PRIMARY KEY (`id_agente`),
|
||||
KEY `nombre` (`nombre`(255)),
|
||||
KEY `direccion` (`direccion`),
|
||||
@ -4517,4 +4520,14 @@ CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
||||
`graph_modules` TEXT NULL,
|
||||
`interval` INT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tpandora_cve`
|
||||
-- ---------------------------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tpandora_cve` (
|
||||
`cve_id` VARCHAR(20),
|
||||
`cvss_score` DOUBLE DEFAULT NULL,
|
||||
`cvss_vector` VARCHAR(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`cve_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
File diff suppressed because it is too large
Load Diff
@ -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(
|
||||
[
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user