Merge branch 'develop' into 'ent-10906-Carga-de-datos-de-demo'

# Conflicts:
#   pandora_console/extras/mr/67.sql
#   pandora_console/pandoradb.sql
This commit is contained in:
Alejandro Campos 2023-12-05 15:30:06 +00:00
commit 0bdc6978e6
276 changed files with 343115 additions and 9858 deletions

View File

@ -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'

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -1,6 +1,6 @@
Source: pandora_gotty
Section: utils
Version: 1.0.0
Version: 1.1.0
Priority: optional
Maintainer: PandoraFMS
Build-Depends: debhelper (>= 12)

View File

@ -1,5 +1,5 @@
%define name pandora_gotty
%define version 1.0
%define version 1.1
%define release 1%{?dist}
Summary: pandora_gptty for Pandora FMS
Name: %{name}

View File

@ -74,7 +74,7 @@ def exec_ssh (user:str, add:str, port:int):
try:
print("> Starting SSH connection...")
ssh_command = f"ssh {user}@{add} -p {port}"
subprocess.run(ssh_command, shell=True)
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
except subprocess.CalledProcessError as e:
raise SystemExit(e)
@ -88,7 +88,7 @@ def exec_telnet (add:str, port:int):
try:
print("> Starting Telnet connection...")
ssh_command = f"telnet -E {add} {port}"
subprocess.run(ssh_command, shell=True)
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
except subprocess.CalledProcessError as e:
raise SystemExit(e)

View File

@ -22,13 +22,16 @@ else
fi
SPEC_FILES="$CODEHOME/pandora_console/pandora_console.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, AIX version
# Version 7.0NG.774, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, FreeBSD Version
# Version 7.0NG.774, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, HP-UX Version
# Version 7.0NG.774, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, Solaris Version
# Version 7.0NG.774, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773.3
# Version 7.0NG.774
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -54,7 +54,6 @@ if (!$@) {
use constant AGENT_VERSION => '4.0.1';
use constant AGENT_BUILD => '111213';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
linux => 'cat /proc/meminfo | grep MemTotal: | awk \'{ print $2 }\'',
@ -117,7 +116,6 @@ my $ConfDir = '';
# Pandora FMS agent configuration file
my $ConfFile = 'pandora_agent.conf';
# Broker agent configuration files
my @BrokerPid;
@ -264,7 +262,6 @@ sub valid_regexp ($) {
sub rmrf {
my $path = shift;
local *DIR;
if (-d $path) {
opendir (DIR, $path) || return;
while (defined (my $file_name = readdir(DIR))) {
@ -348,7 +345,6 @@ sub log_message ($$;$) {
}
}
}
################################################################################
# Add the given directory to the PATH.
################################################################################
@ -582,7 +578,6 @@ sub write_broker_conf($){
}
while (my $line = <CONF_FILE>){
# Skip broker definitions
if ($line =~ m/^\s*broker_agent/) {
next;
@ -1810,7 +1805,6 @@ sub exec_plugin ($) {
$Sem->down () if (defined ($Sem));
$Xml .= $output;
$Sem->up () if (defined ($Sem));
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
}
@ -2287,4 +2281,4 @@ This is released under the GNU Lesser General Public License.
Copyright (c) 2005-2023 Pandora FMS
=cut
=cut

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773.3, AIX version
# Version 7.0NG.774, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773.3, HPUX Version
# Version 7.0NG.774, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.773.3, Solaris version
# Version 7.0NG.774, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, AIX version
# Version 7.0NG.774, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-231023
Version: 7.0NG.774-231205
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773.3-231023"
pandora_version="7.0NG.774-231205"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.773.3"
VERSION="7.0NG.774"
fi
# Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.3" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.774" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.3" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.774" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.773.3</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.773.3 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.773.3</string>
<key>CFBundleVersion</key> <string>7.0NG.774</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.774 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.774</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, FreeBSD Version
# Version 7.0NG.774, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, HP-UX Version
# Version 7.0NG.774, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# Copyright (c) 2004-2023 Pandora FMS
# https://pandorafms.com
@ -313,6 +313,15 @@ module_plugin autodiscover --default
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
#module_absoluteinterval 7d
#module_end
# Logs extraction
#module_begin
#module_name Syslog
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, NetBSD Version
# Version 7.0NG.774, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, Solaris Version
# Version 7.0NG.774, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -39,6 +39,14 @@ BEGIN {
use File::Copy;
use Scalar::Util qw(looks_like_number);
use File::Basename;
BEGIN {
eval {
require MIME::Base64;
};
}
BEGIN { push @INC, '/usr/lib/perl5'; }
################################################################################
@ -1030,8 +1038,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773.3';
use constant AGENT_BUILD => '231023';
use constant AGENT_VERSION => '7.0NG.774';
use constant AGENT_BUILD => '231205';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1562,6 +1570,9 @@ sub parse_conf_modules($) {
} elsif ($line =~ /^\s*module_occupiedpercentdisk\s+(.*)$/) {
$module->{'func'} = \&module_occupiedpercentdisk;
$module->{'params'} = $1;
}elsif ($line =~ /^\s*module_regexp\s+(.*)$/) {
$module->{'func'} = \&module_logger;
$module->{'params'} = $1;
} elsif ($line =~ /^\s*module_max\s+(.*)\s*$/) {
$module->{'max'} = $1;
} elsif ($line =~ /^\s*module_min\s+(.*)\s*$/) {
@ -1817,7 +1828,11 @@ sub parse_conf_modules($) {
# Macros
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
$module->{'macros'}{$1} = $2;
# Regexp
}
elsif ($line =~ /^\s*module_pattern(\S+)\s+(.*)\s*$/) {
$module->{'filter'} = $1;
}
}
return;
}
@ -3663,6 +3678,11 @@ sub write_module_xml ($@) {
return;
}
if ($module->{'func'} == \&module_logger) {
$Xml .= $data[0];
return
}
# Critical section
$Sem->down () if (defined ($Sem));
@ -3860,6 +3880,237 @@ sub module_plugin ($) {
return ($output);
}
################################################################################
# Read the logs
################################################################################
sub module_logger ($) {
my $module = shift;
my $status = grep_logs(
$module->{'name'},
$module->{'params'},
$module->{'filter'}
);
return $status;
}
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
my ($str, $endl) = @_;
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
my $str_len = length($str);
my $str_base64 = '';
for (my $i = 0; $i < $str_len; $i += 3) {
my $chunk = substr($str, $i, 3);
my $chunk_len = length($chunk);
my $num = 0;
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
my $enc_1 = ($num & 0xfc0000) >> 18;
my $enc_2 = ($num & 0x03f000) >> 12;
my $enc_3 = ($num & 0x000fc0) >> 6;
my $enc_4 = ($num & 0x00003f);
$str_base64 .= $ALPHABET[$enc_1];
$str_base64 .= $ALPHABET[$enc_2];
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
}
return $str_base64;
};
sub grep_logs {
my ($str_name, $str_file, $str_regex) = @_;
if(!$str_name){
log_message("module_logger", "Missing module name");
return;
}
if(!$str_file){
log_message("module_logger", "Missing file name");
return;
}
if(!$str_regex){
$str_regex = '.*';
}
my $idx_dir = '/tmp/';
my $idx_file = '';
my $idx_pos = 0;
my $idx_size = 0;
my $idx_ino = '';
my $module_name = $str_name;
my $log_file = $str_file;
my $reg_exp = $str_regex;
# Check that log file exists
if (! -e $log_file) {
log_message("module_logger", "File $log_file does not exist");
return;
}
# Create index file storage directory
if (! -d $idx_dir) {
if (!mkdir($idx_dir)){
log_message("module_logger", "Error creating directory $idx_dir: " . $!);
return;
}
}
# Create index file if it does not exist
$idx_file = $idx_dir.$module_name."_".basename($log_file).".idx";
if (! -e $idx_file) {
return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$idx_size) == 1;
return
} else{
return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1;
my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size);
my $output = create_log($module_name, @data);
return $output;
}
# Start the function definition
sub create_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $idx_size_ref) = @_;
my $first_line;
log_message("module_logger", "Creating index file $$idx_file_ref");
if (!open(LOGFILE, $$log_file_ref)){
log_message("module_logger", "Error opening file $$log_file_ref: ".$!);
return 1;
}
# Go to EOF and save the position
seek(LOGFILE, 0, 2);
$$idx_pos_ref = tell(LOGFILE);
close(LOGFILE);
# Save the file inode number
$$idx_ino_ref = (stat($$log_file_ref))[1];
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
return 0;
}
sub save_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
log_message("module_logger", "Saving index file $$idx_file_ref");
if (!open(IDXFILE, "> $$idx_file_ref")){
log_message("module_logger", "Error opening file $$idx_file_ref: ". $!);
return 1;
}
print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref . " " . $$idx_size_ref);
close(IDXFILE);
return 0;
}
sub load_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
my $line;
my $current_ino;
my $current_size;
log_message("module_logger", "Loading index file $$idx_file_ref");
if (!open(IDXFILE, $$idx_file_ref)){
log_message("module_logger", "Error opening file $$idx_file_ref: " .$!);
return 1;
}
# Read position and date
$line = <IDXFILE>;
($$idx_pos_ref, $$idx_ino_ref, $$idx_size_ref) = split(' ', $line);
close(IDXFILE);
# Reset the file index if the file has changed
$current_ino = (stat($$idx_file_ref))[1];
$current_size = -s "$$idx_file_ref";
if ($current_ino != $$idx_ino_ref || $current_size < $$idx_size_ref) {
log_message("module_logger", "File changed, resetting index");
$$idx_pos_ref = 0;
$$idx_ino_ref = $current_ino;
}
$$idx_size_ref = $current_size;
return 0;
}
sub parse_log {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref, $idx_size_ref) = @_;
my $line;
log_message("module_logger", "Parsing log file $$log_file_ref");
# Open log file for reading
if (!open(LOGFILE, $$log_file_ref)){
log_message("module_logger", "Error opening file $$log_file_ref: " . $!);
return 1;
}
# Go to starting position.
seek(LOGFILE, $$idx_pos_ref, 0);
# Parse log file
my @data;
while ($line = <LOGFILE>) {
if ($line =~ m/$$reg_exp_ref/i) {
push (@data, $line);
}
}
$$idx_pos_ref = tell(LOGFILE);
close(LOGFILE);
# Save the index file
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
return @data;
}
sub create_log {
my ($module_name, @data) = @_;
# No data
if ($#data < 0) {
return;
}
# Log module
my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $module_name . "]]></source>\n";
$output .= "<encoding>base64</encoding>\n";
$output .= "<data><![CDATA[";
$output .= &$encode_sub(join('', @data), '');
$output .= "]]></data>\n";
$output .= "</log_module>\n";
return $output;
}
}
################################################################################
# TERM Handler
################################################################################
@ -4030,6 +4281,8 @@ sub init_module ($) {
$module->{'module_ff_interval'} = undef;
$module->{'macros'} = {};
$module->{'alert_template'} = undef;
$module->{'filter'} = undef;
$module->{'absoluteinterval'} = undef;
}
################################################################################

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231023
%define version 7.0NG.774
%define release 231205
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231205
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231205
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231023
%define version 7.0NG.774
%define release 231205
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231023
%define version 7.0NG.774
%define release 231205
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="231023"
PI_VERSION="7.0NG.774"
PI_BUILD="231205"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773.3
# Version 7.0NG.774
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version
@ -526,7 +526,15 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
# Hardening plugin for security compliance analysis.
#module_begin
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe"
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_hardening.exe -t 150"
#module_absoluteinterval 7d
#module_end
# Logs extraction
#module_begin
#module_name X_Server_log
#module_description Logs extraction module
#module_type log
#module_regexp C:\server\logs\xserver.log
#module_pattern .*
#module_end

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db207ef67053764be7e9b42cd04ea5509cc2a023548aab1c037745ca277b68a3
size 4858753

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
size 5248006

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.773.3}
{Pandora FMS Windows Agent v7.0NG.774}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231023}
{231205}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.773.3 Build 231023")
#define PANDORA_VERSION ("7.0NG.774 Build 231205")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.773.3(Build 231023))"
VALUE "ProductVersion", "(7.0NG.774(Build 231205))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-231023
Version: 7.0NG.774-231205
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773.3-231023"
pandora_version="7.0NG.774-231205"
package_pear=0
package_pandora=1

