Merge remote-tracking branch 'origin/develop' into ent-9662-Restyling-fuentes-colores-botones

Conflicts:
	pandora_console/godmode/users/user_list.php
	pandora_console/operation/events/events.php
This commit is contained in:
daniel 2023-02-22 12:35:34 +01:00
commit 8230ae616b
95 changed files with 10785 additions and 10023 deletions

View File

@ -9,7 +9,7 @@
# RedHat 8.5 # RedHat 8.5
#Constants #Constants
S_VERSION='202302081' S_VERSION='202302201'
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log" LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
@ -275,6 +275,8 @@ EO_CONFIG_F
if [ "$MYVER" -eq '80' ] ; then if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi fi
execute_cmd "systemctl restart mysqld" "Configuring database engine" execute_cmd "systemctl restart mysqld" "Configuring database engine"

View File

@ -4,6 +4,7 @@
############################################################################################################## ##############################################################################################################
## Tested versions ## ## Tested versions ##
# Ubuntu 22.04.1 # Ubuntu 22.04.1
# Ubuntu 22.04.2
#avoid promps #avoid promps
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy WORKDIR=/opt/pandora/deploy
S_VERSION='202302081' S_VERSION='202302201'
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log" LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start rm -f $LOGFILE &> /dev/null # remove last log before start
@ -181,7 +182,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
[mysqld] [mysqld]
datadir=/var/lib/mysql datadir=/var/lib/mysql
user=mysql user=mysql
character-set-server=utf8 character-set-server=utf8mb4
skip-character-set-client-handshake skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 symbolic-links=0
@ -196,7 +197,7 @@ innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M innodb_log_file_size = 64M
innodb_log_buffer_size = 16M innodb_log_buffer_size = 16M
innodb_io_capacity = 100 innodb_io_capacity = 300
thread_cache_size = 8 thread_cache_size = 8
thread_stack = 256K thread_stack = 256K
max_connections = 100 max_connections = 100

View File

@ -431,7 +431,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
# Copy gotty utility # Copy gotty utility
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
@ -639,8 +639,8 @@ systemctl enable tentacle_serverd &>> $LOGFILE
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
# Enabling condole cron # Enabling condole cron
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS 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 http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab 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 agent ## Enabling agent
systemctl enable pandora_agent_daemon &>> $LOGFILE systemctl enable pandora_agent_daemon &>> $LOGFILE
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"

View File

@ -5,7 +5,7 @@
## Tested versions ## ## Tested versions ##
# Centos 8.4, 8.5 # Centos 8.4, 8.5
# Rocky 8.4, 8.5, 8.6, 8.7 # Rocky 8.4, 8.5, 8.6, 8.7
# Almalinuz 8.4, 8.5 # Almalinux 8.4, 8.5
# RedHat 8.5 # RedHat 8.5
#Constants #Constants
@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='202301251' S_VERSION='202302201'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables # define default variables
@ -107,6 +107,17 @@ check_root_permissions () {
fi fi
} }
installing_docker () {
#Installing docker for debug
echo "Start installig docker" &>> "$LOGFILE"
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &>> "$LOGFILE"
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
systemctl disable --now docker &>> "$LOGFILE"
systemctl disable docker.socket --now &>> "$LOGFILE"
echo "End installig docker" &>> "$LOGFILE"
}
## Main ## Main
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
@ -207,6 +218,7 @@ else
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
fi fi
execute_cmd "installing_docker" "Installing Docker for debug"
#Installing wget #Installing wget
execute_cmd "dnf install -y wget" "Installing wget" execute_cmd "dnf install -y wget" "Installing wget"
@ -454,7 +466,7 @@ innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M innodb_log_file_size = 64M
innodb_log_buffer_size = 16M innodb_log_buffer_size = 16M
innodb_io_capacity = 100 innodb_io_capacity = 300
thread_cache_size = 8 thread_cache_size = 8
thread_stack = 256K thread_stack = 256K
max_connections = 100 max_connections = 100
@ -483,6 +495,7 @@ EO_CONFIG_F
if [ "$MYVER" -eq '80' ] ; then if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi fi
execute_cmd "systemctl restart mysqld" "Configuring database engine" execute_cmd "systemctl restart mysqld" "Configuring database engine"
@ -517,7 +530,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages" execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
# Copy gotty utility # Copy gotty utility
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
@ -732,8 +745,8 @@ systemctl enable tentacle_serverd &>> "$LOGFILE"
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
# Enabling condole cron # Enabling condole cron
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS 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 http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab 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 agent ## Enabling agent
systemctl enable pandora_agent_daemon &>> "$LOGFILE" systemctl enable pandora_agent_daemon &>> "$LOGFILE"
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
@ -743,7 +756,7 @@ execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
cat > /etc/issue.net << EOF_banner cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8
------------------------------------------ ------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console Go to Public http://$ipplublic/pandora_console$to 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"}') $(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"}')

View File

