Merge branch 'develop' into ent-11682-no-se-configuran-las-listas-de-dias-especiales

This commit is contained in:
Daniel Cebrian 2023-08-08 17:30:16 +02:00
commit c45b9fb541
240 changed files with 47908 additions and 3713 deletions

View File

@ -19,10 +19,10 @@ LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPASS" ] || DBPASS='Pandor4!'
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTUSER" ] || DBROOTUSER=root
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$DBROOTPASS" ] || DBROOTPASS='Pandor4!'
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
@ -79,6 +79,53 @@ check_root_permissions () {
fi
}
# Function to check if a password meets the MySQL secure password requirements
is_mysql_secure_password() {
local password=$1
# Check password length (at least 8 characters)
if [[ ${#password} -lt 8 ]]; then
echo "Password length should be at least 8 characters."
return 1
fi
# Check if password contains at least one uppercase letter
if [[ $password == ${password,,} ]]; then
echo "Password should contain at least one uppercase letter."
return 1
fi
# Check if password contains at least one lowercase letter
if [[ $password == ${password^^} ]]; then
echo "Password should contain at least one lowercase letter."
return 1
fi
# Check if password contains at least one digit
if ! [[ $password =~ [0-9] ]]; then
echo "Password should contain at least one digit."
return 1
fi
# Check if password contains at least one special character
if ! [[ $password =~ [[:punct:]] ]]; then
echo "Password should contain at least one special character."
return 1
fi
# Check if password is not a common pattern (e.g., "password", "123456")
local common_patterns=("password" "123456" "qwerty")
for pattern in "${common_patterns[@]}"; do
if [[ $password == *"$pattern"* ]]; then
echo "Password should not contain common patterns."
return 1
fi
done
# If all checks pass, the password is MySQL secure compliant
return 0
}
## Main
echo "Starting PandoraFMS External DB deployment EL8 ver. $S_VERSION"
@ -128,6 +175,10 @@ execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "dnf --version" 'Checking needed tools: dnf'
#Check mysql pass
execute_cmd "is_mysql_secure_password $DBROOTPASS" "Checking DBROOTPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
execute_cmd "is_mysql_secure_password $DBPASS" "Checking DBPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
# Creating working directory
rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE"
mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE"
@ -207,16 +258,12 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
if [ "$MYVER" -eq '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = 'Pandor4!';
UNINSTALL COMPONENT 'file://component_validate_password';
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = '$DBROOTPASS';
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"
fi
if [ "$MYVER" -ne '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"fi
fi

View File

@ -26,9 +26,9 @@ rm -f $LOGFILE &> /dev/null # remove last log before start
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPASS" ] || DBPASS='Pandor4!'
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$DBROOTPASS" ] || DBROOTPASS='Pandor4!'
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
@ -86,6 +86,53 @@ check_root_permissions () {
fi
}
# Function to check if a password meets the MySQL secure password requirements
is_mysql_secure_password() {
local password=$1
# Check password length (at least 8 characters)
if [[ ${#password} -lt 8 ]]; then
echo "Password length should be at least 8 characters."
return 1
fi
# Check if password contains at least one uppercase letter
if [[ $password == ${password,,} ]]; then
echo "Password should contain at least one uppercase letter."
return 1
fi
# Check if password contains at least one lowercase letter
if [[ $password == ${password^^} ]]; then
echo "Password should contain at least one lowercase letter."
return 1
fi
# Check if password contains at least one digit
if ! [[ $password =~ [0-9] ]]; then
echo "Password should contain at least one digit."
return 1
fi
# Check if password contains at least one special character
if ! [[ $password =~ [[:punct:]] ]]; then
echo "Password should contain at least one special character."
return 1
fi
# Check if password is not a common pattern (e.g., "password", "123456")
local common_patterns=("password" "123456" "qwerty")
for pattern in "${common_patterns[@]}"; do
if [[ $password == *"$pattern"* ]]; then
echo "Password should not contain common patterns."
return 1
fi
done
# If all checks pass, the password is MySQL secure compliant
return 0
}
## Main
echo "Starting PandoraFMS External DB deployment Ubuntu 22.04 ver. $S_VERSION"
@ -137,6 +184,10 @@ execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "apt --version" 'Checking needed tools: apt'
#Check mysql pass
execute_cmd "is_mysql_secure_password $DBROOTPASS" "Checking DBROOTPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
execute_cmd "is_mysql_secure_password $DBPASS" "Checking DBPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
# Creating working directory
rm -rf "$WORKDIR" &>> "$LOGFILE"
mkdir -p "$WORKDIR" &>> "$LOGFILE"
@ -170,6 +221,7 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
""" | mysql -uroot &>> "$LOGFILE"
export MYSQL_PWD=$DBROOTPASS
echo "INSTALL COMPONENT 'file://component_validate_password';" | mysql -uroot -P$DBPORT -h$DBHOST &>> "$LOGFILE"
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."

View File

@ -11,7 +11,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2023050901'
S_VERSION='2023062901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
@ -285,8 +285,7 @@ console_dependencies=" \
mod_ssl \
libzstd \
openldap-clients \
chromium \
http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
chromium"
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies
@ -313,7 +312,6 @@ server_dependencies=" \
bind-utils \
whois \
cpanminus \
http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
https://firefly.pandorafms.com/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -341,7 +339,6 @@ execute_cmd "yum install -y $oracle_dependencies || yum reinstall -y $oracle_dep
#ipam dependencies
ipam_dependencies=" \
http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
perl(NetAddr::IP) \
perl(Sys::Syslog) \
perl(DBI) \
@ -719,6 +716,9 @@ echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cro
systemctl enable pandora_agent_daemon &>> $LOGFILE
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
# Enable postrix
systemctl enable postfix --now &>> "$LOGFILE"
#SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)

View File

@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2023050901'
S_VERSION='2023062901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
@ -24,10 +24,10 @@ LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPASS" ] || DBPASS='Pandor4!'
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTUSER" ] || DBROOTUSER=root
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$DBROOTPASS" ] || DBROOTPASS='Pandor4!'
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
@ -125,6 +125,52 @@ installing_docker () {
echo "End installig docker" &>> "$LOGFILE"
}
# Function to check if a password meets the MySQL secure password requirements
is_mysql_secure_password() {
local password=$1
# Check password length (at least 8 characters)
if [[ ${#password} -lt 8 ]]; then
echo "Password length should be at least 8 characters."
return 1
fi
# Check if password contains at least one uppercase letter
if [[ $password == ${password,,} ]]; then
echo "Password should contain at least one uppercase letter."
return 1
fi
# Check if password contains at least one lowercase letter
if [[ $password == ${password^^} ]]; then
echo "Password should contain at least one lowercase letter."
return 1
fi
# Check if password contains at least one digit
if ! [[ $password =~ [0-9] ]]; then
echo "Password should contain at least one digit."
return 1
fi
# Check if password contains at least one special character
if ! [[ $password =~ [[:punct:]] ]]; then
echo "Password should contain at least one special character."
return 1
fi
# Check if password is not a common pattern (e.g., "password", "123456")
local common_patterns=("password" "123456" "qwerty")
for pattern in "${common_patterns[@]}"; do
if [[ $password == *"$pattern"* ]]; then
echo "Password should not contain common patterns."
return 1
fi
done
# If all checks pass, the password is MySQL secure compliant
return 0
}
## Main
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
@ -189,6 +235,10 @@ execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "dnf --version" 'Checking needed tools: dnf'
#Check mysql pass
execute_cmd "is_mysql_secure_password $DBROOTPASS" "Checking DBROOTPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
execute_cmd "is_mysql_secure_password $DBPASS" "Checking DBPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
# Creating working directory
rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE"
mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE"
@ -344,8 +394,7 @@ console_dependencies=" \
http://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.pandorafms.com/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm"
execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies
@ -371,7 +420,7 @@ server_dependencies=" \
java \
bind-utils \
whois \
http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
libnsl \
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
https://firefly.pandorafms.com/centos8/pandorawmic-1.0.0-1.x86_64.rpm"
execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -399,7 +448,6 @@ execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant cli
#ipam dependencies
ipam_dependencies=" \
http://firefly.pandorafms.com/centos7/xprobe2-0.3-12.2.x86_64.rpm \
perl(NetAddr::IP) \
perl(Sys::Syslog) \
perl(DBI) \
@ -439,7 +487,6 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
if [ "$MYVER" -eq '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = 'Pandor4!';
UNINSTALL COMPONENT 'file://component_validate_password';
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = '$DBROOTPASS';
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"
fi
@ -447,7 +494,6 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
if [ "$MYVER" -ne '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"fi
fi
@ -622,8 +668,9 @@ sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
#adding 900s to httpd timeout
#adding 900s to httpd timeout and 300 to ProxyTimeout
echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf
echo 'ProxyTimeout 300' >> /etc/httpd/conf.d/timeout.conf
cat > /var/www/html/index.html << EOF_INDEX
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">
@ -787,6 +834,9 @@ echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cro
systemctl enable pandora_agent_daemon &>> "$LOGFILE"
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
# Enable postfix
systemctl enable postfix --now &>> "$LOGFILE"
#SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)

View File

@ -17,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy
S_VERSION='2023050901'
S_VERSION='2023062901'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start
@ -27,9 +27,9 @@ rm -f $LOGFILE &> /dev/null # remove last log before start
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPASS" ] || DBPASS='Pandor4!'
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$DBROOTPASS" ] || DBROOTPASS='Pandor4!'
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
@ -113,6 +113,53 @@ check_root_permissions () {
fi
}
# Function to check if a password meets the MySQL secure password requirements
is_mysql_secure_password() {
local password=$1
# Check password length (at least 8 characters)
if [[ ${#password} -lt 8 ]]; then
echo "Password length should be at least 8 characters."
return 1
fi
# Check if password contains at least one uppercase letter
if [[ $password == ${password,,} ]]; then
echo "Password should contain at least one uppercase letter."
return 1
fi
# Check if password contains at least one lowercase letter
if [[ $password == ${password^^} ]]; then
echo "Password should contain at least one lowercase letter."
return 1
fi
# Check if password contains at least one digit
if ! [[ $password =~ [0-9] ]]; then
echo "Password should contain at least one digit."
return 1
fi
# Check if password contains at least one special character
if ! [[ $password =~ [[:punct:]] ]]; then
echo "Password should contain at least one special character."
return 1
fi
# Check if password is not a common pattern (e.g., "password", "123456")
local common_patterns=("password" "123456" "qwerty")
for pattern in "${common_patterns[@]}"; do
if [[ $password == *"$pattern"* ]]; then
echo "Password should not contain common patterns."
return 1
fi
done
# If all checks pass, the password is MySQL secure compliant
return 0
}
installing_docker () {
#Installing docker for debug
echo "Start installig docker" &>> "$LOGFILE"
@ -194,6 +241,10 @@ execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "apt --version" 'Checking needed tools: apt'
#Check mysql pass
execute_cmd "is_mysql_secure_password $DBROOTPASS" "Checking DBROOTPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
execute_cmd "is_mysql_secure_password $DBPASS" "Checking DBPASS password match policy" 'This password do not match minimum MySQL policy requirements, more info in: https://dev.mysql.com/doc/refman/8.0/en/validate-password.html'
# Creating working directory
rm -rf "$WORKDIR" &>> "$LOGFILE"
mkdir -p "$WORKDIR" &>> "$LOGFILE"
@ -265,7 +316,6 @@ server_dependencies=" \
openssh-client \
postfix \
unzip \
xprobe \
coreutils \
libio-compress-perl \
libmoosex-role-timer-perl \
@ -287,6 +337,8 @@ server_dependencies=" \
libgeo-ip-perl \
arping \
snmp-mibs-downloader \
snmptrapd \
libnsl2 \
openjdk-8-jdk "
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -299,17 +351,7 @@ echo -en "${cyan}Installing wmic and pandorawmic...${reset}"
chmod +x pandorawmic wmic &>> "$LOGFILE" && \
cp -a wmic /usr/bin/ &>> "$LOGFILE" && \
cp -a pandorawmic /usr/bin/ &>> "$LOGFILE"
check_cmd_status "Error Installing phanromjs"
# phantomjs
echo -en "${cyan}Installing phantomjs...${reset}"
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
export OPENSSL_CONF=/etc/ssl
curl -LSs -O "https://firefly.pandorafms.com/pandorafms/utils/$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \
tar xvjf "$PHANTOM_JS.tar.bz2" &>> "$LOGFILE" && \
mv $PHANTOM_JS/bin/phantomjs /usr/bin &>> "$LOGFILE" && \
/usr/bin/phantomjs --version &>> "$LOGFILE"
check_cmd_status "Error Installing phanromjs"
check_cmd_status "Error Installing pandorawmic/wmic"
# create symlink for fping
rm -f /usr/sbin/fping &>> "$LOGFILE"
@ -370,7 +412,6 @@ source '/root/.profile' &>> "$LOGFILE"
#ipam dependencies
ipam_dependencies=" \
xprobe \
libnetaddr-ip-perl \
coreutils \
libdbd-mysql-perl \
@ -413,6 +454,7 @@ if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
""" | mysql -uroot &>> "$LOGFILE"
export MYSQL_PWD=$DBROOTPASS
echo "INSTALL COMPONENT 'file://component_validate_password';" | mysql -uroot -P$DBPORT -h$DBHOST &>> "$LOGFILE"
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."
@ -619,8 +661,9 @@ sed --follow-symlinks -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.i
sed --follow-symlinks -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
sed --follow-symlinks -i -e "s/^disable_functions/;disable_functions/" /etc/php.ini
#adding 900s to httpd timeout
#echo 'TimeOut 900' > /etc/httpd/conf.d/timeout.conf
#adding 900s to httpd timeout and 300 to ProxyTimeout
echo 'TimeOut 900' > /etc/apache2/conf-enabled/timeout.conf
echo 'ProxyTimeout 300' >> /etc/apache2/conf-enabled/timeout.conf
cat > /var/www/html/index.html << EOF_INDEX
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">
@ -792,6 +835,13 @@ systemctl enable pandora_agent_daemon &>> "$LOGFILE"
#fix path phantomjs
sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = openssl_init/g" /etc/ssl/openssl.cnf &>> "$LOGFILE"
# Enable postfix
systemctl enable postfix --now &>> "$LOGFILE"
# Disable snmptrapd
systemctl disable --now snmptrapd &>> "$LOGFILE"
systemctl disable --now snmptrapd.socket &>> "$LOGFILE"
#SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)

View File

@ -4,7 +4,7 @@ Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: ÁRTICA ST <info@artica.es>
Maintainer: Pandora FMS <info@pandorafms.com>
Homepage: https://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -4,7 +4,7 @@ Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: ÁRTICA ST <info@artica.es>
Maintainer: Pandora FMS <info@pandorafms.com>
Homepage: http://pandorafms.org/
Depends: coreutils, perl
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

@ -1,10 +1,10 @@
package: pandorafms-agent-unix
Version: 7.0NG.772-230706
Version: 7.0NG.772-230728
Architecture: all
Priority: optional
Section: admin
Installed-Size: 260
Maintainer: ÁRTICA ST <info@artica.es>
Maintainer: Pandora FMS <info@pandorafms.com>
Homepage: http://pandorafms.org/
Depends: coreutils, perl, unzip
Description: Pandora FMS agents are based on native languages in every platform: scripts that can be written in any language. Its possible to reproduce any agent in any programming language and can be extended without difficulty the existing ones in order to cover aspects not taken into account up to the moment. These scripts are formed by modules that each one gathers a "chunk" of information. Thus, every agent gathers several "chunks" of information; this one is organized in a data set and stored in a single file, called data file.

View File

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

View File

@ -6,7 +6,7 @@
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.772</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.772 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.772</string>
<key>NSPrincipalClass</key><string>NSApplication</string>

View File

@ -213,5 +213,5 @@ module_end
module_plugin grep_log /var/adm/syslog Syslog .
#Inventory plugin
#module_plugin /usr/share/pandora_agent/plugins/inventory_solaris.pl

View File

@ -1031,7 +1031,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.772';
use constant AGENT_BUILD => '230706';
use constant AGENT_BUILD => '230728';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.772
%define release 230706
%define release 230728
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -0,0 +1,168 @@
#
#Pandora FMS Linux Agent
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.772
%define release 230725
Summary: Pandora FMS Linux agent, binary version
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Vendor: ArticaST <http://www.artica.es>
Source0: %{source_name}-%{version}.tar.gz
URL: http://pandorafms.org
Group: System/Monitoring
Packager: Sancho Lerena <slerena@artica.es>
Prefix: /usr/share
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch
Requires(pre): shadow-utils
Requires(post): chkconfig /bin/ln
Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
Requires: coreutils unzip
Requires: util-linux procps grep
Requires: /sbin/ip /bin/awk
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
# Required by plugins
#Requires: sh-utils sed passwd net-tools rpm
AutoReq: 0
Provides: %{name}-%{version}
%description
Pandora FMS agent for unix. Pandora FMS is an OpenSource full-featured monitoring software.
%prep
rm -rf $RPM_BUILD_ROOT
%setup -q -n unix
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_agent/
mkdir -p $RPM_BUILD_ROOT/usr/bin/
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
mkdir -p $RPM_BUILD_ROOT/etc/pandora/
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
cp -aRf * $RPM_BUILD_ROOT%{prefix}/pandora_agent/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/tentacle_client $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_exec $RPM_BUILD_ROOT/usr/bin/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent_daemon $RPM_BUILD_ROOT/etc/rc.d/init.d/pandora_agent_daemon
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/pandora_agent.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/man/man1/tentacle_client.1.gz $RPM_BUILD_ROOT/usr/share/man/man1/
cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUILD_ROOT/usr/share/pandora_agent/pandora_agent.conf.rpmnew
install -m 0644 pandora_agent_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_agent
if [ -f $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec ] ; then
rm $RPM_BUILD_ROOT%{prefix}/pandora_agent/pandora_agent.spec
fi
%clean
rm -Rf $RPM_BUILD_ROOT
%pre
getent passwd pandora >/dev/null || \
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
exit 0
chown pandora:root /var/log/pandora
%post
if [ ! -d /etc/pandora ] ; then
mkdir -p /etc/pandora
fi
if [ ! -f /usr/share/pandora_agent/pandora_agent.conf ] ; then
cp /usr/share/pandora_agent/pandora_agent.conf.rpmnew /usr/share/pandora_agent/pandora_agent.conf
fi
if [ ! -f /etc/pandora/pandora_agent.conf ] ; then
ln -s /usr/share/pandora_agent/pandora_agent.conf /etc/pandora/pandora_agent.conf
else
[[ ! -f /etc/pandora/pandora_agent.conf.rpmnew ]] && ln -s /usr/share/pandora_agent/pandora_agent.conf.rpmnew /etc/pandora/pandora_agent.conf.rpmnew
fi
if [ ! -e /etc/pandora/plugins ]; then
ln -s /usr/share/pandora_agent/plugins /etc/pandora
fi
if [ ! -e /etc/pandora/collections ]; then
mkdir -p /usr/share/pandora_agent/collections
ln -s /usr/share/pandora_agent/collections /etc/pandora
fi
if [ ! -e /etc/pandora/commands ]; then
mkdir -p /usr/share/pandora_agent/commands
ln -s /usr/share/pandora_agent/commands /etc/pandora
fi
mkdir -p /var/spool/pandora/data_out
if [ ! -d /var/log/pandora ]; then
mkdir -p /var/log/pandora
fi
if [ `command -v systemctl` ];
then
echo "Copying new version of pandora_agent_daemon service"
cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/
chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service
# Enable the services on SystemD
systemctl enable pandora_agent_daemon.service
else
/sbin/chkconfig --add pandora_agent_daemon
/sbin/chkconfig pandora_agent_daemon on
fi
if [ "$1" -gt 1 ]
then
echo "If Pandora Agent daemon was running with init.d script,"
echo "please stop it manually and start the service with systemctl"
fi
%preun
# Upgrading
if [ "$1" = "1" ]; then
exit 0
fi
/sbin/chkconfig --del pandora_agent_daemon
/etc/rc.d/init.d/pandora_agent_daemon stop >/dev/null 2>&1 || :
# Remove symbolic links
pushd /etc/pandora
for f in pandora_agent.conf plugins collections
do
[ -L $f ] && rm -f $f
done
exit 0
%files
%defattr(750,root,root)
/usr/bin/pandora_agent
%defattr(755,pandora,root)
%{prefix}/pandora_agent
%defattr(755,root,root)
/usr/bin/pandora_agent_exec
/usr/bin/tentacle_client
/etc/rc.d/init.d/pandora_agent_daemon
%defattr(644,root,root)
/usr/share/man/man1/pandora_agent.1.gz
/usr/share/man/man1/tentacle_client.1.gz
%config(noreplace) %{_sysconfdir}/logrotate.d/pandora_agent

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.772
%define release 230706
%define release 230728
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.772"
PI_BUILD="230706"
PI_BUILD="230728"
OS_NAME=`uname -s`
FORCE=0
@ -541,8 +541,17 @@ install () {
then
echo "Define 'pandora_agent=\"YES\"' in /etc/rc.conf to enable the daemon."
else
echo "Check your startup configuration to be sure Pandora FMS Agent is ready "
echo "to start automatically when system restarts":
# Enable startup service
if [ `command -v systemctl` ]
then
systemctl enable pandora_agent_daemon
elif [ `command -v chkconfig` ]
then
chkconfig pandora_agent_daemon on
else
echo "Check your startup configuration to be sure Pandora FMS Agent is ready "
echo "to start automatically when system restarts":
fi
fi
# Restore the daemon script

View File

@ -0,0 +1,121 @@
#!/usr/bin/perl -w
#
use strict;
use Data::Dumper;
#print header
print "<inventory>\n";
#get pakahes
my @pkg_list = `/usr/bin/pkginfo -l 2> /dev/null`;
print " <inventory_module>\n";
print " <name><![CDATA[Software]]></name>\n";
print " <datalist>\n";
my $pkg;
foreach my $line (@pkg_list) {
chomp $line;
my $match = ( $line =~ /PKGINST:/ .. $line =~ /^$/ );
if ( $match && $match !~ /E0/ ) {
if ( $line =~ /^\s+([A-Z]+):\s+(.*)$/ ) {
my ($key, $val) = ($1, $2);
if ( $key eq 'FILES' ) {
if ( $val =~ /^(\d+) (.*)$/ ) {
$pkg->{FILES}->{$2} = $1;
}
}
else {
$pkg->{$1} = $2;
}
}
elsif ( $line =~ /^\s+([0-9]+) (.*)$/ ) {
$pkg->{FILES}->{$2} = $1;
}
else {
print "Unrecognized output: [$line]\n";
}
}
else {
#
# Blank line between packages
#
print "<data><![CDATA[";
print $pkg->{PKGINST} . ';';
print $pkg->{VERSION} . ';';
print $pkg->{NAME} . ';';
print "]]></data>\n";
}
}
print " </datalist>\n";
print " </inventory_module>\n";
#close software module
#CPU module
print " <inventory_module>\n";
print " <name><![CDATA[CPU]]></name>\n";
print " <datalist>\n";
my $cpu_model =`kstat cpu_info 2> /dev/null | grep brand | uniq | sed 's/.*brand//g' | tr -d ' '`;
my $cpu_clock = `kstat cpu_info 2> /dev/null | grep clock_MHz | uniq | awk '{print \$NF " Mhz"}'`;
my $cpu_brand = `kstat cpu_info 2> /dev/null | grep vendor_id | uniq | awk '{print \$NF}'`;
chomp $cpu_brand;
chomp $cpu_clock;
chomp $cpu_model;
print "<data><![CDATA[" . $cpu_model . ';' . $cpu_brand . ';' . $cpu_clock . "]]></data>\n";
print " </datalist>\n";
print " </inventory_module>\n";
#close cpu module
#RAM module
print " <inventory_module>\n";
print " <name><![CDATA[RAM]]></name>\n";
print " <datalist>\n";
my $memory_size =`prtconf 2> /dev/null | grep Memory | cut -d ':' -f 2`;
chomp $memory_size;
print "<data><![CDATA[System Memory;" . $memory_size . "]]></data>\n";
print " </datalist>\n";
print " </inventory_module>\n";
#close RAM module
#NIC module
print " <inventory_module>\n";
print " <name><![CDATA[NIC]]></name>\n";
print " <datalist>\n";
my @nic =`dladm show-link 2> /dev/null| grep -v STATE | awk '{print \$1}'`;
foreach my $nic (@nic){
chomp $nic;
my $nic_mac = `dladm show-linkprop $nic -p mac-address 2> /dev/null |grep -v LINK| awk '{print \$4}'`;
my $nic_speed = `dladm show-linkprop $nic -p speed 2> /dev/null |grep -v LINK| awk '{print \$4}'`;
chomp $nic_mac;
chomp $nic_speed;
print "<data><![CDATA[" . $nic . ';' . $nic_mac . ';'. $nic_speed . "]]></data>\n";
}
print " </datalist>\n";
print " </inventory_module>\n";
#close NIC module
#close inventory
print "</inventory>\n";

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230706}
{230728}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.772 Build 230706")
#define PANDORA_VERSION ("7.0NG.772 Build 230728")
string pandora_path;
string pandora_dir;

View File

@ -6,12 +6,12 @@ BEGIN
BEGIN
BLOCK "080904E4"
BEGIN
VALUE "CompanyName", "Artica ST"
VALUE "CompanyName", "Pandora FMS"
VALUE "FileDescription", "Pandora FMS Agent for Windows Platform"
VALUE "LegalCopyright", "Artica ST"
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.772(Build 230706))"
VALUE "ProductVersion", "(7.0NG.772(Build 230728))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,10 +1,10 @@
package: pandorafms-console
Version: 7.0NG.772-230706
Version: 7.0NG.772-230728
Architecture: all
Priority: optional
Section: admin
Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es>
Maintainer: Pandora FMS <info@pandorafms.com>
Homepage: https://pandorafms.com/
Depends: php, php-snmp, php-gd, php-mysqlnd, php-db, php-xmlrpc, php-curl, graphviz, dbconfig-common, php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php-zip, php-mbstring
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.772-230706"
pandora_version="7.0NG.772-230728"
package_pear=0
package_pandora=1
@ -163,7 +163,7 @@ if [ $package_pear -eq 1 ]
then
echo "Make the package \"php-xml-rpc\"."
cd temp_package
dh-make-pear --maintainer "ÁRTICA ST <info@artica.es>" XML_RPC
dh-make-pear --maintainer "Pandora FMS <info@pandorafms.com>" XML_RPC
cd php-xml-rpc-*
dpkg-buildpackage -rfakeroot
cd ..

View File

@ -609,7 +609,7 @@
}
],
"description": "PHP library for ChartJS",
"homepage": "https://artica.es/",
"homepage": "https://pandorafms.com/",
"keywords": [
"chartjs",
"graph",

View File

@ -1692,3 +1692,14 @@ enterprise/godmode/modules/manage_inventory_modules_form.php
enterprise/operation/inventory/inventory.php
include/test.js
include/web2image.js
enterprise/meta/monitoring/wizard/wizard.agent.php
enterprise/meta/monitoring/wizard/wizard.create_agent.php
enterprise/meta/monitoring/wizard/wizard.create_module.php
enterprise/meta/monitoring/wizard/wizard.main.php
enterprise/meta/monitoring/wizard/wizard.manage_alert.php
enterprise/meta/monitoring/wizard/wizard.module.local.php
enterprise/meta/monitoring/wizard/wizard.module.network.php
enterprise/meta/monitoring/wizard/wizard.module.web.php
enterprise/meta/monitoring/wizard/wizard.php
enterprise/meta/monitoring/wizard/wizard.update_agent.php
enterprise/meta/monitoring/wizard/wizard.update_module.php

View File

@ -1,5 +1,67 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `tdiscovery_apps` (
`id_app` int(10) auto_increment,
`short_name` varchar(250) NOT NULL DEFAULT '',
`name` varchar(250) NOT NULL DEFAULT '',
`section` varchar(250) NOT NULL DEFAULT 'custom',
`description` varchar(250) NOT NULL DEFAULT '',
`version` varchar(250) NOT NULL DEFAULT '',
PRIMARY KEY (`id_app`),
UNIQUE (`short_name`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tdiscovery_apps_scripts` (
`id_app` int(10),
`macro` varchar(250) NOT NULL DEFAULT '',
`value` text NOT NULL DEFAULT '',
PRIMARY KEY (`id_app`, `macro`),
FOREIGN KEY (`id_app`) REFERENCES tdiscovery_apps(`id_app`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tdiscovery_apps_executions` (
`id` int(10) unsigned NOT NULL auto_increment,
`id_app` int(10),
`execution` text NOT NULL DEFAULT '',
PRIMARY KEY (`id`, `id_app`),
FOREIGN KEY (`id_app`) REFERENCES tdiscovery_apps(`id_app`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tdiscovery_apps_tasks_macros` (
`id_task` int(10) unsigned NOT NULL,
`macro` varchar(250) NOT NULL DEFAULT '',
`type` varchar(250) NOT NULL DEFAULT 'custom',
`value` text NOT NULL DEFAULT '',
`temp_conf` tinyint unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id_task`, `macro`),
FOREIGN KEY (`id_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
ALTER TABLE `trecon_task`
ADD COLUMN `id_app` int(10),
ADD COLUMN `setup_complete` tinyint unsigned NOT NULL DEFAULT 0,
ADD COLUMN `executions_timeout` int unsigned NOT NULL DEFAULT 60,
ADD FOREIGN KEY (`id_app`) REFERENCES tdiscovery_apps(`id_app`) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE TABLE IF NOT EXISTS `tnetwork_explorer_filter` (
`id` INT NOT NULL,
`filter_name` VARCHAR(45) NULL,
`top` VARCHAR(45) NULL,
`action` VARCHAR(45) NULL,
`advanced_filter` TEXT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tnetwork_usage_filter` (
`id` INT NOT NULL auto_increment,
`filter_name` VARCHAR(45) NULL,
`top` VARCHAR(45) NULL,
`action` VARCHAR(45) NULL,
`advanced_filter` TEXT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
ALTER TABLE `tlayout`
ADD COLUMN `grid_color` VARCHAR(45) NOT NULL DEFAULT '#cccccc' AFTER `maintenance_mode`,
ADD COLUMN `grid_size` VARCHAR(45) NOT NULL DEFAULT '10' AFTER `grid_color`;
@ -8,6 +70,17 @@ ALTER TABLE `tlayout_template`
ADD COLUMN `grid_color` VARCHAR(45) NOT NULL DEFAULT '#cccccc' AFTER `maintenance_mode`,
ADD COLUMN `grid_size` VARCHAR(45) NOT NULL DEFAULT '10' AFTER `grid_color`;
DELETE FROM tconfig WHERE token = 'refr';
INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`) VALUES (37,2,'CPU','CPU','','Brand;Clock;Model','',0,2);
INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`) VALUES (38,2,'RAM','RAM','','Size','',0,2);
INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`) VALUES (39,2,'NIC','NIC','','NIC;Mac;Speed','',0,2);
INSERT INTO `tmodule_inventory` (`id_module_inventory`, `id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`) VALUES (40,2,'Software','Software','','PKGINST;VERSION;NAME','',0,2);
ALTER TABLE `treport_content` ADD COLUMN `period_range` INT NULL DEFAULT 0 AFTER `period`;
COMMIT;

View File

@ -34,6 +34,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$notifications_numbers['notifications'],
$notifications_numbers['last_id']
).'</div>';
$header_welcome = '';
if (check_acl($config['id_user'], $group, 'AW')) {
$header_welcome .= '<div id="welcome-icon-header">';
$header_welcome .= html_print_image(
'images/wizard@svg.svg',
true,
[
'class' => 'main_menu_icon invert_filter',
'title' => __('Welcome dialog'),
'id' => 'Welcome-dialog',
'alt' => __('Welcome dialog'),
'style' => 'cursor: pointer;',
]
);
$header_welcome .= '</div>';
}
// ======= Servers List ===============================================
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
@ -217,11 +233,8 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$header_autorefresh = '';
$header_autorefresh_counter = '';
if ($config['legacy_vc']
|| ($_GET['sec2'] !== 'operation/visual_console/render_view')
|| (($_GET['sec2'] !== 'operation/visual_console/render_view')
&& $config['legacy_vc'])
) {
if (($_GET['sec2'] !== 'operation/visual_console/render_view')) {
if ($autorefresh_list !== null
&& array_search($_GET['sec2'], $autorefresh_list) !== false
) {
@ -461,7 +474,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
} else {
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
}
?>
</div> <!-- Closes #table_header_inner -->
@ -904,6 +917,44 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
$("#agent_access").css("display","");
});
$("#welcome-icon-header").click(function () {
if (!$('#welcome_modal_window').length){
$(document.body).append('<div id="welcome_modal_window"></div>');
$(document.body).append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'include/styles/new_installation_welcome_window.css') );
}
// Clean DOM.
load_modal({
target: $('#welcome_modal_window'),
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
modal: {
title: "<?php echo __('Welcome to').' '.io_safe_output(get_product_name()); ?>",
cancel: '<?php echo __('Do not show anymore'); ?>',
ok: '<?php echo __('Close'); ?>'
},
onshow: {
page: 'include/ajax/welcome_window',
method: 'loadWelcomeWindow',
},
oncancel: {
page: 'include/ajax/welcome_window',
title: "<?php echo __('Cancel Configuration Window'); ?>",
method: 'cancelWelcome',
confirm: function (fn) {
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Continue execution.
fn();
}
})
}
}
});
});
<?php if (enterprise_installed()) { ?>
// Feedback.
$("#feedback-header").click(function () {

View File

@ -349,7 +349,7 @@ echo '</div>';
const id = table_hover[0].id;
const classes = $(`#${id}`).attr('class');
if (id === 'icon_about') {
if (id === 'icon_about' || id === 'icon_about_operation') {
return;
}

View File

@ -100,21 +100,23 @@ if ($initial && users_is_admin()) {
);
}
$welcome = !$initial;
try {
$welcome_window = new WelcomeWindow($welcome);
if ($welcome_window !== null) {
$welcome_window->run();
if (check_acl($config['id_user'], 0, 'AW')) {
$welcome = !$initial;
try {
$welcome_window = new WelcomeWindow($welcome);
if ($welcome_window !== null) {
$welcome_window->run();
}
} catch (Exception $e) {
$welcome = false;
}
} catch (Exception $e) {
$welcome = false;
}
try {
if (isset($_SESSION['showed_tips_window']) === false) {
$tips_window = new TipsWindow();
if ($tips_window !== null) {
$tips_window->run();
$tips_window->run();
}
}
} catch (Exception $e) {

View File

@ -212,7 +212,7 @@ $groups = users_get_groups($config['id_user'], 'AR', false);
// Get modules.
$modules = db_get_all_rows_sql(
'SELECT id_agente_modulo as id_module, nombre as name FROM tagente_modulo
WHERE id_agente = '.$id_parent
WHERE id_agente = '.$id_agente
);
$modules_values = [];
$modules_values[0] = __('Any');

View File

@ -80,7 +80,7 @@ if (isset($_POST['template_id']) === true) {
$values = [
'id_agente' => $id_agente,
'id_tipo_modulo' => $row2['type'],
'descripcion' => __('Created by template ').$name_template.' . '.$row2['description'],
'descripcion' => $row2['description'],
'max' => $row2['max'],
'min' => $row2['min'],
'module_interval' => $row2['module_interval'],

View File

@ -460,6 +460,18 @@ if ($id_agente) {
$templatetab['active'] = ($tab === 'template');
// Policy tab.
$policyTab['text'] = html_print_menu_button(
[
'href' => 'index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=policy&amp;id_agente='.$id_agente,
'image' => 'images/policy@svg.svg',
'title' => __('Manage policy'),
],
true
);
$policyTab['active'] = ($tab === 'policy');
// Inventory.
$inventorytab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
'images/hardware-software-component@svg.svg',
@ -638,6 +650,7 @@ if ($id_agente) {
'template' => $templatetab,
'inventory' => $inventorytab,
'pluginstab' => $pluginstab,
'policy' => (enterprise_installed() === true) ? $policyTab : '',
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
@ -654,11 +667,11 @@ if ($id_agente) {
'template' => $templatetab,
'inventory' => $inventorytab,
'pluginstab' => $pluginstab,
'policy' => (enterprise_installed() === true) ? $policyTab : '',
'collection' => $collectiontab,
'group' => $grouptab,
'gis' => $gistab,
'agent_wizard' => $agent_wizard,
];
}
@ -725,6 +738,11 @@ if ($id_agente) {
$tab_name = __('Inventory');
break;
case 'policy':
$help_header = 'policy_tab';
$tab_name = __('Policies');
break;
case 'plugins':
$help_header = 'plugins_tab';
$tab_name = __('Agent plugins');
@ -2428,6 +2446,10 @@ switch ($tab) {
include 'inventory_manager.php';
break;
case 'policy':
enterprise_include('operation/agentes/policy_manager.php');
break;
default:
if (enterprise_hook('switch_agent_tab', [$tab])) {
// This will make sure that blank pages will have at least some

View File

@ -1072,16 +1072,20 @@ if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
function () {
$(".actions", this).css ("visibility", "hidden");
});
$("#ag_group").click (
function () {
$(this).css ("width", "auto");
$(this).css ("min-width", "100px");
});
$("#ag_group").blur (function () {
$(this).css ("width", "100px");
});
var show_deploy_agent = "<?php echo get_parameter('show_deploy_agent', 0); ?>";
if (show_deploy_agent !== '0'){
$('#button-modal_deploy_agent').click();
}
});
</script>

View File

@ -89,7 +89,7 @@ if (is_ajax() === true) {
[
'id' => 'agent_modules_affected_planned_downtime',
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'godmode/agentes/planned_downtime.list',

View File

@ -40,6 +40,8 @@ $table->size = [];
$table->style[0] = 'width: 50%';
$table->style[1] = 'width: 50%';
$modules = [];
if (is_metaconsole() === true) {
$params = [];
$params['return'] = true;
@ -79,8 +81,6 @@ if (is_metaconsole() === true) {
}
}
$modules = [];
$table->data[0][1] = html_print_label_input_block(
__('Module'),
html_print_select(

View File

@ -318,74 +318,59 @@ if (count($actions) == 1 && isset($actions[0])) {
} else {
foreach ($actions as $kaction => $action) {
$table->data[$kaction][0] = $action['name'];
if ((int) $kaction === 0) {
$table->data[$kaction][0] .= ui_print_help_tip(
__('The default actions will be executed every time that the alert is fired and no other action is executed'),
true
);
}
foreach ($action['escalation'] as $k => $v) {
if ($v > 0) {
$table->data[$kaction][$k] .= html_print_image(
'images/tick.png',
true,
['class' => 'invert_filter']
);
if (count($action['escalation']) > 1) {
foreach ($action['escalation'] as $k => $v) {
$table->head[$k] = '#'.$k;
if ($v > 0) {
$table->data[$kaction][$k] .= html_print_image(
'images/tick.png',
true,
['class' => 'invert_filter']
);
} else {
$table->data[$kaction][$k] = html_print_image(
'images/blade.png',
true
);
}
}
} else {
$table->head[1] = __('Every time that the alert is fired');
if (count($action['escalation']) > 0) {
if ($action['escalation'][0] > 0) {
$table->data[$kaction][1] .= html_print_image(
'images/tick.png',
true,
['class' => 'invert_filter']
);
} else {
$table->data[$kaction][1] = html_print_image(
'images/blade.png',
true
);
}
} else {
$table->data[$kaction][$k] = html_print_image(
$table->data[$kaction][1] = html_print_image(
'images/blade.png',
true
);
}
if (count($table->head) <= count($action['escalation'])) {
if ($k == count($action['escalation'])) {
if ($k == 1) {
$table->head[$kaction] = __('Every time that the alert is fired');
} else {
$table->head[$kaction] = '>#'.($kaction - 1);
}
} else {
$table->head[$kaction] = '#'.($kaction);
if ($v > 0) {
$table->data[$kaction][($kaction + 1)] = html_print_image(
'images/tick.png',
true,
['class' => 'invert_filter']
);
} else {
$table->data[$kkaction][($kaction + 1)] = html_print_image(
'images/blade.png',
true
);
}
}
}
}
$table->head[($kaction + 1)] = '#'.($kaction);
if (count($action['escalation']) === 0) {
$table->data[$kaction][($kaction + 2)] = html_print_image(
'images/blade.png',
true
);
}
$action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold'];
if ($action_threshold == 0) {
$table->data[$kaction][($k + 1)] = __('No');
$table->data[$kaction][] = __('No');
} else {
$table->data[$kaction][($k + 1)] = human_time_description_raw(
$table->data[$kaction][] = human_time_description_raw(
$action_threshold,
true,
'tiny'
);
}
$table->head[($kaction + 1)] = __('Threshold');
}
$table->head[] = __('Threshold');
}
html_print_table($table);

View File

@ -322,10 +322,18 @@ function update_template($step)
if ($step == 1) {
$name = (string) get_parameter('name');
$name = trim(io_safe_output($name));
if (strlen($name) === 0) {
ui_print_warning_message(__('You can\'t named a template with spaces'));
return false;
}
$name = io_safe_input($name);
$description = (string) get_parameter('description');
$wizard_level = (string) get_parameter('wizard_level');
$priority = (int) get_parameter('priority');
$id_group = get_parameter('id_group');
$name_check = db_get_value('name', 'talert_templates', 'name', $name);
// Only for Metaconsole. Save the previous name for synchronizing.
if (is_metaconsole() === true) {
$previous_name = db_get_value('name', 'talert_templates', 'id', $id);
@ -342,7 +350,12 @@ function update_template($step)
'previous_name' => $previous_name,
];
$result = alerts_update_alert_template($id, $values);
if ($name_check === false) {
$result = alerts_update_alert_template($id, $values);
} else {
ui_print_warning_message(__('Another template with the same name already exists'));
$result = false;
}
} else if ($step == 2) {
$schedule = io_safe_output(get_parameter('schedule', []));
json_decode($schedule, true);
@ -487,6 +500,13 @@ $wizard_level = 'nowizard';
if ($create_template) {
$name = (string) get_parameter('name');
$name = trim(io_safe_output($name));
if (strlen($name) === 0) {
ui_print_warning_message(__('You can\'t named a template with spaces'));
}
$name = io_safe_input($name);
$description = (string) get_parameter('description');
$type = (string) get_parameter('type', 'critical');
$value = (string) get_parameter('value');
@ -515,10 +535,11 @@ if ($create_template) {
$values['field3_recovery'] = ' ';
}
if (!$name_check) {
if ($name_check === false) {
$result = alerts_create_alert_template($name, $type, $values);
} else {
$result = '';
ui_print_warning_message(__('Another template with the same name already exists'));
$result = false;
}
if ($result) {

View File

@ -184,7 +184,7 @@ if (empty($result) === false) {
]
).'</a>&nbsp;&nbsp;';
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
'images/delet.svg',
'images/delete.svg',
true,
[
'title' => __('Delete'),

View File

@ -187,7 +187,7 @@ try {
[
'id' => 'list_agents_tactical',
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $columnNames,
'return' => true,

View File

@ -86,31 +86,39 @@ if ($do_operation) {
$groups = users_get_groups();
$table = new stdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold';
// Source selection
$table->id = 'source_table';
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'source_id_group',
$source_id_group,
false,
'',
'',
true
$table->class = 'databox filters filter-table-adv';
$table->width = '100%';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
// Source selection.
$table->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AW',
true,
'source_id_group',
$source_id_group,
false,
'',
'',
true,
false,
false,
'w100p',
false,
'width:100%'
)
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox('source_recursion', 1, $source_recursion, true, false);
$table->data[0][1] = html_print_label_input_block(
__('Group recursion'),
html_print_checkbox('source_recursion', 1, $source_recursion, true, false)
);
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
@ -118,37 +126,52 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[0][4] = __('Status');
$table->data[0][5] = html_print_select(
$status_list,
'status_agents_source',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
$table->data[1][0] = html_print_label_input_block(
__('Status'),
html_print_select(
$status_list,
'status_agents_source',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true,
false,
true,
'w100p'
)
);
$table->data[0][6] = __('Agent');
$table->data[0][6] .= ' <span id="source_agent_loading" class="invisible">';
$table->data[0][6] .= html_print_image('images/spinner.png', true);
$table->data[0][6] .= '</span>';
// $table->data[0][7] = html_print_select (agents_get_group_agents ($source_id_group, false, "none"),
// 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
$agents = ( $source_id_group ? agents_get_group_agents($source_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
$table->data[0][7] = html_print_select($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
echo '<form '.'action="index.php?'.'sec=gmassive&'.'sec2=godmode/massive/massive_operations&'.'option=copy_modules" '.'id="manage_config_form" '.'method="post">';
$table->data[1][1] = html_print_label_input_block(
__('Agent').' <span id="source_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
html_print_select(
$agents,
'source_id_agent',
$source_id_agent,
false,
__('Select'),
0,
true
)
);
echo '<form action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=copy_modules" id="manage_config_form" method="post" class="max_floating_element_size">';
echo '<fieldset id="fieldset_source">';
echo '<legend>';
echo '<span>'.__('Source');
echo '</legend>';
echo '<legend><span>'.__('Source').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
// Target selection
unset($table);
// Target selection.
$table = new stdClass();
$table->id = 'target_table';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->width = '100%';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$modules = [];
@ -169,66 +192,64 @@ foreach ($agent_alerts as $alert) {
}
$tags = tags_get_user_tags();
$table->data['tags'][0] = __('Tags');
$table->data['tags'][1] = html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true
$table->colspan[0][0] = 2;
$table->data[0][0] = html_print_label_input_block(
__('Tags'),
html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true,
'',
false,
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
)
);
$table->data['operations'][0] = __('Operations');
$table->data['operations'][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
$table->data['operations'][1] .= html_print_checkbox('copy_modules', 1, true, true);
$table->data['operations'][1] .= html_print_label(__('Copy modules'), 'checkbox-copy_modules', true);
$table->data['operations'][1] .= '</span><br />';
$table->data['operations'][1] .= '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
$table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, true);
$table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true);
$table->data['operations'][1] .= '</span>';
$table->data['form_modules_filter'][0] = __('Filter Modules');
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
$table->data[1][0] = __('Modules');
$table->data[1][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
$table->data[1][1] .= html_print_select(
$modules,
'target_modules[]',
0,
false,
'',
'',
true,
true
$table->data[1][0] = html_print_label_input_block(
__('Operations'),
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_checkbox('copy_modules', 1, true, true).html_print_label(__('Copy modules'), 'checkbox-copy_modules', true).'</span><span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_checkbox('copy_alerts', 1, true, true).html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true).'</span>'
);
$table->data[1][1] .= '</span>';
$table->data[1][1] .= '<span class="without_modules'.(! empty($modules) ? ' invisible' : '').'">';
$table->data[1][1] .= '<em>'.__('No modules for this agent').'</em>';
$table->data[1][1] .= '</span>';
$table->data[2][0] = __('Alerts');
$table->data[2][1] = '<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">';
$table->data[2][1] .= html_print_select(
$alerts,
'target_alerts[]',
0,
false,
'',
'',
true,
true
$table->data[1][1] = html_print_label_input_block(
__('Filter Modules'),
html_print_input_text('filter_modules', '', '', 20, 255, true)
);
$table->colspan[2][0] = 2;
$table->data[2][0] = html_print_label_input_block(
__('Modules'),
'<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">'.html_print_select(
$modules,
'target_modules[]',
0,
false,
'',
'',
true,
true
).'</span><span class="without_modules'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No modules for this agent').'</em></span>'
);
$table->colspan[3][0] = 2;
$table->data[3][0] = html_print_label_input_block(
__('Alerts'),
'<span class="with_alerts'.(empty($alerts) ? ' invisible' : '').'">'.html_print_select(
$alerts,
'target_alerts[]',
0,
false,
'',
'',
true,
true
).'</span><span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'"><em>'.__('No alerts for this agent').'</em></span>'
);
$table->data[2][1] .= '</span>';
$table->data[2][1] .= '<span class="without_alerts'.(! empty($modules) ? ' invisible' : '').'">';
$table->data[2][1] .= '<em>'.__('No alerts for this agent').'</em>';
$table->data[2][1] .= '</span>';
echo '<div id="modules_loading" class="loading invisible">';
html_print_image('images/spinner.png');
@ -240,35 +261,50 @@ echo '<legend><span>'.__('Targets').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
// Destiny selection
unset($table);
// Destiny selection.
$table = new stdClass();
$table->id = 'destiny_table';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->width = '100%';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->size[0] = '20%';
$table->size[1] = '30%';
$table->size[2] = '20%';
$table->size[3] = '30%';
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'destiny_id_group',
$destiny_id_group,
false,
'',
'',
true
$table->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AW',
true,
'destiny_id_group',
$destiny_id_group,
false,
'',
'',
true,
false,
false,
'w100p',
false,
'width:100%'
)
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox(
'destiny_recursion',
1,
$destiny_recursion,
true,
false
$table->data[0][1] = html_print_label_input_block(
__('Group recursion'),
html_print_checkbox(
'destiny_recursion',
1,
$destiny_recursion,
true,
false
)
);
$table->data[1][0] = html_print_label_input_block(
__('Filter Agents'),
html_print_input_text('filter_agents', '', '', 20, 255, true)
);
$status_list = [];
@ -278,32 +314,30 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select(
$status_list,
'status_agents_destiny',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
$table->data[1][1] = html_print_label_input_block(
__('Status'),
html_print_select(
$status_list,
'status_agents_destiny',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
)
);
$table->data['form_agents_filter'][0] = __('Filter Agents');
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
$table->data[2][0] = __('Agent');
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>';
$agents = [];
if ($source_id_agent) {
$agents = ( $destiny_id_group ? agents_get_group_agents($destiny_id_group, false, 'none') : agents_get_group_agents(array_keys(users_get_groups($config['id_user'], 'AW', false))) );
unset($agents[$source_id_agent]);
}
$table->data[2][1] = html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true);
$table->colspan[2][0] = 2;
$table->data[2][0] = html_print_label_input_block(
__('Agent').'<span id="destiny_agent_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
html_print_select($agents, 'destiny_id_agent[]', 0, false, '', '', true, true)
);
echo '<fieldset id="fieldset_destiny"'.($source_id_agent ? '' : ' class="invisible"').'>';
echo '<legend><span>'.__('To agent(s)').'</span></legend>';

View File

@ -189,6 +189,14 @@ echo get_table_inputs_masive_agents($params);
if (is_metaconsole() === true || is_management_allowed() === true) {
attachActionButton('delete', 'delete', '100%', false, $SelectAction);
} else {
html_print_action_buttons(
'',
[
'right_content' => $SelectAction,
'class' => 'pdd_t_15px_important pdd_b_15px_important',
]
);
}
echo '</form>';

View File

@ -310,45 +310,47 @@ foreach ($module_types as $type) {
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'databox filters filter-table-adv';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data['selection_mode'][0] = __('Selection mode');
$table->data['selection_mode'][1] = '<span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br>';
$table->data['selection_mode'][1] .= '<span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true);
$table->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type');
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
$table->data['form_modules_1'][0] .= '</span>';
$types[0] = __('All');
$table->colspan['form_modules_1'][1] = 2;
$table->data['form_modules_1'][1] = html_print_select(
$types,
'module_type',
'',
false,
__('Select'),
-1,
true,
false,
true,
'',
false,
'width:100%'
$table->data[0][0] = html_print_label_input_block(
__('Selection mode'),
'<div class="flex"><span class="massive_span">'.__('Select modules first ').'</span>'.html_print_radio_button_extended('selection_mode', 'modules', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'<br><span class="massive_span">'.__('Select agents first ').'</span>'.html_print_radio_button_extended('selection_mode', 'agents', '', $selection_mode, false, '', 'class="mrgn_right_40px"', true).'</div>'
);
$table->data['form_modules_1'][3] = __('Select all modules of this type').' '.html_print_checkbox_extended(
'force_type',
'type',
'',
'',
false,
'class="mrgn_right_40px"',
true,
''
$table->rowclass[1] = 'select_modules_row';
$types[0] = __('All');
$table->data[1][0] = html_print_label_input_block(
__('Module type').'<span id="module_loading" class="invisible">'.html_print_image('images/spinner.png', true).'</span>',
html_print_select(
$types,
'module_type',
'',
false,
__('Select'),
-1,
true,
false,
true,
'',
false,
'width:100%'
)
);
$table->data[1][1] = html_print_label_input_block(
__('Select all modules of this type'),
html_print_checkbox_extended(
'force_type',
'type',
'',
'',
false,
'class="mrgn_right_40px"',
true,
''
)
);
$modules = [];
@ -368,52 +370,59 @@ foreach ($names as $name) {
$modules[$name['nombre']] = $name['nombre'];
}
$table->rowclass['form_agents_1'] = 'select_agents_row';
$table->data['form_agents_1'][0] = __('Agent group');
$table->rowclass[2] = 'select_agents_row';
$groups = users_get_groups($config['id_user'], 'AW', false);
$groups[0] = __('All');
$table->colspan['form_agents_1'][1] = 2;
$table->data['form_agents_1'][1] = html_print_select_groups(
false,
'AW',
true,
'groups_select',
'',
false,
'',
'',
true
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false);
$table->data['form_agents_1'][3] = __('Select all modules of this group').' '.html_print_checkbox_extended(
'force_group',
'group',
'',
'',
false,
'',
'class="mrgn_right_40px"',
true
$table->data[2][0] = html_print_label_input_block(
__('Agent group'),
html_print_select_groups(
false,
'AW',
true,
'groups_select',
'',
false,
'',
'',
true
).' '.__('Group recursion').' '.html_print_checkbox('recursion', 1, false, true, false)
);
$table->data[2][1] = html_print_label_input_block(
__('Select all modules of this group'),
html_print_checkbox_extended(
'force_group',
'group',
'',
'',
false,
'',
'class="mrgn_right_40px"',
true
)
);
$tags = tags_get_user_tags();
$table->rowstyle['form_modules_4'] = 'vertical-align: top;';
$table->rowclass['form_modules_4'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_4'][0] = __('Tags');
$table->data['form_modules_4'][1] = html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true
$table->rowclass[3] = 'select_modules_row select_modules_row_2';
$table->colspan[3][0] = 2;
$table->data[3][0] = html_print_label_input_block(
__('Tags'),
html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true,
'',
false,
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
)
);
$table->rowclass['form_agents_2'] = 'select_agents_row';
$table->data['form_agents_2'][0] = __('Status');
$table->colspan['form_agents_2'][1] = 2;
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
@ -421,166 +430,194 @@ $status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data['form_agents_2'][1] = html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
$table->data[4][0] = html_print_label_input_block(
__('Module Status'),
html_print_select(
$status_list,
'status_module',
'selected',
'',
__('All'),
AGENT_MODULE_STATUS_ALL,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$table->data['form_agents_2'][3] = '';
$table->rowclass['form_modules_3'] = '';
$table->data['form_modules_3'][0] = __('Module Status');
$table->colspan['form_modules_3'][1] = 2;
$status_list = [];
$status_list[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_MODULE_STATUS_WARNING] = __('Warning');
$status_list[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$status_list[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_MODULE_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
$table->data['form_modules_3'][1] = html_print_select(
$status_list,
'status_module',
'selected',
'',
__('All'),
AGENT_MODULE_STATUS_ALL,
true
$table->cellclass[4][1] = 'select_agents_row';
$table->data[4][1] = html_print_label_input_block(
__('Status'),
html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$table->data['form_modules_3'][3] = '';
$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_filter'][0] = __('Filter Modules');
$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
$table->rowstyle['form_modules_2'] = 'vertical-align: top;';
$table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
$table->data['form_modules_2'][0] = __('Modules');
$table->data['form_modules_2'][1] = html_print_select(
$modules,
'module_name[]',
$module_name,
false,
__('Select'),
-1,
true,
true,
true,
'',
false,
'width:100%'
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'");
$table->data['form_modules_2'][2] = __('When select modules');
$table->data['form_modules_2'][2] .= '<br>';
$table->data['form_modules_2'][2] .= html_print_select(
[
'common' => __('Show common agents'),
'all' => __('Show all agents'),
],
'agents_selection_mode',
'common',
false,
'',
'',
true,
false,
true,
'',
false
$table->rowclass[5] = 'select_modules_row select_modules_row_2';
$table->data[5][0] = html_print_label_input_block(
__('Filter Modules'),
html_print_input_text('filter_modules', '', '', 20, 255, true)
);
$table->data['form_modules_2'][3] = html_print_select(
[],
'agents[]',
$agents_select,
false,
__('None'),
0,
true,
true,
false,
'',
false,
'width:100%'
$table->data[5][1] = html_print_label_input_block(
__('When select modules'),
html_print_select(
[
'common' => __('Show common agents'),
'all' => __('Show all agents'),
],
'agents_selection_mode',
'common',
false,
'',
'',
true,
false,
true,
'w100p',
false,
'width:100%'
)
);
$table->rowclass[6] = 'select_modules_row select_modules_row_2';
$table->data[6][0] = html_print_label_input_block(
__('Modules'),
html_print_select(
$modules,
'module_name[]',
$module_name,
false,
__('Select'),
-1,
true,
true,
true,
'',
false,
'width:100%'
).' '.__('Select all modules').' '.html_print_checkbox('select_all_modules', 1, false, true, false, '', false, "class='static'")
);
$table->data[6][1] = html_print_label_input_block(
__('Agents'),
html_print_select(
[],
'agents[]',
$agents_select,
false,
__('None'),
0,
true,
true,
false,
'',
false,
'width:100%'
)
);
$tags = tags_get_user_tags();
$table->rowstyle['form_agents_4'] = 'vertical-align: top;';
$table->rowclass['form_agents_4'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_4'][0] = __('Tags');
$table->data['form_agents_4'][1] = html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true
$table->rowclass[7] = 'select_agents_row select_agents_row_2';
$table->colspan[7][0] = 2;
$table->data[7][0] = html_print_label_input_block(
__('Tags'),
html_print_select(
$tags,
'tags[]',
$tags_name,
false,
__('Any'),
-1,
true,
true,
true,
'',
false,
'overflow-x: hidden;white-space: nowrap;max-width: 1136px;'
)
);
$table->rowstyle['form_agents_filter'] = 'vertical-align: top;';
$table->rowclass['form_agents_filter'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_filter'][0] = __('Filter Agents');
$table->data['form_agents_filter'][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
$table->rowstyle['form_agents_3'] = 'vertical-align: top;';
$table->rowclass['form_agents_3'] = 'select_agents_row select_agents_row_2';
$table->data['form_agents_3'][0] = __('Agents');
$table->data['form_agents_3'][1] = html_print_select(
$agents,
'id_agents[]',
$agents_id,
false,
'',
'',
true,
true,
false,
'',
false,
'width:100%'
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'");
$table->data['form_agents_3'][2] = __('When select agents');
$table->data['form_agents_3'][2] .= '<br>';
$table->data['form_agents_3'][2] .= html_print_select(
[
'common' => __('Show common modules'),
'all' => __('Show all modules'),
'unknown' => __('Show unknown and not init modules'),
],
'modules_selection_mode',
'common',
false,
'',
'',
true
);
$table->data['form_agents_3'][3] = html_print_select(
[],
'module[]',
$modules_select,
false,
'',
'',
true,
true,
false,
'',
false,
'width:100%'
$table->rowclass[8] = 'select_agents_row select_agents_row_2';
$table->data[8][0] = html_print_label_input_block(
__('Filter Agents'),
html_print_input_text('filter_agents', '', '', 20, 255, true)
);
$table->data[8][1] = html_print_label_input_block(
__('When select agents'),
html_print_select(
[
'common' => __('Show common modules'),
'all' => __('Show all modules'),
'unknown' => __('Show unknown and not init modules'),
],
'modules_selection_mode',
'common',
false,
'',
'',
true,
false,
true,
'w100p',
false,
'width: 100%'
)
);
$table->rowclass[9] = 'select_agents_row select_agents_row_2';
$table->data[9][0] = html_print_label_input_block(
__('Agents'),
html_print_select(
$agents,
'id_agents[]',
$agents_id,
false,
'',
'',
true,
true,
false,
'',
false,
'width:100%;white-space: nowrap;max-width: 1136px;'
).' '.__('Select all agents').' '.html_print_checkbox('select_all_agents', 1, false, true, false, '', false, "class='static'")
);
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
$table->data[9][1] = html_print_label_input_block(
__('Modules'),
html_print_select(
[],
'module[]',
$modules_select,
false,
'',
'',
true,
true,
false,
'w100p',
false,
'width:100%'
)
);
echo '<form method="post" class="max_floating_element_size" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table($table);
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
@ -617,7 +654,9 @@ $(document).ready (function () {
$("#module_name").trigger('change');
} else {
$("#module_name option").prop('selected', false);
$("#module_name").trigger('change');
if ($('#agents_selection_mode :selected').val() === 'all'){
$("#module_name").trigger('change');
}
}
});
@ -760,14 +799,6 @@ $(document).ready (function () {
else if (this.id == "checkbox-recursion") {
$("#groups_select").trigger("change");
}
else {
if (this.checked) {
$(".select_agents_row_2").css('display', 'none');
}
else {
$(".select_agents_row_2").css('display', '');
}
}
}
);

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,7 @@
// Begin.
require_once 'include/config.php';
require_once 'include/functions_menu.php';
require_once $config['homedir'].'/godmode/wizards/ManageExtensions.class.php';
check_login();
@ -78,15 +79,97 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
enterprise_hook('applications_menu');
enterprise_hook('cloud_menu');
}
// Applications.
$sub2 = [];
if (enterprise_installed() === true) {
$sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server');
$sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql');
$sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle');
$sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware');
$sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP');
$sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2');
}
if ((bool) check_acl($config['id_user'], 0, 'RW') === true
|| (bool) check_acl($config['id_user'], 0, 'RM') === true
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
) {
enterprise_hook('console_task_menu');
$extensions = ManageExtensions::getExtensionBySection('app');
if ($extensions !== false) {
foreach ($extensions as $key => $extension) {
$url = sprintf(
'godmode/servers/discovery&wiz=app&mode=%s',
$extension['short_name']
);
$sub2[$url]['text'] = __($extension['name']);
}
}
if ($extensions !== false || enterprise_installed() === true) {
$sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications');
$sub['godmode/servers/discovery&wiz=app']['id'] = 'app';
$sub['godmode/servers/discovery&wiz=app']['type'] = 'direct';
$sub['godmode/servers/discovery&wiz=app']['subtype'] = 'nolink';
$sub['godmode/servers/discovery&wiz=app']['sub2'] = $sub2;
}
// Cloud.
$sub2 = [];
if (enterprise_installed() === true) {
$sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services');
$sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure');
$sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform');
}
$extensions = ManageExtensions::getExtensionBySection('cloud');
if ($extensions !== false) {
foreach ($extensions as $key => $extension) {
$url = sprintf(
'godmode/servers/discovery&wiz=cloud&mode=%s',
$extension['short_name']
);
$sub2[$url]['text'] = __($extension['name']);
}
}
if ($extensions !== false || enterprise_installed() === true) {
$sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud');
$sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud';
$sub['godmode/servers/discovery&wiz=cloud']['type'] = 'direct';
$sub['godmode/servers/discovery&wiz=cloud']['subtype'] = 'nolink';
$sub['godmode/servers/discovery&wiz=cloud']['sub2'] = $sub2;
}
// Custom.
$sub2 = [];
$extensions = ManageExtensions::getExtensionBySection('custom');
if ($extensions !== false) {
foreach ($extensions as $key => $extension) {
$url = sprintf(
'godmode/servers/discovery&wiz=custom&mode=%s',
$extension['short_name']
);
$sub2[$url]['text'] = __($extension['name']);
}
$sub['godmode/servers/discovery&wiz=custom']['text'] = __('Custom');
$sub['godmode/servers/discovery&wiz=custom']['id'] = 'customExt';
$sub['godmode/servers/discovery&wiz=custom']['type'] = 'direct';
$sub['godmode/servers/discovery&wiz=custom']['subtype'] = 'nolink';
$sub['godmode/servers/discovery&wiz=custom']['sub2'] = $sub2;
}
if (check_acl($config['id_user'], 0, 'RW')
|| check_acl($config['id_user'], 0, 'RM')
|| check_acl($config['id_user'], 0, 'PM')
) {
$sub['godmode/servers/discovery&wiz=magextensions']['text'] = __('Manage disco packages');
$sub['godmode/servers/discovery&wiz=magextensions']['id'] = 'mextensions';
}
if ((bool) check_acl($config['id_user'], 0, 'RW') === true
|| (bool) check_acl($config['id_user'], 0, 'RM') === true
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
) {
enterprise_hook('console_task_menu');
}
}
}
@ -174,6 +257,13 @@ if ($access_console_node === true) {
}
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub['wizard']['text'] = __('Configuration wizard');
$sub['wizard']['id'] = 'conf_wizard';
$sub['wizard']['type'] = 'direct';
$sub['wizard']['subtype'] = 'nolink_no_arrow';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['templates']['text'] = __('Templates');
$sub['templates']['id'] = 'Templates';
@ -495,9 +585,13 @@ if ($access_console_node === true) {
$sub2[$extmenu['sec2']]['refr'] = 0;
} else {
if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) {
if (strlen($extmenu['fatherId']) > 0) {
if (empty($extmenu['fatherId']) === false
&& strlen($extmenu['fatherId']) > 0
) {
if (array_key_exists('subfatherId', $extmenu) === true) {
if (strlen($extmenu['subfatherId']) > 0) {
if (empty($extmenu['subfatherId']) === false
&& strlen($extmenu['subfatherId']) > 0
) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0;
@ -620,3 +714,55 @@ if ((bool) $config['pure'] === false) {
}
echo '<div id="about-div"></div>';
// Need to be here because the translate string.
if (check_acl($config['id_user'], $group, 'AW')) {
?>
<script type="text/javascript">
$("#conf_wizard").click(function() {
$("#conf_wizard").addClass("selected");
if (!$("#welcome_modal_window").length) {
$(document.body).append('<div id="welcome_modal_window"></div>');
$(document.body).append(
$('<link rel="stylesheet" type="text/css" />').attr(
"href",
"include/styles/new_installation_welcome_window.css"
)
);
}
load_modal({
target: $('#welcome_modal_window'),
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
modal: {
title: "<?php echo __('Welcome to').' '.io_safe_output(get_product_name()); ?>",
cancel: '<?php echo __('Do not show anymore'); ?>',
ok: '<?php echo __('Close'); ?>'
},
onshow: {
page: 'include/ajax/welcome_window',
method: 'loadWelcomeWindow',
},
oncancel: {
page: 'include/ajax/welcome_window',
title: "<?php echo __('Cancel Configuration Window'); ?>",
method: 'cancelWelcome',
confirm: function (fn) {
confirmDialog({
title: '<?php echo __('Are you sure?'); ?>',
message: '<?php echo __('Are you sure you want to cancel this tutorial?'); ?>',
ok: '<?php echo __('OK'); ?>',
cancel: '<?php echo __('Cancel'); ?>',
onAccept: function() {
// Continue execution.
fn();
}
})
}
}
});
});
</script>
<?php
}

View File

@ -488,14 +488,38 @@ if (!empty($graphs)) {
true
);
$ActionButtons[] = '</form>';
$offset = (int) get_parameter('offset', 0);
$block_size = (int) $config['block_size'];
$tablePagination = ui_pagination(
count($graphs),
false,
$offset,
$block_size,
true,
'offset',
false
);
}
// FALTA METER EL PRINT TABLE.
html_print_table($table);
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
if (is_metaconsole() === true) {
html_print_action_buttons(
implode('', $ActionButtons),
['type' => 'form_action']
);
} else {
html_print_action_buttons(
implode('', $ActionButtons),
[
'type' => 'form_action',
'right_content' => $tablePagination,
]
);
}
}
echo '</div>';

View File

@ -38,6 +38,9 @@ require_once $config['homedir'].'/include/db/oracle.php';
// Login check.
check_login();
// Validate enterprise.
$is_enterprise = enterprise_installed();
if (! check_acl($config['id_user'], 0, 'RW')
&& ! check_acl($config['id_user'], 0, 'RM')
) {
@ -321,6 +324,21 @@ switch ($action) {
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
break;
case 'event_report_log_table':
$period = $item['period'];
$period_range = $item['period_range'];
$description = $item['description'];
$es = json_decode($item['external_source'], true);
$id_agents = $es['id_agents'];
$source = $es['source'];
$search = $es['search'];
$log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
$full_text = empty($es['full_text']) ? 0 : $es['full_text'];
$show_graph = $item['show_graph'];
$group_by_agent = $item['group_by_agent'];
break;
case 'simple_graph':
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
@ -1025,6 +1043,7 @@ switch ($action) {
case 'prediction_date':
case 'simple_baseline_graph':
case 'event_report_log':
case 'event_report_log_table':
case 'increment':
$label = (isset($style['label'])) ? $style['label'] : '';
break;
@ -1411,6 +1430,29 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_period_range" class="datos">
<td class="bolder">
<?php
echo __('Period range');
ui_print_help_tip(
__('This is the time range in which the files are grouped. For example, 1 day will group the files by day and will count them.')
);
?>
</td>
<td >
<?php
html_print_extended_select_for_time(
'period_range',
$period_range,
'',
'',
'0',
10
);
?>
</td>
</tr>
<tr id="row_last_value" class="datos">
<td class="bolder" class="datos">
<?php
@ -3643,25 +3685,28 @@ $class = 'databox filters';
?>
</td>
</tr>
<tr id="row_landscape" class="datos">
<td class="bolder">
<?php
echo __('Show item in landscape format (only PDF)');
<?php
if ($is_enterprise) {
?>
</td>
<td><?php html_print_checkbox_switch('landscape', 1, $landscape); ?></td>
</tr>
<tr id="row_pagebreak" class="datos">
<td class="bolder">
<tr id="row_landscape" class="datos">
<td class="bolder">
<?php
echo __('Show item in landscape format (only PDF)');
?>
</td>
<td><?php html_print_checkbox_switch('landscape', 1, $landscape); ?></td>
</tr>
<tr id="row_pagebreak" class="datos">
<td class="bolder">
<?php
echo __('Page break at the end of the item (only PDF)');
?>
</td>
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
</tr>
<?php
echo __('Page break at the end of the item (only PDF)');
?>
</td>
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
</tr>
}
?>
<tr id="row_agents_inventory_display_options" class="datos">
<td class="bolder">
<?php
@ -5295,6 +5340,12 @@ $(document).ready (function () {
return false;
}
break;
case 'event_report_log_table':
if ($("#id_agents3").val() == '') {
dialog_message('#message_no_agent');
return false;
}
break;
case 'permissions_report':
if ($("#checkbox-select_by_group").prop("checked") && $("select#users_groups>option:selected").val() == undefined) {
dialog_message('#message_no_group');
@ -6385,6 +6436,7 @@ function chooseType() {
$("#row_description").hide();
$("#row_label").hide();
$("#row_period").hide();
$("#row_period_range").hide();
$("#row_agent").hide();
$("#row_module").hide();
$("#row_period").hide();
@ -6559,7 +6611,24 @@ function chooseType() {
loadLogAgents();
break;
break;
case 'event_report_log_table':
$("#log_help_tip").css("visibility", "visible");
$("#row_description").show();
$("#row_period").show();
$("#row_period_range").show();
$("#row_search").show();
$("#row_log_number").show();
$("#agents_row").show();
$("#row_source").show();
$("#row_historical_db_check").hide();
$("#row_show_graph").show();
$("#row_group_by_agent").show();
loadLogAgents();
break;
case 'increment':
$("#row_description").show();
@ -6651,6 +6720,8 @@ function chooseType() {
$("#row_agent").show();
$("#row_module").show();
$("#row_historical_db_check").hide();
period_set_value($("#hidden-period").attr('class'), 3600);
$("#row_period").find('select').val('3600').trigger('change');
break;
case 'SLA_monthly':
@ -7522,9 +7593,68 @@ function dialog_message(message_id) {
}
});
}
function control_period_range() {
let value_period_range = $('#row_period_range #hidden-period_range').val();
let current_value = $('#row_period #hidden-period').val();
let min_range = (current_value/12);
if(min_range > value_period_range) {
$('#row_period_range div:nth-child(2) select option').removeAttr("selected");
$('#row_period_range div:nth-child(1)').hide();
$('#row_period_range div:nth-child(2)').show();
setTimeout(() => {
if(min_range >= 2592000) {
$('#row_period_range input').val(Math.round((min_range/2592000) * 100) / 100);
$('#row_period_range div:nth-child(2) select option[value="2592000"]').attr("selected", "selected");
$('#row_period_range div:nth-child(2) select').val(2592000);
$('#row_period_range #hidden-period_range').val(min_range);
return;
}
if(min_range >= 604800) {
$('#row_period_range input').val(Math.round((min_range/604800) * 100) / 100);
$('#row_period_range div:nth-child(2) select option[value="604800"]').attr("selected", "selected");
$('#row_period_range div:nth-child(2) select').val(604800);
$('#row_period_range #hidden-period_range').val(min_range);
return;
}
if(min_range >= 86400) {
$('#row_period_range input').val(Math.round((min_range/86400) * 100) / 100);
$('#row_period_range div:nth-child(2) select option[value="86400"]').attr("selected", "selected");
$('#row_period_range div:nth-child(2) select').val(86400);
$('#row_period_range #hidden-period_range').val(min_range);
return;
}
if(min_range >= 3600) {
$('#row_period_range input').val(Math.round((min_range/3600) * 100) / 100);
$('#row_period_range div:nth-child(2) select option[value="3600"]').attr("selected", "selected");
$('#row_period_range div:nth-child(2) select').val(3600);
$('#row_period_range #hidden-period_range').val(min_range);
return;
}
if(min_range >= 60) {
$('#row_period_range input').val(Math.round((min_range/60) * 100) / 100);
$('#row_period_range div:nth-child(2) select option[value="60"]').attr("selected", "selected");
$('#row_period_range div:nth-child(2) select option[value="60"]').val(60);
$('#row_period_range #hidden-period_range').val(min_range);
return;
}
}, 800);
}
}
$(document).ready(function () {
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
$('#row_period input').change(function(e){
control_period_range();
});
$('#row_period select').change(function(e){
control_period_range();
});
$('#row_period_range input').change(function(e){
control_period_range();
});
$('#row_period_range select').change(function(e){
control_period_range();
});
});
</script>

View File

@ -116,10 +116,13 @@ if (!$report_r && !$report_w && !$report_m) {
}
require_once $config['homedir'].'/include/functions_reports.php';
require_once $config['homedir'].'/godmode/wizards/DiscoveryTaskList.class.php';
// Load enterprise extensions.
enterprise_include('operation/reporting/custom_reporting.php');
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once('include/functions_tasklist.php');
enterprise_include_once('include/functions_cron.php');
@ -508,11 +511,11 @@ switch ($action) {
$buttons = [
'list_reports' => [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image(
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'&action=list">'.html_print_image(
'images/logs@svg.svg',
true,
[
'title' => __('Reports list'),
'title' => __('Reports'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
@ -545,7 +548,7 @@ switch ($action) {
// Header.
ui_print_standard_header(
__('List of reports'),
__('Reports'),
'images/op_reporting.png',
false,
'',
@ -782,7 +785,7 @@ switch ($action) {
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
true,
false,
'',
'white-box-content',
@ -1251,7 +1254,12 @@ switch ($action) {
array_push($table->data, $data);
}
html_print_table($table);
$reports_table = '<div class="white_box">';
$reports_table .= '<span class="white_table_graph_header">'.__('Reports').'</span>';
$reports_table .= html_print_table($table, true);
$reports_table .= '<br></div>';
echo $reports_table;
$tablePagination = ui_pagination(
$total_reports,
$url,
@ -1259,7 +1267,7 @@ switch ($action) {
$pagination,
true,
'offset',
false,
false
);
} else {
ui_print_info_message(
@ -1270,6 +1278,21 @@ switch ($action) {
);
}
$discovery_tasklist = new DiscoveryTaskList();
$report_task_data = $discovery_tasklist->showListConsoleTask(true);
if (is_array($report_task_data) === true || strpos($report_task_data, 'class="nf"') === false) {
$task_table = '<div class="mrgn_top_15px white_box">';
$task_table .= '<span class="white_table_graph_header">'.__('Report tasks');
$task_table .= ui_print_help_tip(__('To schedule a report, do it from the editing view of each report.'), true);
$task_table .= '</span><div>';
$task_table .= $report_task_data;
$task_table .= '</div></div>';
echo $task_table;
} else {
ui_print_info_message($report_task_data.__('To schedule a report, do it from the editing view of each report.'));
}
if (check_acl($config['id_user'], 0, 'RW')
|| check_acl($config['id_user'], 0, 'RM')
) {
@ -1621,6 +1644,27 @@ switch ($action) {
$good_format = true;
break;
case 'event_report_log_table':
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);
$values['period'] = get_parameter('period');
$values['period_range'] = get_parameter('period_range');
$values['show_graph'] = get_parameter('combo_graph_options');
$values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent');
$good_format = true;
break;
case 'prediction_date':
$values['period'] = get_parameter('period1');
$values['top_n'] = get_parameter(
@ -2605,6 +2649,27 @@ switch ($action) {
$good_format = true;
break;
case 'event_report_log_table':
$agents_to_report = get_parameter('id_agents3');
$source = get_parameter('source', '');
$search = get_parameter('search', '');
$full_text = (integer) get_parameter('full_text', 0);
$log_number = get_parameter('log_number', '');
$es['source'] = $source;
$es['id_agents'] = $agents_to_report;
$es['search'] = $search;
$es['full_text'] = $full_text;
$es['log_number'] = $log_number;
$values['external_source'] = json_encode($es);
$values['period'] = get_parameter('period');
$values['period_range'] = get_parameter('period_range');
$values['show_graph'] = get_parameter('combo_graph_options');
$values['group_by_agent'] = get_parameter('checkbox_row_group_by_agent');
$good_format = true;
break;
case 'agent_module':
case 'agent_module_status':
$agents_to_report_text = get_parameter('id_agents2-multiple-text');
@ -3636,7 +3701,7 @@ switch ($action) {
$buttons = [
'list_reports' => [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Reports list'), 'class' => 'invert_filter main_menu_icon']).'</a>',
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'&action=list">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Reports'), 'class' => 'invert_filter main_menu_icon']).'</a>',
],
];
@ -3703,7 +3768,7 @@ $buttons = [
'images/report_list.png',
true,
[
'title' => __('Reports list'),
'title' => __('Reports'),
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
@ -3751,12 +3816,13 @@ if ($idReport != 0) {
$buttons = [
'main' => [
'active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'">'.html_print_image('images/report_list.png', true, ['title' => __('Reports list'), 'class' => 'main_menu_icon invert_filter']).'</a>',
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure.'&action=list">'.html_print_image('images/report_list.png', true, ['title' => __('Reports'), 'class' => 'main_menu_icon invert_filter']).'</a>',
],
];
$textReportName = __('Create Custom Report');
}
// here1
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
if (is_metaconsole() === true || $action !== 'update') {

View File

@ -837,12 +837,6 @@ $buttons['wizard'] = [
'active' => false,
'text' => '<a href="'.$url_base.$action.'&tab=wizard&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/wizard@svg.svg', true, ['title' => __('Wizard'), 'class' => 'invert_filter']).'</a>',
];
if ($config['legacy_vc']) {
$buttons['editor'] = [
'active' => false,
'text' => '<a href="'.$url_base.$action.'&tab=editor&id_visual_console='.$idVisualConsole.'">'.html_print_image('images/builder@svg.svg', true, ['title' => __('Builder'), 'class' => 'invert_filter']).'</a>',
];
}
$buttons['view'] = [
'active' => false,

View File

@ -53,6 +53,12 @@ function get_wiz_class($str)
case 'deploymentCenter':
return 'DeploymentCenter';
case 'magextensions':
return 'ManageExtensions';
case 'custom':
return 'Custom';
default:
// Main, show header.
ui_print_standard_header(
@ -161,7 +167,7 @@ if ($classname_selected === null) {
$wiz_data = [];
foreach ($classes as $classpath) {
if (is_reporting_console_node() === true) {
if ($classpath !== '/var/www/html/pandora_console/godmode/wizards/DiscoveryTaskList.class.php') {
if ($classpath !== $config['homedir'].'/godmode/wizards/DiscoveryTaskList.class.php') {
continue;
}
}
@ -169,6 +175,12 @@ if ($classname_selected === null) {
$classname = basename($classpath, '.class.php');
$obj = new $classname();
if (method_exists($obj, 'isEmpty') === true) {
if ($obj->isEmpty() === true) {
continue;
}
}
$button = $obj->load();
if ($button === false) {

View File

@ -212,7 +212,7 @@ if (isset($_GET['server']) === true) {
false,
'servers',
true,
[],
$buttons,
[
[
'link' => '',

View File

@ -537,17 +537,16 @@ if (empty($create) === false || empty($view) === false) {
$data = [];
$data[0] = html_print_label_input_block(
__('Plug-in parameters'),
html_print_input_text(
html_print_textarea(
'form_parameters',
4,
50,
$parameters,
'',
100,
255,
true,
'command_component command_advanced_conf text_input',
false,
false,
'',
'command_component command_advanced_conf text_input'
false
)
);
@ -561,7 +560,14 @@ if (empty($create) === false || empty($view) === false) {
// $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true);
$data[0] = html_print_label_input_block(
__('Command preview'),
html_print_div(['id' => 'command_preview', 'class' => 'mono'], true)
html_print_div(
[
'id' => 'command_preview',
'class' => 'mono',
'style' => 'max-width: 1050px;overflow-wrap: break-word;',
],
true
)
);
$table->data['plugin_preview_inputs'] = $data;
$table->colspan['plugin_preview_inputs'][0] = 2;
@ -1167,7 +1173,7 @@ ui_require_javascript_file('pandora_modules');
function update_preview() {
var command = $('#text-form_execute').val();
var parameters = $('#text-form_parameters').val();
var parameters = $('#textarea_form_parameters').val();
var i = 1;
while (1) {

View File

@ -101,6 +101,13 @@ foreach ($servers as $server) {
}
}
$ext = '';
// Check for any data-type server present in servers list. If none, enable server access for first server.
if (array_search('data', array_column($servers, 'type')) === false) {
$ext = '_server';
}
foreach ($servers as $server) {
$data = [];
@ -185,14 +192,12 @@ foreach ($servers as $server) {
$data[7] = ui_print_timestamp($server['keepalive'], true);
$ext = '_server';
if ($server['type'] != 'data') {
$ext = '';
if ($server['type'] === 'data') {
$ext = '_server';
}
$safe_server_name = servers_get_name($server['id_server']);
if (($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
if (($ext === '_server' || $server['type'] == 'enterprise satellite')) {
if (servers_check_remote_config($safe_server_name.$ext) && enterprise_installed()) {
$names_servers[$safe_server_name] = true;
} else {
@ -253,7 +258,7 @@ foreach ($servers as $server) {
);
$data[8] .= '</a>';
if (($names_servers[$safe_server_name] === true) && ($server['type'] === 'data' || $server['type'] === 'enterprise satellite')) {
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
$data[8] .= html_print_image(
'images/agents@svg.svg',
@ -298,6 +303,8 @@ foreach ($servers as $server) {
unset($data[8]);
}
$ext = '';
array_push($table->data, $data);
}

View File

@ -545,23 +545,8 @@ $table->data[6][0] = html_print_label_input_block(
)
);
$table->data[6][1] = html_print_label_input_block(
__('Max. days before delete old network matrix data'),
html_print_input(
[
'type' => 'number',
'size' => 5,
'max' => $performance_variables_control['delete_old_network_matrix']->max,
'name' => 'delete_old_network_matrix',
'value' => $config['delete_old_network_matrix'],
'return' => true,
'min' => $performance_variables_control['delete_old_network_matrix']->min,
]
)
);
if (enterprise_installed()) {
$table->data[7][0] = html_print_label_input_block(
$table->data[6][1] = html_print_label_input_block(
__('Max. days before delete inventory data'),
html_print_input_text(
'inventory_purge',
@ -574,6 +559,18 @@ if (enterprise_installed()) {
);
}
$table->data[7][1] = html_print_label_input_block(
__('Max. days before disabled agents are deleted'),
html_print_input_text(
'delete_disabled_agents',
$config['delete_disabled_agents'],
'',
false,
0,
true
)
);
$table_other = new stdClass();
$table_other->width = '100%';
$table_other->class = 'filter-table-adv';

View File

@ -210,7 +210,7 @@ if (is_ajax() === true) {
// Ldapsearch timeout.
// Default Ldapsearch timeout.
set_when_empty($config['ldap_searh_timeout'], 5);
set_when_empty($config['ldap_search_timeout'], 5);
$row = [];
$row['name'] = __('Ldap search timeout (secs)');
$row['control'] = html_print_input_text(
@ -418,7 +418,27 @@ if (is_ajax() === true) {
$table->rowclass['2FA_all_users'] = '';
}
$table->data['2FA_all_users'] = $row;
$table->data['2FA_all_users'] = $row;
// Session timeout behavior.
// Set default value.
$row = [];
$options = [
'check_activity' => __('Check activity'),
'ignore_activity' => __('Ignore activity'),
];
$row['name'] = __('Control of timeout session').ui_print_help_tip(__('Select \'ignore activity\' to ignore user activity when checking the session.'), true);
$row['control'] = html_print_select(
$options,
'control_session_timeout',
$config['control_session_timeout'],
'',
'',
0,
true
);
$table->data['session_timeouts'] = $row;
// Session timeout.
@ -538,7 +558,13 @@ echo '</form>';
if ($('input[type=checkbox][name=secondary_ldap_enabled]:checked').val() == 1) {
$("tr[id*='ldap_'][id$='_secondary']").show();
} else {
$( "tr[id*='ldap_'][id$='_secondary']" ).hide();
$( "tr[id*='ldap_'][id$='_secondary']" ).hide();
}
if ($('input[type=checkbox][name=secondary_active_directory]:checked').val() == 1) {
$("tr[id*='ad_'][id$='_secondary']").show();
} else {
$( "tr[id*='ad_'][id$='_secondary']" ).hide();
}
}
$( document ).ready(function() {

View File

@ -681,15 +681,19 @@ $table->data[$i++][] = html_print_label_input_block(
)
);
$help_tip = ui_print_help_tip(
__('This log is recommended to be DISABLED by default due to the large amount of debug data it generates.'),
true
);
$table->data[$i][] = html_print_label_input_block(
__('Enable console log'),
__('Enable console log').$help_tip,
html_print_checkbox_switch(
'console_log_enabled',
1,
$config['console_log_enabled'],
true
).ui_print_input_placeholder(
__('Log location').': pandora_console/log/console.log',
__('Log location').': /var/log/php-fpm/error.log',
true
)
);
@ -743,6 +747,16 @@ $table->data[$i][] = html_print_label_input_block(
)
);
$table->data[$i][] = html_print_label_input_block(
__('Show experimental features'),
html_print_checkbox_switch(
'show_experimental_features',
1,
$config['show_experimental_features'],
true
)
);
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo '<fieldset class="margin-bottom-10">';

View File

@ -1344,17 +1344,6 @@ $table_vc->style[0] = 'font-weight: bold';
$table_vc->size[0] = '50%';
$table_vc->data = [];
// Remove when the new view reaches rock solid stability.
$table_vc->data[$row][] = html_print_label_input_block(
__('Legacy Visual Console View'),
html_print_checkbox_switch(
'legacy_vc',
1,
(bool) $config['legacy_vc'],
true
)
);
$table_vc->data[$row][] = html_print_label_input_block(
__('Default cache expiration'),
html_print_extended_select_for_time(
@ -1372,7 +1361,6 @@ $table_vc->data[$row][] = html_print_label_input_block(
$intervals
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Default interval for refresh on Visual Console'),
@ -1388,6 +1376,7 @@ $table_vc->data[$row][] = html_print_label_input_block(
false
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Type of view of visual consoles'),
@ -1401,12 +1390,12 @@ $table_vc->data[$row][] = html_print_label_input_block(
true
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Number of favorite visual consoles to show in the menu'),
"<input ' value=".$config['vc_menu_items']." size='5' name='vc_menu_items' min='0' max='25'>"
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Default line thickness for the Visual Console'),
@ -1419,10 +1408,9 @@ $table_vc->data[$row][] = html_print_label_input_block(
true
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Mobile view not allow visual console orientation'),
__('Lock screen orientation when viewing on mobile devices'),
html_print_checkbox_switch(
'mobile_view_orientation_vc',
1,
@ -1430,6 +1418,7 @@ $table_vc->data[$row][] = html_print_label_input_block(
true
)
);
$row++;
$table_vc->data[$row][] = html_print_label_input_block(
__('Display item frame on alert triggered'),

View File

@ -50,7 +50,7 @@ try {
[
'id' => $tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'include/ajax/update_manager',

View File

@ -664,20 +664,31 @@ if ($update_user) {
$values['local_user'] = (bool) get_parameter('local_user', false);
$values['strict_acl'] = (bool) get_parameter('strict_acl', false);
$values['session_time'] = (int) get_parameter('session_time', 0);
$force_update_session_expire = false;
if ($values['session_time'] !== $user_info['session_time']) {
$force_update_session_expire = true;
}
// Previously defined.
$values['autorefresh_white_list'] = $autorefresh_white_list;
$res1 = update_user($id, $values);
if ($force_update_session_expire === true) {
config_prepare_expire_time_session(true);
}
if ($config['user_can_update_password']) {
$password_new = (string) get_parameter('password_new', '');
$password_confirm = (string) get_parameter('password_confirm', '');
$own_password_confirm = (string) get_parameter('own_password_confirm', '');
$id_user = (string) get_parameter('id_user', '');
if ($password_new != '') {
$correct_password = false;
$user_credentials_check = process_user_login($config['id_user'], $own_password_confirm, true);
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
if ($user_credentials_check !== false) {
$correct_password = true;

View File

@ -302,25 +302,45 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
true
);
if ($new_user === false) {
if ($new_user === false && users_is_admin() === false) {
$passwordManageTable->data['captions_currentpassword'][0] = __('Current password');
$passwordManageTable->rowclass['fields_currentpassword'] = 'w540px';
$passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended(
'own_password_confirm',
'',
'own_password_confirm',
'',
'20',
'150',
$view_mode,
'',
[
'class' => 'input w100p',
'placeholder' => __('Own password confirmation'),
],
true,
true
);
if ($user_info['id_user'] === $config['id_user']) {
$passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended(
'own_password_confirm',
'',
'own_password_confirm',
'',
'20',
'45',
$view_mode,
'',
[
'class' => 'input w100p',
'placeholder' => __('Own password confirmation'),
],
true,
true
);
} else {
$passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended(
'own_password_confirm',
'',
'own_password_confirm',
'',
'20',
'45',
$view_mode,
'',
[
'class' => 'input w100p',
'placeholder' => __('Third user password confirmation'),
],
true,
true
);
}
}
$userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true);

View File

@ -0,0 +1,221 @@
<?php
/**
* Applications wizard manager.
*
* @category Wizard
* @package Pandora FMS
* @subpackage Applications
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannnot redistribute it without written permission of copyright holder.
* ============================================================================
*/
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/class/ExtensionsDiscovery.class.php';
/**
* Implements Wizard to provide generic Applications wizard.
*/
class Applications extends Wizard
{
/**
* Sub-wizard to be launch (vmware,oracle...).
*
* @var string
*/
public $mode;
/**
* Constructor.
*
* @param integer $page Start page, by default 0.
* @param string $msg Default message to show to users.
* @param string $icon Target icon to be used.
* @param string $label Target label to be displayed.
*
* @return mixed
*/
public function __construct(
int $page=0,
string $msg='Default message. Not set.',
string $icon='images/wizard/applications.png',
string $label='Applications'
) {
$this->setBreadcrum([]);
$this->access = 'AW';
$this->task = [];
$this->msg = $msg;
$this->icon = $icon;
$this->class = $class_style;
$this->label = $label;
$this->page = $page;
$this->url = ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app'
);
return $this;
}
/**
* Run wizard manager.
*
* @return mixed Returns null if wizard is ongoing. Result if done.
*/
public function run()
{
global $config;
// Load styles.
parent::run();
// Load current wiz. sub-styles.
ui_require_css_file(
'application',
ENTERPRISE_DIR.'/include/styles/wizards/'
);
$mode = get_parameter('mode', null);
// Load application wizards.
$enterprise_classes = glob(
$config['homedir'].'/'.ENTERPRISE_DIR.'/include/class/*.app.php'
);
$extensions = new ExtensionsDiscovery('app', $mode);
foreach ($enterprise_classes as $classpath) {
enterprise_include_once(
'include/class/'.basename($classpath)
);
}
switch ($mode) {
case 'DB2':
$classname_selected = 'DB2';
break;
case 'SAP':
$classname_selected = 'SAP';
break;
case 'vmware':
$classname_selected = 'VMware';
break;
case 'mysql':
$classname_selected = 'MySQL';
break;
case 'oracle':
$classname_selected = 'Oracle';
break;
case 'MicrosoftSQLServer':
$classname_selected = 'MicrosoftSQLServer';
break;
default:
$classname_selected = null;
break;
}
// Else: class not found pseudo exception.
if ($classname_selected !== null) {
$wiz = new $classname_selected($this->page);
$result = $wiz->run();
if (is_array($result) === true) {
return $result;
}
}
if ($classname_selected === null) {
if ($mode !== null) {
// Load extension if exist.
$extensions->run();
return;
}
// Load classes and print selector.
$wiz_data = [];
foreach ($enterprise_classes as $classpath) {
$classname = basename($classpath, '.app.php');
$obj = new $classname();
$wiz_data[] = $obj->load();
}
$wiz_data = array_merge($wiz_data, $extensions->loadExtensions());
$this->prepareBreadcrum(
[
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery'
),
'label' => __('Discovery'),
],
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app'
),
'label' => __('Applications'),
'selected' => true,
],
]
);
// Header.
ui_print_page_header(
__('Applications'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
Wizard::printBigButtonsList($wiz_data);
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
}
return $result;
}
/**
* Check if section have extensions.
*
* @return boolean Return true if section is empty.
*/
public function isEmpty()
{
$extensions = new ExtensionsDiscovery('app');
$listExtensions = $extensions->getExtensionsApps();
if ($listExtensions > 0 || enterprise_installed() === true) {
return false;
} else {
return true;
}
}
}

View File

@ -0,0 +1,661 @@
<?php
/**
* Cloud wizard manager.
*
* @category Wizard
* @package Pandora FMS
* @subpackage Cloud
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannnot redistribute it without written permission of copyright holder.
* ============================================================================
*/
global $config;
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
/**
* Implements Wizard to provide generic Cloud wizard.
*/
class Cloud extends Wizard
{
/**
* Sub-wizard to be launch (vmware,oracle...).
*
* @var string
*/
public $mode;
/**
* Discovery task data.
*
* @var array.
*/
public $task;
/**
* General maxPages.
*
* @var integer
*/
public $maxPages;
/**
* Product string.
*
* @var string
*/
protected $product = '';
/**
* Credentials store identifier.
*
* @var string
*/
protected $keyIdentifier = null;
/**
* Credentials store product identifier.
*
* @var string
*/
protected $keyStoreType = null;
/**
* Constructor.
*
* @param integer $page Start page, by default 0.
* @param string $msg Default message to show to users.
* @param string $icon Target icon to be used.
* @param string $label Target label to be displayed.
*
* @return mixed
*/
public function __construct(
int $page=0,
string $msg='Default message. Not set.',
string $icon='images/wizard/cloud.png',
string $label='Cloud'
) {
$this->setBreadcrum([]);
$this->access = 'AW';
$this->task = [];
$this->msg = $msg;
$this->icon = $icon;
$this->label = $label;
$this->page = $page;
$this->url = ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=cloud'
);
return $this;
}
/**
* Run wizard manager.
*
* @return mixed Returns null if wizard is ongoing. Result if done.
*/
public function run()
{
global $config;
// Load styles.
parent::run();
// Load current wiz. sub-styles.
ui_require_css_file(
'cloud',
ENTERPRISE_DIR.'/include/styles/wizards/'
);
$mode = get_parameter('mode', null);
// Load cloud wizards.
$enterprise_classes = glob(
$config['homedir'].'/'.ENTERPRISE_DIR.'/include/class/*.cloud.php'
);
$extensions = new ExtensionsDiscovery('cloud', $mode);
foreach ($enterprise_classes as $classpath) {
enterprise_include_once(
'include/class/'.basename($classpath)
);
}
switch ($mode) {
case 'amazonws':
$classname_selected = 'Aws';
break;
case 'azure':
$classname_selected = 'Azure';
break;
case 'gcp':
$classname_selected = 'Google';
break;
default:
$classname_selected = null;
break;
}
// Else: class not found pseudo exception.
if ($classname_selected !== null) {
$wiz = new $classname_selected($this->page);
$result = $wiz->run();
if (is_array($result) === true) {
return $result;
}
}
if ($classname_selected === null) {
if ($mode !== null) {
// Load extension if exist.
$extensions->run();
return;
}
// Load classes and print selector.
$wiz_data = [];
foreach ($enterprise_classes as $classpath) {
$classname = basename($classpath, '.cloud.php');
$obj = new $classname();
$wiz_data[] = $obj->load();
}
$wiz_data = array_merge($wiz_data, $extensions->loadExtensions());
$this->prepareBreadcrum(
[
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery'
),
'label' => __('Discovery'),
],
[
'link' => $this->url,
'label' => __('Cloud'),
'selected' => true,
],
],
true
);
// Header.
ui_print_page_header(
__('Cloud'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
Wizard::printBigButtonsList($wiz_data);
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
}
return $result;
}
/**
* Run credentials wizard.
*
* @return boolean True if credentials wizard is displayed and false if not.
*/
public function runCredentials()
{
global $config;
if ($this->status === false) {
$empty_account = true;
}
// Checks credentials. If check not passed. Show the form to fill it.
if ($this->checkCredentials()) {
return true;
}
// Add breadcrum and print header.
$this->prepareBreadcrum(
[
[
'link' => $this->url.'&credentials=1',
'label' => __('%s credentials', $this->product),
'selected' => true,
],
],
true
);
// Header.
ui_print_page_header(
__('%s credentials', $this->product),
'',
false,
$this->product.'_credentials_tab',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
if ($this->product === 'Aws') {
ui_print_warning_message(
__(
'If a task with the selected credentials is already running, it will be edited. To create a new one, another account from the credential store must be selected.'
)
);
}
if ($this->status === true) {
ui_print_success_message($this->msg);
} else if ($this->status === false) {
ui_print_error_message($this->msg);
}
if ($empty_account === true) {
ui_print_error_message($this->msg);
}
$link_to_cs = '';
if (check_acl($config['id_user'], 0, 'UM')) {
$link_to_cs = '<a class="ext_link" href="'.ui_get_full_url(
'index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox'
).'" >';
$link_to_cs .= __('Manage accounts').'</a>';
}
$this->getCredentials();
$this->printFormAsList(
[
'form' => [
'action' => $this->url,
'method' => 'POST',
'id' => 'form-credentials',
],
'inputs' => [
[
'label' => __('Cloud tool full path'),
'arguments' => [
'name' => 'cloud_util_path',
'value' => isset($config['cloud_util_path']) ? io_safe_output($config['cloud_util_path']) : '/usr/bin/pandora-cm-api',
'type' => 'text',
],
],
[
'label' => __('Account'),
'extra' => $link_to_cs,
'arguments' => [
'name' => 'account_identifier',
'type' => 'select',
'fields' => CredentialStore::getKeys($this->keyStoreType),
'selected' => $this->keyIdentifier,
'return' => true,
],
],
[
'arguments' => [
'name' => 'parse_credentials',
'value' => 1,
'type' => 'hidden',
'return' => true,
],
],
],
]
);
$buttons_form = $this->printInput(
[
'name' => 'submit',
'label' => __('Validate'),
'type' => 'submit',
'attributes' => [
'icon' => 'wand',
'form' => 'form-credentials',
],
'return' => true,
'width' => 'initial',
]
);
$buttons_form .= $this->printGoBackButton(
ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=cloud'
),
true
);
html_print_action_buttons($buttons_form);
return false;
}
/**
* Check credentials.
*
* @return boolean True if credentials are OK.
*/
public function checkCredentials()
{
global $config;
$pandora = io_safe_output($config['cloud_util_path']);
if (isset($pandora) === false) {
config_update_value('cloud_util_path', '/usr/bin/pandora-cm-api');
}
if ((bool) get_parameter('disconnect_account', false) === true) {
$this->status = null;
return false;
}
if ($this->keyIdentifier === null) {
// Ask user for available credentials.
$this->msg = __('Select a set of credentials from the list');
$this->status = null;
return false;
}
$credentials = $this->getCredentials($this->keyIdentifier);
if (empty($credentials['username']) === true
|| empty($credentials['password']) === true
|| isset($pandora) === false
|| is_executable($pandora) === false
) {
if (is_executable($pandora) === false) {
$this->msg = (__('Path %s is not executable.', $pandora));
$this->status = false;
} else {
$this->msg = __('Invalid username or password');
$this->status = false;
}
return false;
}
try {
$value = $this->executeCMCommand('--get availability');
} catch (Exception $e) {
$this->msg = $e->getMessage();
$this->status = false;
return false;
}
if ($value == '1') {
return true;
}
$this->status = false;
// Error message directly from pandora-cm-api.
$this->msg = str_replace('"', '', $value);
return false;
}
/**
* Handle the click on disconnect account link.
*
* @return void But it prints some info to user.
*/
protected function parseDisconnectAccount()
{
// Check if disconection account link is pressed.
if ((bool) get_parameter('disconnect_account') === false) {
return;
}
$ret = $this->setCredentials(null);
if ($ret) {
$this->msg = __('Account disconnected');
} else {
$this->msg = __('Failed disconnecting account');
}
$this->status = $ret;
$this->page = 0;
}
/**
* Build an array with Product credentials.
*
* @return array with credentials (pass and id).
*/
public function getCredentials()
{
return CredentialStore::getKey($this->keyIdentifier);
}
/**
* Set Product credentials.
*
* @param string|null $identifier Credential store identifier.
*
* @return boolean True if success.
*/
public function setCredentials($identifier)
{
if ($identifier === null) {
unset($this->keyIdentifier);
return true;
}
if (isset($identifier) === false) {
return false;
}
$all = CredentialStore::getKeys($this->type);
if (in_array($identifier, $all) === true) {
$this->keyIdentifier = $identifier;
return true;
}
return false;
}
/**
* Parse credentials form.
*
* @return void But it prints a message.
*/
protected function parseCredentials()
{
global $config;
if (!$this->keyIdentifier) {
$this->setCredentials(get_parameter('ki', null));
}
// Check if credentials form is submitted.
if ((bool) get_parameter('parse_credentials') === false) {
return;
}
$this->page = 0;
$ret = $this->setCredentials(
get_parameter('account_identifier')
);
$path = get_parameter('cloud_util_path');
$ret_path = config_update_value('cloud_util_path', $path);
if ($ret_path) {
$config['cloud_util_path'] = $path;
}
if ($ret && $ret_path) {
$this->msg = __('Credentials successfully updated');
} else {
$this->msg = __('Failed updating credentials process');
}
$this->status = ($ret && $ret_path);
}
/**
* This method must be implemented.
*
* Execute a pandora-cm-api request.
*
* @param string $command Command to execute.
*
* @return void But must return string STDOUT of executed command.
* @throws Exception If not implemented.
*/
protected function executeCMCommand($command)
{
throw new Exception('executeCMCommand must be implemented.');
}
/**
* Get a recon token value
*
* @param string $token The recon key to retrieve.
*
* @return string String with the value.
*/
protected function getConfigReconElement($token)
{
if ($this->reconConfig === false
|| isset($this->reconConfig[0][$token]) === false
) {
if (is_array($this->task) === true
&& isset($this->task[$token]) === true
) {
return $this->task[$token];
} else {
return '';
}
} else {
return $this->reconConfig[0][$token];
}
}
/**
* Print global inputs
*
* @param boolean $last True if is last element.
*
* @return array Array with all global inputs.
*/
protected function getGlobalInputs(bool $last=false)
{
$task_id = $this->task['id_rt'];
if (!$task_id) {
$task_id = $this->getConfigReconElement('id_rt');
}
return [
[
'arguments' => [
'name' => 'page',
'value' => ($this->page + 1),
'type' => 'hidden',
'return' => true,
],
],
[
'arguments' => [
'name' => 'submit',
'label' => ($last) ? __('Finish') : __('Next'),
'type' => 'submit',
'attributes' => 'class="sub '.(($last) ? 'wand' : 'next').'"',
'return' => true,
],
],
[
'arguments' => [
'name' => 'task',
'value' => $task_id,
'type' => 'hidden',
'return' => true,
],
],
[
'arguments' => [
'name' => 'parse_form',
'value' => 1,
'type' => 'hidden',
'return' => true,
],
],
];
}
/**
* Print required css in some points.
*
* @return string With js code.
*/
protected function cloudJS()
{
return '
function toggleCloudSubmenu(curr_elem, id_csm){
if (document.getElementsByName(curr_elem)[0].checked){
$("#li-"+id_csm).show();
} else {
$("#li-"+id_csm).hide();
}
};
';
}
/**
* Check if section have extensions.
*
* @return boolean Return true if section is empty.
*/
public function isEmpty()
{
$extensions = new ExtensionsDiscovery('cloud');
$listExtensions = $extensions->getExtensionsApps();
if ($listExtensions > 0 || enterprise_installed() === true) {
return false;
} else {
return true;
}
}
}

View File

@ -0,0 +1,160 @@
<?php
/**
* Custom wizard manager.
*
* @category Wizard
* @package Pandora FMS
* @subpackage Custom
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
* This code is NOT free software. This code is NOT licenced under GPL2 licence
* You cannnot redistribute it without written permission of copyright holder.
* ============================================================================
*/
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/class/ExtensionsDiscovery.class.php';
/**
* Implements Wizard to provide generic Custom wizard.
*/
class Custom extends Wizard
{
/**
* Sub-wizard to be launch (vmware,oracle...).
*
* @var string
*/
public $mode;
/**
* Constructor.
*
* @param integer $page Start page, by default 0.
* @param string $msg Default message to show to users.
* @param string $icon Target icon to be used.
* @param string $label Target label to be displayed.
*
* @return mixed
*/
public function __construct(
int $page=0,
string $msg='Default message. Not set.',
string $icon='/images/wizard/Custom_apps@svg.svg',
string $label='Custom'
) {
$this->setBreadcrum([]);
$this->access = 'AW';
$this->task = [];
$this->msg = $msg;
$this->icon = $icon;
$this->class = $class_style;
$this->label = $label;
$this->page = $page;
$this->url = ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=custom'
);
return $this;
}
/**
* Run wizard manager.
*
* @return mixed Returns null if wizard is ongoing. Result if done.
*/
public function run()
{
global $config;
// Load styles.
parent::run();
// Load current wiz. sub-styles.
ui_require_css_file(
'custom',
ENTERPRISE_DIR.'/include/styles/wizards/'
);
$mode = get_parameter('mode', null);
$extensions = new ExtensionsDiscovery('custom', $mode);
if ($mode !== null) {
// Load extension if exist.
$extensions->run();
return;
}
// Load classes and print selector.
$wiz_data = $extensions->loadExtensions();
$this->prepareBreadcrum(
[
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery'
),
'label' => __('Discovery'),
],
[
'link' => ui_get_full_url(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=custom'
),
'label' => __('Custom'),
'selected' => true,
],
]
);
// Header.
ui_print_page_header(
__('Custom'),
'',
false,
'',
true,
'',
false,
'',
GENERIC_SIZE_TEXT,
'',
$this->printHeader(true)
);
Wizard::printBigButtonsList($wiz_data);
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
return $result;
}
/**
* Check if section have extensions.
*
* @return boolean Return true if section is empty.
*/
public function isEmpty()
{
$extensions = new ExtensionsDiscovery('custom');
$listExtensions = $extensions->getExtensionsApps();
if ($listExtensions > 0) {
return false;
} else {
return true;
}
}
}

View File

@ -129,6 +129,11 @@ class DiscoveryTaskList extends HTML
}
$delete_console_task = (bool) get_parameter('delete_console_task');
$report_task = (bool) get_parameter('report_task', 0);
if ($report_task === true) {
$this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder');
}
if ($delete_console_task === true) {
return $this->deleteConsoleTask();
}
@ -163,7 +168,10 @@ class DiscoveryTaskList extends HTML
}
if (is_reporting_console_node() === false) {
$ret2 = $this->showList();
$ret2 = $this->showList(__('Host & devices tasks'), [0, 1]);
$ret2 .= $this->showList(__('Applications tasks'), [3, 4, 5, 10, 11, 12], 'app');
$ret2 .= $this->showList(__('Cloud tasks'), [6, 7, 8, 13, 14], 'cloud');
$ret2 .= $this->showList(__('Custom tasks'), [-1], 'custom');
}
if ($ret === false && $ret2 === false) {
@ -287,6 +295,10 @@ class DiscoveryTaskList extends HTML
}
$id_console_task = (int) get_parameter('id_console_task');
$report_task = (bool) get_parameter('report_task', 0);
if ($report_task === true) {
$this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder');
}
if ($id_console_task != null) {
// --------------------------------
@ -352,6 +364,10 @@ class DiscoveryTaskList extends HTML
}
$id_console_task = (int) get_parameter('id_console_task');
$report_task = (bool) get_parameter('report_task', 0);
if ($report_task === true) {
$this->url = ui_get_full_url('index.php?sec=reporting&sec2=godmode/reporting/reporting_builder');
}
if ($id_console_task > 0) {
$result = db_process_sql_update(
@ -505,9 +521,13 @@ class DiscoveryTaskList extends HTML
/**
* Show complete list of running tasks.
*
* @param string $titleTable Title of section.
* @param array $filter Ids array from apps for filter.
* @param boolean $extension_section Extension to add in table.
*
* @return boolean Success or not.
*/
public function showList()
public function showList($titleTable, $filter, $extension_section=false)
{
global $config;
@ -531,7 +551,16 @@ class DiscoveryTaskList extends HTML
include_once $config['homedir'].'/include/functions_network_profiles.php';
if (users_is_admin()) {
$recon_tasks = db_get_all_rows_sql('SELECT * FROM trecon_task');
$recon_tasks = db_get_all_rows_sql(
sprintf(
'SELECT tasks.*, apps.section AS section, apps.short_name AS short_name
FROM trecon_task tasks
LEFT JOIN tdiscovery_apps apps ON tasks.id_app = apps.id_app
WHERE type IN (%s) OR section = "%s"',
implode(',', $filter),
$extension_section
)
);
} else {
$user_groups = implode(
',',
@ -539,9 +568,14 @@ class DiscoveryTaskList extends HTML
);
$recon_tasks = db_get_all_rows_sql(
sprintf(
'SELECT * FROM trecon_task
WHERE id_group IN (%s)',
$user_groups
'SELECT tasks.*, apps.section AS section, apps.short_name AS short_name
FROM trecon_task
LEFT JOIN tdiscovery_apps apps ON tasks.id_app = apps.id_app
WHERE id_group IN (%s) AND
(type IN (%s) OR section = "%s")',
$user_groups,
implode(',', $filter),
$extension_section
)
);
}
@ -658,7 +692,9 @@ class DiscoveryTaskList extends HTML
$recon_script_name = false;
}
if ($task['disabled'] == 0 && $server_name !== '') {
if (($task['disabled'] == 0 && $server_name !== '' && (int) $task['type'] !== DISCOVERY_EXTENSION)
|| ((int) $task['type'] === DISCOVERY_EXTENSION && (int) $task['setup_complete'] === 1)
) {
if (check_acl($config['id_user'], 0, 'AW')) {
$data[0] = '<span class="link" onclick="force_task(\'';
$data[0] .= ui_get_full_url(
@ -682,7 +718,9 @@ class DiscoveryTaskList extends HTML
);
$data[0] .= '</span>';
}
} else if ($task['disabled'] == 2) {
} else if ($task['disabled'] == 2
|| ((int) $task['type'] === DISCOVERY_EXTENSION && (int) $task['setup_complete'] === 0)
) {
$data[0] = ui_print_help_tip(
__('This task has not been completely defined, please edit it'),
true
@ -843,6 +881,19 @@ class DiscoveryTaskList extends HTML
$data[6] .= __('Discovery.App.Microsoft SQL Server');
break;
case DISCOVERY_EXTENSION:
// Discovery NetScan.
$data[6] = html_print_image(
'images/cluster@os.svg',
true,
[
'title' => $task['short_name'],
'class' => 'main_menu_icon invert_filter',
]
).'&nbsp;&nbsp;';
$data[6] .= $task['short_name'];
break;
case DISCOVERY_HOSTDEVICES:
default:
if ($task['id_recon_script'] == 0) {
@ -941,7 +992,7 @@ class DiscoveryTaskList extends HTML
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
&& $task['type'] != DISCOVERY_CLOUD_AWS_S3
) {
if (check_acl($config['id_user'], 0, 'MR')) {
if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== 15) {
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
$data[9] .= html_print_image(
'images/web@groups.svg',
@ -999,13 +1050,24 @@ class DiscoveryTaskList extends HTML
).'</a>';
}
} else {
$url_edit = sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task, $recon_script_data),
$task['id_rt']
);
if ((int) $task['type'] === DISCOVERY_EXTENSION) {
$url_edit = sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=%s&mode=%s&id_task=%s',
$task['section'],
$task['short_name'],
$task['id_rt'],
);
}
// Check if is a H&D, Cloud or Application or IPAM.
$data[9] .= '<a href="'.ui_get_full_url(
sprintf(
'index.php?sec=gservers&sec2=godmode/servers/discovery&%s&task=%d',
$this->getTargetWiz($task, $recon_script_data),
$task['id_rt']
)
$url_edit
).'">'.html_print_image(
'images/edit.svg',
true,
@ -1069,7 +1131,7 @@ class DiscoveryTaskList extends HTML
$return = true;
}
ui_toggle($content, __('Server Tasks'), '', '', false);
ui_toggle($content, $titleTable, '', '', false);
// Div neccesary for modal map task.
echo '<div id="map_task" class="invisible"></div>';
@ -1096,9 +1158,9 @@ class DiscoveryTaskList extends HTML
*
* @return boolean Success or not.
*/
public function showListConsoleTask()
public function showListConsoleTask($report_task=false)
{
return enterprise_hook('tasklist_showListConsoleTask', [$this]);
return enterprise_hook('tasklist_showListConsoleTask', [$this, $report_task]);
}
@ -1137,6 +1199,9 @@ class DiscoveryTaskList extends HTML
case DISCOVERY_CLOUD_AWS_S3:
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&sub=s3&page=0';
case DISCOVERY_CLOUD_GCP_COMPUTE_ENGINE:
return 'wiz=cloud&mode=gcp&ki='.$task['auth_strings'].'&sub=compute&page=0';
default:
return 'wiz=cloud';
}
@ -1224,7 +1289,7 @@ class DiscoveryTaskList extends HTML
($task['status'] < 0) ? 100 : $task['status'],
150,
150,
'#3A3A3A',
'#14524f',
'%',
'',
'#ececec',
@ -1294,7 +1359,7 @@ class DiscoveryTaskList extends HTML
$task['stats']['c_network_percent'],
150,
150,
'#3A3A3A',
'#14524f',
'%',
'',
'#ececec',
@ -1337,14 +1402,14 @@ class DiscoveryTaskList extends HTML
$output = '';
if (is_array($task['stats']) === false) {
$task['stats'] = json_decode($task['summary'], true);
if (is_array($task['stats']) === false && (int) $task['type'] !== DISCOVERY_EXTENSION) {
$task['stats'] = json_decode(io_safe_output($task['summary']), true);
if (json_last_error() !== JSON_ERROR_NONE) {
return $task['summary'];
}
}
if (is_array($task['stats'])) {
if (is_array($task['stats']) || (int) $task['type'] === DISCOVERY_EXTENSION) {
$i = 0;
$table = new StdClasS();
$table->class = 'databox data';
@ -1402,6 +1467,65 @@ class DiscoveryTaskList extends HTML
$table->data[$i][1] = '<span id="alive">';
$table->data[$i][1] .= ($total - $agents);
$table->data[$i++][1] .= '</span>';
} else if ((int) $task['type'] === DISCOVERY_EXTENSION) {
// Content.
$countSummary = 1;
if (is_array($task['stats']) === true && count(array_filter(array_keys($task['stats']), 'is_numeric')) === count($task['stats'])) {
foreach ($task['stats'] as $key => $summary) {
$table->data[$i][0] = '<b>'.__('Summary').' '.$countSummary.'</b>';
$table->data[$i][1] = '';
$countSummary++;
$i++;
if (is_array($summary) === true) {
if (empty($summary['summary']) === true && empty($summary['info']) === true) {
$table->data[$i][0] = json_encode($summary, JSON_PRETTY_PRINT);
$table->data[$i][1] = '';
$i++;
continue;
}
$unknownJson = $summary;
foreach ($summary as $k2 => $v) {
if (is_array($v) === true) {
if ($k2 === 'summary') {
foreach ($v as $k3 => $v2) {
$table->data[$i][0] = $k3;
$table->data[$i][1] = $v2;
$i++;
}
unset($unknownJson[$k2]);
}
} else {
if ($k2 === 'info') {
$table->data[$i][0] = $v;
$table->data[$i][1] = '';
$i++;
unset($unknownJson[$k2]);
}
}
}
if (empty($unknownJson) === false) {
$table->data[$i][0] = json_encode($unknownJson, JSON_PRETTY_PRINT);
$table->data[$i][1] = '';
$i++;
}
} else {
$table->data[$i][0] = $summary;
$table->data[$i][1] = '';
$i++;
}
}
} else {
$table->data[$i][0] = '<b>'.__('Summary').'</b>';
$table->data[$i][1] = '';
$i++;
$table->data[$i][0] = $task['summary'];
$table->data[$i][1] = '';
$i++;
}
} else {
// Content.
if (is_array($task['stats']['summary']) === true) {
@ -1463,7 +1587,7 @@ class DiscoveryTaskList extends HTML
}
$task = db_get_row('trecon_task', 'id_rt', $id_task);
$task['stats'] = json_decode($task['summary'], true);
$task['stats'] = json_decode(io_safe_output($task['summary']), true);
$summary = $this->progressTaskSummary($task);
$output = '';
@ -1856,7 +1980,11 @@ class DiscoveryTaskList extends HTML
if ($task['status'] <= 0
&& empty($task['summary']) === false
) {
$status = __('Done');
if ($task['status'] == -2) {
$status = __('Failed');
} else {
$status = __('Done');
}
} else if ($task['utimestamp'] == 0
&& empty($task['summary'])
) {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>EB094270-FB38-4A58-BE94-D40EA44EA568</title>
<g id="Agentes" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="1.a1-Agentes---Listado" transform="translate(-362.500000, -268.000000)" fill="#C1CCDC">
<g id="Contenido" transform="translate(310.000000, 188.000000)">
<g transform="translate(20.000000, 20.000000)" id="Agentes">
<g id="Content" transform="translate(29.308511, 20.000000)">
<g id="Top" transform="translate(0.191489, 0.000000)">
<g id="Icons/Light/24/example" transform="translate(3.000000, 40.000000)">
<circle id="Oval" cx="6" cy="6" r="6"></circle>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Reportes programados@svg</title>
<g id="Reportes-programados" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M8.00059781,0 C8.54059781,0 9.00059781,0.363636364 9.00059781,0.909090909 L9.00059781,4.07934284 C9.00059781,5.35207011 9.69059781,6 10.9505978,6 L14.1005978,6 C14.6405978,6 15.0005978,6.45454545 15.0005978,7 L15.0005978,16.3636364 C15.0005978,18.3636364 13.3805978,20 11.4005978,20 L5.24310254,20.0009635 C7.48899044,18.7052484 9.00059781,16.2791516 9.00059781,13.5 C9.00059781,9.35786438 5.64273343,6 1.50059781,6 C0.986687841,6 0.484850221,6.05168787 -2.12052598e-14,6.15014855 L0.000597808993,3.63636364 C0.000597808993,1.63636364 1.62059781,0 3.60059781,0 Z M10.0001439,1 L14.0005978,5 L11.0001439,5 C10.4478591,5 10.0001439,4.55228475 10.0001439,4 L10.0001439,1 Z" id="Shape" fill="#3F3F3F" transform="translate(7.500299, 10.000482) scale(-1, 1) translate(-7.500299, -10.000482) "></path>
<path d="M13.5,7 C17.0898509,7 20,9.91014913 20,13.5 C20,17.0898509 17.0898509,20 13.5,20 C9.91014913,20 7,17.0898509 7,13.5 C7,9.91014913 9.91014913,7 13.5,7 Z M14.0002191,9 C13.4873832,9 13.0647119,9.38604019 13.0069468,9.88337887 L13.0002191,10 L13.0002191,13.382 L11.4068856,14.2067645 C10.9481913,14.4361116 10.742785,14.9704208 10.9135349,15.4410874 L10.959672,15.5484052 C11.1890192,16.0070996 11.7233284,16.2125059 12.193995,16.0417559 L12.3013128,15.9956188 L14.4474327,14.8944272 C14.748574,14.7438565 14.9511225,14.4535358 14.9924154,14.1248553 L15.0002191,14 L15.0002191,10 C15.0002191,9.44771525 14.5525038,9 14.0002191,9 Z" id="Oval-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="462px" height="462px" viewBox="0 0 462 462" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Configurar app@svg</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M170.651341,0 L170.651,0.004 L172.111579,0.00817671226 C263.146802,0.548182735 340,27.8694245 340,92.0575424 L340,247.942458 C340,312.77894 261.586371,340 169.348659,340 L170.651,339.996 L170.651341,340 L170,339.998 L169.348659,340 L169.348659,340 L169.348,339.996 L167.888421,339.991823 C128.247423,339.756679 91.2955334,334.44344 62.2073113,323.219366 L161.855602,223.57095 C187.013424,231.95857 215.800358,226.422038 235.828233,206.394148 C254.435585,187.786783 260.775236,161.559784 254.857225,137.762234 C253.732853,133.229606 248.060798,131.693633 244.757955,134.996478 L207.432822,172.321638 L173.360336,166.644559 L167.683262,132.572049 L205.008395,95.2468889 C208.331316,91.9239659 206.73009,86.2619459 202.167348,85.1275341 C178.384873,79.2346161 152.19805,85.5843105 133.610776,104.166578 C113.713408,124.06396 108.237114,152.90613 116.519318,178.053931 L10.1129522,284.45776 C3.58111026,273.936239 0,261.798287 0,247.942458 L0,92.0575424 C0,27.2210597 78.4136287,0 170.651341,0 L169.348,0.004 L169.348659,0 L170,0.002 L170.651341,0 L170.651341,0 Z" id="path-1"></path>
</defs>
<g id="Configurar-app" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Rectangle" transform="translate(61.000000, 61.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="Mask" stroke="#555555" stroke-width="14" stroke-linejoin="round" xlink:href="#path-1"></use>
</g>
<g id="Group" transform="translate(107.000000, 136.000000)" stroke="#555555" stroke-width="7">
<circle id="Oval" cx="14.5" cy="14.5" r="14.5"></circle>
<circle id="Oval-Copy" cx="14.5" cy="61.5" r="14.5"></circle>
<circle id="Oval-Copy-2" cx="142.5" cy="208.5" r="14.5"></circle>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="462px" height="462px" viewBox="0 0 462 462" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Custom apps@svg</title>
<desc>Created with Sketch.</desc>
<g id="Custom-apps" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" transform="translate(61.000000, 61.000000)" stroke="#555555">
<path d="M0,315.724835 L0,274.275165 C0,257.178072 20.6773253,250 45,250 L45,250 C69.3226747,250 90,257.178072 90,274.275165 L90,315.724835 C90,332.821928 69.3226747,340 45,340 L45,340 C20.6773253,340 0,332.821928 0,315.724835 Z" id="Mask" stroke-width="14" stroke-linejoin="round"></path>
<path d="M0,190.724835 L0,149.275165 C0,132.178072 20.6773253,125 45,125 L45,125 C69.3226747,125 90,132.178072 90,149.275165 L90,190.724835 C90,207.821928 69.3226747,215 45,215 L45,215 C20.6773253,215 0,207.821928 0,190.724835 Z" id="Mask-Copy" stroke-width="14" stroke-linejoin="round"></path>
<path d="M0,65.7248353 L0,24.2751647 C0,7.17807242 20.6773253,0 45,0 L45,0 C69.3226747,0 90,7.17807242 90,24.2751647 L90,65.7248353 C90,82.8219276 69.3226747,90 45,90 L45,90 C20.6773253,90 0,82.8219276 0,65.7248353 Z" id="Mask-Copy-2" stroke-width="14" stroke-linejoin="round"></path>
<path d="M125,315.724835 L125,274.275165 C125,257.178072 145.677325,250 170,250 L170,250 C194.322675,250 215,257.178072 215,274.275165 L215,315.724835 C215,332.821928 194.322675,340 170,340 L170,340 C145.677325,340 125,332.821928 125,315.724835 Z" id="Mask" stroke-width="14" stroke-linejoin="round"></path>
<path d="M125,190.724835 L125,149.275165 C125,132.178072 145.677325,125 170,125 L170,125 C194.322675,125 215,132.178072 215,149.275165 L215,190.724835 C215,207.821928 194.322675,215 170,215 L170,215 C145.677325,215 125,207.821928 125,190.724835 Z" id="Mask-Copy" stroke-width="14" stroke-linejoin="round"></path>
<path d="M125,65.7248353 L125,24.2751647 C125,7.17807242 145.677325,0 170,0 L170,0 C194.322675,0 215,7.17807242 215,24.2751647 L215,65.7248353 C215,82.8219276 194.322675,90 170,90 L170,90 C145.677325,90 125,82.8219276 125,65.7248353 Z" id="Mask-Copy-2" stroke-width="14" stroke-linejoin="round"></path>
<path d="M250,190.724835 L250,149.275165 C250,132.178072 270.677325,125 295,125 L295,125 C319.322675,125 340,132.178072 340,149.275165 L340,190.724835 C340,207.821928 319.322675,215 295,215 L295,215 C270.677325,215 250,207.821928 250,190.724835 Z" id="Mask-Copy" stroke-width="14" stroke-linejoin="round"></path>
<path d="M250,65.7248353 L250,24.2751647 C250,7.17807242 270.677325,0 295,0 L295,0 C319.322675,0 340,7.17807242 340,24.2751647 L340,65.7248353 C340,82.8219276 319.322675,90 295,90 L295,90 C270.677325,90 250,82.8219276 250,65.7248353 Z" id="Mask-Copy-2" stroke-width="14" stroke-linejoin="round"></path>
<circle id="Oval" stroke-width="7" cx="45" cy="45" r="15"></circle>
<polygon id="Polygon" stroke-width="7" points="295 155 309.265848 165.364745 303.816779 182.135255 286.183221 182.135255 280.734152 165.364745"></polygon>
<rect id="Rectangle" stroke-width="7" x="155" y="280" width="30" height="30"></rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="462px" height="462px" viewBox="0 0 462 462" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>App genérico@svg</title>
<desc>Created with Sketch.</desc>
<defs>
<path d="M340,247.942458 C340,312.77894 261.586371,340 169.348659,340 L170.651,339.996 L170.651341,340 L170,339.998 L169.348659,340 L169.348659,340 L169.348,339.996 L167.888421,339.991823 C76.8531975,339.451817 0,312.130576 0,247.942458 L0,92.0575424 C0,27.2210597 78.4136287,0 170.651341,0 L169.348,0.004 L169.348659,0 L170,0.002 L170.651341,0 L170.651341,0 L170.651,0.004 L172.111579,0.00817671226 C263.146802,0.548182735 340,27.8694245 340,92.0575424 Z" id="path-1"></path>
</defs>
<g id="App-genérico" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Rectangle" transform="translate(61.000000, 61.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use id="Mask" stroke="#555555" stroke-width="14" stroke-linejoin="round" xlink:href="#path-1"></use>
<path d="M243.089632,66.6385397 C255.811455,68.1348967 268.474117,71.8213332 276.910371,78.4128805 C279.780827,80.6195335 283.214489,83.0345401 285.04609,85.6744737 C286.108609,87.2039779 287.599447,90.7246786 286.747539,92.8105813 C285.689754,95.3439706 281.820673,95.5831036 278.614186,95.5168093 C267.669538,95.2682057 257.661988,94.0985848 247.077034,95.3534412 C232.071625,97.1623285 219.643237,101.345972 208.921031,105.81847 C186.274482,115.196745 166.808389,130.69067 151.450385,146.338491 C135.966961,162.071549 121.652544,181.903015 110.248812,202.274305 C97.5530192,224.954058 87.9619574,248.876829 80.0344822,274 C62.0000677,250.340039 50.8566406,221.118459 50,189.124358 L50,189.079372 L50,189.079372 C67.1635754,162.156784 86.968065,137.803101 110.459422,117.133486 C126.655136,102.842329 145.730771,90.113824 166.841519,80.8823431 C170.384035,79.3102211 173.820063,77.3284952 177.646549,76.1044183 C181.43044,74.8637679 185.379979,73.6325881 189.417075,72.3019668 C204.850804,67.2470266 226.07514,64.7278433 243.089632,66.6385397 Z M249.443746,111.548575 C251.871655,112.938928 254.490313,115.160583 256.507696,116.816952 C263.206733,122.210025 268.91885,129.801891 273.814061,136.838864 C280.819956,146.997376 286.722822,158.745753 288.862533,171.957223 C294.066675,204.579596 280.685187,228.427576 263.552985,242.99199 C254.774364,250.4841 243.209143,256.901753 230.756521,260.222805 C216.819372,263.942882 201.165478,264.946679 186.253848,262.930771 C158.17014,259.167051 132.95804,241.350168 116,224.649308 C117.944815,220.058442 118.525357,218.38129 120.519932,213.865241 C123.851827,217.348397 129.769207,221.999533 132.402378,223.828397 C150.61895,236.584729 174.427383,247.587012 205.998488,245.822573 C221.986194,244.978802 236.82733,239.450643 247.36209,231.008769 C257.579625,222.849539 266.134322,211.117788 265.976747,194.763997 C265.812951,177.460443 257.372288,163.326228 248.149968,153.85354 C244.990162,150.594836 241.573259,147.109602 238.121109,144.540878 C232.659869,140.477889 226.584914,137.325176 220.476785,134.344958 C214.262915,131.264983 207.879029,128.18293 200.468828,126.561891 C212.714113,118.797529 245.558263,109.318607 249.443746,111.548575 Z" id="Path-3" stroke="#555555" stroke-width="7" stroke-linecap="round" stroke-linejoin="round" mask="url(#mask-2)"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -84,7 +84,7 @@ if ($save_log_filter) {
if ($recover_aduit_log_select) {
echo json_encode(audit_get_audit_filter_select());
echo json_encode(audit_get_audit_filter_select_fix_order());
}
if ($update_log_filter) {
@ -190,7 +190,7 @@ function show_filter() {
draggable: true,
modal: false,
closeOnEscape: true,
width: 380
width: "auto"
});
}
@ -207,12 +207,13 @@ function load_filter_values() {
},
success: function(data) {
var options = "";
console.log(data);
$.each(data,function(i,value){
if (i == 'text'){
$("#text-filter_text").val(value);
}
if (i == 'period'){
$("#text-filter_period").val(value);
$("#filter_period").val(value).change();
}
if (i == 'ip'){
$("#text-filter_ip").val(value);
@ -395,7 +396,7 @@ function save_new_filter() {
"save_log_filter" : 1,
"id_name" : $("#text-id_name").val(),
"text" : $("#text-filter_text").val(),
"period" : $("#text-filter_period").val(),
"period" : $("#filter_period :selected").val(),
"ip" : $('#text-filter_ip').val(),
"type" : $('#filter_type :selected').val(),
"user" : $('#filter_user :selected').val(),
@ -431,7 +432,7 @@ function save_update_filter() {
"update_log_filter" : 1,
"id" : $("#overwrite_filter :selected").val(),
"text" : $("#text-filter_text").val(),
"period" : $("#text-filter_period").val(),
"period" : $("#filter_period :selected").val(),
"ip" : $('#text-filter_ip').val(),
"type" : $('#filter_type :selected').val(),
"user" : $('#filter_user :selected').val(),

View File

@ -17,6 +17,8 @@ $save_custom_graph = (bool) get_parameter('save_custom_graph');
$print_custom_graph = (bool) get_parameter('print_custom_graph', false);
$print_sparse_graph = (bool) get_parameter('print_sparse_graph');
$get_graphs = (bool) get_parameter('get_graphs_container');
$width = get_parameter('width', 0);
$height = get_parameter('height', 0);
if ($save_custom_graph) {
$return = [];
@ -25,8 +27,6 @@ if ($save_custom_graph) {
$name = get_parameter('name', '');
$description = get_parameter('description', '');
$stacked = get_parameter('stacked', CUSTOM_GRAPH_LINE);
$width = get_parameter('width', 0);
$height = get_parameter('height', 0);
$events = get_parameter('events', 0);
$period = get_parameter('period', 0);
$fullscale = get_parameter('fullscale', 0);
@ -126,6 +126,8 @@ if ($print_sparse_graph) {
'force_interval' => '',
'time_interval' => 300,
'array_data_create' => 0,
'height' => $height,
'width' => $width,
];
echo grafico_modulo_sparse($params);

View File

@ -0,0 +1,60 @@
<?php
/**
* Manager extensions ajax
*
* @category Ajax library.
* @package Pandora FMS
* @subpackage Modules.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
require_once $config['homedir'].'/godmode/wizards/ManageExtensions.class.php';
if (is_ajax() === false) {
exit;
}
// Control call flow.
try {
// User access and validation is being processed on class constructor.
$actions = new ManageExtensions();
} catch (Exception $e) {
exit;
}
// Ajax controller.
$method = get_parameter('method', '');
if (method_exists($actions, $method) === true) {
if ($actions->ajaxMethod($method) === true) {
$actions->{$method}();
} else {
$actions->errorAjax('Unavailable method.');
}
} else {
$actions->errorAjax('Method not found. ['.$method.']');
}
// Stop any execution.
exit;

View File

@ -97,6 +97,21 @@ if (check_login()) {
return;
}
$id_plugin = get_parameter('id_plugin', 0);
if ($id_plugin !== 0) {
$id_module_plugin = db_get_value(
'id_plugin',
'tagente_modulo',
'id_agente_modulo',
$get_module_macros
);
if ($id_plugin !== $id_module_plugin) {
$get_plugin_macros = true;
$get_module_macros = 0;
}
}
if ($get_plugin_macros) {
if (https_is_running()) {
header('Content-type: application/json');

View File

@ -182,6 +182,7 @@ try {
if ($method == 'snmp_browser_create_modules') {
// Get target ids from form.
$use_agent_ip = get_parameter('use_agent_ip', '');
$id_items = get_parameter('id_item2', null);
$id_target = null;
if (empty($id_items) === false) {
@ -209,7 +210,8 @@ try {
$module_target,
$snmp_conf_values,
$id_target,
$server_to_exec
$server_to_exec,
$use_agent_ip
);
// Return fail modules for error/success message.

View File

@ -0,0 +1,190 @@
<?php
/**
* Extension to schedule tasks on Pandora FMS Console
*
* @category Wizard
* @package Pandora FMS
* @subpackage Host&Devices
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 PandoraFMS S.L.
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
require_once '../functions.php';
require_once '../functions_welcome_wizard.php';
global $config;
$check_web = get_parameter('check_web', 0);
$check_connectivity = get_parameter('check_connectivity', 0);
$create_net_scan = get_parameter('create_net_scan', 0);
$create_mail_alert = get_parameter('create_mail_alert', 0);
$create_unknown_template_alert = get_parameter('create_unknown_template_alert', 0);
// Begin.
global $config;
if ($check_web) {
include_once '../functions_api.php';
include_once '../functions_servers.php';
$status_webserver = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_WEB], 'status')['status'];
if ($status_webserver === '1') {
$name = array_keys(servers_get_names())[0];
$id_group = get_parameter('id_group', 4);
$array_other['data'] = [
'Web monitoring',
'',
2,
$id_group,
0,
30,
30,
9,
$name,
0,
0,
0,
__('Agent Web monitoring created on welcome'),
];
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
if ($id_agent > 0) {
$module_name = get_parameter('module_name', 'Web_monitoring_module');
$text_to_search = get_parameter('text_to_search', '');
$url_goliat = get_parameter('url_goliat', 'https://pandorafms.com/en/');
$module_latency = create_module_latency_goliat($id_agent, $module_name, $id_group, $url_goliat, $text_to_search);
$module_status = create_module_status_goliat($id_agent, $module_name, $id_group, $url_goliat, $text_to_search);
if ($module_latency > 0 && $module_status > 0) {
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
}
} else {
ui_print_error_message(__('The Name is not valid for the modules.'));
}
} else {
ui_print_error_message(__('Web server is not enabled.'));
}
}
if ($check_connectivity) {
include_once '../functions_api.php';
include_once '../functions_servers.php';
$status_newtwork = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_NETWORK], 'status')['status'];
$status_pluggin = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_PLUGIN], 'status')['status'];
if ($status_newtwork === '1' && $status_pluggin === '1') {
$name = array_keys(servers_get_names())[0];
$id_group = get_parameter('id_group', 4);
$agent_name = get_parameter('agent_name', __('Agent check connectivity'));
$array_other['data'] = [
$agent_name,
'',
2,
$id_group,
0,
30,
30,
9,
$name,
0,
0,
0,
__('Basic connectivity'),
];
$id_agent = api_set_new_agent(0, '', $array_other, '', true);
if ($id_agent > 0) {
$ip_target = get_parameter('ip_target', '127.0.0.1');
$basic_network = create_module_basic_network($id_agent, $id_group, $ip_target);
$latency_network = create_module_latency_network($id_agent, $id_group, $ip_target);
$packet_lost = create_module_packet_lost($id_agent, $id_group, $ip_target);
if ($basic_network > 0 && $latency_network > 0 && $packet_lost > 0) {
ui_print_success_message(__('Your check has been created, <a href='.ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agent).'>click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
}
} else {
ui_print_error_message(__('The Name is not valid for the modules.'));
}
} else {
ui_print_error_message(__('Web server is not enabled.'));
}
}
if ($create_net_scan) {
$ip_target = get_parameter('ip_target', '192.168.10.0/24');
$id_net_scan = create_net_scan($ip_target);
if ($id_net_scan > 0) {
$id_recon_server = db_get_row_filter('tserver', ['server_type' => SERVER_TYPE_DISCOVERY], 'id_server')['id_server'];
ui_print_success_message(__('Basic net created and scan in progress. <a href='.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist&server_id='.$id_recon_server.'&force='.$id_net_scan).'>Click here to view the data</a>. Please note that it may take a few seconds to see data if your server is busy'));
} else {
ui_print_error_message(__('Basic net already exists. <a href='.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'>Click here to view the data</a>'));
}
}
if ($create_mail_alert) {
include_once '../functions_alerts.php';
$id_action = db_get_row_filter('talert_actions', ['name' => 'Email to '.$config['id_user']], 'id')['id'];
if (!$id_action) {
$al_action = alerts_get_alert_action($id);
$id_action = alerts_clone_alert_action(1, $al_action['id_group'], 'Email to '.$config['id_user']);
}
$id_alert_template = get_parameter('id_condition', 0);
$id_agent_module = get_parameter('id_agent_module', 0);
$exist = db_get_value_sql(
sprintf(
'SELECT COUNT(id)
FROM talert_template_modules
WHERE id_agent_module = %d
AND id_alert_template = %d
AND id_policy_alerts = 0
',
$id_agent_module,
$id_alert_template
)
);
if ($exist > 0) {
ui_print_error_message(__('Alert already exists. <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure=0').'>Click here to view the data</a>'));
} else {
$id = alerts_create_alert_agent_module($id_agent_module, $id_alert_template);
if ($id !== false) {
$values = [];
$values['fires_min'] = (int) get_parameter('fires_min');
$values['fires_max'] = (int) get_parameter('fires_max');
$values['module_action_threshold'] = (int) 300;
$alert_created = alerts_add_alert_agent_module_action($id, $id_action, $values);
}
}
if ($alert_created === true) {
ui_print_success_message(__('Congratulations, you have already created a simple alert. <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure=0').'>You can see it.</a> Pandora FMS alerts are very flexible, you can do many more things with them, we recommend you to read the <a href="https://pandorafms.com/manual/start?id=en/documentation/04_using/01_alerts">documentation</a> for more information. You can create advanced alerts from <a href='.ui_get_full_url('index.php?sec=galertas&sec2=godmode/alerts/alert_actions').'>here</a>.'));
}
}
if ($create_unknown_template_alert) {
if (is_array(alerts_get_alert_templates(['name' => io_safe_input('Unknown condition')]))) {
echo 1;
} else {
echo create_template_alert_unknown();
}
}

View File

@ -35,6 +35,13 @@ if (is_ajax() === false) {
}
$ajaxPage = 'include/ajax/welcome_window';
// Ajax controller.
$method = get_parameter('method', '');
if ($method === 'loadWelcomeWindow') {
unset($config['welcome_state']);
}
// Control call flow.
try {
@ -44,9 +51,6 @@ try {
exit;
}
// Ajax controller.
$method = get_parameter('method', '');
if (method_exists($welcome_actions, $method) === true) {
if ($welcome_actions->ajaxMethod($method) === true) {
$welcome_actions->{$method}();

View File

@ -129,6 +129,14 @@ if (empty($apiPassword) === true
// Compat.
$config['id_user'] = 'admin';
$correctLogin = true;
// Bypass credentials if server-auth and api-pass are correct.
} else if (($config['server_unique_identifier'] === get_parameter('server_auth'))
&& ($api_password === $apiPassword)
&& ((bool) isInACL($ipOrigin) === true)
) {
$config['id_usuario'] = 'admin';
$config['id_user'] = 'admin';
$correctLogin = true;
} else if ((bool) isInACL($ipOrigin) === true) {
// External access.
// Token is valid. Bypass the credentials.
@ -203,9 +211,9 @@ if ($correctLogin === true) {
}
break;
case 'create_network_module':
// case 'create_network_module':
case 'create_plugin_module':
case 'create_data_module':
// case 'create_data_module':
case 'create_synthetic_module':
case 'create_snmp_module':
case 'delete_module':
@ -320,6 +328,7 @@ if ($correctLogin === true) {
break;
default:
return false;
// Ignore.
break;
}

View File

@ -237,8 +237,13 @@ function process_user_login_remote($login, $pass, $api=false)
// Active Directory.
case 'ad':
if (enterprise_hook('ad_process_user_login', [$login, $pass]) === false) {
$config['auth_error'] = 'User not found in database or incorrect password';
$sr = enterprise_hook('ad_process_user_login', [$login, $pass]);
// Try with secondary server.
if ($sr === false && (bool) $config['secondary_active_directory'] === true) {
$sr = enterprise_hook('ad_process_user_login', [$login, $pass, true]);
}
if ($sr === false) {
return false;
}
break;

View File

@ -165,6 +165,9 @@ $hack_metaconsole = (is_metaconsole() === true) ? '../../' : '';
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.symbol.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.exportdata.pandora.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/jquery.flot.axislabels.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
<script type="text/javascript">
var phpTimezone = "<?php echo date_default_timezone_get(); ?>";
</script>
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/flot/pandora.flot.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chart.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>
<script language="javascript" type="text/javascript" src="<?php echo ui_get_full_url($hack_metaconsole.'include/graphs/chartjs/chartjs-plugin-datalabels.min.js'); ?>?v=<?php echo $config['current_package']; ?>"></script>

View File

@ -178,7 +178,7 @@ class AuditLog extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,
@ -469,7 +469,7 @@ class AuditLog extends HTML
success: function(data) {
var options = "";
$.each(data,function(key,value){
options += "<option value='"+key+"'>"+value+"</option>";
options += "<option value='"+value+"'>"+key+"</option>";
});
$('#overwrite_filter').html(options);
$('#overwrite_filter').select2();
@ -509,8 +509,12 @@ class AuditLog extends HTML
/* Filter management */
$('#button-load-filter').click(function (){
if($('#load-filter-select').length) {
$('#load-filter-select').dialog({width: "20%",
maxWidth: "25%",
$('#load-filter-select').dialog({
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true,
width: "auto",
title: "<?php echo __('Load filter'); ?>"
});
$.ajax({
@ -523,8 +527,9 @@ class AuditLog extends HTML
},
success: function(data) {
var options = "";
console.log(data)
$.each(data,function(key,value){
options += "<option value='"+key+"'>"+value+"</option>";
options += "<option value='"+value+"'>"+key+"</option>";
});
$('#filter_id').html(options);
$('#filter_id').select2();

View File

@ -1040,7 +1040,7 @@ class CalendarManager
'id' => 'templates_alerts_special_days',
'return' => true,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => 'godmode/alerts/alert_special_days',

View File

@ -612,7 +612,7 @@ class ConfigPEN extends HTML
'id' => $tableId,
'return' => true,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,

View File

@ -595,7 +595,6 @@ class ConsoleSupervisor
'days_delete_unknown' => 'Max. days before unknown modules are deleted',
'days_delete_not_initialized' => 'Max. days before delete not initialized modules',
'days_autodisable_deletion' => 'Max. days before autodisabled agents are deleted',
'delete_old_network_matrix' => 'Max. days before delete old network matrix data',
'report_limit' => 'Item limit for real-time reports',
'event_view_hr' => 'Default hours for event view',
'big_operation_step_datos_purge' => 'Big Operation Step to purge old data',
@ -679,20 +678,24 @@ class ConsoleSupervisor
*/
public function checkAccessStatisticsPerformance()
{
global $config;
$total_agents = db_get_value('count(*)', 'tagente');
if ($total_agents >= 200) {
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
$this->notify(
[
'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE',
'title' => __('Access statistics performance'),
'message' => __(
'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty'
),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
if ($config['agentaccess'] !== 0) {
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
$this->notify(
[
'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE',
'title' => __('Access statistics performance'),
'message' => __(
'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty'
),
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup&section=perf',
]
);
}
} else {
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
}
@ -1803,7 +1806,8 @@ class ConsoleSupervisor
$this->cleanNotifications('NOTIF.PHP.SERIALIZE_PRECISION');
}
if (version_compare('8.1', PHP_VERSION) >= 0) {
// If PHP_VERSION is lower than 8.0.27 version_compare() returns 1.
if (version_compare('8.0.27', PHP_VERSION) === 1) {
$url = 'https://www.php.net/supported-versions.php';
$this->notify(
[
@ -2375,7 +2379,8 @@ class ConsoleSupervisor
'SELECT count(*) FROM tusuario
WHERE
id_user="admin"
AND password="1da7ee7d45b96d0e1f45ee4ee23da560"
AND (password="1da7ee7d45b96d0e1f45ee4ee23da560" OR
password="$2y$10$Wv/xoxjI2VAkthJhk/PzeeGIhBKYU/K.TMgUdmW7fEP2NQkdWlB9K")
AND is_admin=1
and disabled!=1'
);

View File

@ -827,7 +827,7 @@ class CredentialStore extends Wizard
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,

View File

@ -1579,7 +1579,7 @@ class Diagnostics extends Wizard
[
'id' => $tableId,
'class' => 'info_table caption_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $columnNames,
'ajax_data' => [
@ -1591,6 +1591,7 @@ class Diagnostics extends Wizard
'no_sortable_columns' => [-1],
'caption' => $title,
'print' => true,
'mini_csv' => true,
]
);
} else {

View File

@ -320,7 +320,7 @@ class EventSound extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,

File diff suppressed because it is too large Load Diff

View File

@ -162,7 +162,7 @@ class SatelliteAgent extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,

View File

@ -142,7 +142,7 @@ class SatelliteCollection extends HTML
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,

View File

@ -326,7 +326,7 @@ class SnmpConsole extends HTML
[
'id' => $tableId,
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,
@ -519,6 +519,8 @@ class SnmpConsole extends HTML
$legend .= '</div>';
$legend .= '</div></div></td>';
echo '<br>';
ui_toggle($legend, __('Legend'));
// Load own javascript file.
@ -1331,17 +1333,8 @@ class SnmpConsole extends HTML
* Show more information
*/
function toggleVisibleExtendedInfo(id, position) {
// Show all "Show more"
$('[id^=img_]').each(function() {
$(this).show();
});
// Hide all "Hide details"
$('[id^=img_hide_]').each(function() {
$(this).hide();
});
var status = $('#eye_'+id).attr('data-show');
if(status == "show"){
$('tr[id^=show_]').remove()
$.ajax({
method: 'get',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
@ -1360,14 +1353,14 @@ class SnmpConsole extends HTML
datatype: "json",
success: function(data) {
let trap = JSON.parse(data);
var tr = $('#snmp_console tr').eq(position+1);
var tr = $('#snmp_console tr:not([id^="show_"])').eq(position+1);
// Count.
if ($('#filter_group_by').val() == 1) {
let labelCount = '<td align="left" valign="top"><b><?php echo __('Count:'); ?></b></br><b><?php echo __('First trap:'); ?></b></br><b><?php echo __('Last trap:'); ?></td>';
let variableCount = `<td align="left" valign="top" style="line-height: 16pt">${trap['count']}</br>${trap['first']}</br>${trap['last']}</td>`;
tr.after(`<tr id="show_" role="row">${labelCount}${variableCount}</tr>`);
tr.after(`<tr id="show_${id}" role="row">${labelCount}${variableCount}</tr>`);
}
// Type.
@ -1405,27 +1398,27 @@ class SnmpConsole extends HTML
let labelType = '<td align="left" valign="top"><b><?php echo __('Type:'); ?></td>';
let variableType = `<td align="left" colspan="8">${desc_trap_type}</td>`;
tr.after(`<tr id="show_" role="row">${labelType}${variableType}</tr>`);
tr.after(`<tr id="show_${id}" role="row">${labelType}${variableType}</tr>`);
// Description.
if (trap['description']) {
let labelDesc = '<td align="left" valign="top"><b><?php echo __('Description:'); ?></td>';
let variableDesc = `<td align="left" colspan="8">${trap['description']}</td>`;
tr.after(`<tr id="show_" role="row">${labelDesc}${variableDesc}</tr>`);
tr.after(`<tr id="show_${id}" role="row">${labelDesc}${variableDesc}</tr>`);
}
// Enterprise String.
let labelOid = '<td align="left" valign="top"><b><?php echo __('Enterprise String:'); ?></td>';
let variableOId = `<td align="left" colspan="8">${trap['oid']}</td>`;
tr.after(`<tr id="show_" role="row">${labelOid}${variableOId}</tr>`);
tr.after(`<tr id="show_${id}" role="row">${labelOid}${variableOId}</tr>`);
// Variable bindings.
let labelBindings = '';
let variableBindings = '';
if ($('#filter_group_by').val() == 1) {
labelBindings = '<td align="left" valign="top" width="15%"><b><?php echo __('Variable bindings:'); ?></b></td>';
labelBindings = '<td align="left" valign="top" ><b><?php echo __('Variable bindings:'); ?></b></td>';
let new_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view';
new_url += '&filter_severity='+$('#filter_severity').val();
@ -1439,7 +1432,7 @@ class SnmpConsole extends HTML
variableBindings = `<td align="left" colspan="8">${string}</td>`;
} else {
labelBindings = '<td align="left" valign="top" width="15%"><b><?php echo __('Variable bindings:'); ?></b></td>';
labelBindings = '<td align="left" valign="top" ><b><?php echo __('Variable bindings:'); ?></b></td>';
const binding_vars = trap['oid_custom'].split("\t");
let string = '';
binding_vars.forEach(function(oid) {
@ -1448,7 +1441,7 @@ class SnmpConsole extends HTML
variableBindings = `<td align="left" colspan="8" class="break-word w200px">${string}</td>`;
}
tr.after(`<tr id="show_" role="row">${labelBindings}${variableBindings}</tr>`);
tr.after(`<tr id="show_${id}" role="row">${labelBindings}${variableBindings}</tr>`);
},
error: function(e) {
console.error(e);
@ -1458,7 +1451,7 @@ class SnmpConsole extends HTML
$('#img_'+id).hide();
$('#img_hide_'+id).show();
} else{
$('tr[id^=show_]').remove();
$(`tr#show_${id}`).remove();
$('#eye_'+id).attr('data-show', 'show');
$('#img_'+id).show();
$('#img_hide_'+id).hide();

View File

@ -475,7 +475,7 @@ class TipsWindow
[
'id' => 'list_tips_windows',
'class' => 'info_table',
'style' => 'width: 99%',
'style' => 'width: 100%',
'dom_elements' => 'lpfti',
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
'columns' => $columns,

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC230706';
$build_version = 'PC230728';
$pandora_version = 'v7.0NG.772';
// Do not overwrite default timezone set if defined.

View File

@ -648,6 +648,7 @@ define('DISCOVERY_APP_DB2', 11);
define('DISCOVERY_APP_MICROSOFT_SQL_SERVER', 12);
define('DISCOVERY_CLOUD_GCP_COMPUTE_ENGINE', 13);
define('DISCOVERY_CLOUD_AWS_S3', 14);
define('DISCOVERY_EXTENSION', 15);
// Force task build tmp results.
define('DISCOVERY_REVIEW', 0);

View File

@ -907,7 +907,7 @@ function set_cookie($name, $value)
{
if (is_null($value)) {
unset($_COOKIE[$value]);
setcookie($name, null, -1, '/');
setcookie($name, '', -1, '/');
} else {
setcookie($name, $value);
}
@ -4348,6 +4348,11 @@ function generator_chart_to_pdf(
curl_close($curl);
$page->setHtml($response);
/*
//For debug url with parameters.
$navigation = $page->navigate($url.'?data='.urlencode(json_encode($data)));
$navigation->waitForNavigation(Page::DOM_CONTENT_LOADED);
*/
// Dynamic.
$dynamic_height = $page->evaluate('document.getElementById("container-chart-generator-item").clientHeight')->getReturnValue();

View File

@ -2770,6 +2770,69 @@ function agents_delete_agent($id_agents, $disableACL=false)
enterprise_include_once('include/functions_agents.php');
enterprise_hook('agent_delete_from_cache', [$id_agent]);
// Delete agent from visual console.
db_process_sql_delete(
'tlayout_data',
['id_agent' => $id_agent]
);
// Delete agent from visual dashboards.
db_process_sql(
'UPDATE twidget_dashboard
SET options = NULL
WHERE options LIKE ("%\"agentid\":\"'.$id_agent.'\"%")'
);
// Delete agent from treport.
db_process_sql_delete(
'treport_content',
['id_agent' => $id_agent]
);
// Delete rules from tevent alerts (correlative alerts)
db_process_sql_delete(
'tevent_rule',
[
'agent' => $id_agent,
'operator_agent' => '==',
]
);
db_process_sql_delete(
'tevent_rule',
[
'log_agent' => $id_agent,
'operator_log_agent' => '==',
]
);
// Delete from gis maps history
db_process_sql_delete(
'tgis_data_history',
['tagente_id_agente' => $id_agent]
);
// Delete from policies.
db_process_sql_delete(
'tpolicy_agents',
['id_agent' => $id_agent]
);
// Delete from tnetwork maps
db_process_sql_delete(
'titem',
['source_data' => $id_agent]
);
db_process_sql_delete(
'trel_item',
[
'id_parent_source_data' => $id_agent,
'id_child_source_data' => $id_agent,
],
'OR'
);
// Delete agent from fav menu.
db_process_sql_delete(
'tfavmenu_user',

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