View File

@ -27,17 +27,18 @@
*/
global $config;
if (true) {
include_once '../include/config.php';
include_once '../include/functions_agents.php';
include_once '../include/functions_reporting.php';
include_once '../include/functions_modules.php';
include_once '../include/functions_users.php';
if ((bool) $config['metaconsole']) {
include_once $config['homedir'].'/include/config.php';
include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_modules.php';
include_once $config['homedir'].'/include/functions_users.php';
} else {
include_once '../include/config.php';
include_once '../include/functions_agents.php';
include_once '../include/functions_reporting.php';
include_once '../include/functions_modules.php';
include_once '../include/functions_users.php';
}
@ -106,7 +107,25 @@ if ($get_agents_module_csv === '1') {
foreach ($results as $result) {
foreach ($result as $key => $value) {
$out_csv .= io_safe_output($value).$divider;
if (preg_match('/Linux/i', $_SERVER['HTTP_USER_AGENT'])) {
$value = preg_replace(
'/\s+/',
' ',
io_safe_output($value)
);
} else {
$value = mb_convert_encoding(
preg_replace(
'/\s+/',
'',
io_safe_output($value)
),
'UTF-16LE',
'UTF-8'
);
}
$out_csv .= $value.$divider;
}
$out_csv .= "\n";

View File

@ -99,7 +99,7 @@ function api_execute(
if (empty($token) === true) {
$data['apipass'] = $apipass;
$data['user'] = $user;
$data['password'] = $password;
$data['pass'] = $password;
}
}

View File

@ -90,7 +90,7 @@ function dbmgr_extension_main()
// Header.
ui_print_standard_header(
__('Database interface'),
__('DB interface'),
'images/gm_db.png',
false,
'',

View File

@ -223,6 +223,8 @@ function quickShell()
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$response = curl_exec($ch);
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
@ -541,6 +543,9 @@ if (is_ajax() === true) {
// Maximum time to establish a connection.
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_exec($ch);
$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

View File

@ -1718,3 +1718,6 @@ operation/incidents/list_integriaims_incidents.php
include/functions_incidents.php
include/functions_integriaims.php
include/ajax/integria_incidents.ajax.php
enterprise/operation/log/log_source.php
enterprise/include/class/LogSource.class.php
include/chart_generator.php

View File

@ -1,4 +1,4 @@
pandorafms.vmware=459175dce8ab811e874ce2e7216f0db4
pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b
pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe
pandorafms.mssql=1cc215409741d19080269ffba112810e
pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6

File diff suppressed because it is too large Load Diff

View File

@ -375,4 +375,51 @@ SET @widget_id = NULL;
SELECT @widget_id := `id` FROM `twidget` WHERE `unique_name` = @unique_name;
INSERT IGNORE INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`page`) VALUES (@widget_id,@class_name,@unique_name,@description,'',@page);
ALTER TABLE `tevento`
ADD COLUMN `event_custom_id` TEXT NULL AFTER `module_status`;
-- Telegram and vonage default alerts
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=9;
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=11;
-- Delete table tagent_access
DROP TABLE tagent_access;
ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`;
ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`;
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
ALTER TABLE `tevent_filter`
ADD COLUMN `regex` TEXT NULL AFTER `private_filter_user`;
-- Update macros for plugin oracle
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
UPDATE `tdiscovery_apps_tasks_macros` SET `value` = 'agents_group_id=__taskGroupID__ interval=__taskInterval__ user=_dbuser_ password=_dbpass_ thick_mode=_thickMode_ client_path=_clientPath_ threads=_threads_ modules_prefix=_prefixModuleName_ execute_custom_queries=_executeCustomQueries_ analyze_connections=_checkConnections_ engine_uptime=_checkUptime_ query_stats=_queryStats_ cache_stats=_checkCache_ fragmentation_ratio=_checkFragmentation_ check_tablescpaces=_checkTablespaces_' WHERE `macro` = '_tempfileConf_' AND `id_task` IN (SELECT `id_rt` FROM `trecon_task` WHERE `id_app` = @id_app);
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_thickMode_', 'custom', 0, 0 FROM `trecon_task` WHERE `id_app` = @id_app;
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
-- Update lts updates
UPDATE tconfig SET value='1' WHERE token='lts_updates';
ALTER TABLE `tdashboard`
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,
ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`;
SELECT @generic_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_data";
SELECT @generic_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_proc";
SELECT @async_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_data";
SELECT @async_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_proc";
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_data WHERE `tagente_modulo`.`id_tipo_modulo` = @async_data;
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_proc WHERE `tagente_modulo`.`id_tipo_modulo` = @async_proc;
COMMIT;

View File

@ -418,7 +418,7 @@ switch ($login_screen) {
}
if ($config['enterprise_installed']) {
if ($config['reset_pass_option']) {
if ($config['reset_pass_option'] && $config['auth'] === 'mysql') {
$reset_pass_link = 'reset_pass.php';
// Reset password link.
echo '<div class="reset_password">';

View File

@ -600,43 +600,176 @@ html_print_div(
'content' => html_print_table($tableAgent, true).$CodeQRTable,
]
);
/*
TODO REVIEW
$table_satellite = '';
if ($remote_agent === true) {
// Satellite server selector.
$satellite_servers = db_get_all_rows_filter(
'tserver',
['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE],
[
'id_server',
'name',
]
);
$satellite_names = [];
if (empty($satellite_servers) === false) {
foreach ($satellite_servers as $s_server) {
$satellite_names[$s_server['id_server']] = $s_server['name'];
// Basic Options.
$tableBasicAgent = new stdClass();
$tableBasicAgent->class = 'filter-table-adv';
$tableBasicAgent->data = [];
$disabledBasic = false;
$tableClassDisabled = '';
if ($new_agent === true || $remote_agent === false || $has_remote_conf === false) {
$disabledBasic = true;
$tableClassDisabled = ' basic-options-disabled';
}
if (enterprise_installed()) {
// Get all plugins (BASIC OPTIONS).
$agent_plugin = new PandoraFMS\Agent($id_agente);
$plugins = $agent_plugin->getPlugins();
// Check if some plugin was enabled/disabled in conf.
foreach ($plugins as $key => $row) {
if (preg_match('/pandora_hardening/', $row['raw']) === 1) {
if ($row['disabled'] === 1) {
$security_hardening = 0;
} else {
$security_hardening = 1;
}
}
$table_satellite = '<div class="label_select"><p class="input_label">'.__('Satellite').'</p>';
$table_satellite .= '<div class="label_select_parent">';
if ($id_os === '1' || $id_os === '8') {
if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) {
if ($row['disabled'] === 1) {
$enable_log_collector = 0;
} else {
$enable_log_collector = 1;
}
}
$table_satellite .= html_print_input(
if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) {
if ($row['disabled'] === 1) {
$enable_inventory = 0;
} else {
$enable_inventory = 1;
}
}
} else {
if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) {
if ($row['disabled'] === 1) {
$enable_inventory = 0;
} else {
$enable_inventory = 1;
}
}
}
}
if ($id_os === '9') {
$modules = $agent_plugin->getModules();
foreach ($modules as $key => $row) {
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
if ($row['disabled'] === 1) {
$enable_log_collector = 0;
} else {
$enable_log_collector = 1;
}
}
}
}
unset($agent_plugin, $plugins);
if (($new_agent === true && $config['current_package'] >= 774) || ($agent_version >= 774 && $new_agent === false)) {
if ($disabledBasic === true || $has_remote_conf === false) {
$message = __('Remote config disabled, please activate to enable agent basic options');
$tableBasicAgent->data[] = '<span>'.$message.'</span>';
}
$tableBasicAgent->data[] = html_print_label_input_block(
__('Enable security hardening monitoring'),
html_print_input(
[
'type' => 'select',
'fields' => $satellite_names,
'name' => 'satellite_server',
'selected' => $satellite_server,
'nothing' => __('None'),
'nothinf_value' => 0,
'return' => true,
'type' => 'switch',
'id' => 'security_hardening',
'name' => 'security_hardening',
'value' => $security_hardening,
'disabled' => $disabledBasic,
]
).'<div class="label_select_child_icons"></div></div></div>';
).html_print_input_hidden('options_package', '1', true)
);
$tableBasicAgent->data[] = html_print_label_input_block(
__('Enable log collection'),
html_print_input(
[
'type' => 'switch',
'id' => 'enable_log_collector',
'name' => 'enable_log_collector',
'value' => $enable_log_collector,
'disabled' => $disabledBasic,
]
)
);
}
$tableBasicAgent->data[] = html_print_label_input_block(
__('Enable inventory'),
html_print_input(
[
'type' => 'switch',
'id' => 'enable_inventory',
'name' => 'enable_inventory',
'value' => $enable_inventory,
'disabled' => $disabledBasic,
]
).html_print_input_hidden('enable_basic_options', '1', true)
);
if ($config['ehorus_enabled'] === '1') {
$pandoraRC_Id = html_print_image(
'images/alert_recovered@svg.svg',
true,
[
'class' => 'invert_filter main_menu_icon',
'title' => __('Pandora RC connected with id ').$config['ehorus_custom_field'],
]
);
} else {
$pandoraRC_Id = html_print_image(
'images/alerts.svg',
true,
[
'class' => 'invert_filter main_menu_icon',
'title' => __('This agent do not have a Pandora RC agent installed, install one.'),
]
);
}
*/
$tableBasicAgent->data[] = html_print_label_input_block(
__('Enable remote control'),
$pandoraRC_Id
);
$WarningPackage = '';
if (($new_agent === true && $config['current_package'] < 774) || ($agent_version < 774 && $new_agent === false)) {
$WarningPackage = html_print_image(
'images/alert-yellow@svg.svg',
true,
[
'title' => __('Only available for agents 774 or higher'),
'alt' => __('Only available for agents 774 or higher'),
'class' => 'main_menu_icon mrgn_lft_5px',
]
);
}
} else {
$tableBasicAgent->data[] = '<span>'.__('Remote config is enabled only in the Enteprise version').'</span>';
$tableBasicAgent->data[] .= html_print_input_hidden(
'enable_basic_options',
'0',
true
);
}
ui_toggle(
html_print_table($tableBasicAgent, true),
'<span class="subsection_header_title">'.__('Basic options').$WarningPackage.'</span>',
'',
'basic_options',
true,
false,
'white_box_content',
'no-border white_table_graph'.$tableClassDisabled,
'box-flat white_table_graph invisible'
);
// Advanced options.
$tableAdvancedAgent = new stdClass();
@ -922,6 +1055,26 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
)
);
if (enterprise_installed() === true) {
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
__('Vulnerability scanning'),
html_print_select(
[
0 => __('Disabled'),
1 => __('Enabled'),
2 => __('Use global settings'),
],
'vul_scan_enabled',
$vul_scan_enabled,
'',
'',
0,
true
)
);
}
ui_toggle(
html_print_table($tableAdvancedAgent, true),
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
@ -1236,7 +1389,8 @@ ui_require_jquery_file('bgiframe');
});
$("#checkbox-cascade_protection").change(function () {
var checked = $("#checkbox-cascade_protection").is(":checked"); if (checked) {
var checked = $("#checkbox-cascade_protection").is(":checked");
if (checked) {
$("#cascade_protection_module").removeAttr("disabled");
$("#text-id_parent").attr("required", "required");
}
@ -1246,7 +1400,7 @@ ui_require_jquery_file('bgiframe');
$("#text-id_parent").removeAttr("required");
}
});
var safe_mode_checked = $("#checkbox-safe_mode").is(":checked");
if (safe_mode_checked) {
$("#safe_mode_module").removeAttr("disabled");
@ -1254,10 +1408,10 @@ ui_require_jquery_file('bgiframe');
else {
$("#safe_mode_module").attr("disabled", 'disabled');
}
$("#checkbox-safe_mode").change(function () {
var safe_mode_checked = $("#checkbox-safe_mode").is(":checked");
if (safe_mode_checked) {
$("#safe_mode_module").removeAttr("disabled");
}
@ -1291,5 +1445,17 @@ ui_require_jquery_file('bgiframe');
}
});
check_basic_options();
$('#id_os').on('change', function(){
check_basic_options();
})
});
function check_basic_options(){
if ($('#id_os').val() == 1 || $('#id_os').val() == 8 || $('#id_os').val() == 9) {
$('#basic_options').removeClass('invisible');
} else {
$('#basic_options').addClass('invisible');
}
}
</script>

View File

@ -231,7 +231,8 @@ if ($create_agent) {
$quiet = (int) get_parameter('quiet', 0);
$cps = (int) get_parameter_switch('cps', -1);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
$agent_version = $config['current_package'];
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -298,6 +299,8 @@ if ($create_agent) {
'quiet' => $quiet,
'cps' => $cps,
'fixed_ip' => $fixed_ip,
'vul_scan_enabled' => $vul_scan_enabled,
'agent_version' => $agent_version,
]
);
} else {
@ -610,6 +613,7 @@ if ($id_agente) {
$agent_wizard['active'] = false;
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
if ($has_remote_conf !== false) {
$agent_name = agents_get_name($id_agente);
@ -642,24 +646,26 @@ if ($id_agente) {
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
'vulnerabilities' => $vulnerabilities,
'agent_wizard' => $agent_wizard,
];
} else {
$onheader = [
'view' => $viewtab,
'separator' => '',
'main' => $maintab,
'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab,
'template' => $templatetab,
'inventory' => $inventorytab,
'pluginstab' => $pluginstab,
'policy' => (enterprise_installed() === true) ? $policyTab : '',
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
'agent_wizard' => $agent_wizard,
'view' => $viewtab,
'separator' => '',
'main' => $maintab,
'module' => $moduletab,
'ncm' => $ncm_tab,
'alert' => $alerttab,
'template' => $templatetab,
'inventory' => $inventorytab,
'pluginstab' => $pluginstab,
'policy' => (enterprise_installed() === true) ? $policyTab : '',
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
'vulnerabilities' => $vulnerabilities,
'agent_wizard' => $agent_wizard,
];
}
@ -760,6 +766,11 @@ if ($id_agente) {
$help_header = 'gis_tab';
break;
case 'vulnerabilities':
$tab_name = __('Vulnerabilities');
$help_header = 'vulnerabilities_tab';
break;
case 'incident':
$tab_name = __('Incidents');
break;
@ -1004,6 +1015,14 @@ if ($update_agent) {
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
$satellite_server = (int) get_parameter('satellite_server', 0);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
$security_vunerability = (int) get_parameter_switch('security_vunerability', 0);
$security_hardening = (int) get_parameter_switch('security_hardening', 0);
$security_monitoring = (int) get_parameter_switch('security_monitoring', 0);
$enable_log_collector = (int) get_parameter_switch('enable_log_collector', 0);
$enable_inventory = (int) get_parameter_switch('enable_inventory', 0);
$enable_basic_options = get_parameter('enable_basic_options');
$options_package = get_parameter('options_package', '0');
if ($fields === false) {
$fields = [];
@ -1130,6 +1149,7 @@ if ($update_agent) {
'safe_mode_module' => $safe_mode_module,
'satellite_server' => $satellite_server,
'fixed_ip' => $fixed_ip,
'vul_scan_enabled' => $vul_scan_enabled,
];
if ($config['metaconsole_agent_cache'] == 1) {
@ -1231,6 +1251,81 @@ if ($update_agent) {
);
}
}
if ($enable_basic_options === '1') {
// Get all plugins (BASIC OPTIONS).
$agent = new PandoraFMS\Agent($id_agente);
$plugins = $agent->getPlugins();
foreach ($plugins as $key => $row) {
// Only check plugins when agent package is bigger than 774.
if ($options_package === '1') {
if (preg_match('/pandora_hardening/', $row['raw']) === 1) {
if ($security_hardening === 1) {
if ($row['disabled'] === 1) {
$agent->enablePlugins($row['raw']);
}
} else {
if ($row['disabled'] !== 1) {
$agent->disablePlugins($row['raw']);
}
}
}
if (preg_match('/(module_plugin grep_log_module ).*/', $row['raw']) === 1) {
if ($enable_log_collector === 1) {
if ($row['disabled'] === 1) {
$agent->enablePlugins($row['raw']);
}
} else {
if ($row['disabled'] !== 1) {
$agent->disablePlugins($row['raw']);
}
}
}
}
// Inventory switch enable when basic options are enabled.
if (preg_match('/(module_plugin inventory).*/', $row['raw']) === 1) {
if ($enable_inventory === 1) {
if ($row['disabled'] === 1) {
$agent->enablePlugins($row['raw']);
}
} else {
if ($row['disabled'] !== 1) {
$agent->disablePlugins($row['raw']);
}
}
}
// Inventory switch enable when basic options are enabled.
if (preg_match('/.vbs/', $row['raw']) === 1 && preg_match('/nettraffic.vbs/', $row['raw']) === 0 && preg_match('/software_installed.vbs/', $row['raw']) === 0 && preg_match('/df.vbs/', $row['raw']) === 0 && preg_match('/win_cf.vbs/', $row['raw']) === 0) {
if ($enable_inventory === 1) {
if ($row['disabled'] === 1) {
$agent->enablePlugins($row['raw']);
}
} else {
if ($row['disabled'] !== 1) {
$agent->disablePlugins($row['raw']);
}
}
}
}
$modules = $agent->getModules();
foreach ($modules as $key => $row) {
if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
if ($enable_log_collector === 1) {
if ($row['disabled'] === 1) {
$agent->enableModule($row['module_name'], $row);
}
} else {
if ($row['disabled'] !== 1) {
$agent->disableModule($row['module_name'], $row);
}
}
}
}
}
}
// Read agent data
@ -1287,6 +1382,20 @@ if ($id_agente) {
$safe_mode = ($safe_mode_module) ? 1 : 0;
$satellite_server = (int) $agent['satellite_server'];
$fixed_ip = (int) $agent['fixed_ip'];
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
if (strpos($agent['agent_version'], '(')) {
$agent_version = (int) explode('.', explode('(', $agent['agent_version'])[0])[2];
} else {
if (strpos($agent['agent_version'], 'build') || strpos($agent['agent_version'], 'Build')) {
$agent_version = (int) explode('.', explode('build', $agent['agent_version'])[0])[2];
} else {
if (strpos($agent['agent_version'], '.')) {
$agent_version = (int) explode('.', $agent['agent_version'])[2];
} else {
$agent_version = $agent['agent_version'];
}
}
}
}
$update_module = (bool) get_parameter('update_module');
@ -1326,6 +1435,12 @@ if ($update_module === true || $create_module === true) {
*/
$post_process = (string) get_parameter('post_process', 0.0);
if (modules_made_compatible($id_module_type) === true) {
$made_enabled = (bool) get_parameter_checkbox('made_enabled', 0);
} else {
$made_enabled = false;
}
$prediction_module = (int) get_parameter('prediction_module');
$max_timeout = (int) get_parameter('max_timeout');
$max_retries = (int) get_parameter('max_retries');
@ -1348,6 +1463,14 @@ if ($update_module === true || $create_module === true) {
}
$configuration_data = (string) get_parameter('configuration_data');
$array_configuration_data = explode(PHP_EOL, io_safe_output($configuration_data));
$configuration_data = '';
foreach ($array_configuration_data as $value) {
$configuration_data .= trim($value).PHP_EOL;
}
$configuration_data = io_safe_input($configuration_data);
$old_configuration_data = (string) get_parameter('old_configuration_data');
$new_configuration_data = '';
@ -1488,6 +1611,14 @@ if ($update_module === true || $create_module === true) {
}
$plugin_parameter = (string) get_parameter('plugin_parameter');
$array_plugin_parameter = explode(PHP_EOL, io_safe_output($plugin_parameter));
$plugin_parameter = '';
foreach ($array_plugin_parameter as $value) {
$plugin_parameter .= trim($value).PHP_EOL;
}
$plugin_parameter = io_safe_input($plugin_parameter);
}
$parent_module_id = (int) get_parameter('parent_module_id');
@ -1704,6 +1835,7 @@ if ($update_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
@ -1902,6 +2034,7 @@ if ($create_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
@ -2401,6 +2534,10 @@ switch ($tab) {
include 'agent_conf_gis.php';
break;
case 'vulnerabilities':
include enterprise_include('godmode/agentes/vulnerabilities_editor.php');
break;
case 'incident':
include 'agent_incidents.php';
break;

View File

@ -217,6 +217,7 @@ foreach ($fields as $field) {
array_push($table->data, $data);
}
$tablePagination = '';
if ($fields) {
html_print_table($table);
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
@ -231,6 +232,9 @@ html_print_action_buttons(
[ 'icon' => 'next' ],
true
),
['type' => 'form_action']
[
'type' => 'form_action',
'right_content' => $tablePagination,
],
);
echo '</form>';

View File

@ -38,6 +38,7 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_servers.php';
require_once $config['homedir'].'/include/functions_macros.php';
$search_string = get_parameter('search_string');
@ -949,7 +950,23 @@ if ($modules !== false) {
);
if (strlen($module['ip_target']) !== 0) {
$title .= '<br/>IP: '.$module['ip_target'];
// Check if value is custom field.
if ($module['ip_target'][0] == '_' && $module['ip_target'][(strlen($module['ip_target']) - 1)] == '_') {
$custom_field_name = substr($module['ip_target'], 1, -1);
$custom_value = agents_get_agent_custom_field($id_agente, $custom_field_name);
if (isset($custom_value) && $custom_value !== false) {
$title .= '<br/>IP: '.$custom_value;
} else {
$array_macros = return_agent_macros($id_agente);
if (isset($array_macros[$module['ip_target']])) {
$title .= '<br/>IP: '.$array_macros[$module['ip_target']];
} else {
$title .= '<br/>IP: '.$module['ip_target'];
}
}
} else {
$title .= '<br/>IP: '.$module['ip_target'];
}
}
// This module is initialized ? (has real data).

View File

@ -294,6 +294,7 @@ if ($id_agent_module) {
$plugin_parameter = $module['plugin_parameter'];
$id_plugin = $module['id_plugin'];
$post_process = $module['post_process'];
$made_enabled = $module['made_enabled'];
$prediction_module = $module['prediction_module'];
$custom_integer_1 = $module['custom_integer_1'];
$custom_integer_2 = $module['custom_integer_2'];
@ -408,6 +409,7 @@ if ($id_agent_module) {
$id_module_group = 1;
$id_module_type = 1;
$post_process = '';
$made_enabled = false;
$max_timeout = 0;
$max_retries = 0;
$min = '';

View File

@ -171,7 +171,7 @@ foreach ($password_fields as $k => $p) {
}
$(document).ready(function () {
if ($("#id_plugin").val() === 0) {
if ($("#id_plugin").val() !== 0) {
changePluginSelect();
}
});

View File

@ -131,9 +131,10 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
}
$data = [];
$data[0] = __('Agent');
$data[1] = __('Module');
$data[2] = __('Period');
$data[0] = __('Module');
$data[1] = __('Period');
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
@ -163,34 +164,68 @@ $params['none_module_text'] = __('Select Module');
$params['use_hidden_input_idagent'] = true;
$params['input_style'] = 'width: 100%;';
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
$data[0] = ui_print_agent_autocomplete_input($params);
if ($id_agente > 0) {
$predictionModuleInput = html_print_select_from_sql(
'SELECT id_agente_modulo, nombre
FROM tagente_modulo
WHERE delete_pending = 0
AND history_data = 1
AND id_agente = '.$id_agente_clean.'
AND id_agente_modulo <> '.$id_agente_modulo,
if (strstr($page, 'policy_modules') === false) {
$modules = agents_get_modules($id_agente);
$predictionModuleInput = html_print_select(
$modules,
'prediction_module',
$prediction_module,
'',
__('Select Module'),
'',
0,
true,
false,
true,
'',
false,
'width: 100%;'
false,
false,
false,
false,
'',
false,
false,
false,
false,
true,
false,
false,
'',
false,
'pm'
);
} else {
$predictionModuleInput = '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
$modules = index_array(policies_get_modules($policy_id, false, ['id', 'name']));
$predictionModuleInput = html_print_select(
$modules,
'id_module_policy',
$module['custom_integer_1'],
'',
'',
0,
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
true
);
}
$data[1] = $predictionModuleInput;
$data[2] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
$data[2] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
$data[0] = $predictionModuleInput;
$data[1] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
$data[1] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
$table_simple->cellclass['prediction_module'][0] = 'w33p';
$table_simple->cellclass['prediction_module'][1] = 'w33p';
$table_simple->cellclass['prediction_module'][2] = 'w33p';
@ -264,7 +299,7 @@ if ($selector_form !== ENTERPRISE_NOT_HOOK) {
}
// Synthetic modules are an Enterprise feature.
$synthetic_module_form = enterprise_hook('get_synthetic_module_form');
$synthetic_module_form = enterprise_hook('get_synthetic_module_form', [$policy_id]);
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
$data = [];
$data[0] = $synthetic_module_form;

View File

@ -318,7 +318,7 @@ foreach ($texts as $code => $text) {
return;
}
$(plugin_parameter).val('task_begin\ncookie 0\nresource 0\ntask_end');
$(plugin_parameter).val('task_begin\nget https://demoweb.com/page/\ncheck_string text string or HTML code to search (regexp)\ntask_end\n');
$('#button-btn_loadbasic').attr('disabled', 'disabled');

View File

@ -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'] != '') {

View File

@ -256,7 +256,7 @@ $schedule = io_safe_output(
$data[0] = '';
$data[0] .= html_print_input_hidden('schedule', $schedule, true);
$data[0] .= '<div id="calendar_map"></div>';
$data[0] .= '<div id="calendar_map" class="alert_view_calendar"></div>';
$data[1] = '';
$table_conditions->data[] = $data;

View File

@ -484,6 +484,7 @@ echo '</form>';
ui_require_javascript_file('pandora_alerts');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script type="text/javascript">
@ -500,194 +501,6 @@ $(document).ready (function () {
render_command_description(command_description);
}
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
var values = values || [];
var recovery_values = recovery_values || [];
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').val('');
$('[name=field'+i+'_recovery_value\\[\\]').val('');
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
data.forEach(function(custom_field, key) {
var custom_field_key = key+8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $('#table_macros-field'+custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
var label_name = label_html.split('<br>')[0];
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case 'CHECKBOX':
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
checkbox_selector.on('change', function() {
if (checkbox_selector.prop('checked')) {
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.attr('value', "0");
}
});
checkbox_recovery_selector.on('change', function() {
if (checkbox_recovery_selector.prop('checked')) {
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.attr('value', "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop('checked', true);
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.prop('checked', false);
checkbox_selector.attr('value', "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop('checked', true);
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.prop('checked', false);
checkbox_recovery_selector.attr('value', "0");
}
}
$('[name=field'+custom_field_key+'_value_container]').show();
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'COMBO':
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
combo_input.find('option').remove();
combo_input_recovery.find('option').remove();
var combo_values_array = custom_field.comboValue.split(',');
combo_values_array.forEach(function(value) {
combo_input.append($('<option>', {
value: value,
text: value
}));
combo_input_recovery.append($('<option>', {
value: value,
text: value
}));
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case 'DATE':
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
if (typeof values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
break;
case 'NUMERIC':
if (typeof values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXT':
if (typeof values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXTAREA':
default:
if (typeof values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
}
});
},
"json"
);
}
$("#id_command").change (function () {
values = Array ();
// No se envia el valor del commando.
@ -707,7 +520,7 @@ $(document).ready (function () {
name: "id_action",
value: "<?php echo (int) $id; ?>"
});
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
values,
function (data, status) {
@ -739,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;
}
@ -914,12 +730,22 @@ $(document).ready (function () {
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
ajax_get_integria_custom_fields(
$('#field5_value').val(),
integria_custom_fields_values,
integria_custom_fields_rvalues,
max_macro_fields
);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val());
ajax_get_integria_custom_fields(
$(this).val(),
[],
[],
max_macro_fields
);
});
}

View File

@ -1240,7 +1240,7 @@ if ($step == 2) {
'priority',
$priority,
'',
0,
'',
0,
true,
false,

View File

@ -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');

View File

@ -115,6 +115,7 @@ $fields_available['module_status'] = __('Module Status');
$fields_available['mini_severity'] = __('Severity mini');
$fields_available['module_custom_id'] = __('Module custom ID');
$fields_available['custom_data'] = __('Custom data');
$fields_available['event_custom_id'] = __('Event Custom ID');
// Remove fields already selected.

View File

@ -68,7 +68,7 @@ foreach ($layer_ids as $layer_id) {
$layer_list[] = [
'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null,
'layer_name' => $trimmed_name,
'layer_visible' => ((int) $layers[$layer_id]['visible'] === 1),
'layer_visible' => ($layers[$layer_id]['visible'] === 'true'),
'layer_group' => (int) $layers[$layer_id]['agents_from_group'],
'layer_agent_list' => $layers[$layer_id]['agents'],
'layer_group_list' => $layers[$layer_id]['groups'],
@ -560,21 +560,23 @@ html_print_table($table);
$user_groups = users_get_groups($config['user'], 'AR', false);
echo '<h3>'.__('Layers').'</h3>';
echo '<fieldset class="margin-bottom-10"><legend>'.__('Layers').'</legend>';
$table->width = '100%';
$table->class = 'databox filters';
$table->valign = [];
$table->valign[0] = 'top';
$table->valign[1] = 'top';
$table->valign[0] = 'top; width: 50%';
$table->valign[1] = 'top; width: 50%';
$table->data = [];
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
$table->data[0][1] = '<div class="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'</div>';
$table->data[1][0] = '<table class="databox" border="0" cellpadding="4" cellspacing="4" id="list_layers"></table>';
$table->data[1][1] = '<div id="form_layer" class="invisible">
$table->data[1][0] = '<div id="form_layer" class="invisible">
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
<tr>
<td colspan="4"><hr/></td>
</tr>
<tr>
<td>'.__('Layer name').':</td>
<td>'.html_print_input_text('layer_name_form', '', '', 20, 40, true).'</td>
@ -592,10 +594,6 @@ $table->data[1][1] = '<div id="form_layer" class="invisible">
<td>'.__('Agent').':</td>
<td colspan="3">';
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
@ -608,12 +606,13 @@ $params['javascript_function_action_after_select'] = 'active_button_add_agent';
$params['javascript_is_function_select'] = true;
$params['disabled_javascript_on_blur_function'] = false;
$table->data[1][1] .= ui_print_agent_autocomplete_input($params);
$table->data[1][1] .= '</td>
$table->data[1][0] .= ui_print_agent_autocomplete_input($params);
$buttonAgent = html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$table->data[1][0] .= '</td>
</tr>
<tr>
<td colspan="4" align="right">'.$buttonAgent.'</td>
</tr>
<tr>
<td colspan="4">
<h4>'.__('List of Agents to be shown in the layer').'</h4>
@ -641,7 +640,7 @@ $params['disabled_javascript_on_blur_function'] = false;
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
$table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
$table->data[1][0] .= '<tr><td colspan="4"><hr /></td></tr>
<tr>
<td>'.__('Group').':</td>
<td colspan="3">'.$group_select.'</td>
@ -661,7 +660,7 @@ $table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
</td>
</tr>';
$table->data[1][1] .= '<tr>
$table->data[1][0] .= '<tr>
<td align="right" colspan="4">'.html_print_button(__('Save Layer'), 'save_layer', false, 'javascript:saveNewLayer();', 'class="sub wand"', true).'
'.html_print_input_hidden('current_edit_layer_id', '', true).'
</td>
@ -669,7 +668,12 @@ $table->data[1][1] .= '<tr>
</table>
</div>';
$table->data[1][1] = '<fieldset>
<legend>'.__('Layers list').'</legend>
<table class="databox invisible" border="0" id="list_layers"></table>
</fieldset>';
html_print_table($table);
echo '</fieldset>';
switch ($action) {
case 'save_new':
@ -1229,6 +1233,8 @@ function getLayerRow (layerId, layerData) {
.append($editCol)
.append($deleteCol);
$("#list_layers").removeClass('invisible');
return $row;
}

View File

@ -84,6 +84,9 @@ if (is_ajax() === true) {
}
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
if (str_contains($group['icon'], '.png') === true) {
$group['folder'] = 'groups_small/';
}
echo json_encode($group);
return;
@ -757,6 +760,125 @@ if ($tab == 'tree') {
/*
* Group tree view.
*/
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters filter-table-adv';
if (is_metaconsole() === true) {
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$search_group_string = get_parameter('search_group_string', '');
$search_agent_string = get_parameter('search_agent_string', '');
$agent_status = get_parameter('agent_status', '');
$show_not_init_agents = get_parameter('show_not_init_agents', 1);
$show_not_init_modules = get_parameter('show_not_init_modules', 1);
$show_full_hirearchy = get_parameter('show_full_hirearchy', 1);
$table->data = [];
$table->head = [];
$table->style = [];
$table->style[0] = 'width: 50%;';
$table->style[1] = 'width: 50%;';
$table->data[0][0] = html_print_label_input_block(
__('Search group'),
html_print_input_text(
'search_group_string',
$search_group_string,
'',
25,
255,
true,
false,
false,
'',
)
);
$agents_status_list = agents_status_list();
$table->data[0][1] = html_print_label_input_block(
__('Search by agent status').ui_print_help_tip(__('Shows the groups that contain an agent with the status that has been searched'), true),
html_print_select(
$agents_status_list,
'agent_status',
$agent_status,
'',
__('All'),
'',
true,
false,
false,
'w200p',
false,
'width: 100%;'
)
);
$table->data[1][0] = html_print_label_input_block(
__('Search by agent').ui_print_help_tip(__('Shows groups that contain an agent matching the search'), true),
html_print_input_text(
'search_agent_string',
$search_agent_string,
'',
25,
255,
true,
false,
false,
'',
)
);
$table->data[1][1] = html_print_label_input_block(
__('Show full hierarchy'),
html_print_checkbox_switch_extended(
'show_full_hirearchy',
1,
$show_full_hirearchy,
false,
'',
'',
true
)
);
$table->data[3][0] = '&nbsp;';
$table->data[3][1] = html_print_submit_button(
__('Filter'),
'filter',
false,
[
'class' => 'float-right',
'icon' => 'search',
],
true
);
$form = "<form method='post' action=''>";
$form .= html_print_table($table, true);
$form .= '</form>';
ui_toggle(
$form,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo "<div id='tree-controller-recipient'></div>";
} else {
/*
@ -826,6 +948,8 @@ if ($tab == 'tree') {
);
$form .= '</form>';
ui_toggle(
$form,
'<span class="subsection_header_title">'.__('Filters').'</span>',
@ -1058,87 +1182,119 @@ $tab = 'group_edition';
<?php } ?>
<script type="text/javascript">
var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();
let show_full_hirearchy = "<?php echo $show_full_hirearchy; ?>";
let show_not_init_agents = "<?php echo $show_not_init_agents; ?>";
let show_not_init_modules = "<?php echo $show_not_init_modules; ?>";
showSpinner();
$('#checkbox-show_full_hirearchy').on("change", function() {
if (show_full_hirearchy == 1) {
show_full_hirearchy = 0;
} else {
show_full_hirearchy = 1;
}
});
var parameters = {};
parameters['page'] = "include/ajax/tree.ajax";
parameters['getChildren'] = 1;
parameters['type'] = "<?php echo $tab; ?>";
parameters['filter'] = {};
parameters['filter']['searchGroup'] = '';
parameters['filter']['searchAgent'] = '';
parameters['filter']['statusAgent'] = '';
parameters['filter']['searchModule'] = '';
parameters['filter']['statusModule'] = '';
parameters['filter']['groupID'] = '';
parameters['filter']['tagID'] = '';
parameters['filter']['searchHirearchy'] = 1;
parameters['filter']['show_not_init_agents'] = 1;
parameters['filter']['show_not_init_modules'] = 1;
$('#button-filter').on('click', function(event) {
console.log('here');
event.preventDefault();
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: parameters,
success: function(data) {
if (data.success) {
hideSpinner();
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
});
treeController.init({
recipient: $("div#tree-controller-recipient"),
page: parameters['page'],
emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: "<?php echo __('Found groups'); ?>",
tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'],
counterTitles: {
total: {
agents: "<?php echo __('Total agents'); ?>",
modules: "<?php echo __('Total modules'); ?>",
none: "<?php echo __('Total'); ?>"
},
alerts: {
agents: "<?php echo __('Fired alerts'); ?>",
modules: "<?php echo __('Fired alerts'); ?>",
none: "<?php echo __('Fired alerts'); ?>"
},
critical: {
agents: "<?php echo __('Critical agents'); ?>",
modules: "<?php echo __('Critical modules'); ?>",
none: "<?php echo __('Critical'); ?>"
},
warning: {
agents: "<?php echo __('Warning agents'); ?>",
modules: "<?php echo __('Warning modules'); ?>",
none: "<?php echo __('Warning'); ?>"
},
unknown: {
agents: "<?php echo __('Unknown agents'); ?>",
modules: "<?php echo __('Unknown modules'); ?>",
none: "<?php echo __('Unknown'); ?>"
},
not_init: {
agents: "<?php echo __('Not init agents'); ?>",
modules: "<?php echo __('Not init modules'); ?>",
none: "<?php echo __('Not init'); ?>"
},
ok: {
agents: "<?php echo __('Normal agents'); ?>",
modules: "<?php echo __('Normal modules'); ?>",
none: "<?php echo __('Normal'); ?>"
window.addEventListener('load', function() {
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
});
function load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules) {
var treeController = TreeController.getController();
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
treeController.recipient.empty();
showSpinner();
var parameters = {};
parameters['page'] = "include/ajax/tree.ajax";
parameters['getChildren'] = 1;
parameters['type'] = "<?php echo $tab; ?>";
parameters['filter'] = {};
parameters['filter']['searchGroup'] = $('#text-search_group_string').val();
parameters['filter']['searchAgent'] = $('#text-search_agent_string').val();
parameters['filter']['statusAgent'] = $('#agent_status option:selected').val();
parameters['filter']['searchModule'] = '';
parameters['filter']['statusModule'] = '';
parameters['filter']['groupID'] = '';
parameters['filter']['tagID'] = '';
parameters['filter']['searchHirearchy'] = 1;
parameters['filter']['show_full_hirearchy'] = show_full_hirearchy;
parameters['filter']['show_not_init_agents'] = show_not_init_agents;
parameters['filter']['show_not_init_modules'] = show_not_init_modules;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: parameters,
success: function(data) {
if (data.success) {
hideSpinner();
treeController.init({
recipient: $("div#tree-controller-recipient"),
page: parameters['page'],
emptyMessage: "<?php echo __('No data found'); ?>",
foundMessage: "<?php echo __('Found groups'); ?>",
tree: data.tree,
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
filter: parameters['filter'],
counterTitles: {
total: {
agents: "<?php echo __('Total agents'); ?>",
modules: "<?php echo __('Total modules'); ?>",
none: "<?php echo __('Total'); ?>"
},
alerts: {
agents: "<?php echo __('Fired alerts'); ?>",
modules: "<?php echo __('Fired alerts'); ?>",
none: "<?php echo __('Fired alerts'); ?>"
},
critical: {
agents: "<?php echo __('Critical agents'); ?>",
modules: "<?php echo __('Critical modules'); ?>",
none: "<?php echo __('Critical'); ?>"
},
warning: {
agents: "<?php echo __('Warning agents'); ?>",
modules: "<?php echo __('Warning modules'); ?>",
none: "<?php echo __('Warning'); ?>"
},
unknown: {
agents: "<?php echo __('Unknown agents'); ?>",
modules: "<?php echo __('Unknown modules'); ?>",
none: "<?php echo __('Unknown'); ?>"
},
not_init: {
agents: "<?php echo __('Not init agents'); ?>",
modules: "<?php echo __('Not init modules'); ?>",
none: "<?php echo __('Not init'); ?>"
},
ok: {
agents: "<?php echo __('Normal agents'); ?>",
modules: "<?php echo __('Normal modules'); ?>",
none: "<?php echo __('Normal'); ?>"
}
}
}
});
}
},
dataType: "json"
});
});
}
},
dataType: "json"
});
}
</script>

View File

@ -255,7 +255,18 @@ $table->data[1][1] = html_print_select(
true,
'',
false,
'width:180px;'
'width:180px;',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
$table->data[1][2] = __('When select agents');
$table->data[1][2] .= '<br>';
@ -271,7 +282,31 @@ $table->data[1][2] .= html_print_select(
'',
true
);
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
$table->data[1][3] = html_print_select(
[],
'module[]',
'',
false,
'',
'',
true,
true,
false,
'',
false,
'width:180px;',
false,
false,
false,
'',
true,
false,
false,
false,
true,
true,
false
);
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';

View File

@ -916,7 +916,24 @@ $table->data[17][0] = html_print_label_input_block(
)
);
$table->data[17][1] = html_print_label_input_block(
$table->data['made_enabled'][1] = html_print_label_input_block(
__('MADE enabled').ui_print_help_tip(
__('By activating this option, the module data will be processed by the MADE engine (if active), and events will be generated automatically by the IA engine'),
true
),
html_print_checkbox_switch(
'made_enabled',
1,
false,
true,
false,
'',
false,
'wp100 static'
)
);
$table->data[17][2] = html_print_label_input_block(
__('SNMP community'),
html_print_input_text(
'snmp_community',
@ -1653,7 +1670,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
var params = {
@ -1728,7 +1746,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show ();
switch($('#module_type').val()) {
@ -1838,7 +1857,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide ();
$('input[type=checkbox]').attr('checked', false);
$('input[type=checkbox]').attr('disabled', true);
@ -1877,7 +1897,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show();
}
else {
@ -1908,7 +1929,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -1932,6 +1954,9 @@ $(document).ready (function () {
else if (this.id == "checkbox-dynamic_two_tailed") {
return; //Do none
}
else if (this.id == "checkbox-made_enabled") {
return; //Do none
}
else {
if (this.id == "checkbox-force_group") {
$("#checkbox-recursion").prop("checked", false);
@ -1964,7 +1989,7 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-40").show ();
}
else {
@ -1995,7 +2020,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -2085,7 +2111,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
jQuery.post ("ajax.php",
@ -2315,6 +2342,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
'module_interval',
'disabled',
'post_process',
'made_enabled',
'unit_select',
'snmp_community',
'snmp_oid',
@ -2626,6 +2654,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['macros'] = json_encode($module_macros);
}
if (modules_made_compatible($module['id_tipo_modulo']) === false) {
$values['made_enabled'] = 0;
}
$result = modules_update_agent_module(
$module['id_agente_modulo'],
$values,

View File

@ -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(

View File

@ -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 = [];

View File

@ -367,6 +367,8 @@ if ($access_console_node === true) {
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
$sub['godmode/agentes/planned_downtime.list']['text'] = __('Scheduled downtime');
$sub['godmode/agentes/planned_downtime.list']['id'] = 'scheduled_downtime';
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
@ -711,6 +713,17 @@ if ($access_console_node === true) {
}
if ($access_console_node === true) {
// Tools
$menu_godmode['tools']['text'] = __('Tools');
$menu_godmode['tools']['sec2'] = 'operation/extensions';
$menu_godmode['tools']['id'] = 'oper-extensions';
$sub = [];
$sub['operation/agentes/exportdata']['text'] = __('Export data');
$sub['operation/agentes/exportdata']['id'] = 'export_data';
$sub['extensions/files_repo']['text'] = __('File repository');
$sub['extensions/files_repo']['id'] = 'file_repository';
$menu_godmode['tools']['sub'] = $sub;
// About.
$menu_godmode['about']['text'] = __('About');
$menu_godmode['about']['id'] = 'about';

View File

@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
$buttons['graph_container'] = [
'active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
'images/graph-container.svg@svg',
'images/graph-container@svg.svg',
true,
[
'title' => __('Graph container'),

View File

@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) {
$data = [];
if (is_metaconsole() === false) {
$data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='.$map['id'].'&amp;refr='.$refr.'">'.$map['name'].'</a>';
$data[0] = '<a href="index.php?sec=network&amp;sec2=operation/visual_console/render_view&amp;id='.$map['id'].'&amp;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'].'&amp;refr='.$refr.'">'.$map['name'].'</a>';
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&amp;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&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;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&amp;sec2=godmode/reporting/map_builder&amp;id_layout='.$map['id'].'&amp;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'].'&amp;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'].'&amp;delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
@ -571,6 +571,7 @@ if (!$maps && is_metaconsole() === false) {
}
if ($maps || is_metaconsole() === true) {
$buttons = '';
if ($vconsoles_write || $vconsoles_manage) {
if (is_metaconsole() === false) {
$actionUrl = 'index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder';
@ -578,20 +579,22 @@ if ($maps || is_metaconsole() === true) {
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
}
echo '<form action="'.$actionUrl.'" method="post">';
html_print_input_hidden('edit_layout', 1);
$buttons .= '<form action="'.$actionUrl.'" method="post">';
$buttons .= html_print_input_hidden('edit_layout', 1, true);
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
),
[ 'right_content' => $tablePagination ]
$buttons .= html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
);
echo '</form>';
$buttons .= '</form>';
}
html_print_action_buttons(
$buttons,
[ 'right_content' => $tablePagination ]
);
}

View File

@ -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':
@ -1084,6 +1086,50 @@ switch ($action) {
$period = $item['period'];
break;
case 'vuls_severity_graph':
$group = $item['id_group'];
break;
case 'vuls_attack_complexity':
$group = $item['id_group'];
break;
case 'vuls_by_packages':
$group = $item['id_group'];
break;
case 'vuls_by_agent':
$group = $item['id_group'];
$es = json_decode($item['external_source'], true);
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$security_hardening_score = $es['security_hardening_score'];
$vulnerabilities_status = $es['vulnerabilities_status'];
$secmon_status = $es['secmon_status'];
break;
case 'vuls_info_agent':
$idAgent = $item['id_agent'];
$es = json_decode($item['external_source'], true);
$vul_package = $es['vul_package'];
$vul_severity = $es['vul_severity'];
$vul_ac = $es['vul_ac'];
$vul_pr = $es['vul_pr'];
$vul_ui = $es['vul_ui'];
$vul_av = (empty($es['vul_av']) === true) ? 'all' : $es['vul_av'];
break;
case 'top_n_agents_vuls':
$group = $item['id_group'];
$recursion = $item['recursion'];
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
break;
case 'top_n_vuls_count':
$group = $item['id_group'];
$recursion = $item['recursion'];
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
break;
default:
// It's not possible.
break;
@ -1589,7 +1635,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 +1743,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
@ -1932,33 +2011,8 @@ if (is_metaconsole() === true) {
<td class="bolder"><?php echo __('Source'); ?></td>
<td >
<?php
$agents = agents_get_group_agents($group);
if ((empty($agents)) || $agents == -1) {
$agents = [];
}
$sql_log = 'SELECT source AS k, source AS v
FROM tagente,tagent_module_log
WHERE tagente.id_agente = tagent_module_log.id_agent
AND tagente.disabled = 0';
if (!empty($agents)) {
$index = 0;
foreach ($agents as $key => $a) {
if ($index == 0) {
$sql_log .= ' AND (id_agente = '.$key;
} else {
$sql_log .= ' OR id_agente = '.$key;
}
$index++;
}
$sql_log .= ')';
}
html_print_select_from_sql(
$sql_log,
html_print_select(
[],
'source',
$source,
'onselect=source_change_agents();',
@ -1966,7 +2020,7 @@ if (is_metaconsole() === true) {
'',
false,
false,
false
false,
);
?>
</td>
@ -2946,6 +3000,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
@ -3938,6 +4009,217 @@ if (is_metaconsole() === true) {
?>
</td>
</tr>
<tr id="row_secmon_status" class="datos">
<td class="bolder">
<?php
echo __('Secmon status');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'critical' => __('Critical'),
'warning' => __('Warning'),
],
'secmon_status',
$secmon_status,
);
?>
</td>
</tr>
<tr id="row_security_hardening_score" class="datos">
<td class="bolder">
<?php
echo __('Security hardening score');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'90' => __('< 90%'),
'80' => __('< 80%'),
'70' => __('< 70%'),
'60' => __('< 60%'),
'50' => __('< 50%'),
'40' => __('< 40%'),
'30' => __('< 30%'),
'20' => __('< 20%'),
'10' => __('< 10%'),
],
'security_hardening_score',
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
'',
'',
0,
false,
false,
false
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_status" class="datos">
<td class="bolder">
<?php
echo __('Vulnerabilities status');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'crit' => __('Critical'),
'warn' => __('Warning'),
],
'vulnerabilities_status',
$vulnerabilities_status,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_packages" class="datos">
<td class="bolder">
<?php
echo __('Package').ui_print_help_tip(__('Select a agent for load his packages.'), true);
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
],
'vul_package',
$vul_package,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_severity" class="datos">
<td class="bolder">
<?php
echo __('Severity');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'high' => __('High'),
'low' => __('Low'),
'none' => __('None'),
],
'vul_severity',
$vul_severity,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_ac" class="datos">
<td class="bolder">
<?php
echo __('Attack Complexity');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'H' => __('High'),
'L' => __('Low'),
],
'vul_ac',
$vul_ac,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_pr" class="datos">
<td class="bolder">
<?php
echo __('Privileges Required');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'H' => __('High'),
'L' => __('Low'),
'N' => __('None'),
],
'vul_pr',
$vul_pr,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_ui" class="datos">
<td class="bolder">
<?php
echo __('User Interaction');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'R' => __('Required'),
'N' => __('None'),
],
'vul_ui',
$vul_ui,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_av" class="datos">
<td class="bolder">
<?php
echo __('Attack vector');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'A' => __('Adjacent Network'),
'L' => __('Local'),
'N' => __('Network'),
'P' => __('Physical'),
],
'vul_av',
(empty($vul_av) === true) ? 'all' : $vul_av,
'',
'',
0,
false,
false,
false
);
?>
</td>
</tr>
<?php endif; ?>
<tr id="row_status_check" class="datos">
@ -5665,6 +5947,27 @@ $(document).ready (function () {
return false;
}
break;
case 'vuls_info_agent':
if ($("#hidden-id_agent").val() == 0) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'top_n_agents_vuls':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
case 'top_n_vuls_count':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
default:
break;
}
@ -5819,7 +6122,24 @@ $(document).ready (function () {
return false;
}
break;
case 'vuls_info_agent':
if ($("#hidden-id_agent").val() == 0) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'top_n_agents_vuls':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
case 'top_n_vuls_count':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
default:
break;
}
@ -6702,68 +7022,41 @@ function loadGeneralAgents(agent_group) {
function loadLogAgents() {
var params = [];
params.push("get_log_agents=1");
params.push("source=<?php echo $source; ?>");
params.push('id_agents=<?php echo json_encode($id_agents); ?>');
params.push("page=include/ajax/reporting.ajax");
let source = '<?php echo $source; ?>';
let agent = '<?php echo json_encode($id_agents); ?>';
agent = JSON.parse(agent);
$('#id_agents3')
.find('option')
.remove();
var params = {};
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",
type: "POST",
url: "ajax.php",
async: true,
success: function(data) {
$('#id_agents3').find('option').remove();
$('#source option[value!=""]').remove();
$('#id_agents3')
.append('<option>Loading agents...</option>');
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action=
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
+ "/ajax.php",
timeout: 300000,
dataType: 'json',
success: function (data) {
if (data['correct']) {
$('#id_agents3')
.find('option')
.remove();
var selectElements = [];
var selectedStr = 'selected="selected"';
if (data['select_agents'] === null) {
return;
}
if (Array.isArray(data['select_agents'])) {
data['select_agents'].forEach(function(agentAlias, agentID) {
var optionAttr = '';
if (typeof data['agents_selected'][agentID] !== 'undefined') {
optionAttr = ' selected="selected"';
}
$('#id_agents3')
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
});
$.each(data['source'],function(key,value) {
if (value === source) {
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
} else {
for (const [agentID, agentAlias] of Object.entries(data['select_agents'])) {
var optionAttr = '';
if (typeof data['agents_selected'][agentID] !== 'undefined') {
optionAttr = ' selected="selected"';
}
$('#id_agents3')
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
}
$('#source').append( `<option value='${key}'>${value}</option>`);
}
}
});
$.each(data['agent'],function(key,value) {
const result = agent.includes(key);
if (result === true) {
$('#id_agents3').append( `<option selected='selected' value='${key}'>${value}</option>`);
} else {
$('#id_agents3').append( `<option value='${key}'>${value}</option>`);
}
});
}
});
}
@ -6777,10 +7070,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();
@ -6896,12 +7189,22 @@ 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();
$("#row_cat_security_hardening").hide();
$("#row_ignore_skipped").hide();
$("#row_status_check").hide();
$("#row_secmon_status").hide();
$("#row_security_hardening_score").hide();
$("#row_vulnerabilities_status").hide();
$("#row_vulnerabilities_packages").hide();
$("#row_vulnerabilities_severity").hide();
$("#row_vulnerabilities_ac").hide();
$("#row_vulnerabilities_pr").hide();
$("#row_vulnerabilities_ui").hide();
$("#row_vulnerabilities_av").hide();
// SLA list default state.
$("#sla_list").hide();
@ -6947,7 +7250,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();
@ -6961,7 +7264,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();
@ -6988,6 +7291,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'){
@ -7801,6 +8105,50 @@ function chooseType() {
$("#row_group").show();
$('#row_period').show();
break;
case 'vuls_severity_graph':
$("#row_group").show();
break;
case 'vuls_attack_complexity':
$("#row_group").show();
break;
case 'vuls_by_packages':
$("#row_group").show();
break;
case 'vuls_by_agent':
$("#row_group").show();
$("#row_custom_field_filter").show();
$("#row_secmon_status").show();
$("#row_security_hardening_score").show();
$("#row_vulnerabilities_status").show();
break;
case 'vuls_info_agent':
$("#row_agent").show();
$("#row_vulnerabilities_packages").show();
$("#row_vulnerabilities_severity").show();
$("#row_vulnerabilities_ac").show();
$("#row_vulnerabilities_pr").show();
$("#row_vulnerabilities_ui").show();
$("#row_vulnerabilities_av").show();
updatePackages();
$('#row_agent input[type=text]').change(function(e) {
updatePackages();
});
break;
case 'top_n_agents_vuls':
$("#row_group").show();
$("#row_max_items").show();
break;
case 'top_n_vuls_count':
$("#row_group").show();
$("#row_max_items").show();
break;
}
switch (type) {
@ -7948,23 +8296,37 @@ function set_last_value_period() {
}
function source_change_agents() {
$("#id_agents3").empty();
$("#spinner_hack").show();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_source_json" : 1,
"source" : $("#source").val()
},
function (data, status) {
for (var clave in data) {
$("#id_agents3").append(
'<option value="'+clave+'">'+data[clave]+'</option>'
);
const source = $("#source").val();
if (source === '') {
$("#id_agents3 option[value!=0]").attr("style","display:");
} else {
$("#spinner_hack").show();
$("#id_agents3 option").attr("style","display:none");
var params = {};
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,
dataType: "json",
type: "POST",
url: "ajax.php",
async: true,
success: function(data) {
$.each(data,function(key,value) {
$(`#id_agents3 option[value*='${value}']`).attr("style","display:");
});
$("#spinner_hack").hide();
},
error: function(error){
$("#spinner_hack").hide();
}
$("#spinner_hack").hide();
},
"json"
);
});
}
}
function dialog_message(message_id) {
@ -7984,7 +8346,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");
@ -8029,13 +8391,53 @@ function control_period_range() {
}, 800);
}
}
function updateSelect(element, fields, selected) {
if (typeof fields === "object") {
$(element).find("select").empty();
$(element).find(".select2-container .select2-selection__rendered").empty();
Object.keys(fields).forEach(function(key) {
if (key === selected) {
$(element).find(".select2-container .select2-selection__rendered").append(`${fields[key]}`);
$(element).find("select").append(`<option value="${key}" selected>${fields[key]}</option>`);
} else {
$(element).find("select").append(`<option value="${key}">${fields[key]}</option>`);
}
});
}
}
function updatePackages() {
let id_agent = $('#hidden-id_agent').val();
let server_id = $('#hidden-server_id').val();
$.ajax({
method: "POST",
url: "<?php echo ui_get_full_url('ajax.php'); ?>",
data: {
page: "<?php echo ENTERPRISE_DIR.'/include/ajax/vulnerabilities.ajax'; ?>",
action: "updatePackages",
id_agent: id_agent,
server_id: server_id,
},
success: function(data) {
const json = JSON.parse(data);
if (json.success) {
updateSelect("#row_vulnerabilities_packages", json.data, '<?php echo $vul_package; ?>');
}
}
});
}
$(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){

View File

@ -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,

View File

@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user']
$options['div_class'] = '';
}
$table->data[2][1] = html_print_label_input_block(
__('Group'),
$table->data[3][0] = html_print_label_input_block(
__('Write Access Group'),
html_print_select_groups(
false,
'RW',
@ -216,7 +216,7 @@ if ($enterpriseEnable) {
if (enterprise_installed() === true) {
$table->data[3][0] = html_print_label_input_block(
$table->data[4][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
@ -226,7 +226,7 @@ if (enterprise_installed() === true) {
)
);
$table->data[3][1] = html_print_label_input_block(
$table->data[4][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',

View File

@ -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(
@ -2045,6 +2046,56 @@ switch ($action) {
$good_format = true;
break;
case 'vuls_severity_graph':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_attack_complexity':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_packages':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_agent':
$values['id_group'] = get_parameter('combo_group');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['secmon_status'] = get_parameter('secmon_status');
$es['security_hardening_score'] = get_parameter('security_hardening_score');
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'vuls_info_agent':
$values['id_agent'] = get_parameter('id_agent');
$es['server_id'] = get_parameter('server_id');
$es['vul_package'] = get_parameter('vul_package');
$es['vul_severity'] = get_parameter('vul_severity');
$es['vul_ac'] = get_parameter('vul_ac');
$es['vul_pr'] = get_parameter('vul_pr');
$es['vul_ui'] = get_parameter('vul_ui');
$es['vul_av'] = get_parameter('vul_av');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'top_n_agents_vuls':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
case 'top_n_vuls_count':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter(
@ -2867,6 +2918,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(
@ -2977,6 +3029,56 @@ switch ($action) {
$good_format = true;
break;
case 'vuls_severity_graph':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_attack_complexity':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_packages':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_agent':
$values['id_group'] = get_parameter('combo_group');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['secmon_status'] = get_parameter('secmon_status');
$es['security_hardening_score'] = get_parameter('security_hardening_score');
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'vuls_info_agent':
$values['id_agent'] = get_parameter('id_agent');
$es['server_id'] = get_parameter('server_id');
$es['vul_package'] = get_parameter('vul_package');
$es['vul_severity'] = get_parameter('vul_severity');
$es['vul_ac'] = get_parameter('vul_ac');
$es['vul_pr'] = get_parameter('vul_pr');
$es['vul_ui'] = get_parameter('vul_ui');
$es['vul_av'] = get_parameter('vul_av');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'top_n_agents_vuls':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
case 'top_n_vuls_count':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
default:
$values['period'] = get_parameter('period');
$values['top_n'] = get_parameter(

View File

@ -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,

View File

@ -164,6 +164,9 @@ switch ($activeTab) {
$width = (int) get_parameter('width');
$height = (int) get_parameter('height');
$visualConsoleName = (string) get_parameter('name');
$visualConsoleName = str_replace('&lt;', '', $visualConsoleName);
$visualConsoleName = str_replace('&gt;', '', $visualConsoleName);
$visualConsoleName = (string) io_safe_input($visualConsoleName);
$is_favourite = (int) get_parameter('is_favourite_sent');
$auto_adjust = (int) get_parameter('auto_adjust_sent');
@ -239,7 +242,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 +875,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,

View File

@ -24,14 +24,6 @@ if (! check_acl($config['id_user'], 0, 'AR')
ui_require_css_file('discovery');
ui_require_javascript_file('pandora_alerts');
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
ui_require_javascript_file('pandora_fullcalendar');
/**
* Mask class names.
@ -212,115 +204,3 @@ if ($classname_selected === null) {
Wizard::printBigButtonsList($wiz_data);
}
$is_management_allowed = is_management_allowed();
$task_id = get_parameter('task', '');
if ($task_id !== '') {
$task = db_get_row_filter(
'tuser_task_scheduled',
['id' => $task_id]
);
$args = unserialize($task['args']);
$event_calendar = io_safe_output($args['weekly_schedule']);
} else {
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
}
?>
<script type="text/javascript">
$(document).ready (function () {
$("#table-new-job-3").hide();
var edit = '<?php echo $task_id; ?>';
if (edit != '') {
exec_calendar();
}
$("#scheduled").change(exec_calendar);
function exec_calendar() {
if ($("#scheduled").val() == "weekly") {
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
var eventsBBDD = '<?php echo $event_calendar; ?>';
var events = loadEventBBDD(eventsBBDD);
var calendarEl = document.getElementById('calendar_map');
var options = {
contentHeight: "auto",
headerToolbar: {
left: "",
center: "",
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
},
buttonText: {
dayGridWeek: '<?php echo __('Simple'); ?>',
timeGridWeek: '<?php echo __('Detailed'); ?>'
},
dayHeaderFormat: { weekday: "short" },
initialView: "dayGridWeek",
navLinks: false,
selectable: true,
selectMirror: true,
slotDuration: "01:00:00",
slotLabelInterval: "02:00:00",
snapDuration: "01:00:00",
slotMinTime: "00:00:00",
slotMaxTime: "24:00:00",
scrollTime: "01:00:00",
locale: "en-GB",
firstDay: 1,
eventTimeFormat: {
hour: "numeric",
minute: "2-digit",
hour12: false
},
eventColor: "#82b92e",
editable: is_management_allowed === 0 ? false : true,
dayMaxEvents: 3,
dayPopoverFormat: { weekday: "long" },
defaultAllDay: false,
displayEventTime: true,
displayEventEnd: true,
selectOverlap: false,
eventOverlap: false,
allDaySlot: true,
droppable: false,
select: is_management_allowed === 0 ? false : select_alert_template,
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
};
var settings = {
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
removeText: '<?php echo __('Remove'); ?>',
userLanguage: '<?php echo get_user_language(); ?>',
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
tooltipText: '<?php echo __('Drag out to remove'); ?>',
alert: '<?php echo __('Alert'); ?>'
}
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
calendar.render();
$("#table-new-job-3").show();
$('.fc-event-title').hide();
$(".fc-button-active" ).trigger( "click" );
} else {
$("#calendar_map").html();
$("#table-new-job-3").hide();
}
}
});
</script>

View File

@ -151,6 +151,10 @@ if (isset($_GET['server']) === true) {
$title .= __('Netflow server').' ID: '.$id_server;
break;
case SERVER_TYPE_MADE:
$title .= __('MADE server').' ID: '.$id_server;
break;
default:
$title = __('Update server').' ID: '.$id_server;
break;

View File

@ -860,8 +860,10 @@ if (empty($create) === false || empty($view) === false) {
if ($management_allowed === false) {
ui_print_warning_message(
__(
'This console is not manager of this environment,
please manage this feature from centralized manager console (Metaconsole).'
'This console is not manager of this environment, please manage this feature from feature from %s.',
'<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/servers/plugin_registration&tab=plugin_registration&pure=0'
).'">'.__('metaconsole').'</a>'
)
);
}

View File

@ -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'].'&nbsp;&nbsp;&nbsp;&nbsp;'.$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] = '';
if ($server['queued_modules'] > 500) {
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
$data[7] = '';
if ($server['queued_modules'] >= $config['number_modules_queue']) {
$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>&nbsp;&nbsp;';
}
$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=advanced_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'].'&amp;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'].'&amp;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) {

View File

@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) {
$fallback_directory = 'images';
// Get directory.
$directory = (string) get_parameter('directory');
$directory = str_replace('&lt;', '', $text);
$directory = str_replace('&gt;', '', $text);
if (empty($directory) === true) {
$directory = $fallback_directory;
} else {

View File

@ -54,8 +54,12 @@ if (isset($_POST['create'])) {
if (! $result) {
ui_print_error_message(__('There was a problem creating link'));
} else {
ui_print_success_message(__('Successfully created'));
$id_link = $result;
ui_print_result_message(
$id_link,
__('Successfully created'),
__('Could not be created')
);
}
}
@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
$link = '';
}
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
if ($creation_mode == 1) {
echo "<input type='hidden' name='create' value='1'>";
} else {
@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
)
);
echo '</form></td></tr></table>';
echo '</td></tr></table></form>';
} else {
// Main list view for Links editor
$rows = db_get_all_rows_in_table('tlink', 'name');
// Main list view for Links editor.
$rows = db_get_all_fields_in_table('tlink', '', '', 'name');
if ($rows === false) {
$rows = [];
}

View File

@ -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()
{

View File

@ -97,6 +97,24 @@ try {
'column_names' => $column_names,
'ajax_url' => 'include/ajax/os',
'ajax_data' => ['method' => 'drawOSTable'],
'pagination_options' => [
[
$config['block_size'],
10,
25,
100,
200,
500,
],
[
$config['block_size'],
10,
25,
100,
200,
500,
],
],
'ajax_postprocess' => 'process_datatables_item(item)',
'no_sortable_columns' => [
-1,
@ -137,6 +155,10 @@ if (is_metaconsole() === true) {
true
);
$buttons .= '</form>';
} else {
$buttons .= '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
$buttons .= html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true);
$buttons .= '</form>';
}
html_print_action_buttons(
@ -150,15 +172,6 @@ html_print_action_buttons(
echo '<div id="aux" class="invisible"></div>';
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
html_print_action_buttons(
html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true),
['type' => 'form_action']
);
echo '</form>';
?>
<script language="javascript" type="text/javascript">
function process_datatables_item(item) {

View File

@ -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:

View File

@ -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',

Some files were not shown because too many files have changed in this diff Show More