mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#12137 Resolve conflicts
This commit is contained in:
commit
cac31cc482
@ -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-231116
|
||||
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-231116"
|
||||
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 => '231116';
|
||||
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 231116
|
||||
%define release 231127
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -5,7 +5,7 @@
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 231116
|
||||
%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 231116
|
||||
%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 231116
|
||||
%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 231116
|
||||
%define release 231127
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -10,7 +10,7 @@
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231116"
|
||||
PI_BUILD="231127"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{231116}
|
||||
{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 231116")
|
||||
#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 231116))"
|
||||
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-231116
|
||||
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-231116"
|
||||
pandora_version="7.0NG.774-231127"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
8
pandora_console/extras/mr/67.sql
Normal file
8
pandora_console/extras/mr/67.sql
Normal file
@ -0,0 +1,8 @@
|
||||
START TRANSACTION;
|
||||
|
||||
-- Delete table tagent_access
|
||||
DROP TABLE tagent_access;
|
||||
|
||||
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
|
||||
|
||||
COMMIT;
|
@ -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();
|
||||
|
@ -31,13 +31,14 @@ if (is_ajax()) {
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<h3>'.$template['name'].'</h3>';
|
||||
echo '<h3 style="background-color: #14524f">'.$template['name'].'</h3>';
|
||||
echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']);
|
||||
echo ui_print_alert_template_example($template['id'], true, true, false);
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
echo '<strong>'.__('Type').': </strong>';
|
||||
echo alerts_get_alert_templates_type_name($template['type']);
|
||||
|
||||
echo '<br />';
|
||||
echo ui_print_alert_template_example($template['id'], true);
|
||||
|
||||
echo '<br />';
|
||||
|
||||
if ($template['description'] != '') {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) {
|
||||
|
||||
// Get some general DB stats (not very heavy)
|
||||
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
|
||||
$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0');
|
||||
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
|
||||
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
|
||||
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
|
||||
@ -149,18 +148,6 @@ echo $stat_modules;
|
||||
echo '</b></td></tr>';
|
||||
|
||||
|
||||
|
||||
echo '<tr class="rowOdd"><td>';
|
||||
echo __('Total agent access records');
|
||||
echo '<td><b>';
|
||||
if ($stat_access > $max_access) {
|
||||
echo "<font color='#ff0000'>$stat_access</font>";
|
||||
} else {
|
||||
echo $stat_access;
|
||||
}
|
||||
|
||||
echo '</b></td></tr>';
|
||||
|
||||
// Sanity
|
||||
echo '<tr><th colspan=2><i>';
|
||||
echo __('Database sanity');
|
||||
|
@ -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']
|
||||
|
@ -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){
|
||||
|
@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block(
|
||||
)
|
||||
);
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Poisition'),
|
||||
__('Position'),
|
||||
html_print_input_text_extended(
|
||||
'position_to_delete',
|
||||
1,
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -46,7 +46,7 @@ if ($idOS > 0) {
|
||||
$description = $os['description'];
|
||||
$icon = $os['icon_name'];
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
}
|
||||
@ -87,9 +87,16 @@ if ($is_management_allowed === true) {
|
||||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') {
|
||||
$message = 10;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
if ($file_uploaded !== true) {
|
||||
$message = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -108,7 +115,7 @@ if ($is_management_allowed === true) {
|
||||
|
||||
if ($resultOrId === false) {
|
||||
$message = 2;
|
||||
$tab = 'builder';
|
||||
$tab = 'manage_os';
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
@ -144,13 +151,19 @@ if ($is_management_allowed === true) {
|
||||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else if (exif_imagetype($file_tmp) === false) {
|
||||
$message = 10;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
if ($file_uploaded !== true) {
|
||||
$message = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
|
||||
@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv';
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
|
||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px')
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
@ -290,6 +303,28 @@ html_print_action_buttons(
|
||||
|
||||
echo '</form>';
|
||||
|
||||
$id_message = get_parameter('id_message', 0);
|
||||
|
||||
if ($id_message !== 0) {
|
||||
switch ($id_message) {
|
||||
case 8:
|
||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_list_os_icons_dir()
|
||||
{
|
||||
|
@ -162,11 +162,15 @@ if (empty($id_message) === false) {
|
||||
break;
|
||||
|
||||
case 8:
|
||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8');
|
||||
break;
|
||||
|
||||
case 9:
|
||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9');
|
||||
break;
|
||||
|
||||
case 10:
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -154,8 +154,7 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
|
||||
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
|
||||
|
||||
$total_agents = db_get_value('count(*)', 'tagente');
|
||||
$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
||||
|
||||
// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
||||
$table_status = new StdClass();
|
||||
$table_status->width = '100%';
|
||||
$table_status->class = 'databox filters';
|
||||
@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block(
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
/*
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
__('Use agent access graph'),
|
||||
html_print_checkbox_switch(
|
||||
'agentaccess',
|
||||
@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block(
|
||||
true,
|
||||
$disable_agentaccess
|
||||
)
|
||||
);
|
||||
|
||||
$table_other->data[3][1] = html_print_label_input_block(
|
||||
);
|
||||
*/
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
__('Max. recommended number of files in attachment directory'),
|
||||
html_print_input_text(
|
||||
'num_files_attachment',
|
||||
|
@ -370,7 +370,7 @@ switch ($section) {
|
||||
break;
|
||||
|
||||
default:
|
||||
$subpage = 'seccion: '.$section;
|
||||
$subpage = 'seccion: ';
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
@ -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 ?? ''),
|
||||
]
|
||||
);
|
||||
|
||||
|
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,
|
||||
]
|
||||
),
|
||||
],
|
||||
|
@ -38,6 +38,10 @@ if ($change_label === '1') {
|
||||
$source = get_parameter('source', 0);
|
||||
$user = get_parameter('user', '');
|
||||
$value = get_parameter('value', 0) ? 1 : 0;
|
||||
$user_info = get_user_info($config['id_user']);
|
||||
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update the label value.
|
||||
ob_clean();
|
||||
|
@ -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(
|
||||
|
@ -269,13 +269,6 @@ class ConsoleSupervisor
|
||||
$this->checkSyncQueueStatus();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check number of agents is equals and more than 200.
|
||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
||||
*/
|
||||
|
||||
$this->checkAccessStatisticsPerformance();
|
||||
|
||||
/*
|
||||
* Checkc agent missing libraries.
|
||||
* NOTIF.AGENT.LIBRARY
|
||||
@ -573,13 +566,6 @@ class ConsoleSupervisor
|
||||
$this->checkSyncQueueStatus();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check number of agents is equals and more than 200.
|
||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
||||
*/
|
||||
|
||||
$this->checkAccessStatisticsPerformance();
|
||||
|
||||
/*
|
||||
* Checkc agent missing libraries.
|
||||
* NOTIF.AGENT.LIBRARY
|
||||
@ -732,6 +718,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');
|
||||
|
@ -580,9 +580,6 @@ class Diagnostics extends Wizard
|
||||
$countModuleData = db_get_value_sql(
|
||||
'SELECT COUNT(*) FROM tagente_datos'
|
||||
);
|
||||
$countAgentAccess = db_get_value_sql(
|
||||
'SELECT COUNT(*) FROM tagent_access'
|
||||
);
|
||||
$countEvents = db_get_value_sql('SELECT COUNT(*) FROM tevento');
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
@ -595,39 +592,35 @@ class Diagnostics extends Wizard
|
||||
$result = [
|
||||
'error' => false,
|
||||
'data' => [
|
||||
'countAgents' => [
|
||||
'countAgents' => [
|
||||
'name' => __('Total agents'),
|
||||
'value' => $countAgents,
|
||||
],
|
||||
'countModules' => [
|
||||
'countModules' => [
|
||||
'name' => __('Total modules'),
|
||||
'value' => $countModules,
|
||||
],
|
||||
'countGroups' => [
|
||||
'countGroups' => [
|
||||
'name' => __('Total groups'),
|
||||
'value' => $countGroups,
|
||||
],
|
||||
'countModuleData' => [
|
||||
'countModuleData' => [
|
||||
'name' => __('Total module data records'),
|
||||
'value' => $countModuleData,
|
||||
],
|
||||
'countAgentAccess' => [
|
||||
'name' => __('Total agent access record'),
|
||||
'value' => $countAgentAccess,
|
||||
],
|
||||
'countEvents' => [
|
||||
'countEvents' => [
|
||||
'name' => __('Total events'),
|
||||
'value' => $countEvents,
|
||||
],
|
||||
'countTraps' => [
|
||||
'countTraps' => [
|
||||
'name' => __('Total traps'),
|
||||
'value' => $countTraps,
|
||||
],
|
||||
'countUsers' => [
|
||||
'countUsers' => [
|
||||
'name' => __('Total users'),
|
||||
'value' => $countUsers,
|
||||
],
|
||||
'countSessions' => [
|
||||
'countSessions' => [
|
||||
'name' => __('Total sessions'),
|
||||
'value' => $countSessions,
|
||||
],
|
||||
|
@ -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 = 'PC231116';
|
||||
$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);
|
||||
|
@ -4850,8 +4850,8 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
||||
[$agent['id_agente']]
|
||||
);
|
||||
|
||||
$data = [];
|
||||
if ((bool) $has_remote_conf) {
|
||||
$data = [];
|
||||
$data[0] = __('Remote configuration');
|
||||
$data[1] = '<spam style="position: relative;top: -10%; margin-right: 10px;">'.__('Enabled').'</spam>';
|
||||
$data[1] .= html_print_menu_button(
|
||||
@ -4879,9 +4879,51 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
||||
$data[0] = __('Satellite server');
|
||||
$data[1] = $satellite_name;
|
||||
}
|
||||
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
// Optional data
|
||||
// Position Information.
|
||||
|
@ -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;
|
||||
|
@ -917,10 +917,6 @@ function config_update_config()
|
||||
$error_update[] = __('Batch statistics period (secs)');
|
||||
}
|
||||
|
||||
if (config_update_value('agentaccess', (int) get_parameter('agentaccess'), true) === false) {
|
||||
$error_update[] = __('Use agent access graph');
|
||||
}
|
||||
|
||||
if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) {
|
||||
$error_update[] = __('Max. recommended number of files in attachment directory');
|
||||
}
|
||||
@ -2237,10 +2233,6 @@ function config_process_config()
|
||||
config_update_value('show_qr_code_header', false);
|
||||
}
|
||||
|
||||
if (!isset($config['agentaccess'])) {
|
||||
config_update_value('agentaccess', true);
|
||||
}
|
||||
|
||||
if (!isset($config['timezone'])) {
|
||||
config_update_value('timezone', 'Europe/Berlin');
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -2525,92 +2525,6 @@ function combined_graph_summatory_average(
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print a graph with access data of agents.
|
||||
*
|
||||
* @param integer $id_agent Agent Id.
|
||||
* @param integer $period Timestamp period graph.
|
||||
* @param boolean|null $return Type return.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function graphic_agentaccess(
|
||||
int $id_agent,
|
||||
int $period=0,
|
||||
?bool $return=false,
|
||||
?bool $agent_view=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
// Dates.
|
||||
$date = get_system_time();
|
||||
$datelimit = ($date - $period);
|
||||
$interval = 3600;
|
||||
|
||||
// Query.
|
||||
$sql = sprintf(
|
||||
'SELECT utimestamp, count(*) as data
|
||||
FROM tagent_access
|
||||
WHERE id_agent = %d
|
||||
AND utimestamp >= %d
|
||||
AND utimestamp <= %d
|
||||
GROUP BY TRUNCATE(utimestamp/%d,0)',
|
||||
$id_agent,
|
||||
$datelimit,
|
||||
$date,
|
||||
$interval
|
||||
);
|
||||
|
||||
$data = db_get_all_rows_sql($sql);
|
||||
|
||||
// Array data.
|
||||
$data_array = [];
|
||||
$colors = [];
|
||||
if (isset($data) === true && is_array($data) === true) {
|
||||
foreach ($data as $value) {
|
||||
$time = io_safe_output(date('H:m', $value['utimestamp']));
|
||||
$labels[] = $time;
|
||||
$data_array[] = [
|
||||
'y' => (int) $value['data'],
|
||||
'x' => $time,
|
||||
];
|
||||
|
||||
$colors[] = '#82b92f';
|
||||
}
|
||||
}
|
||||
|
||||
$options = [];
|
||||
$options['grid']['hoverable'] = true;
|
||||
|
||||
if ($agent_view === true) {
|
||||
$options['agent_view'] = true;
|
||||
}
|
||||
|
||||
$options = [
|
||||
'height' => 125,
|
||||
'colors' => $colors,
|
||||
'legend' => ['display' => false],
|
||||
'scales' => [
|
||||
'x' => [
|
||||
'grid' => ['display' => false],
|
||||
'ticks' => [
|
||||
'fonts' => ['size' => 8],
|
||||
],
|
||||
],
|
||||
'y' => [
|
||||
'grid' => ['display' => false],
|
||||
'ticks' => [
|
||||
'fonts' => ['size' => 8],
|
||||
],
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
];
|
||||
|
||||
return vbar_graph($data_array, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print a pie graph with alerts defined/fired data
|
||||
*
|
||||
|
@ -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,
|
||||
@ -4939,8 +4939,8 @@ function html_print_input_file($name, $return=false, $options=false, $inline_upl
|
||||
$inline_upload_anchor_to_form
|
||||
),
|
||||
[
|
||||
'mode' => 'link',
|
||||
'style' => 'min-width: initial;',
|
||||
'class' => 'secondary',
|
||||
'style' => 'min-width: initial; position: relative; margin-left: 5%; ',
|
||||
],
|
||||
true,
|
||||
);
|
||||
@ -7305,8 +7305,10 @@ function html_print_select_date_range(
|
||||
$time_end='',
|
||||
$date_text=SECONDS_1DAY,
|
||||
$class='w100p',
|
||||
$date_format='Y/m/d',
|
||||
$time_format='H:i:s'
|
||||
$date_format_php='Y/m/d',
|
||||
$time_format_php='H:i:s',
|
||||
$date_format_js='yy/mm/dd',
|
||||
$time_format_js='HH:mm:ss'
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -7328,21 +7330,21 @@ function html_print_select_date_range(
|
||||
}
|
||||
|
||||
if ($date_end === '') {
|
||||
$date_end = date($date_format);
|
||||
$date_end = date($date_format_php);
|
||||
}
|
||||
|
||||
if ($date_init === '') {
|
||||
$date_init = date($date_format, strtotime($date_end.' -1 days'));
|
||||
$date_init = date($date_format_php, strtotime($date_end.' -1 days'));
|
||||
}
|
||||
|
||||
$date_init = date($date_format, strtotime($date_init));
|
||||
$date_init = date($date_format_php, strtotime($date_init));
|
||||
|
||||
if ($time_init === '') {
|
||||
$time_init = date($time_format);
|
||||
$time_init = date($time_format_php);
|
||||
}
|
||||
|
||||
if ($time_end === '') {
|
||||
$time_end = date($time_format);
|
||||
$time_end = date($time_format_php);
|
||||
}
|
||||
|
||||
$fields[SECONDS_1DAY] = __('Last 24hr');
|
||||
@ -7508,7 +7510,7 @@ function html_print_select_date_range(
|
||||
}
|
||||
|
||||
$('#text-date').datepicker({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
dateFormat: '".$date_format_js."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown'
|
||||
@ -7516,7 +7518,7 @@ function html_print_select_date_range(
|
||||
|
||||
$('[id^=text-time_init]').timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '".TIME_FORMAT_JS."',
|
||||
timeFormat: '".$time_format_js."',
|
||||
timeOnlyTitle: '".__('Choose time')."',
|
||||
timeText: '".__('Time')."',
|
||||
hourText: '".__('Hour')."',
|
||||
@ -7527,7 +7529,7 @@ function html_print_select_date_range(
|
||||
});
|
||||
|
||||
$('[id^=text-date_init]').datepicker ({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
dateFormat: '".$date_format_js."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown',
|
||||
@ -7549,7 +7551,7 @@ function html_print_select_date_range(
|
||||
});
|
||||
|
||||
$('[id^=text-date_end]').datepicker ({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
dateFormat: '".$date_format_js."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown',
|
||||
@ -7572,7 +7574,7 @@ function html_print_select_date_range(
|
||||
|
||||
$('[id^=text-time_end]').timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '".TIME_FORMAT_JS."',
|
||||
timeFormat: '".$time_format_js."',
|
||||
timeOnlyTitle: '".__('Choose time')."',
|
||||
timeText: '".__('Time')."',
|
||||
hourText: '".__('Hour')."',
|
||||
|
@ -659,7 +659,15 @@ function notifications_get_user_label_status($source, $user, $label)
|
||||
*/
|
||||
function notifications_set_user_label_status($source, $user, $label, $value)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$user_info = get_user_info($config['id_user']);
|
||||
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$source_info = notifications_get_all_sources(['id' => $source]);
|
||||
|
||||
if (!isset($source_info[0])
|
||||
|| !$source_info[0]['enabled']
|
||||
|| !$source_info[0]['user_editable']
|
||||
|
@ -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,
|
||||
|
@ -3249,7 +3249,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
||||
$out .= '</tr>';
|
||||
$out .= '<tr>';
|
||||
$out .= '</td>';
|
||||
$out .= '<td><fieldset><legend>'.__('Events per agent').'</legend>';
|
||||
$out .= '<td><fieldset><legend>'.__('Events by agent').'</legend>';
|
||||
$data = [];
|
||||
$options = [];
|
||||
$labels = [];
|
||||
|
@ -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'
|
||||
);
|
||||
|
||||
|
@ -1802,11 +1802,14 @@ function ui_print_string_substr($string, $cutoff=16, $return=false, $fontsize=0)
|
||||
*
|
||||
* @return An HTML string if return was true.
|
||||
*/
|
||||
function ui_print_alert_template_example($id_alert_template, $return=false, $print_values=true)
|
||||
function ui_print_alert_template_example($id_alert_template, $return=false, $print_values=true, $print_icon=true)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
$output .= html_print_image('images/information.png', true, ['class' => 'invert_filter']);
|
||||
if ($print_icon === true) {
|
||||
$output .= html_print_image('images/information.png', true, ['class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
$output .= '<span id="example">';
|
||||
$template = alerts_get_alert_template($id_alert_template);
|
||||
|
||||
@ -8230,3 +8233,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);
|
||||
}
|
||||
}
|
@ -1228,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 = [];
|
||||
|
@ -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) {
|
||||
|
@ -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'][] = [
|
||||
|
@ -950,6 +950,19 @@ input.resize_button {
|
||||
right: 6%;
|
||||
}
|
||||
|
||||
.new-widget-message > div > table,
|
||||
.container-center > div > table {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.new-widget-message > div > table tr td > div,
|
||||
.container-center > div > table tr td > div {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.parent_graph > .graph {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
@ -6471,6 +6471,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;
|
||||
@ -6748,6 +6760,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 {
|
||||
@ -12799,6 +12812,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;
|
||||
}
|
||||
@ -12820,3 +12855,8 @@ tr.shown td.details-control {
|
||||
position: relative;
|
||||
top: -92px;
|
||||
}
|
||||
|
||||
#cluetip-inner > #example {
|
||||
position: absolute;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@
|
||||
.dt-buttons {
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
margin-left: 0px;
|
||||
margin-left: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.dt-buttons button {
|
||||
@ -148,6 +148,15 @@
|
||||
.col-md-7 {
|
||||
width: 80%;
|
||||
}
|
||||
.col-sl-12 {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.col-sl-4 {
|
||||
width: 33%;
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes load {
|
||||
|
@ -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 = '231116';
|
||||
$build = '231127';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
@ -345,55 +345,6 @@ for ($i = 0; $i < $custom_fields_count; $i++) {
|
||||
* END: TABLE DATA BUILD
|
||||
*/
|
||||
|
||||
/*
|
||||
* START: ACCESS RATE GRAPH
|
||||
*/
|
||||
|
||||
$access_agent = db_get_value_sql(
|
||||
'SELECT COUNT(id_agent)
|
||||
FROM tagent_access
|
||||
WHERE id_agent = '.$id_agente
|
||||
);
|
||||
|
||||
if ((bool) $config['agentaccess'] === true && $access_agent > 0) {
|
||||
$agentAccessRateHeader = html_print_div(
|
||||
[
|
||||
'class' => 'agent_details_header',
|
||||
'content' => '<span class="subsection_header_title">'.__('Agent access rate (Last 24h)').'</span>',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$agentAccessRateContent = html_print_div(
|
||||
[
|
||||
'class' => 'white-table-graph-content',
|
||||
'content' => graphic_agentaccess(
|
||||
$id_agente,
|
||||
SECONDS_1DAY,
|
||||
true,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$agentAccessRate = html_print_div(
|
||||
[
|
||||
'class' => 'box-flat agent_details_col mrgn_lft_20px w50p',
|
||||
'id' => 'table_access_rate',
|
||||
'content' => $agentAccessRateHeader.$agentAccessRateContent,
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$agentAccessRate = '';
|
||||
}
|
||||
|
||||
/*
|
||||
* END: ACCESS RATE GRAPH
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* START: TABLE INTERFACES
|
||||
*/
|
||||
@ -597,7 +548,7 @@ html_print_div(
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'agent_details_line',
|
||||
'content' => $agentEvents.$agentAccessRate,
|
||||
'content' => $agentEvents,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -789,10 +789,6 @@ function print_table(
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
if (count($selected_interfaces) > $config['block_size']) {
|
||||
ui_pagination(count($selected_interfaces), false, $pagination_index, 0, false, 'offset', true, '');
|
||||
}
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No search parameters')]);
|
||||
}
|
||||
|
@ -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']) {
|
||||
|
@ -2604,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>';
|
||||
@ -2642,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>';
|
||||
@ -2690,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(
|
||||
[
|
||||
@ -2713,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'],
|
||||
@ -3262,6 +3323,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');
|
||||
|
||||
@ -3427,6 +3501,10 @@ $(document).ready( function() {
|
||||
click_button_remove_tag("without");
|
||||
});
|
||||
|
||||
$("#button-events_form_search_bt").click(function(){
|
||||
show_events_graph();
|
||||
});
|
||||
|
||||
|
||||
//Autorefresh in fullscreen
|
||||
var pure = '<?php echo $pure; ?>';
|
||||
@ -3641,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>
|
||||
|
@ -38,7 +38,7 @@ $send_mes = (bool) get_parameter('send_mes', false);
|
||||
$new_msg = (string) get_parameter('new_msg');
|
||||
$dst_user = get_parameter('dst_user');
|
||||
$dst_group = get_parameter('dst_group');
|
||||
$subject = io_safe_html_tags(get_parameter('subject'));
|
||||
$subject = io_safe_input(get_parameter('subject'));
|
||||
$message = (string) get_parameter('message');
|
||||
$read_message = (bool) get_parameter('read_message', false);
|
||||
$reply = (bool) get_parameter('reply', false);
|
||||
@ -132,7 +132,7 @@ if ($read_message) {
|
||||
echo '<h1>Conversation with '.$user_name.'</h1>';
|
||||
}
|
||||
|
||||
echo '<h2>Subject: '.$message['subject'].'</h2>';
|
||||
echo '<h2>Subject: '.io_safe_output($message['subject']).'</h2>';
|
||||
|
||||
$conversation = messages_get_conversation($message);
|
||||
|
||||
|
@ -259,7 +259,7 @@ if (empty($messages) === true) {
|
||||
$pathSubject = 'index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id;
|
||||
}
|
||||
|
||||
$contentSubject = (empty($message['subject']) === true) ? __('No Subject') : $message['subject'];
|
||||
$contentSubject = (empty($message['subject']) === true) ? __('No Subject') : io_safe_output($message['subject']);
|
||||
|
||||
if ((int) $message['read'] !== 1) {
|
||||
$contentSubject = '<strong>'.$contentSubject.'</strong>';
|
||||
|
@ -6,7 +6,7 @@
|
||||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.774
|
||||
%define release 231116
|
||||
%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 231116
|
||||
%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 231116
|
||||
%define release 231127
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
@ -293,12 +293,12 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagent_access`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `tagent_access` (
|
||||
`id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`utimestamp` BIGINT NOT NULL DEFAULT 0,
|
||||
KEY `agent_index` (`id_agent`),
|
||||
KEY `idx_utimestamp` USING BTREE (`utimestamp`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
-- CREATE TABLE IF NOT EXISTS `tagent_access` (
|
||||
-- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
-- `utimestamp` BIGINT NOT NULL DEFAULT 0,
|
||||
-- KEY `agent_index` (`id_agent`),
|
||||
-- KEY `idx_utimestamp` USING BTREE (`utimestamp`)
|
||||
-- ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
@ -1646,6 +1646,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
|
||||
`cat_security_hardening` INT NOT NULL DEFAULT 0,
|
||||
`ignore_skipped` INT NOT NULL DEFAULT 0,
|
||||
`status_of_check` TINYTEXT,
|
||||
`check_unknowns_graph` tinyint DEFAULT '0',
|
||||
PRIMARY KEY(`id_rc`),
|
||||
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
@ -2648,6 +2648,82 @@ INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`
|
||||
SELECT @last_id := LAST_INSERT_ID();
|
||||
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/');
|
||||
|
||||
INSERT INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`page`) VALUES
|
||||
(1,'AgentHive','AgentHive','Agents hive','','AgentHive.php'),
|
||||
(2,'AvgSumMaxMinModule','AvgSumMaxMinModule','Avg|Sum|Max|Min Module Data','','AvgSumMaxMinModule.php'),
|
||||
(3,'BasicChart','BasicChart','Basic chart','','BasicChart.php'),
|
||||
(4,'BlockHistogram','BlockHistogram','Block histogram','','BlockHistogram.php'),
|
||||
(5,'ColorModuleTabs','ColorModuleTabs','Color tabs modules','','ColorModuleTabs.php'),
|
||||
(6,'DataMatrix','DataMatrix','Data Matrix','','DataMatrix.php'),
|
||||
(7,'EventCardboard','EventCardboard','Event cardboard','','EventCardboard.php'),
|
||||
(8,'GroupedMeterGraphs','GroupedMeterGraphs','Grouped meter graphs','','GroupedMeterGraphs.php'),
|
||||
(9,'ModulesByStatus','ModulesByStatus','Modules by status','','ModulesByStatus.php'),
|
||||
(10,'AgentModuleWidget','agent_module','Agent/Module View','','agent_module.php'),
|
||||
(11,'AlertsFiredWidget','alerts_fired','Triggered alerts report','','alerts_fired.php'),
|
||||
(12,'ClockWidget','clock','Clock','','clock.php'),
|
||||
(13,'CustomGraphWidget','custom_graph','Defined custom graph','','custom_graph.php'),
|
||||
(14,'EventsListWidget','events_list','List of latest events','','events_list.php'),
|
||||
(15,'WelcomeWidget','example','Welcome message to Pandora FMS','','example.php'),
|
||||
(16,'GraphModuleHistogramWidget','graph_module_histogram','Module histogram','','graph_module_histogram.php'),
|
||||
(17,'GroupsStatusWidget','groups_status','General group status','','groups_status.php'),
|
||||
(18,'GroupsStatusMapWidget','groups_status_map','Group status map','','groups_status_map.php'),
|
||||
(19,'HeatmapWidget','heatmap','Heatmap','','heatmap.php'),
|
||||
(20,'InventoryWidget','inventory','Inventory','','inventory.php'),
|
||||
(21,'MapsMadeByUser','maps_made_by_user','Visual Console','','maps_made_by_user.php'),
|
||||
(22,'MapsStatusWidget','maps_status','General visual maps report','','maps_status.php'),
|
||||
(23,'ModuleIconWidget','module_icon','Icon and module value','','module_icon.php'),
|
||||
(24,'ModuleStatusWidget','module_status','Module status','','module_status.php'),
|
||||
(25,'ModuleTableValueWidget','module_table_value','Module in a table','','module_table_value.php'),
|
||||
(26,'ModuleValueWidget','module_value','Module value','','module_value.php'),
|
||||
(27,'MonitorHealthWidget','monitor_health','Global health info','','monitor_health.php'),
|
||||
(28,'Netflow','netflow','Netflow','','netflow.php'),
|
||||
(29,'NetworkMapWidget','network_map','Network map','','network_map.php'),
|
||||
(30,'OsQuickReportWidget','os_quick_report','OS quick report','','os_quick_report.php'),
|
||||
(31,'PostWidget','post','Panel with a message','','post.php'),
|
||||
(32,'ReportsWidget','reports','Custom report','','reports.php'),
|
||||
(33,'ServiceMapWidget','service_map','Service map','','service_map.php'),
|
||||
(34,'ServiceViewWidget','service_view','Services view','','service_view.php'),
|
||||
(35,'SingleGraphWidget','single_graph','Agent module graph','','single_graph.php'),
|
||||
(36,'SLAPercentWidget','sla_percent','SLA percentage','','sla_percent.php'),
|
||||
(37,'SystemGroupStatusWidget','system_group_status','Groups status','','system_group_status.php'),
|
||||
(38,'TacticalWidget','tactical','Tactical view','','tactical.php'),
|
||||
(39,'TopNWidget','top_n','Top N of agent modules','','top_n.php'),
|
||||
(40,'TopNEventByGroupWidget','top_n_events_by_group','Top N events by agent','','top_n_events_by_group.php'),
|
||||
(41,'TopNEventByModuleWidget','top_n_events_by_module','Top N events by module','','top_n_events_by_module.php'),
|
||||
(42,'TreeViewWidget','tree_view','Tree view','','tree_view.php'),
|
||||
(43,'UrlWidget','url','URL content','','url.php'),
|
||||
(44,'WuxWidget','wux_transaction','Agent WUX transaction','','wux_transaction.php'),
|
||||
(45,'WuxStatsWidget','wux_transaction_stats','WUX transaction stats','','wux_transaction_stats.php'),
|
||||
(46,'SecurityHardening','security_hardening','Security Hardening','','security_hardening.php');
|
||||
|
||||
INSERT INTO `tmap` (`id`,`id_group`,`id_user`,`type`,`subtype`,`name`,`description`,`height`,`width`,`center_x`,`center_y`,`background`,`background_options`,`source_period`,`source`,`source_data`,`generation_method`,`generated`,`filter`,`id_group_map`,`refresh_time`) VALUES (1,'0','admin',0,0,'Sample dynamic map','This is a sample dynamic map.',900,900,0,0,'',0,60,0,'0',6,0,'{\"dont_show_subgroups\":0,\"node_radius\":40,\"x_offs\":\"0\",\"y_offs\":\"0\",\"z_dash\":\"1\",\"node_sep\":\"0.25\",\"rank_sep\":\"0.5\",\"mindist\":\"1\",\"kval\":\"0.3\"}',0,300);
|
||||
INSERT INTO `treport` (`id_report`,`id_user`,`name`,`description`,`private`,`id_group`,`custom_logo`,`header`,`first_page`,`footer`,`custom_font`,`id_template`,`id_group_edit`,`metaconsole`,`non_interactive`,`hidden`,`orientation`,`cover_page_render`,`index_render`) VALUES (1,'admin','Sample report #1','This is a sample report, just to show you some general report items.',0,0,NULL,NULL,'<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><img src="http://localhost/pandora_console//images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>',NULL,'Lato-Regular.ttf',0,0,0,0,0,'vertical',1,1);
|
||||
INSERT INTO `treport_content` (`id_rc`,`id_report`,`id_gs`,`id_agent_module`,`type`,`period`,`period_range`,`order`,`name`,`description`,`id_agent`,`text`,`external_source`,`treport_custom_sql_id`,`header_definition`,`column_separator`,`line_separator`,`time_from`,`time_to`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`,`only_display_wrong`,`top_n`,`top_n_value`,`exception_condition`,`exception_condition_value`,`show_resume`,`order_uptodown`,`show_graph`,`group_by_agent`,`style`,`id_group`,`id_module_group`,`server_name`,`historical_db`,`lapse_calc`,`lapse`,`visual_format`,`hide_no_data`,`recursion`,`show_extended_events`,`total_time`,`time_failed`,`time_in_ok_status`,`time_in_warning_status`,`time_in_unknown_status`,`time_of_not_initialized_module`,`time_of_downtime`,`total_checks`,`checks_failed`,`checks_in_ok_status`,`checks_in_warning_status`,`unknown_checks`,`agent_max_value`,`agent_min_value`,`current_month`,`failover_mode`,`failover_type`,`uncompressed_module`,`summary`,`landscape`,`pagebreak`,`compare_work_time`,`graph_render`,`ipam_network_filter`,`ipam_alive_ips`,`ipam_ip_not_assigned_to_agent`,`macros_definition`,`render_definition`,`use_prefix_notation`,`cat_security_hardening`,`ignore_skipped`,`status_of_check`) VALUES
|
||||
(1,1,0,0,'agents_inventory',300,0,1,'General agent inventory','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>','{\"agent_server_filter\":\"\",\"agents_inventory_display_options\":[\"alias\",\"comentarios\",\"id_grupo\",\"direccion\",\"id_os\",\"estado\"],\"agent_custom_field_filter\":\"\",\"agent_os_filter\":[\"0\"],\"agent_custom_fields\":[\"3\",\"2\",\"1\"],\"agent_status_filter\":[\"-1\"],\"agent_version_filter\":\"\",\"agent_module_search_filter\":\"\",\"agent_group_filter\":\"0\",\"agent_remote_conf\":\"\"}',0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250"}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL),
|
||||
(2,1,0,0,'top_n',28800,0,2,'Top CPU per agent','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,3,10,0,10,0,1,1,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","text_agent":"Lio=","text_agent_module":"Y3B1Lio="}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL),
|
||||
(3,1,0,0,'event_report_group',21600,0,3,'General event report','This is a sample of not normal events for any agent available in the last 6 hours',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","server_multiple":"\"\"","show_summary_group":0,"filter_event_severity":"[\"20\"]","filter_event_type":"[\"all\"]","filter_event_status":"[\"-1\"]","event_graph_by_agent":"1","event_graph_by_user_validator":"1","event_graph_by_criticity":"1","event_graph_validated_vs_unvalidated":0,"event_filter_search":"","event_filter_exclude":"","custom_data_events":"1","label":""}',0,0,'',0,0,300,0,0,NULL,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL);
|
||||
INSERT INTO `tdashboard` (`id`,`name`,`id_user`,`id_group`,`active`,`cells`,`cells_slideshow`) VALUES
|
||||
(1,'Sample Dashboard #1','',0,0,0,0),
|
||||
(2,'Sample Dashboard #2','',0,0,0,0);
|
||||
INSERT INTO `twidget_dashboard` (`id`,`position`,`options`,`order`,`id_dashboard`,`id_widget`,`prop_width`,`prop_height`) VALUES
|
||||
(1,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Agents hive\",\"background\":\"#ffffff\",\"groups\":[\"12,8,4,9,2,10,13,11\"]}',0,1,1,0.32,0.32),
|
||||
(2,'{\"x\":\"4\",\"y\":\"0\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Clock\",\"background\":\"#ffffff\",\"clockType\":\"analogic\"}',1,1,12,0.32,0.32),
|
||||
(3,'{\"x\":\"7\",\"y\":\"0\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Event cardboard\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"8\",\"eventStatus\":\"-1\",\"groupId\":[\"0\"],\"severity\":\"4,1,0,5,2,3\",\"nodes\":0}',2,1,7,0.32,0.32),
|
||||
(4,'{\"x\":\"7\",\"y\":\"2\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Heatmap\",\"background\":\"#ffffff\",\"search\":\"\",\"type\":\"3\",\"groups\":[\"0\"]}',3,1,19,0.32,0.32),
|
||||
(5,'{\"x\":\"0\",\"y\":\"4\",\"width\":\"4\",\"height\":\"6\"}','{\"title\":\"Groups status\",\"background\":\"#ffffff\",\"groupId\":[\"0\"],\"status\":[\"4,1,0,2\"],\"groupRecursion\":false}',4,1,37,0.32,0.32),
|
||||
(6,'{\"x\":\"4\",\"y\":\"4\",\"width\":\"3\",\"height\":\"6\"}','{\"title\":\"Unknown Group overview\",\"background\":\"#ffffff\",\"groupId\":\"10\",\"groupRecursion\":0}',5,1,17,0.32,0.32),
|
||||
(7,'{\"x\":\"7\",\"y\":\"4\",\"width\":\"5\",\"height\":\"6\"}','{\"title\":\"CPU Status\",\"background\":\"#ffffff\",\"search\":\"cpu\",\"status\":\"1,0,2\",\"limit\":\"5\",\"nodes\":\"\",\"disabled_modules\":1}',6,1,9,0.32,0.32),
|
||||
(8,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"6\",\"height\":\"13\"}','{\"title\":\"Last event view\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"24\",\"limit\":40,\"eventStatus\":\"-1\",\"severity\":\"-1\",\"groupId\":[\"0\"],\"tagsId\":[\"\"],\"groupRecursion\":0,\"customFilter\":\"-1\",\"columns_events_widget\":[\"mini_severity,evento,estado,agent_name,timestamp\",\"\"]}',0,2,14,0.32,0.32),
|
||||
(9,'{\"x\":\"6\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Tactical view\",\"background\":\"#ffffff\",\"statusMonitor\":1,\"serverPerformance\":1,\"summary\":1,\"groupId\":[\"0\"]}',1,2,38,0.32,0.32),
|
||||
(10,'{\"x\":\"6\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Top N events per agent\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\",\"show_total_data\":0}',3,2,40,0.32,0.32),
|
||||
(11,'{\"x\":\"10\",\"y\":\"0\",\"width\":\"2\",\"height\":\"4\"}','{\"title\":\"Dynamic map\",\"background\":\"#ffffff\",\"networkmapId\":\"1\",\"xOffset\":\"0\",\"yOffset\":\"0\",\"zoomLevel\":0.6}',2,2,29,0.32,0.32),
|
||||
(12,'{\"x\":\"9\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Fired alerts\",\"background\":\"#ffffff\",\"groupId\":\"0\",\"group_recursion\":\"\"}',4,2,11,0.32,0.32),
|
||||
(13,'{\"x\":\"0\",\"y\":\"13\",\"width\":\"6\",\"height\":\"3\"}','{\"title\":\"Infrastructure treeview\",\"background\":\"#ffffff\",\"typeTree\":\"group\",\"groupId\":\"0\",\"openAllGroups\":1,\"agentStatus\":\"-1\",\"filterAgent\":\"\",\"moduleStatus\":\"6\",\"filterModule\":\"\"}',7,2,42,0.32,0.32),
|
||||
(14,'{\"x\":\"6\",\"y\":\"8\",\"width\":\"6\",\"height\":\"4\"}','{\"title\":\"Top N events per module\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\"}',5,2,41,0.32,0.32),
|
||||
(15,'{\"x\":\"6\",\"y\":\"12\",\"width\":\"6\",\"height\":\"4\"}',NULL,6,2,30,0.32,0.32),
|
||||
(16,'{\"x\":\"0\",\"y\":\"16\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"\",\"background\":\"#ffffff\",\"agentId\":0}',8,2,15,0.32,0.32),
|
||||
(17,'{\"x\":\"4\",\"y\":\"16\",\"width\":\"8\",\"height\":\"4\"}','{\"title\":\"Top10 CPU Modules per agent\",\"background\":\"#ffffff\",\"agent\":\".*\",\"module\":\"CPU\",\"period\":\"86400\",\"quantity\":\"10\",\"order\":\"1\",\"display\":\"0\",\"type_graph\":\"bar_vertical\",\"legend\":\"agent\"}',9,2,39,0.32,0.32);
|
||||
|
||||
-- Insert new VMware APP
|
||||
SET @short_name = 'pandorafms.vmware';
|
||||
SET @name = 'VMware';
|
||||
|
@ -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(
|
||||
[
|
||||
|
@ -328,11 +328,11 @@ function updateProgress(url, auth) {
|
||||
}
|
||||
|
||||
if (general_label.innerText == "100.00 %") {
|
||||
cleanExit();
|
||||
window.onbeforeunload = undefined;
|
||||
if (_auxIntervalReference != null) {
|
||||
window.clearInterval(_auxIntervalReference);
|
||||
}
|
||||
return;
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
ajax({
|
||||
@ -375,6 +375,19 @@ function updateProgress(url, auth) {
|
||||
|
||||
general_action.innerText = d.result.processing;
|
||||
task_action.innerText = d.result.message;
|
||||
|
||||
// Reload to update console.
|
||||
if (
|
||||
d.result.extra != undefined &&
|
||||
d.result.extra.reload != undefined &&
|
||||
d.result.extra.reload === true
|
||||
) {
|
||||
window.onbeforeunload = undefined;
|
||||
if (_auxIntervalReference != null) {
|
||||
window.clearInterval(_auxIntervalReference);
|
||||
}
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
error: function(d) {
|
||||
dprog.innerHTML = umErrorMsg(d.error);
|
||||
|
@ -27,7 +27,9 @@
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
?>
|
||||
<head>
|
||||
<link rel="stylesheet" href="<?php $asset('resources/styles/um.css'); ?>?v=<?php echo $config['current_package']; ?>">
|
||||
@ -57,16 +59,25 @@ global $config;
|
||||
$settings = update_manager_get_config_values();
|
||||
$umc = new \UpdateManager\Client($settings);
|
||||
$updates = $umc->listUpdates();
|
||||
if ($updates === null) {
|
||||
$updates = [];
|
||||
}
|
||||
|
||||
$text_for_next_version = '';
|
||||
$text_for_last_version = '';
|
||||
$back_up_url = 'index.php?sec=gextensions&sec2=enterprise/godmode/manage_backups';
|
||||
if ($updates[0]['lts'] === true) {
|
||||
if (isset($updates[0]['lts']) === true
|
||||
&& $updates[0]['lts'] === true
|
||||
) {
|
||||
$text_for_next_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
|
||||
} else {
|
||||
$text_for_next_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
|
||||
}
|
||||
|
||||
if ($updates[array_key_last($updates)]['lts'] === true) {
|
||||
if (isset($updates[array_key_last($updates)]) === true
|
||||
&& isset($updates[array_key_last($updates)]['lts']) === true
|
||||
&& $updates[array_key_last($updates)]['lts'] === true
|
||||
) {
|
||||
$text_for_last_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
|
||||
} else {
|
||||
$text_for_last_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
|
||||
@ -160,14 +171,19 @@ global $config;
|
||||
}
|
||||
},
|
||||
error: function(e, r) {
|
||||
if (typeof r != "undefined" ) {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' '+r
|
||||
);
|
||||
if(e != '504') {
|
||||
if (typeof r != "undefined" ) {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' '+r
|
||||
);
|
||||
} else {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' RC'+e
|
||||
);
|
||||
}
|
||||
} else {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' RC'+e
|
||||
);
|
||||
cleanExit();
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
@ -202,12 +218,17 @@ global $config;
|
||||
}
|
||||
},
|
||||
error: function(e, r) {
|
||||
if (typeof r != "undefined" ) {
|
||||
result.innerHTML = umErrorMsg(r);
|
||||
if(e != '504') {
|
||||
if (typeof r != "undefined" ) {
|
||||
result.innerHTML = umErrorMsg(r);
|
||||
} else {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update:'); ?> RC'+e
|
||||
);
|
||||
}
|
||||
} else {
|
||||
result.innerHTML = umErrorMsg(
|
||||
'<?php echo __('Failed to update:'); ?> RC'+e
|
||||
);
|
||||
cleanExit();
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -75,144 +75,69 @@ if (empty($dashboards) === true) {
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->headstyle['name'] = 'text-align: left;';
|
||||
$table->headstyle['cells'] = 'text-align: center;';
|
||||
$table->headstyle['groups'] = 'text-align: center;';
|
||||
$table->headstyle['favorite'] = 'text-align: center;';
|
||||
$table->headstyle['full_screen'] = 'text-align: center;';
|
||||
|
||||
$table->style = [];
|
||||
$table->style['name'] = 'text-align: left;';
|
||||
$table->style['cells'] = 'text-align: center;';
|
||||
$table->style['groups'] = 'text-align: center;';
|
||||
$table->style['favorite'] = 'text-align: center;';
|
||||
$table->style['full_screen'] = 'text-align: center;';
|
||||
|
||||
$table->size = [];
|
||||
$table->size['name'] = '40%';
|
||||
$table->size['full_screen'] = '30px';
|
||||
|
||||
$table->head = [];
|
||||
$table->head['name'] = __('Name');
|
||||
$table->head['cells'] = __('Cells');
|
||||
$table->head['groups'] = __('Group');
|
||||
$table->head['favorite'] = __('Favorite');
|
||||
$table->head['full_screen'] = __('Full screen');
|
||||
$id_table = 'dashboards_list';
|
||||
$columns = [
|
||||
'name',
|
||||
'cells',
|
||||
'groups',
|
||||
'favorite',
|
||||
'full_screen',
|
||||
];
|
||||
|
||||
$column_names = [
|
||||
__('Name'),
|
||||
__('Cells'),
|
||||
__('Group'),
|
||||
__('Favorite'),
|
||||
__('Full screen'),
|
||||
];
|
||||
if ($manageDashboards === 1) {
|
||||
$table->head['copy'] = __('Copy');
|
||||
$table->head['delete'] = __('Delete');
|
||||
$table->headstyle['copy'] = 'text-align: center;';
|
||||
$table->headstyle['delete'] = 'text-align: center;';
|
||||
$table->style['copy'] = 'text-align: center;';
|
||||
$table->style['delete'] = 'text-align: center;';
|
||||
$table->size['cells'] = '30px';
|
||||
$table->size['groups'] = '30px';
|
||||
$table->size['favorite'] = '30px';
|
||||
$table->size['copy'] = '30px';
|
||||
$table->size['delete'] = '30px';
|
||||
} else {
|
||||
$table->size['cells'] = '60px';
|
||||
$table->size['groups'] = '60px';
|
||||
$table->size['favorite'] = '60px';
|
||||
$columns[] = 'copy';
|
||||
$columns[] = 'delete';
|
||||
$column_names[] = __('Copy');
|
||||
$column_names[] = __('Delete');
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
foreach ($dashboards as $dashboard) {
|
||||
$data = [];
|
||||
|
||||
$dataQuery = ['dashboardId' => $dashboard['id']];
|
||||
|
||||
$url = $urlDashboard.'&'.http_build_query($dataQuery);
|
||||
$data['name'] = '<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;
|
||||
}
|
||||
|
||||
\html_print_table($table);
|
||||
$tablePagination = \ui_pagination(
|
||||
$count,
|
||||
false,
|
||||
$offset,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
''
|
||||
ui_print_datatable(
|
||||
[
|
||||
'id' => $id_table,
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/dashboard.ajax',
|
||||
'ajax_data' => [
|
||||
'method' => 'draw',
|
||||
'urlDashboard' => $urlDashboard,
|
||||
'manageDashboards' => $manageDashboards,
|
||||
],
|
||||
'default_pagination' => $config['block_size'],
|
||||
'no_sortable_columns' => [],
|
||||
'order' => [
|
||||
'field' => 'name',
|
||||
'direction' => 'desc',
|
||||
],
|
||||
'search_button_class' => 'sub filter float-right',
|
||||
'form' => [
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Name'),
|
||||
'type' => 'text',
|
||||
'class' => 'w80p',
|
||||
'id' => 'free_search',
|
||||
'name' => 'free_search',
|
||||
],
|
||||
[
|
||||
'label' => __('Group'),
|
||||
'type' => 'select_groups',
|
||||
'id' => 'group',
|
||||
'name' => 'group',
|
||||
],
|
||||
],
|
||||
],
|
||||
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
|
||||
'csv' => false,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -72,37 +72,36 @@ $output .= '<h2 id="title_tip">'.$title.'</h2>';
|
||||
$output .= '<p id="text_tip">';
|
||||
$output .= $text;
|
||||
$output .= '</p>';
|
||||
|
||||
$link_class = 'invisible';
|
||||
$disabled_class = 'disabled_button';
|
||||
$disabled = true;
|
||||
if (empty($url) === false && $url !== '') {
|
||||
$link_class = '';
|
||||
$disabled_class = '';
|
||||
$disabled = false;
|
||||
}
|
||||
|
||||
$output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_tip">'.__('See more info').'</a>';
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
$output .= '<div class="ui-dialog-buttonset">';
|
||||
|
||||
$output .= '<a href="'.$url.'" class="" target="_blank" id="url_tip">';
|
||||
$output .= html_print_button(
|
||||
__('Maybe later'),
|
||||
__('Learn more'),
|
||||
'learn_more',
|
||||
$disabled,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onclick' => 'close_dialog()',
|
||||
'class' => 'secondary mini',
|
||||
],
|
||||
['class' => 'secondary mini '.$disabled_class],
|
||||
true
|
||||
);
|
||||
$output .= '</a>';
|
||||
$output .= '<div class="counter-tips">';
|
||||
$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter']);
|
||||
$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter']);
|
||||
|
||||
$output .= html_print_image('images/arrow-left-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'previous_tip()']);
|
||||
$output .= html_print_image('images/arrow-right-grey.png', true, ['class' => 'arrow_counter', 'onclick' => 'next_tip()']);
|
||||
$output .= html_print_input_hidden('tip_position', 0, true);
|
||||
$output .= '</div>';
|
||||
if ($preview === true) {
|
||||
$output .= html_print_button(
|
||||
__('Ok'),
|
||||
'next_tip',
|
||||
__('Close'),
|
||||
'close_dialog',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
@ -113,12 +112,12 @@ if ($preview === true) {
|
||||
);
|
||||
} else {
|
||||
$output .= html_print_button(
|
||||
__('Ok'),
|
||||
'next_tip',
|
||||
__('Close'),
|
||||
'close_dialog',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'onclick' => 'next_tip()',
|
||||
'onclick' => 'close_dialog()',
|
||||
'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini',
|
||||
],
|
||||
true
|
||||
|
@ -43,7 +43,7 @@ if ((int) $cellData['id_widget'] !== 0 || $widgetId !== 0) {
|
||||
true
|
||||
);
|
||||
|
||||
$output .= '<div class="new-widget-message">';
|
||||
$output .= '<div class="new-widget-message w100p">';
|
||||
$output .= \ui_print_info_message(
|
||||
__('Please select widget'),
|
||||
'',
|
||||
|
@ -268,7 +268,7 @@
|
||||
<div class="row" id="auto-rescaling">
|
||||
<div class="col-8 br-r trigger-100">
|
||||
<div class="subtitle link padding10 padding2">
|
||||
<?php echo __('Number of events per hour ('.$config['event_view_hr'].' hrs)'); ?></b> <a href="index.php?sec=eventos&sec2=operation/events/events&filter[event_view_hr]=24&filter[tag_with]=WyIwIl0=&filter[tag_without]=WyIwIl0="><?php echo __('Info'); ?></a>
|
||||
<?php echo __('Number of events per hour ('.$config['event_view_hr'].' hrs)'); ?></b> <a href="index.php?sec=eventos&sec2=operation/events/events&filter[event_view_hr]=<?php echo $config['event_view_hr']; ?>&filter[tag_with]=WyIwIl0=&filter[tag_without]=WyIwIl0="><?php echo __('Info'); ?></a>
|
||||
</div>
|
||||
<div id="events-last-24"><?php echo $Events->loading(); ?></div>
|
||||
<div class="row br-t h100p observer">
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-server
|
||||
Version: 7.0NG.774-231116
|
||||
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-231116"
|
||||
pandora_version="7.0NG.774-231127"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.774";
|
||||
my $pandora_build = "231116";
|
||||
my $pandora_build = "231127";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
@ -128,7 +128,6 @@ sub pandora_get_sharedconfig ($$) {
|
||||
my ($pa_config, $dbh) = @_;
|
||||
|
||||
# Agentaccess option
|
||||
$pa_config->{"agentaccess"} = pandora_get_tconfig_token ($dbh, 'agentaccess', 1);
|
||||
|
||||
# Realtimestats 0 disabled, 1 enabled.
|
||||
# Master servers will generate all the information (global tactical stats).
|
||||
@ -466,7 +465,6 @@ sub pandora_load_config {
|
||||
# don't get an error later.
|
||||
$pa_config->{"realtimestats"} = 0;
|
||||
$pa_config->{"stats_interval"} = 300;
|
||||
$pa_config->{"agentaccess"} = 1;
|
||||
$pa_config->{"event_storm_protection"} = 0;
|
||||
$pa_config->{"use_custom_encoding"} = 0;
|
||||
$pa_config->{"node_metaconsole"} = 0; # > 7.0NG
|
||||
|
@ -2159,24 +2159,6 @@ sub send_console_notification {
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
=head2 C<< pandora_access_update (I<$pa_config>, I<$agent_id>, I<$dbh>) >>
|
||||
|
||||
Update agent access table.
|
||||
|
||||
=cut
|
||||
##########################################################################
|
||||
sub pandora_access_update ($$$) {
|
||||
my ($pa_config, $agent_id, $dbh) = @_;
|
||||
|
||||
return if ($agent_id < 0);
|
||||
|
||||
if ($pa_config->{"agentaccess"} == 0){
|
||||
return;
|
||||
}
|
||||
db_do ($dbh, "INSERT INTO tagent_access (id_agent, utimestamp) VALUES (?, ?)", $agent_id, time ());
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
=head2 C<< pandora_process_module (I<$pa_config>, I<$data>, I<$agent>, I<$module>, I<$module_type>, I<$timestamp>, I<$utimestamp>, I<$server_id>, I<$dbh>) >>
|
||||
|
||||
@ -2413,10 +2395,8 @@ sub pandora_process_module ($$$$$$$$$;$) {
|
||||
|
||||
} else {
|
||||
if($new_status == 0 && $ff_normal > $min_ff_event) {
|
||||
# Reached normal FF but status have not changed, reset counters.
|
||||
# Reached normal FF but status have not changed, reset counter.
|
||||
$ff_normal = 0;
|
||||
$ff_critical = 0;
|
||||
$ff_warning = 0;
|
||||
}
|
||||
|
||||
# Active ff interval
|
||||
@ -3428,11 +3408,7 @@ sub pandora_update_agent ($$$$$$$;$$$) {
|
||||
|
||||
# No access update for data without interval.
|
||||
# Single modules from network server, for example. This could be very Heavy for Pandora FMS
|
||||
if ($agent_interval != -1){
|
||||
pandora_access_update ($pa_config, $agent_id, $dbh);
|
||||
} else {
|
||||
|
||||
# Do not update the agent interval
|
||||
if ($agent_interval == -1){
|
||||
$agent_interval = undef;
|
||||
}
|
||||
|
||||
@ -4240,9 +4216,6 @@ sub pandora_delete_agent ($$;$) {
|
||||
# Delete the agent
|
||||
db_do ($dbh, 'DELETE FROM tagente WHERE id_agente = ?', $agent_id);
|
||||
|
||||
# Delete agent access data
|
||||
db_do ($dbh, 'DELETE FROM tagent_access WHERE id_agent = ?', $agent_id);
|
||||
|
||||
# Delete addresses
|
||||
db_do ($dbh, 'DELETE FROM taddress_agent WHERE id_ag = ?', $agent_id);
|
||||
|
||||
@ -6711,8 +6684,7 @@ sub pandora_installation_monitoring($$) {
|
||||
FROM
|
||||
information_schema.tables
|
||||
WHERE
|
||||
table_schema not in ('information_schema', 'mysql')
|
||||
AND table_name NOT IN ('tagent_access, tevento')"
|
||||
table_schema not in ('information_schema', 'mysql')"
|
||||
);
|
||||
$module->{'unit'} = '%';
|
||||
push(@modules, $module);
|
||||
|
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