@ -4,6 +4,7 @@
############################################################################################################## ##############################################################################################################
## Tested versions ## ## Tested versions ##
# Ubuntu 22.04.1 # Ubuntu 22.04.1
# Ubuntu 22.04.2
#avoid promps #avoid promps
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy WORKDIR=/opt/pandora/deploy
S_VERSION='202301251' S_VERSION='202302201'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start rm -f $LOGFILE &> /dev/null # remove last log before start
@ -106,6 +107,21 @@ check_root_permissions () {
fi fi
} }
installing_docker () {
#Installing docker for debug
echo "Start installig docker" &>> "$LOGFILE"
mkdir -m 0755 -p /etc/apt/keyrings &>> "$LOGFILE"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /etc/apt/keyrings/docker.gpg &>> "$LOGFILE"
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &>> "$LOGFILE"
apt update -y &>> "$LOGFILE"
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
systemctl disable docker --now &>> "$LOGFILE"
systemctl disable docker.socket --now &>> "$LOGFILE"
echo "End installig docker" &>> "$LOGFILE"
}
## Main ## Main
echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION" echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION"
@ -173,7 +189,7 @@ execute_cmd "cd $WORKDIR" "Moving to workdir: $WORKDIR"
## Install utils ## Install utils
execute_cmd "apt update" "Updating repos" execute_cmd "apt update" "Updating repos"
execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https" "Installing utils" execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https ca-certificates gnupg lsb-release" "Installing utils"
#Installing Apache and php-fpm #Installing Apache and php-fpm
[ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo" [ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo"
@ -221,7 +237,8 @@ systemctl restart php$PHPVER-fpm &>> "$LOGFILE"
php$PHPVER-xml \ php$PHPVER-xml \
php$PHPVER-yaml \ php$PHPVER-yaml \
libnet-telnet-perl \ libnet-telnet-perl \
whois" whois \
cron"
execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies" execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies # Server dependencies
@ -254,10 +271,13 @@ server_dependencies=" \
libnet-telnet-perl \ libnet-telnet-perl \
libjson-perl \ libjson-perl \
libencode-perl \ libencode-perl \
cron \
libgeo-ip-perl \ libgeo-ip-perl \
openjdk-8-jdk " openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
execute_cmd "installing_docker" "Installing Docker for debug"
# wmic and pandorawmic # wmic and pandorawmic
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic" execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic"
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic" execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic"
@ -393,7 +413,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
[mysqld] [mysqld]
datadir=/var/lib/mysql datadir=/var/lib/mysql
user=mysql user=mysql
character-set-server=utf8 character-set-server=utf8mb4
skip-character-set-client-handshake skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 symbolic-links=0
@ -408,7 +428,7 @@ innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M innodb_log_file_size = 64M
innodb_log_buffer_size = 16M innodb_log_buffer_size = 16M
innodb_io_capacity = 100 innodb_io_capacity = 300
thread_cache_size = 8 thread_cache_size = 8
thread_stack = 256K thread_stack = 256K
max_connections = 100 max_connections = 100
@ -477,7 +497,7 @@ check_cmd_status "Error installing PandoraFMS Agent"
# Copy gotty utility # Copy gotty utility
cd $WORKDIR &>> "$LOGFILE" cd $WORKDIR &>> "$LOGFILE"
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util' execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
@ -731,9 +751,14 @@ systemctl enable pandora_server &>> "$LOGFILE"
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server" execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
systemctl enable tentacle_serverd &>> "$LOGFILE" systemctl enable tentacle_serverd &>> "$LOGFILE"
# Enabling condole cron # Enabling console cron
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS 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 http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab 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 pandoradb cron
execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron"
echo "@hourly root bash -c /etc/cron.hourly/pandora_db" >> /etc/crontab
## Enabling agent adn configuring Agente ## Enabling agent adn configuring Agente
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE" sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE"
@ -748,7 +773,7 @@ sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = open
cat > /etc/issue.net << EOF_banner cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS Welcome to Pandora FMS appliance on Ubuntu
------------------------------------------ ------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console Go to Public http://$ipplublic/pandora_console$to 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"}') $(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"}')

View File

@ -277,8 +277,8 @@ export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
EOF_ENV EOF_ENV
echo ">> Enable discovery cron: " echo ">> Enable discovery cron: "
#while true ; do wget -q -O - --no-check-certificate http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/pandora_console.log && sleep 60 ; done & #while true ; do wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/pandora_console.log && sleep 60 ; done &
echo "*/5 * * * * wget -q -O - --no-check-certificate http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/log/cron.log" >> /opt/pandora/crontasks echo "*/5 * * * * wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/log/cron.log" >> /opt/pandora/crontasks
echo ">> Enable pandora_db cron: " echo ">> Enable pandora_db cron: "
/usr/bin/perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf /usr/bin/perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768, FreeBSD Version # Version 7.0NG.769, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768, Solaris Version # Version 7.0NG.769, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.768 # Version 7.0NG.769
# This program is Free Software, you can redistribute it and/or modify it # 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 # 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 # Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 4.0 %define version 4.0
%define release 1 %define release 1

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 4.0.1 %define version 4.0.1
%define release 1 %define release 1

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768 # Version 7.0NG.769
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,7 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent %define name pandorafms_agent
%define version 3.2 %define version 3.2
Summary: Pandora FMS Linux agent Summary: Pandora FMS Linux agent

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768 # Version 7.0NG.769
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.768-230210 Version: 7.0NG.769-230222
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string> <key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string> <key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.768</string> <key>CFBundleVersion</key> <string>7.0NG.769</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.768 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.769 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.768</string> <key>CFBundleShortVersionString</key> <string>7.0NG.769</string>
<key>NSPrincipalClass</key><string>NSApplication</string> <key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string> <key>NSMainNibFile</key><string>MainMenu</string>

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768, FreeBSD Version # Version 7.0NG.769, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768, NetBSD Version # Version 7.0NG.769, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.768, Solaris Version # Version 7.0NG.769, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -556,10 +556,19 @@ BEGIN {
sub runCommand { sub runCommand {
my ($self, $ref, $output_mode) = @_; my ($self, $ref, $output_mode) = @_;
my $result;
if($self->load_libraries()) { if($self->load_libraries()) {
# Functionality possible. # Functionality possible.
my $command = $self->{'commands'}->{$ref}; my $command = $self->{'commands'}->{$ref};
my $result = $self->evaluate_command($ref); $result = $self->evaluate_command($ref);
} else {
$result = {
'stderr' => 'Cannot use commands without YAML dependency, please install it.',
'name' => 'YAML::Tiny',
'error_level' => 2,
};
}
if (ref($result) eq "HASH") { if (ref($result) eq "HASH") {
# Process command result. # Process command result.
if (defined($output_mode) && $output_mode eq 'xml') { if (defined($output_mode) && $output_mode eq 'xml') {
@ -580,7 +589,6 @@ BEGIN {
} else { } else {
$self->set_last_error('Failed to process ['.$ref.']: '.$result); $self->set_last_error('Failed to process ['.$ref.']: '.$result);
} }
}
return undef; return undef;
} }
@ -1014,8 +1022,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.768'; use constant AGENT_VERSION => '7.0NG.769';
use constant AGENT_BUILD => '230210'; use constant AGENT_BUILD => '230222';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -1,9 +1,10 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -1,9 +1,10 @@
# #
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.768 # Version 7.0NG.769
# This program is Free Software, you can redistribute it and/or modify it # 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 # 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 # Foundation; either version 2 of the Licence or any later version

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.768 Build 230210") #define PANDORA_VERSION ("7.0NG.769 Build 230222")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.768(Build 230210))" VALUE "ProductVersion", "(7.0NG.769(Build 230222))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.768-230210 Version: 7.0NG.769-230222
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -2,6 +2,8 @@ START TRANSACTION;
ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0; ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0;
ALTER TABLE `tmap` MODIFY COLUMN `id_group` TEXT NOT NULL default '';
CREATE TABLE IF NOT EXISTS `tmonitor_filter` ( CREATE TABLE IF NOT EXISTS `tmonitor_filter` (
`id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_name` VARCHAR(600) NOT NULL, `id_name` VARCHAR(600) NOT NULL,

View File

@ -402,6 +402,10 @@ echo '
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>'; echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
// CSRF validation. // CSRF validation.
if (isset($_SESSION['csrf_code']) === true) {
unset($_SESSION['csrf_code']);
}
html_print_csrf_hidden(); html_print_csrf_hidden();
echo '</form></div>'; echo '</form></div>';

View File

@ -992,7 +992,7 @@ if (($create != '') || ($view != '')) {
echo '<div id="deploy_messages" class="invisible">'; echo '<div id="deploy_messages" class="invisible">';
} }
// The '%s' will be replaced in the javascript code of the function 'show_locked_dialog' // The '%s' will be replaced in the javascript code of the function 'show_locked_dialog'.
echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>"; echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>";
echo '</div>'; echo '</div>';
@ -1041,12 +1041,11 @@ ui_require_javascript_file('pandora_modules');
data: parameters, data: parameters,
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {
var title = $("#dialog_locked").prop('title').replace(/%s/, plugin_name); var title = 'List of modules and components created by "'+ plugin_name +'"';
$("#dialog_locked") $("#dialog_locked")
.prop('title', title)
.html(data) .html(data)
.dialog ({ .dialog ({
title: title,
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
@ -1062,7 +1061,6 @@ ui_require_javascript_file('pandora_modules');
}); });
} }
$(document).ready(function() { $(document).ready(function() {
// Add macro // Add macro
var add_macro_click_event = function (event) { var add_macro_click_event = function (event) {

View File

@ -416,6 +416,11 @@ if ($delete_user === true) {
__('There was a problem deleting the profile') __('There was a problem deleting the profile')
); );
} else if ($disable_user !== false) { } else if ($disable_user !== false) {
// CSRF Validator.
if (html_print_csrf_error()) {
return;
}
// Disable_user. // Disable_user.
$id_user = get_parameter('id', 0); $id_user = get_parameter('id', 0);
@ -662,6 +667,8 @@ $limit = (int) $config['block_size'];
$rowPair = true; $rowPair = true;
$iterator = 0; $iterator = 0;
$cont = 0; $cont = 0;
// Creates csrf.
$csrf = html_print_csrf_hidden(true);
foreach ($info as $user_id => $user_info) { foreach ($info as $user_id => $user_info) {
if (empty($user_id) === true) { if (empty($user_id) === true) {
continue; continue;
@ -854,6 +861,8 @@ foreach ($info as $user_id => $user_info) {
$user_info['id_user'], $user_info['id_user'],
true true
); );
// Same csrf for every disable button for submit.
$data[6] .= $csrf;
$data[6] .= html_print_input_hidden( $data[6] .= html_print_input_hidden(
'disable_user', 'disable_user',
$toDoAction, $toDoAction,

View File

@ -92,6 +92,9 @@ $node_id = (int) get_parameter('node_id', 0);
if ($get_comments === true) { if ($get_comments === true) {
$event = get_parameter('event', false); $event = get_parameter('event', false);
$event_rep = (int) get_parameter('event_rep', 0); $event_rep = (int) get_parameter('event_rep', 0);
$event_rep = get_parameter_post('event')['event_rep'];
$group_rep = get_parameter_post('event')['group_rep'];
if ($event === false) { if ($event === false) {
return __('Failed to retrieve comments'); return __('Failed to retrieve comments');
} }
@ -99,7 +102,7 @@ if ($get_comments === true) {
$eventsGrouped = []; $eventsGrouped = [];
// Consider if the event is grouped. // Consider if the event is grouped.
$whereGrouped = '1=1'; $whereGrouped = '1=1';
if ($event_rep === EVENT_GROUP_REP_EVENTS) { if ($group_rep === EVENT_GROUP_REP_EVENTS && $event_rep > 1) {
// Default grouped message filtering (evento and estado). // Default grouped message filtering (evento and estado).
$whereGrouped = sprintf( $whereGrouped = sprintf(
'`evento` = "%s"', '`evento` = "%s"',
@ -120,7 +123,7 @@ if ($get_comments === true) {
(int) $event['id_agentmodule'] (int) $event['id_agentmodule']
); );
} }
} else if ($event_rep === EVENT_GROUP_REP_EXTRAIDS) { } else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
$whereGrouped = sprintf( $whereGrouped = sprintf(
'`id_extra` = "%s"', '`id_extra` = "%s"',
$event['id_extra'] $event['id_extra']
@ -1647,6 +1650,7 @@ if ($get_extended_event) {
$comments = $event['comments']; $comments = $event['comments'];
$event['similar_ids'] = $similar_ids; $event['similar_ids'] = $similar_ids;
$event['group_rep'] = $group_rep;
if (isset($comments) === false) { if (isset($comments) === false) {
$comments = $event['user_comment']; $comments = $event['user_comment'];

View File

@ -258,6 +258,14 @@ class ConsoleSupervisor
$this->checkSyncQueueStatus(); $this->checkSyncQueueStatus();
} }
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
*/
if ((bool) enterprise_installed() === true) {
$this->checkLibaryError();
}
} }
@ -518,6 +526,14 @@ class ConsoleSupervisor
$this->checkSyncQueueLength(); $this->checkSyncQueueLength();
$this->checkSyncQueueStatus(); $this->checkSyncQueueStatus();
} }
/*
* Checkc agent missing libraries.
* NOTIF.AGENT.LIBRARY
*/
if ((bool) enterprise_installed() === true) {
$this->checkLibaryError();
}
} }
@ -2379,7 +2395,7 @@ class ConsoleSupervisor
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
$message_conf_cron .= __('Discovery relies on an appropriate cron setup.'); $message_conf_cron .= __('Discovery relies on an appropriate cron setup.');
$message_conf_cron .= '. '.__('Please, add the following line to your crontab file:'); $message_conf_cron .= '. '.__('Please, add the following line to your crontab file:');
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * &lt;user&gt; wget -q -O - --no-check-certificate '; $message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * &lt;user&gt; wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
$message_conf_cron .= str_replace( $message_conf_cron .= str_replace(
ENTERPRISE_DIR.'/meta/', ENTERPRISE_DIR.'/meta/',
'', '',
@ -2806,4 +2822,30 @@ class ConsoleSupervisor
} }
/**
* Chechs if an agent has a dependency eror on omnishell
*
* @return void
*/
public function checkLibaryError()
{
$sql = 'SELECT COUNT(errorlevel) from tremote_command_target WHERE errorlevel = 2';
$error_dependecies = db_get_sql($sql);
if ($error_dependecies > 0) {
$this->notify(
[
'type' => 'NOTIF.AGENT.LIBRARY',
'title' => __('Agent dependency error'),
'message' => __(
'There are omnishell agents with dependency errors',
),
'url' => '__url__/index.php?sec=gextensions&sec2=enterprise/tools/omnishell',
]
);
}
}
} }

View File

@ -104,6 +104,7 @@ class Diagnostics extends Wizard
'getChartAjax', 'getChartAjax',
'formFeedback', 'formFeedback',
'createdScheduleFeedbackTask', 'createdScheduleFeedbackTask',
'getSystemDate',
]; ];
@ -209,6 +210,7 @@ class Diagnostics extends Wizard
'getAttachmentFolder', 'getAttachmentFolder',
'getInfoTagenteDatos', 'getInfoTagenteDatos',
'getServerThreads', 'getServerThreads',
'getSystemDate',
]; ];
if ($this->pdf === true) { if ($this->pdf === true) {
@ -278,6 +280,10 @@ class Diagnostics extends Wizard
$title = __('SQL show engine innodb status'); $title = __('SQL show engine innodb status');
break; break;
case 'getSystemDate':
$title = __('Date system');
break;
default: default:
// Not possible. // Not possible.
$title = ''; $title = '';
@ -516,6 +522,27 @@ class Diagnostics extends Wizard
} }
/**
* Date system
*
* @return string
*/
public function getSystemDate(): string
{
$result = [
'error' => false,
'data' => [
'date' => [
'name' => __('System Date (Console)'),
'value' => date('H:i:s Y-m-d'),
],
],
];
return json_encode($result);
}
/** /**
* Database size stats. * Database size stats.
* *
@ -619,7 +646,7 @@ class Diagnostics extends Wizard
$currentTime = time(); $currentTime = time();
$pandoraDbLastRun = __('Pandora DB has never been executed'); $pandoraDbLastRun = __('Pandora DB has never been executed');
if ($dateDbMantenaince !== false) { if ($dateDbMantenaince !== false && empty($dateDbMantenaince) === false) {
$difference = ($currentTime - $dateDbMantenaince); $difference = ($currentTime - $dateDbMantenaince);
$pandoraDbLastRun = human_time_description_raw( $pandoraDbLastRun = human_time_description_raw(
$difference, $difference,

View File

@ -782,7 +782,9 @@ class NetworkMap
if ($this->network) { if ($this->network) {
// Network map, based on direct network. // Network map, based on direct network.
$nodes = networkmap_get_nodes_from_ip_mask( $nodes = networkmap_get_nodes_from_ip_mask(
$this->network $this->network,
false,
'&#x0d;&#x0a;'
); );
} else if ($this->mapOptions['map_filter']['empty_map']) { } else if ($this->mapOptions['map_filter']['empty_map']) {
// Empty map returns no data. // Empty map returns no data.
@ -792,17 +794,22 @@ class NetworkMap
|| $this->mapOptions['map_filter']['dont_show_subgroups'] == 1 || $this->mapOptions['map_filter']['dont_show_subgroups'] == 1
) { ) {
// Show only current selected group. // Show only current selected group.
$filter['id_grupo'] = $this->idGroup; $filter['id_grupo'] = explode(',', $this->idGroup);
} else { } else {
// Show current group and children. // Show current group and children.
$childrens = groups_get_children($this->idGroup, null, true); foreach (explode(',', $this->idGroup) as $key => $group) {
$childrens = groups_get_children($group, null, true);
if (!empty($childrens)) { if (!empty($childrens)) {
$childrens = array_keys($childrens); $childrens = array_keys($childrens);
$filter['id_grupo'] = $childrens; if (empty($filter['id_grupo']) === false) {
$filter['id_grupo'][] = $this->idGroup; $filter['id_grupo'] = array_merge($filter['id_grupo'], $childrens);
} else { } else {
$filter['id_grupo'] = $this->idGroup; $filter['id_grupo'] = $childrens;
}
} else {
$filter['id_grupo'][] = $group;
}
} }
} }
@ -1189,6 +1196,10 @@ class NetworkMap
$head .= 'overlap="scalexy";'; $head .= 'overlap="scalexy";';
} }
if ($layout == 'spring1' || $layout == 'spring2') {
$head .= 'sep="'.$node_sep.'";';
}
if ($layout == 'flat') { if ($layout == 'flat') {
$head .= 'ranksep="'.$rank_sep.'";'; $head .= 'ranksep="'.$rank_sep.'";';
} }
@ -3498,6 +3509,7 @@ class NetworkMap
url_background_grid: url_background_grid, url_background_grid: url_background_grid,
refresh_time: '.$this->mapOptions['refresh_time'].', refresh_time: '.$this->mapOptions['refresh_time'].',
font_size: '.$this->mapOptions['font_size'].', font_size: '.$this->mapOptions['font_size'].',
method: '.$this->map['generation_method'].',
base_url_homedir: "'.ui_get_full_url(false).'" base_url_homedir: "'.ui_get_full_url(false).'"
}); });
init_drag_and_drop(); init_drag_and_drop();

View File

@ -416,8 +416,8 @@ class SnmpConsole extends HTML
'label' => __('Alert'), 'label' => __('Alert'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_alert', 'id' => 'filter_alert',
'input_class' => 'filter_input_datatable',
'name' => 'filter_alert', 'name' => 'filter_alert',
'class' => 'w200px',
'fields' => $show_alerts, 'fields' => $show_alerts,
'return' => true, 'return' => true,
'selected' => $this->filter_alert, 'selected' => $this->filter_alert,
@ -426,8 +426,8 @@ class SnmpConsole extends HTML
'label' => __('Severity'), 'label' => __('Severity'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_severity', 'id' => 'filter_severity',
'input_class' => 'filter_input_datatable',
'name' => 'filter_severity', 'name' => 'filter_severity',
'class' => 'w200px',
'fields' => $severities, 'fields' => $severities,
'return' => true, 'return' => true,
'selected' => $this->filter_severity, 'selected' => $this->filter_severity,
@ -435,8 +435,8 @@ class SnmpConsole extends HTML
[ [
'label' => __('Free search'), 'label' => __('Free search'),
'type' => 'text', 'type' => 'text',
'class' => 'w400px',
'id' => 'filter_free_search', 'id' => 'filter_free_search',
'input_class' => 'filter_input_datatable',
'name' => 'filter_free_search', 'name' => 'filter_free_search',
'value' => $this->filter_free_search, 'value' => $this->filter_free_search,
], ],
@ -444,8 +444,8 @@ class SnmpConsole extends HTML
'label' => __('Status'), 'label' => __('Status'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_status', 'id' => 'filter_status',
'input_class' => 'filter_input_datatable',
'name' => 'filter_status', 'name' => 'filter_status',
'class' => 'w200px',
'fields' => $status_array, 'fields' => $status_array,
'return' => true, 'return' => true,
'selected' => $this->filter_status, 'selected' => $this->filter_status,
@ -458,6 +458,7 @@ class SnmpConsole extends HTML
'disabled' => false, 'disabled' => false,
'return' => true, 'return' => true,
'id' => 'filter_group_by', 'id' => 'filter_group_by',
'input_class' => 'filter_input_datatable',
'fields' => [ 'fields' => [
0 => __('No'), 0 => __('No'),
1 => __('Yes'), 1 => __('Yes'),
@ -466,8 +467,8 @@ class SnmpConsole extends HTML
[ [
'label' => __('Max. hours old'), 'label' => __('Max. hours old'),
'type' => 'text', 'type' => 'text',
'class' => 'w200px',
'id' => 'filter_hours_ago', 'id' => 'filter_hours_ago',
'input_class' => 'filter_input_datatable',
'name' => 'filter_hours_ago', 'name' => 'filter_hours_ago',
'value' => $this->filter_hours_ago, 'value' => $this->filter_hours_ago,
], ],
@ -475,8 +476,8 @@ class SnmpConsole extends HTML
'label' => __('Trap type'), 'label' => __('Trap type'),
'type' => 'select', 'type' => 'select',
'id' => 'filter_trap_type', 'id' => 'filter_trap_type',
'input_class' => 'filter_input_datatable',
'name' => 'filter_trap_type', 'name' => 'filter_trap_type',
'class' => 'w200px',
'fields' => $trap_types, 'fields' => $trap_types,
'return' => true, 'return' => true,
'selected' => $this->filter_trap_type, 'selected' => $this->filter_trap_type,

View File

@ -20,8 +20,8 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC230210'; $build_version = 'PC230222';
$pandora_version = 'v7.0NG.768'; $pandora_version = 'v7.0NG.769';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get(); $script_tz = @date_default_timezone_get();

View File

@ -463,10 +463,6 @@ function config_update_config()
if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) { if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) {
$error_update[] = __('Ipam Ocuppied Manager Warning'); $error_update[] = __('Ipam Ocuppied Manager Warning');
} }
if (config_update_value('sap_license', get_parameter('sap_license'), true) === false) {
$error_update[] = __('SAP/R3 Plugin Licence');
}
} }
break; break;

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* Images File Manager functions. * Images File Manager functions.
* *
@ -139,25 +140,8 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
$nombre_archivo = sprintf('%s/%s', $real_directory, $filename); $nombre_archivo = sprintf('%s/%s', $real_directory, $filename);
try { try {
$mimeContentType = mime_content_type($_FILES['file']['tmp_name']); $mimeContentType = mime_content_type($_FILES['file']['tmp_name']);
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
$validFileExtension = true; if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) {
if (empty($fileExtension) === false) {
$filtered_types = array_filter(
$filterFilesType,
function ($value) use ($fileExtension) {
$mimeTypeExtensionName = explode('/', $value)[1];
return $mimeTypeExtensionName === $fileExtension;
}
);
if (empty($filtered_types) === true) {
$validFileExtension = false;
}
}
if ($validFileExtension === true && (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true)) {
$result = copy($_FILES['file']['tmp_name'], $nombre_archivo); $result = copy($_FILES['file']['tmp_name'], $nombre_archivo);
} else { } else {
$error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.'; $error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.';
@ -522,6 +506,7 @@ function filemanager_file_explorer(
check_opened_dialog('create_text_file'); check_opened_dialog('create_text_file');
} }
<?php endif ?> <?php endif ?>
function show_upload_file() { function show_upload_file() {
actions_dialog('upload_file'); actions_dialog('upload_file');
$("#upload_file").css("display", "block"); $("#upload_file").css("display", "block");
@ -588,6 +573,44 @@ function filemanager_file_explorer(
} }
}).show(); }).show();
} }
function show_modal_real_path(path) {
if (navigator.clipboard && window.isSecureContext) <?php $secure_con = true; ?>;
else <?php $secure_con = false; ?>;
$('#modal_real_path').addClass('file_table_modal_active');
$('#real_path').empty();
$('#real_path').html(path);
title_action = "<?php echo __('Real path'); ?>";
$('#modal_real_path')
.dialog({
title: title_action,
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 448,
minWidth: 448,
minHeight: 213,
maxWidth: 800,
maxHeight: 300,
close: function() {
$('#modal_real_path').removeClass('file_table_modal_active');
}
}).show();
$("#submit-submit").on("click", copyToClipboard);
}
function copyToClipboard() {
if (navigator.clipboard && window.isSecureContext) {
window.navigator.clipboard.writeText($("#real_path").text()).then(function() {
$('#modal_real_path').dialog('close');
});
}
}
</script> </script>
<?php <?php
// List files. // List files.
@ -764,6 +787,13 @@ function filemanager_file_explorer(
$data[4] .= '</a>'; $data[4] .= '</a>';
} }
if (is_writable($fileinfo['realpath']) === true
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
&& ($readOnly === false)
) {
$data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/book_edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter']).'</a>';
}
$data[4] .= '</span>'; $data[4] .= '</span>';
array_push($table->data, $data); array_push($table->data, $data);
@ -942,6 +972,22 @@ function filemanager_file_explorer(
); );
echo '</a>'; echo '</a>';
// Show Modal Real Path
$modal_real_path = "<div><b>Real path to plugin execution is:</b></div>
<div id='real_path'></div>";
if (isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') {
$modal_real_path .= "<div style='float:right;margin: 5em 0 0 auto';>".html_print_submit_button(__('Copy'), 'submit', false, 'class="sub next"', true).'</div>';
}
html_print_div(
[
'id' => 'modal_real_path',
'class' => 'invisible',
'content' => $modal_real_path,
]
);
echo '</div>'; echo '</div>';
} else { } else {
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>"; echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";

View File

@ -837,6 +837,7 @@ if (is_ajax()) {
$db_fragmentation = json_decode($d->getTablesFragmentation()); $db_fragmentation = json_decode($d->getTablesFragmentation());
$sys_info = json_decode($d->getSystemInfo()); $sys_info = json_decode($d->getSystemInfo());
$php_sys = json_decode($d->getPHPSetup()); $php_sys = json_decode($d->getPHPSetup());
$system_date = json_decode($d->getSystemDate());
$fragmentation_status = ''; $fragmentation_status = '';
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) { if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
@ -1098,6 +1099,14 @@ if (is_ajax()) {
<p>'.$sys_info->data->ipInfo->value.'</p> <p>'.$sys_info->data->ipInfo->value.'</p>
</th> </th>
</tr> </tr>
<tr>
<th style="width: 15%;">
<p><span>'.$system_date->data->date->name.'</span></p>
</th>
<th style="width: 85%;">
<p>'.$system_date->data->date->value.'</p>
</th>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -519,12 +519,13 @@ function modules_delete_agent_module($id_agent_module)
'disabled' => 1, 'disabled' => 1,
'delete_pending' => 1, 'delete_pending' => 1,
]; ];
$result = db_process_sql_update( $id_agent = db_process_sql_update(
'tagente_modulo', 'tagente_modulo',
$values, $values,
['id_agente_modulo' => $id_borrar_modulo] ['id_agente_modulo' => $id_borrar_modulo]
); );
if ($result === false) {
if ($id_agent === false) {
$error++; $error++;
} else { } else {
// Set flag to update module status count. // Set flag to update module status count.
@ -562,7 +563,7 @@ function modules_delete_agent_module($id_agent_module)
$result = db_process_delete_temp( $result = db_process_delete_temp(
'ttag_module', 'ttag_module',
'id_agente_modulo', 'id_agente_modulo',
$id_borrar_modulo $id_agent
); );
if ($result === false) { if ($result === false) {
$error++; $error++;

View File

@ -1126,6 +1126,10 @@ function networkmap_open_graph(
$head .= 'overlap="scalexy";'; $head .= 'overlap="scalexy";';
} }
if ($layout == 'spring1' || $layout == 'spring2') {
$head .= 'sep="'.$node_sep.'";';
}
if ($layout === 'flat') { if ($layout === 'flat') {
$head .= 'ranksep="'.$rank_sep.'";'; $head .= 'ranksep="'.$rank_sep.'";';
} else if ($layout === 'spring2') { } else if ($layout === 'spring2') {
@ -1356,9 +1360,10 @@ function networkmap_get_types($strict_user=false)
*/ */
function networkmap_get_nodes_from_ip_mask( function networkmap_get_nodes_from_ip_mask(
$ip_mask, $ip_mask,
$return_ids_only=false $return_ids_only=false,
$separator=',',
) { ) {
$list_ip_masks = explode(',', $ip_mask); $list_ip_masks = explode($separator, $ip_mask);
if (empty($list_ip_masks) === true) { if (empty($list_ip_masks) === true) {
return []; return [];

View File

@ -55,10 +55,30 @@ function draw_minimap() {
var relation_min_nodes = minimap_relation; var relation_min_nodes = minimap_relation;
var relation_minimap_w = 2; var relation_minimap_w = 2;
var relation_minimap_h = 2; var relation_minimap_h = 2;
if (graph.nodes.length > 100) { if (graph.nodes.length > 100 && graph.nodes.length < 500) {
relation_min_nodes = 0.01; relation_min_nodes = 0.01;
relation_minimap_w = (graph.nodes.length / 100) * 2.5; relation_minimap_w = (graph.nodes.length / 100) * 2.5;
relation_minimap_h = 1.5; relation_minimap_h = 1.5;
} else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) {
if (typeof method != "undefined" && method == 4) {
relation_min_nodes = 0.002;
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
relation_minimap_h = 3;
} else {
relation_min_nodes = 0.008;
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
relation_minimap_h = 3;
}
} else if (graph.nodes.length >= 1000) {
if (typeof method != "undefined" && method == 4) {
relation_min_nodes = 0.001;
relation_minimap_w = (graph.nodes.length / 1000) * 4.5;
relation_minimap_h = 4;
} else {
relation_min_nodes = 0.0015;
relation_minimap_w = (graph.nodes.length / 1000) * 3.5;
relation_minimap_h = 3.5;
}
} }
//Draw the items and lines //Draw the items and lines
@ -1792,10 +1812,30 @@ function init_minimap() {
var relation_minimap_w = 2; var relation_minimap_w = 2;
var relation_minimap_h = 2; var relation_minimap_h = 2;
if (graph.nodes.length > 100) { if (graph.nodes.length > 100 && graph.nodes.length < 500) {
relation_min_nodes = 0.01; relation_min_nodes = 0.01;
relation_minimap_w = (graph.nodes.length / 100) * 2.5; relation_minimap_w = (graph.nodes.length / 100) * 2.5;
relation_minimap_h = 1.5; relation_minimap_h = 1.5;
} else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) {
if (typeof method != "undefined" && method == 4) {
relation_min_nodes = 0.002;
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
relation_minimap_h = 3;
} else {
relation_min_nodes = 0.008;
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
relation_minimap_h = 3;
}
} else if (graph.nodes.length >= 1000) {
if (typeof method != "undefined" && method == 4) {
relation_min_nodes = 0.001;
relation_minimap_w = (graph.nodes.length / 1000) * 4.5;
relation_minimap_h = 4;
} else {
relation_min_nodes = 0.0015;
relation_minimap_w = (graph.nodes.length / 1000) * 3.5;
relation_minimap_h = 3.5;
}
} }
$("#minimap_" + networkmap_id).bind("mousemove", function(event) { $("#minimap_" + networkmap_id).bind("mousemove", function(event) {
@ -3092,6 +3132,10 @@ function init_graph(parameter_object) {
window.refresh_time = parameter_object.refresh_time; window.refresh_time = parameter_object.refresh_time;
} }
if (typeof parameter_object.method != "undefined") {
window.method = parameter_object.method;
}
var rect_center_x = graph.nodes[0].x; var rect_center_x = graph.nodes[0].x;
var rect_center_y = graph.nodes[0].y; var rect_center_y = graph.nodes[0].y;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -405,6 +405,27 @@ a.pandora_pagination.current:hover {
cursor: default; cursor: default;
} }
.filter_input_datatable {
width: 45% !important;
display: flex;
flex-wrap: nowrap;
flex-direction: row;
max-width: 450px;
min-width: 400px;
}
.filter_input_datatable input {
flex: 1;
}
.filter_input_datatable label {
width: 93px;
max-width: 100%;
}
.filter_input_datatable .select2.select2-container {
flex: 1;
}
.datatable_filter.content li.filter_input_datatable {
margin: 1em 0;
}
/* Default datatable filter style */ /* Default datatable filter style */
.datatable_filter.content { .datatable_filter.content {
display: flex; display: flex;
@ -419,6 +440,7 @@ a.pandora_pagination.current:hover {
.datatable_filter.content li { .datatable_filter.content li {
flex: 1 1 auto; flex: 1 1 auto;
margin: 1em auto; margin: 1em auto;
padding: 0px 10px;
} }
.sorting_desc { .sorting_desc {
background: url(../../images/sort_down_green.png) no-repeat; background: url(../../images/sort_down_green.png) no-repeat;

View File

@ -1054,6 +1054,7 @@ if (isset($_GET['bye'])) {
header_remove('Set-Cookie'); header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
generate_csrf_code();
// Process logout. // Process logout.
include 'general/logoff.php'; include 'general/logoff.php';

View File

@ -130,8 +130,8 @@
</div> </div>
<div style='padding-bottom: 50px'> <div style='padding-bottom: 50px'>
<?php <?php
$version = '7.0NG.768'; $version = '7.0NG.769';
$build = '230210'; $build = '230222';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -57,10 +57,10 @@ if ($new_networkmap) {
$offset_x = ''; $offset_x = '';
$offset_y = ''; $offset_y = '';
$scale_z = 0.5; $scale_z = 0.5;
$node_sep = 10; $node_sep = 0.25;
$rank_sep = 1.0; $rank_sep = 0.5;
$mindist = 1.0; $mindist = 1.0;
$kval = 5; $kval = 0.3;
$refresh_time = 300; $refresh_time = 300;
} }
@ -273,6 +273,25 @@ if (!empty($result)) {
if ($not_found) { if ($not_found) {
ui_print_error_message(__('Not found networkmap.')); ui_print_error_message(__('Not found networkmap.'));
} else { } else {
if ($disabled_source === false) {
echo '<div id="map_loading" style="width: 98%;height: 1000px; background-color: rgba(245, 245, 245, .3);position: absolute;display: flex;justify-content: center;align-items: center;flex-direction: column-reverse;">';
echo html_print_image('images/spinner.gif', true, 'width: 50px;height: 50px;');
echo '<div>'.__('Creating map...').'</div>';
echo '</div>';
$info1 = __('To create a network map that visually recreates link-level (L2) relationships, you must first discover these relationships with Discovery Server. Network maps only reflect relationships that have already been discovered.');
$separator = '<br>';
$info2 = __('Discovery Server discovers relationships between interfaces (L2) through SNMP and relationships between hosts (L3) through route discovery.');
$info3 = __('You can also create these relationships manually by editing nodes or re-passing a discovery task after adding new information (for example by adding new SNMP communities).');
$info4 = __('See our documentation for more information.');
ui_print_info_message(
[
'no_close' => false,
'message' => $info1.$separator.$info2.$separator.$info3.$separator.$info4,
],
'style="width: 98%;"'
);
}
$table = new stdClass(); $table = new stdClass();
$table->id = 'form_editor'; $table->id = 'form_editor';
@ -337,7 +356,14 @@ if ($not_found) {
); );
$table->data[3][0] = __('Description'); $table->data[3][0] = __('Description');
$table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true); $table->data[3][1] = html_print_input_text(
'description',
$description,
'',
100,
100,
true
);
$table->data[4][0] = __('Position X'); $table->data[4][0] = __('Position X');
$table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true); $table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true);
@ -352,7 +378,23 @@ if ($not_found) {
$table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true); $table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
$table->data['source'][0] = __('Source'); $table->data['source'][0] = __('Source');
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source); $table->data['source'][1] = html_print_select(
[
'group' => __('Group'),
'recon_task' => __('Discovery task'),
'ip_mask' => __('CIDR IP mask'),
],
'source',
$source,
'',
'',
0,
true,
false,
false,
'',
$disabled_source
);
$table->data['source_data_recon_task'][0] = __('Source from recon task'); $table->data['source_data_recon_task'][0] = __('Source from recon task');
$table->data['source_data_recon_task'][0] .= ui_print_help_tip( $table->data['source_data_recon_task'][0] .= ui_print_help_tip(
@ -378,18 +420,28 @@ if ($not_found) {
); );
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask'); $table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $ip_mask, '', 20, 255, true, $disabled_source); $table->data['source_data_ip_mask'][1] = html_print_textarea(
'ip_mask',
3,
5,
$ip_mask,
'style="width: 238px"',
true,
'',
$disabled_source
);
$table->data['source_data_group'][0] = __('Source group'); $table->data['source_data_group'][0] = __('Source group');
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups( $table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
$config['id_user'], $config['id_user'],
'AR', 'AR',
true, true,
'id_group', 'id_group[]',
$id_group, explode(',', $id_group),
'', '',
'', '',
'', '',
true,
true true
).'</div>'; ).'</div>';
$table->data['source_data_group'][1] .= html_print_image( $table->data['source_data_group'][1] .= html_print_image(
@ -498,8 +550,9 @@ if ($not_found) {
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("input[name='source']").on('change', function() { $("#map_loading").hide();
var source = $("input[name='source']:checked").val(); $("#source").change(function() {
const source = $(this).val();
if (source == 'recon_task') { if (source == 'recon_task') {
$("#form_editor-source_data_ip_mask") $("#form_editor-source_data_ip_mask")
@ -510,7 +563,6 @@ $(document).ready(function() {
.css('display', 'none'); .css('display', 'none');
$("#form_editor-source_data_recon_task") $("#form_editor-source_data_recon_task")
.css('display', ''); .css('display', '');
} }
else if (source == 'ip_mask') { else if (source == 'ip_mask') {
$("#form_editor-source_data_ip_mask") $("#form_editor-source_data_ip_mask")
@ -565,7 +617,7 @@ $(document).ready(function() {
$("#form_editor-kval") $("#form_editor-kval")
.css('display', 'none'); .css('display', 'none');
$("#form_editor-nodesep") $("#form_editor-nodesep")
.css('display', ''); .css('display', 'none');
} }
else if (method == 'neato') { else if (method == 'neato') {
$("#form_editor-ranksep") $("#form_editor-ranksep")
@ -599,16 +651,14 @@ $(document).ready(function() {
} }
}); });
$("input[name='source']").trigger("change"); $("#source").trigger("change");
$("#method").trigger("change"); $("#method").trigger("change");
// Control if id_group has changed. // Control if id_group has changed.
var id_group_old = $("#id_group").val(); var id_group_old = $("#id_group").val();
var id_group_changed = false; var id_group_changed = false;
$("#id_group").on('change',{id_group_old: id_group_old}, function () { $("#id_group").on('change',{id_group_old: id_group_old}, function () {
var id_group_new = $("#id_group").val(); var id_group_new = $("#id_group").val();
if((id_group_old != id_group_new) && (update_networkmap == 1 )) { if((id_group_old != id_group_new) && (update_networkmap == 1 )) {
id_group_changed = true; id_group_changed = true;
@ -625,7 +675,7 @@ $(document).ready(function() {
update_networkmap = $("input[name='update_networkmap']").val(); update_networkmap = $("input[name='update_networkmap']").val();
$( "#submit-crt" ).click(function( event ) { $( "#submit-crt" ).click(function( event ) {
$("#map_loading").show();
if(update_networkmap == 1 && id_group_changed === true) { if(update_networkmap == 1 && id_group_changed === true) {
confirmDialog({ confirmDialog({
title: '<?php echo __('Are you sure?'); ?>', title: '<?php echo __('Are you sure?'); ?>',
@ -643,7 +693,6 @@ $(document).ready(function() {
}) })
event.preventDefault(); event.preventDefault();
} }
}); });
$("#refresh_time_units").trigger("change"); $("#refresh_time_units").trigger("change");

View File

@ -182,7 +182,7 @@ if ($save_empty_networkmap === true) {
$values = []; $values = [];
$values['name'] = $name; $values['name'] = $name;
$values['id_group'] = $id_group; $values['id_group'] = implode(',', $id_group);
$values['generation_method'] = 4; $values['generation_method'] = 4;
@ -237,7 +237,7 @@ if ($new_networkmap || $save_networkmap) {
} }
if ($save_networkmap) { if ($save_networkmap) {
$id_group = (int) get_parameter('id_group', 0); $id_group = get_parameter('id_group', 0);
$id_group_map = (int) get_parameter('id_group_map', 0); $id_group_map = (int) get_parameter('id_group_map', 0);
@ -292,7 +292,7 @@ if ($new_networkmap || $save_networkmap) {
$values = []; $values = [];
$values['name'] = $name; $values['name'] = $name;
$values['id_group'] = $id_group; $values['id_group'] = implode(',', $id_group);
$values['source_period'] = 60; $values['source_period'] = 60;
$values['width'] = $width; $values['width'] = $width;
$values['height'] = $height; $values['height'] = $height;
@ -333,7 +333,7 @@ if ($new_networkmap || $save_networkmap) {
if ($source == 'group') { if ($source == 'group') {
$values['source'] = 0; $values['source'] = 0;
$values['source_data'] = $id_group; $values['source_data'] = implode(',', $id_group);
} else if ($source == 'recon_task') { } else if ($source == 'recon_task') {
$values['source'] = 1; $values['source'] = 1;
$values['source_data'] = $recon_task_id; $values['source_data'] = $recon_task_id;
@ -444,7 +444,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
} }
if ($update_networkmap) { if ($update_networkmap) {
$id_group = (int) get_parameter('id_group', 0); $id_group = get_parameter('id_group', 0);
// Get id of old group source to check changes. // Get id of old group source to check changes.
$id_group_old = db_get_value('id_group', 'tmap', 'id', $id); $id_group_old = db_get_value('id_group', 'tmap', 'id', $id);
@ -480,7 +480,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
$values = []; $values = [];
$values['name'] = $name; $values['name'] = $name;
$values['id_group'] = $id_group; $values['id_group'] = implode(',', $id_group);
$values['id_group_map'] = $id_group_map; $values['id_group_map'] = $id_group_map;
$description = get_parameter('description', ''); $description = get_parameter('description', '');

View File

@ -171,7 +171,23 @@ if (is_ajax() === true) {
$table->data[6][1] = html_print_input_text('scale_z', $map_filter['z_dash'], '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true); $table->data[6][1] = html_print_input_text('scale_z', $map_filter['z_dash'], '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
$table->data['source'][0] = __('Source'); $table->data['source'][0] = __('Source');
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true); $table->data['source'][1] = html_print_select(
[
'group' => __('Group'),
'recon_task' => __('Discovery task'),
'ip_mask' => __('CIDR IP mask'),
],
'source',
$source,
'',
'',
0,
true,
false,
false,
'',
$disabled_source
);
if (! check_acl($config['id_user'], 0, 'PM')) { if (! check_acl($config['id_user'], 0, 'PM')) {
$sql = sprintf( $sql = sprintf(
@ -221,7 +237,16 @@ if (is_ajax() === true) {
); );
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask'); $table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $map_info['source_data'], '', 20, 255, true); $table->data['source_data_ip_mask'][1] = html_print_textarea(
'ip_mask',
3,
5,
$map_info['source_data'],
'',
true,
'',
$disabled_source
);
$dont_show_subgroups = 0; $dont_show_subgroups = 0;
if (isset($map_filter['dont_show_subgroups'])) { if (isset($map_filter['dont_show_subgroups'])) {
@ -296,8 +321,8 @@ if (is_ajax() === true) {
$map_form .= html_print_table($table, true); $map_form .= html_print_table($table, true);
$map_form .= '<script> $map_form .= '<script>
$("input[name=\'source\']").on(\'change\', function() { $("#source").change(function() {
var source = $("input[name=\'source\']:checked").val(); const source = $(this).val();
if (source == \'recon_task\') { if (source == \'recon_task\') {
$("#form_editor-source_data_ip_mask") $("#form_editor-source_data_ip_mask")
@ -389,7 +414,7 @@ if (is_ajax() === true) {
} }
}); });
$("input[name=\'source\']").trigger("change"); $("#source").trigger("change");
$("#method").trigger("change"); $("#method").trigger("change");
</script>'; </script>';

View File

@ -162,7 +162,7 @@ $autosearch = false;
// It is validated if it receives parameters different from those it has by default. // It is validated if it receives parameters different from those it has by default.
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== '' if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4 || $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|| $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== '' || $modulegroup !== -1 || (bool) array_filter($tag_filter) !== false || $sortField !== ''
|| $sort !== 'none' || $id_module !== 0 || $module_option !== 1 || $sort !== 'none' || $id_module !== 0 || $module_option !== 1
|| $min_hours_status !== '' || $min_hours_status !== ''
) { ) {

View File

@ -239,6 +239,13 @@ $server_id = get_parameter(
($filter['server_id'] ?? '') ($filter['server_id'] ?? '')
); );
if (empty($id_agent) === true) {
$id_agent = get_parameter(
'id_agent',
($filter['id_agent'] ?? '')
);
}
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$servers = metaconsole_get_servers(); $servers = metaconsole_get_servers();
if (is_array($servers) === true) { if (is_array($servers) === true) {
@ -574,37 +581,37 @@ if (is_ajax() === true) {
// Event severity prepared. // Event severity prepared.
switch ($tmp->criticity) { switch ($tmp->criticity) {
case EVENT_CRIT_CRITICAL; case EVENT_CRIT_CRITICAL:
$text = __('CRITICAL'); $text = __('CRITICAL');
$color = COL_CRITICAL; $color = COL_CRITICAL;
break; break;
case EVENT_CRIT_MAINTENANCE; case EVENT_CRIT_MAINTENANCE:
$text = __('MAINTENANCE'); $text = __('MAINTENANCE');
$color = COL_MAINTENANCE; $color = COL_MAINTENANCE;
break; break;
case EVENT_CRIT_INFORMATIONAL; case EVENT_CRIT_INFORMATIONAL:
$text = __('INFORMATIONAL'); $text = __('INFORMATIONAL');
$color = COL_INFORMATIONAL; $color = COL_INFORMATIONAL;
break; break;
case EVENT_CRIT_MAJOR; case EVENT_CRIT_MAJOR:
$text = __('MAJOR'); $text = __('MAJOR');
$color = COL_MAJOR; $color = COL_MAJOR;
break; break;
case EVENT_CRIT_MINOR; case EVENT_CRIT_MINOR:
$text = __('MINOR'); $text = __('MINOR');
$color = COL_MINOR; $color = COL_MINOR;
break; break;
case EVENT_CRIT_NORMAL; case EVENT_CRIT_NORMAL:
$text = __('NORMAL'); $text = __('NORMAL');
$color = COL_NORMAL; $color = COL_NORMAL;
break; break;
case EVENT_CRIT_WARNING; case EVENT_CRIT_WARNING:
$text = __('WARNING'); $text = __('WARNING');
$color = COL_WARNING; $color = COL_WARNING;
break; break;
@ -652,43 +659,43 @@ if (is_ajax() === true) {
// Event type prepared. // Event type prepared.
switch ($tmp->event_type) { switch ($tmp->event_type) {
case EVENTS_ALERT_FIRED; case EVENTS_ALERT_FIRED:
case EVENTS_ALERT_RECOVERED; case EVENTS_ALERT_RECOVERED:
case EVENTS_ALERT_CEASED; case EVENTS_ALERT_CEASED:
case EVENTS_ALERT_MANUAL_VALIDATION; case EVENTS_ALERT_MANUAL_VALIDATION:
$text = __('ALERT'); $text = __('ALERT');
$color = COL_ALERTFIRED; $color = COL_ALERTFIRED;
break; break;
case EVENTS_RECON_HOST_DETECTED; case EVENTS_RECON_HOST_DETECTED:
case EVENTS_SYSTEM; case EVENTS_SYSTEM:
case EVENTS_ERROR; case EVENTS_ERROR:
case EVENTS_NEW_AGENT; case EVENTS_NEW_AGENT:
case EVENTS_CONFIGURATION_CHANGE; case EVENTS_CONFIGURATION_CHANGE:
$text = __('SYSTEM'); $text = __('SYSTEM');
$color = COL_MAINTENANCE; $color = COL_MAINTENANCE;
break; break;
case EVENTS_GOING_UP_WARNING; case EVENTS_GOING_UP_WARNING:
case EVENTS_GOING_DOWN_WARNING; case EVENTS_GOING_DOWN_WARNING:
$text = __('WARNING'); $text = __('WARNING');
$color = COL_WARNING; $color = COL_WARNING;
break; break;
case EVENTS_GOING_DOWN_NORMAL; case EVENTS_GOING_DOWN_NORMAL:
case EVENTS_GOING_UP_NORMAL; case EVENTS_GOING_UP_NORMAL:
$text = __('NORMAL'); $text = __('NORMAL');
$color = COL_NORMAL; $color = COL_NORMAL;
break; break;
case EVENTS_GOING_DOWN_CRITICAL; case EVENTS_GOING_DOWN_CRITICAL:
case EVENTS_GOING_UP_CRITICAL; case EVENTS_GOING_UP_CRITICAL:
$text = __('CRITICAL'); $text = __('CRITICAL');
$color = COL_CRITICAL; $color = COL_CRITICAL;
break; break;
case EVENTS_UNKNOWN; case EVENTS_UNKNOWN:
case EVENTS_GOING_UNKNOWN; case EVENTS_GOING_UNKNOWN:
default: default:
$text = __('UNKNOWN'); $text = __('UNKNOWN');
$color = COL_UNKNOWN; $color = COL_UNKNOWN;
@ -702,29 +709,29 @@ if (is_ajax() === true) {
// Module status. // Module status.
// Event severity prepared. // Event severity prepared.
switch ($tmp->module_status) { switch ($tmp->module_status) {
case AGENT_MODULE_STATUS_NORMAL; case AGENT_MODULE_STATUS_NORMAL:
$text = __('NORMAL'); $text = __('NORMAL');
$color = COL_NORMAL; $color = COL_NORMAL;
break; break;
case AGENT_MODULE_STATUS_CRITICAL_BAD; case AGENT_MODULE_STATUS_CRITICAL_BAD:
$text = __('CRITICAL'); $text = __('CRITICAL');
$color = COL_CRITICAL; $color = COL_CRITICAL;
break; break;
case AGENT_MODULE_STATUS_NO_DATA; case AGENT_MODULE_STATUS_NO_DATA:
$text = __('NOT INIT'); $text = __('NOT INIT');
$color = COL_NOTINIT; $color = COL_NOTINIT;
break; break;
case AGENT_MODULE_STATUS_CRITICAL_ALERT; case AGENT_MODULE_STATUS_CRITICAL_ALERT:
case AGENT_MODULE_STATUS_NORMAL_ALERT; case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT; case AGENT_MODULE_STATUS_WARNING_ALERT:
$text = __('ALERT'); $text = __('ALERT');
$color = COL_ALERTFIRED; $color = COL_ALERTFIRED;
break; break;
case AGENT_MODULE_STATUS_WARNING; case AGENT_MODULE_STATUS_WARNING:
$text = __('WARNING'); $text = __('WARNING');
$color = COL_WARNING; $color = COL_WARNING;
break; break;
@ -2417,8 +2424,6 @@ try {
100, 100,
200, 200,
500, 500,
1000,
-1,
], ],
[ [
$config['block_size'], $config['block_size'],
@ -2427,8 +2432,6 @@ try {
100, 100,
200, 200,
500, 500,
1000,
'All',
], ],
], ],
'order' => [ 'order' => [

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console # Pandora FMS Console
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.768" PI_VERSION="7.0NG.769"
FORCE=0 FORCE=0
DESTDIR="" DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"` LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -2323,7 +2323,7 @@ CREATE TABLE IF NOT EXISTS `tsessions_php` (
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tmap` ( CREATE TABLE IF NOT EXISTS `tmap` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_group` INT UNSIGNED NOT NULL DEFAULT 0, `id_group` TEXT NOT NULL DEFAULT '',
`id_user` VARCHAR(255) NOT NULL DEFAULT '', `id_user` VARCHAR(255) NOT NULL DEFAULT '',
`type` INT UNSIGNED NOT NULL DEFAULT 0, `type` INT UNSIGNED NOT NULL DEFAULT 0,
`subtype` INT UNSIGNED NOT NULL DEFAULT 0, `subtype` INT UNSIGNED NOT NULL DEFAULT 0,

View File

@ -97,7 +97,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('first_login', 0), ('first_login', 0),
('mins_fail_pass', 5), ('mins_fail_pass', 5),
('number_attempts', 5), ('number_attempts', 5),
('enable_pass_policy_admin', 0), ('enable_pass_policy_admin', 1),
('enable_pass_history', 0), ('enable_pass_history', 0),
('compare_pass', 3), ('compare_pass', 3),
('meta_style', 'meta_pandora'), ('meta_style', 'meta_pandora'),
@ -112,10 +112,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''), ('custom_report_front_header', ''),
('custom_report_front_footer', ''), ('custom_report_front_footer', ''),
('MR', 60), ('MR', 61),
('identification_reminder', 1), ('identification_reminder', 1),
('identification_reminder_timestamp', 0), ('identification_reminder_timestamp', 0),
('current_package', 768), ('current_package', 769),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.00097656250000":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'), ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.00097656250000":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'), ('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'), ('custom_support_logo', 'default_support.png'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.768-230210 Version: 7.0NG.769-230222
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.768-230210" pandora_version="7.0NG.769-230222"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -801,7 +801,7 @@ sub main() {
# Testing API url # Testing API url
my $curl_execution = "'".$Config{'console_api_url'}."?op=get&op2=test&apipass=".$Config{"console_api_pass"}."&user=".$Config{"console_user"}."&pass=".$Config{"console_pass"}."'"; my $curl_execution = "'".$Config{'console_api_url'}."?op=get&op2=test&apipass=".$Config{"console_api_pass"}."&user=".$Config{"console_user"}."&pass=".$Config{"console_pass"}."'";
# More than 30 secs is highly unrecommendated # More than 30 secs is highly unrecommendated
my $command = $Config{'plugin_exec'}.' 30 curl '.$curl_execution.' 2>/dev/null'; my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null';
my $exe_testing_api = `$command`; my $exe_testing_api = `$command`;
my @res_testing_api = split(',', $exe_testing_api); my @res_testing_api = split(',', $exe_testing_api);
if ( $res_testing_api[0] ne 'OK' ) { if ( $res_testing_api[0] ne 'OK' ) {

View File

@ -1,7 +1,7 @@
############################################################################# #############################################################################
# Pandora FMS Server Parameters # Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System. # Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.768 # Version 7.0NG.769
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -45,8 +45,8 @@ our @EXPORT = qw(
); );
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.768"; my $pandora_version = "7.0NG.769";
my $pandora_build = "230210"; my $pandora_build = "230222";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -5628,16 +5628,26 @@ sub pandora_server_statistics ($$) {
# Non-dataserver LAG calculation: # Non-dataserver LAG calculation:
if ($server->{"server_type"} != DATASERVER){ if ($server->{"server_type"} != DATASERVER){
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag $lag_row = get_db_single_row ($dbh,
FROM tagente_estado, tagente_modulo "SELECT COUNT(tam.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
WHERE utimestamp > 0 FROM (
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
FROM tagente_estado
WHERE tagente_estado.current_interval > 0
AND tagente_estado.last_execution_try > 0
AND tagente_estado.running_by = ?
) tae
JOIN (
SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag
FROM tagente_modulo LEFT JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
WHERE tagente.disabled = 0
AND tagente_modulo.disabled = 0 AND tagente_modulo.disabled = 0
AND tagente_modulo.id_tipo_modulo < 5 AND tagente_modulo.id_tipo_modulo < 5
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo ) tam
AND current_interval > 0 ON tae.id_agente_modulo = tam.id_agente_modulo
AND (UNIX_TIMESTAMP() - utimestamp) < ( current_interval * 10) WHERE (UNIX_TIMESTAMP() - tae.last_execution_try) < ( tae.current_interval * 10)
AND running_by = ? AND (tam.flag = 1 OR (UNIX_TIMESTAMP() - tae.last_execution_try) > tae.current_interval)", $server->{"id_server"});
AND (UNIX_TIMESTAMP() - utimestamp) > (current_interval * 1.1)", $server->{"id_server"});
} }
# Dataserver LAG calculation: # Dataserver LAG calculation:
else { else {

View File

@ -221,10 +221,14 @@ sub data_consumer ($$) {
if ($task->{'type'} == DISCOVERY_APP_SAP) { if ($task->{'type'} == DISCOVERY_APP_SAP) {
# SAP TASK, retrieve license. # SAP TASK, retrieve license.
if (defined($task->{'field4'}) && $task->{'field4'} ne "") {
$task->{'sap_license'} = $task->{'field4'};
} else {
$task->{'sap_license'} = pandora_get_config_value( $task->{'sap_license'} = pandora_get_config_value(
$dbh, $dbh,
'sap_license' 'sap_license'
); );
}
# Retrieve credentials for task (optional). # Retrieve credentials for task (optional).
if (defined($task->{'auth_strings'}) if (defined($task->{'auth_strings'})

View File

@ -33,8 +33,8 @@ use base 'Exporter';
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.768"; my $pandora_version = "7.0NG.769";
my $pandora_build = "230210"; my $pandora_build = "230222";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -1,9 +1,10 @@
# #
# Pandora FMS Server # Pandora FMS Server
# #
%global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}
@ -109,6 +110,12 @@ rm -fr $RPM_BUILD_ROOT
getent passwd pandora >/dev/null || \ getent passwd pandora >/dev/null || \
/usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora /usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
exit 1
fi
exit 0 exit 0
%post %post
@ -176,6 +183,12 @@ if [ "$1" = "1" ]; then
exit 0 exit 0
fi fi
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
exit 1
fi
/sbin/service pandora_server stop >/dev/null 2>&1 || : /sbin/service pandora_server stop >/dev/null 2>&1 || :
/sbin/service tentacle_serverd stop >/dev/null 2>&1 || : /sbin/service tentacle_serverd stop >/dev/null 2>&1 || :
/sbin/chkconfig --del pandora_server /sbin/chkconfig --del pandora_server

View File

@ -1,9 +1,10 @@
# #
# Pandora FMS Server # Pandora FMS Server
# #
%global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.768 %define version 7.0NG.769
%define release 230210 %define release 230222
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}
@ -100,7 +101,11 @@ if [ "`id pandora | grep uid | wc -l`" = 0 ]
then then
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
fi fi
exit 0 current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
exit 1
fi
%post %post
if [ `command -v systemctl` ]; if [ `command -v systemctl` ];
@ -172,6 +177,12 @@ if [ "$1" = "1" ]; then
exit 0 exit 0
fi fi
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
exit 1
fi
/etc/init.d/pandora_server stop &>/dev/null /etc/init.d/pandora_server stop &>/dev/null
/etc/init.d/tentacle_serverd stop &>/dev/null /etc/init.d/tentacle_serverd stop &>/dev/null
chkconfig --del pandora_server chkconfig --del pandora_server

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license. # This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.768" PI_VERSION="7.0NG.769"
PI_BUILD="230210" PI_BUILD="230222"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.768 Build 230210"; my $version = "7.0NG.769 Build 230222";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;
@ -53,6 +53,9 @@ my $SMALL_OPERATION_STEP = 1000; # 1000 is default
# Timeout for lock acquisition. # Timeout for lock acquisition.
my $LOCK_TIMEOUT = 60; my $LOCK_TIMEOUT = 60;
# Cron cookies file.
my $COOKIES_FILE = '/tmp/cron-session-cookies';
# FLUSH in each IO # FLUSH in each IO
$| = 1; $| = 1;
@ -1067,12 +1070,17 @@ sub pandora_delete_old_session_data {
$ulimit_timestamp = time() - $session_timeout; $ulimit_timestamp = time() - $session_timeout;
log_message ('PURGE', "Deleting old session data from tsessions_php\n"); log_message ('PURGE', "Deleting old session data from tsessions_php");
while(db_delete_limit ($dbh, 'tsessions_php', 'last_active < ?', $SMALL_OPERATION_STEP, $ulimit_timestamp) ne '0E0') { while(db_delete_limit ($dbh, 'tsessions_php', 'last_active < ?', $SMALL_OPERATION_STEP, $ulimit_timestamp) ne '0E0') {
usleep (10000); usleep (10000);
}; };
db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'"); db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'");
# Delete cron cookies file
log_message ('PURGE', "Deleting cron session file");
unlink($COOKIES_FILE);
} }
############################################################################### ###############################################################################

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.768 Build 230210"; my $version = "7.0NG.769 Build 230222";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);

View File

@ -571,7 +571,7 @@ foreach my $iface (keys %{$analysis_tree}) {
$inUsage += $analysis_tree->{$iface}{'inUsage'}; $inUsage += $analysis_tree->{$iface}{'inUsage'};
$j++; $j++;
} }
if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'inUsage'} == 0) { if (is_enabled($analysis_tree->{$iface}{'outUsage'}) || $analysis_tree->{$iface}{'outUsage'} == 0) {
$outUsage += $analysis_tree->{$iface}{'outUsage'}; $outUsage += $analysis_tree->{$iface}{'outUsage'};
$k++; $k++;
} }