mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-08-17 07:48:48 +02:00
#10637 Resolve conflicts
This commit is contained in:
commit
feac240905
@ -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
|
||||
|
@ -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."
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -32,6 +32,7 @@ services:
|
||||
PUBLICURL: ""
|
||||
SLEEP: 5
|
||||
RETRIES: 10
|
||||
TZ: 'Europe/Madrid'
|
||||
networks:
|
||||
- pandora
|
||||
ports:
|
||||
|
@ -10,6 +10,8 @@ ENV DBPORT=3306
|
||||
ENV SLEEP=5
|
||||
ENV RETRIES=1
|
||||
ENV OPEN=1
|
||||
ENV TZ='Europe/Madrid'
|
||||
|
||||
|
||||
ENV LC_ALL=C
|
||||
|
||||
|
@ -230,6 +230,10 @@ fi
|
||||
echo "" > /opt/pandora/crontasks || touch /opt/pandora/crontasks
|
||||
|
||||
|
||||
#set localtime
|
||||
rm -rf /etc/localtime
|
||||
ln -s /usr/share/zoneinfo/$TZ /etc/localtime
|
||||
|
||||
#install pandora packages
|
||||
echo "-> Istalling pandorafms"
|
||||
cd /opt/pandora
|
||||
|
@ -28,6 +28,7 @@ $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spe
|
||||
$CODEHOME/pandora_console/pandora_console.redhat.spec \
|
||||
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec\
|
||||
$CODEHOME/pandora_server/pandora_server.redhat.spec \
|
||||
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
|
||||
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -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. It’s 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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, FreeBSD Version
|
||||
# Version 7.0NG.773.1, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, HP-UX Version
|
||||
# Version 7.0NG.773.1, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, Solaris Version
|
||||
# Version 7.0NG.773.1, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.772, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.772, HPUX Version
|
||||
# Version 7.0NG.773.1, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -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. It’s 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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.772, Solaris version
|
||||
# Version 7.0NG.773.1, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, AIX version
|
||||
# Version 7.0NG.773.1, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,10 +1,10 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.772-230704
|
||||
Version: 7.0NG.773.1-230822
|
||||
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. It’s 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.
|
||||
|
@ -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-230704"
|
||||
pandora_version="7.0NG.773.1-230822"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
@ -42,6 +42,7 @@ mkdir -p temp_package/usr/bin/
|
||||
mkdir -p temp_package/usr/sbin/
|
||||
mkdir -p temp_package/etc/pandora/plugins
|
||||
mkdir -p temp_package/etc/pandora/collections
|
||||
mkdir -p temp_package/etc/pandora/ref
|
||||
mkdir -p temp_package/etc/pandora/trans
|
||||
mkdir -p temp_package/etc/pandora/commands
|
||||
mkdir -p temp_package/etc/init.d/
|
||||
|
@ -31,7 +31,7 @@ fi
|
||||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.772"
|
||||
VERSION="7.0NG.773.1"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
@ -19,11 +19,11 @@
|
||||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.772" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.1" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.772" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.1" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
@ -5,9 +5,9 @@
|
||||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.772</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.772 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.772</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773.1</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773.1 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773.1</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
@ -30,6 +30,7 @@ else
|
||||
mkdir -p /usr/local/share/man/man1/
|
||||
mkdir -p /usr/local/share/pandora_agent/collections/
|
||||
mkdir -p /usr/local/share/pandora_agent/commands/
|
||||
mkdir -p /usr/local/share/pandora_agent/ref/
|
||||
mkdir -p /etc/pandora/
|
||||
mkdir -p /var/spool/pandora/data_out/
|
||||
mkdir -p /var/log/pandora/
|
||||
@ -39,6 +40,7 @@ else
|
||||
# Setting permissions to directories and files
|
||||
chmod -R 700 /usr/local/share/pandora_agent/collections
|
||||
chmod -R 700 /usr/local/share/pandora_agent/commands
|
||||
chmod -R 700 /usr/local/share/pandora_agent/ref
|
||||
chmod -R 755 /etc/pandora/
|
||||
chmod -R 700 /var/spool/pandora/data_out
|
||||
chmod -R 711 /var/log/pandora
|
||||
@ -69,6 +71,7 @@ chown root:wheel /usr/local/bin/tentacle_client
|
||||
ln -s /usr/local/share/pandora_agent/plugins /etc/pandora/plugins
|
||||
ln -s /usr/local/share/pandora_agent/commands /etc/pandora/commands
|
||||
ln -s /usr/local/share/pandora_agent/collections /etc/pandora/collections
|
||||
ln -s /usr/local/share/pandora_agent/ref /etc/pandora/ref
|
||||
|
||||
|
||||
# Copy manuals
|
||||
@ -90,4 +93,4 @@ echo "/var/log/pandora/pandora_agent.log : 640 5 204
|
||||
# Clean all install utilites
|
||||
rm -Rf inst_utilities
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, FreeBSD Version
|
||||
# Version 7.0NG.773.1, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, HP-UX Version
|
||||
# Version 7.0NG.773.1, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
@ -310,3 +310,9 @@ module_plugin autodiscover --default
|
||||
#module_description Zombies process on system
|
||||
#module_group System
|
||||
#module_end
|
||||
|
||||
#Hardening plugin for security compliance analysis. Enable to use it.
|
||||
#module_begin
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, GNU/Linux
|
||||
# Version 7.0NG.773.1, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, NetBSD Version
|
||||
# Version 7.0NG.773.1, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.772, Solaris Version
|
||||
# Version 7.0NG.773.1, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
@ -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
|
||||
|
@ -1003,7 +1003,7 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use POSIX qw(strftime floor);
|
||||
use POSIX qw(ceil floor strftime);
|
||||
use Sys::Hostname;
|
||||
use File::Basename;
|
||||
use File::Copy;
|
||||
@ -1030,8 +1030,8 @@ my $Sem = undef;
|
||||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.772';
|
||||
use constant AGENT_BUILD => '230704';
|
||||
use constant AGENT_VERSION => '7.0NG.773.1';
|
||||
use constant AGENT_BUILD => '230822';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
@ -1121,6 +1121,7 @@ my %DefaultConf = (
|
||||
'server_path_md5' => 'md5', #undocumented
|
||||
'server_path_conf' => 'conf', #undocumented
|
||||
'server_path_zip' => 'collections', #undocumented
|
||||
'server_path_ref' => 'ref', #undocumented
|
||||
'logfile' =>'/var/log/pandora/pandora_agent.log',
|
||||
'logsize' => DEFAULT_MAX_LOG_SIZE,
|
||||
'logrotate' => DEFAULT_LOG_ROTATE,
|
||||
@ -1569,6 +1570,34 @@ sub parse_conf_modules($) {
|
||||
$module->{'post_process'} = $1;
|
||||
} elsif ($line =~ /^\s*module_interval\s+(\d+)\s*$/) {
|
||||
$module->{'interval'} = $1;
|
||||
} elsif ($line =~ /^\s*module_absoluteinterval\s+(.*)$/) {
|
||||
my $absolute_interval = $1;
|
||||
if ($absolute_interval eq 'once') {
|
||||
$module->{'absoluteinterval'} = 0;
|
||||
} elsif ($absolute_interval =~ /^(\d+)([smhd])?\s*$/) {
|
||||
if (defined($2)) {
|
||||
# Seconds.
|
||||
if ($2 eq 's') {
|
||||
$module->{'absoluteinterval'} = int($1);
|
||||
}
|
||||
# Minutes (convert to seconds).
|
||||
elsif ($2 eq 'm') {
|
||||
$module->{'absoluteinterval'} = int($1) * 60;
|
||||
}
|
||||
# Hours (convert to seconds).
|
||||
elsif ($2 eq 'h') {
|
||||
$module->{'absoluteinterval'} = int($1) * 3600;
|
||||
}
|
||||
# Days (convert to seconds).
|
||||
elsif ($2 eq 'd') {
|
||||
$module->{'absoluteinterval'} = int($1) * 86400;
|
||||
}
|
||||
} else {
|
||||
$module->{'absoluteinterval'} = int($1) * $Conf{'interval'};
|
||||
}
|
||||
} else {
|
||||
log_message ('setup', "Invalid value for module_absoluteinterval: $absolute_interval");
|
||||
}
|
||||
} elsif ($line =~ /^\s*module_timeout\s+(\d+)\s*$/) {
|
||||
$module->{'timeout'} = $1;
|
||||
} elsif ($line =~ /^\s*module_save\s+(\w+)$/) {
|
||||
@ -1636,6 +1665,27 @@ sub parse_conf_modules($) {
|
||||
next;
|
||||
}
|
||||
|
||||
# Configure modules with an absolute interval.
|
||||
if (defined($module->{'absoluteinterval'})) {
|
||||
|
||||
# Convert from seconds to actual agent intervals.
|
||||
$module->{'interval'} = ceil($module->{'absoluteinterval'} / $Conf{'interval'});
|
||||
|
||||
# Make sure modules that run once are asynchronous.
|
||||
if ($module->{'interval'} == 0) {
|
||||
if ($module->{'type'} eq 'generic_data') {
|
||||
$module->{'type'} = 'async_data';
|
||||
} elsif ($module->{'type'} eq 'generic_proc') {
|
||||
$module->{'type'} = 'async_proc';
|
||||
} elsif ($module->{'type'} eq 'generic_data_string') {
|
||||
$module->{'type'} = 'async_string';
|
||||
}
|
||||
}
|
||||
|
||||
# This file will be used for persistence.
|
||||
$module->{'timestamp_file'} = $ConfDir . '/' . $Conf{'server_path_ref'} . '/' . md5($module->{'name'}) . '.ref';
|
||||
}
|
||||
|
||||
# Set the intensive interval
|
||||
if ($module->{'is_intensive'} == 1) {
|
||||
$module->{'intensive_interval'} = $module->{'interval'};
|
||||
@ -1643,9 +1693,9 @@ sub parse_conf_modules($) {
|
||||
$module->{'intensive_interval'} = $module->{'interval'} * ($Conf{'interval'} / $Conf{'intensive_interval'});
|
||||
}
|
||||
|
||||
# Make the module run the first time
|
||||
$module->{'counter'} = $module->{'intensive_interval'};
|
||||
|
||||
# Initialize the module's execution counter.
|
||||
init_counter($module);
|
||||
|
||||
# Replace macros
|
||||
replace_macros ($module);
|
||||
|
||||
@ -2805,7 +2855,15 @@ sub exec_module {
|
||||
}
|
||||
}
|
||||
|
||||
if (++($module->{'counter'}) < $module->{'intensive_interval'}) {
|
||||
# Modules that will run once.
|
||||
if ($module->{'interval'} == 0) {
|
||||
if ($module->{'counter'} == 0) {
|
||||
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
# Modules that will run periodically.
|
||||
elsif (++($module->{'counter'}) < $module->{'intensive_interval'}) {
|
||||
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
return;
|
||||
}
|
||||
@ -2862,6 +2920,9 @@ sub exec_module {
|
||||
}
|
||||
}
|
||||
|
||||
# Save the module's timestamp to disk.
|
||||
save_module_timestamp($module);
|
||||
|
||||
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
|
||||
}
|
||||
|
||||
@ -3547,6 +3608,44 @@ sub check_module_cron {
|
||||
return 0;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Initialize a module's internal execution counter.
|
||||
################################################################################
|
||||
sub init_counter($) {
|
||||
my ($module) = @_;
|
||||
|
||||
# Open the timestamp file if available.
|
||||
my $fh;
|
||||
if (!defined($module->{'timestamp_file'}) ||
|
||||
!open($fh, '<', $module->{'timestamp_file'})) {
|
||||
# If intensive_interval is 0, setting counter to any value != 0 will make the module run.
|
||||
$module->{'counter'} = $module->{'intensive_interval'} == 0 ? 1 : $module->{'intensive_interval'};
|
||||
return;
|
||||
}
|
||||
|
||||
# Read the timestamp from disk.
|
||||
my $timestamp = int(<$fh>);
|
||||
close($fh);
|
||||
|
||||
# Update the module's execution counter.
|
||||
# If intensive_interval is 0, setting counter to 0 will prevent the module from running again.
|
||||
$module->{'counter'} = $module->{'intensive_interval'} == 0 ? 0 : floor((time() - $timestamp) / $Conf{'interval'});
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Save a module's execution timestamp to disk for persistence.
|
||||
################################################################################
|
||||
sub save_module_timestamp($) {
|
||||
my ($module) = @_;
|
||||
|
||||
return if (!defined($module->{'timestamp_file'}));
|
||||
|
||||
# Update the time reference.
|
||||
open(my $fh, '>', $module->{'timestamp_file'}) or return;
|
||||
print $fh time();
|
||||
close($fh);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Write module data in XML format.
|
||||
################################################################################
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.772
|
||||
%define release 230704
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
@ -25,7 +25,7 @@ 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)
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) perl(File::Copy) perl(Sys::Hostname)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
@ -100,6 +100,11 @@ if [ ! -e /etc/pandora/collections ]; then
|
||||
ln -s /usr/share/pandora_agent/collections /etc/pandora
|
||||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/ref ]; then
|
||||
mkdir -p /usr/share/pandora_agent/ref
|
||||
ln -s /usr/share/pandora_agent/ref /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
|
||||
@ -143,7 +148,7 @@ fi
|
||||
|
||||
# Remove symbolic links
|
||||
pushd /etc/pandora
|
||||
for f in pandora_agent.conf plugins collections
|
||||
for f in pandora_agent.conf plugins collections ref
|
||||
do
|
||||
[ -L $f ] && rm -f $f
|
||||
done
|
||||
|
166
pandora_agents/unix/pandora_agent.redhat_bin.spec
Normal file
166
pandora_agents/unix/pandora_agent.redhat_bin.spec
Normal file
@ -0,0 +1,166 @@
|
||||
#
|
||||
#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.773
|
||||
%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: x86_64
|
||||
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: libnsl
|
||||
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
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.772
|
||||
%define release 230704
|
||||
%define version 7.0NG.773.1
|
||||
%define release 230822
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
@ -94,6 +94,10 @@ if [ ! -e /etc/pandora/collections ]; then
|
||||
mkdir /etc/pandora/collections
|
||||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/ref ]; then
|
||||
mkdir /etc/pandora/ref
|
||||
fi
|
||||
|
||||
if [ ! -e /etc/pandora/commands ]; then
|
||||
mkdir /etc/pandora/commands
|
||||
fi
|
||||
|
@ -9,8 +9,8 @@
|
||||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.772"
|
||||
PI_BUILD="230704"
|
||||
PI_VERSION="7.0NG.773.1"
|
||||
PI_BUILD="230822"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
@ -408,6 +408,11 @@ install () {
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/commands
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/commands $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
echo "Creating the ref directory in to $PANDORA_BASE$PANDORA_HOME/ref..."
|
||||
mkdir -p $PANDORA_BASE$PANDORA_HOME/ref
|
||||
chmod -R 700 $PANDORA_BASE$PANDORA_HOME/ref
|
||||
ln -s $PANDORA_BASE_REAL$PANDORA_HOME/ref $PANDORA_BASE$PANDORA_CFG
|
||||
|
||||
if [ $WITHOUT_TENTACLE_SERVER -eq 0 ]
|
||||
then
|
||||
echo "Copying tentacle server to $PANDORA_BASE$TENTACLE_SERVER"
|
||||
@ -541,8 +546,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
|
||||
|
121
pandora_agents/unix/plugins/inventory_solaris.pl
Normal file
121
pandora_agents/unix/plugins/inventory_solaris.pl
Normal 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";
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.772
|
||||
# Version 7.0NG.773.1
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
@ -522,5 +522,4 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
|
||||
#module_type generic_data_string
|
||||
#module_exec echo Bordón
|
||||
#module_native_encoding OEM
|
||||
#module_end
|
||||
|
||||
#module_end
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
||||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.772}
|
||||
{Pandora FMS Windows Agent v7.0NG.773.1}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{230704}
|
||||
{230822}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -31,6 +31,10 @@ using namespace std;
|
||||
* File operations.
|
||||
*/
|
||||
namespace Pandora_File {
|
||||
|
||||
/* Size of a buffer that will be passed to Pandora_File::md5. */
|
||||
const int MD5_BUF_SIZE = 33;
|
||||
|
||||
/**
|
||||
* File super-class exception.
|
||||
*/
|
||||
|
@ -19,11 +19,14 @@
|
||||
*/
|
||||
|
||||
#include "pandora_module.h"
|
||||
#include "pandora_windows_service.h"
|
||||
#include "../misc/pandora_file.h"
|
||||
#include "../pandora_strutils.h"
|
||||
#include "../pandora.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <cmath>
|
||||
|
||||
#define BUFSIZE 4096
|
||||
|
||||
@ -472,18 +475,27 @@ Pandora_Module::setNoOutput () {
|
||||
*/
|
||||
void
|
||||
Pandora_Module::run () {
|
||||
/* Check the interval */
|
||||
if (this->executions % this->intensive_interval != 0) {
|
||||
|
||||
// Run once.
|
||||
if (this->intensive_interval == 0) {
|
||||
if (this->executions == 0) {
|
||||
has_output = false;
|
||||
throw Interval_Not_Fulfilled ();
|
||||
}
|
||||
}
|
||||
// Run periodically.
|
||||
else if (++this->executions < this->intensive_interval) {
|
||||
pandoraDebug ("%s: Interval is not fulfilled", this->module_name.c_str ());
|
||||
this->executions++;
|
||||
has_output = false;
|
||||
throw Interval_Not_Fulfilled ();
|
||||
}
|
||||
|
||||
/* Increment the executions after check. This is done to execute the
|
||||
first time */
|
||||
this->executions++;
|
||||
// Reset the execution counter.
|
||||
this->executions = 0;
|
||||
has_output = true;
|
||||
|
||||
// Update the execution timestamp.
|
||||
this->updateTimestampFile();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1663,6 +1675,63 @@ Pandora_Module::getTimestamp () {
|
||||
return this->timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the module timestamp file.
|
||||
*
|
||||
* @param file_name The name of the timestamp file.
|
||||
*/
|
||||
void
|
||||
Pandora_Module::setTimestampFile (string file_name) {
|
||||
this->timestamp_file = file_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the module timestamp file.
|
||||
*
|
||||
* @return The name of the timestamp file.
|
||||
*/
|
||||
string
|
||||
Pandora_Module::getTimestampFile () {
|
||||
return this->timestamp_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the timestamp file with the current time.
|
||||
*
|
||||
*/
|
||||
void
|
||||
Pandora_Module::updateTimestampFile () {
|
||||
try {
|
||||
Pandora_File::writeFile(this->timestamp_file, std::to_string(std::time(NULL)));
|
||||
} catch (...) {
|
||||
/* Ignore errors. */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the module's internal execution counter.
|
||||
*
|
||||
*/
|
||||
void
|
||||
Pandora_Module::initExecutions () {
|
||||
string timestamp;
|
||||
|
||||
try {
|
||||
if (this->timestamp_file != "" && Pandora_File::readFile(this->timestamp_file, timestamp) != FILE_NOT_FOUND) {
|
||||
// If the interval is 0, setting executions to 0 will prevent the module from running.
|
||||
this->executions = this->intensive_interval == 0 ?
|
||||
0 :
|
||||
floor((1000.0 * (std::time(NULL) - strtoint(timestamp))) / Pandora_Windows_Service::getInstance()->getInterval());
|
||||
return;
|
||||
}
|
||||
} catch (...) {
|
||||
// Ignore errors.
|
||||
}
|
||||
|
||||
// If the interval is 0, setting executions to any value != 0 will make the module run.
|
||||
this->executions = this->intensive_interval == 0 ? 1 : this->intensive_interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of intensive_match.
|
||||
*
|
||||
|
@ -171,6 +171,7 @@ namespace Pandora_Modules {
|
||||
Cron *cron;
|
||||
list<Condition *> *intensive_condition_list;
|
||||
time_t timestamp;
|
||||
string timestamp_file;
|
||||
unsigned char intensive_match;
|
||||
int intensive_interval;
|
||||
string unit, custom_id, str_warning, str_critical;
|
||||
@ -238,6 +239,7 @@ namespace Pandora_Modules {
|
||||
bool getAsync ();
|
||||
void setExecutions(long executions=0);
|
||||
long getExecutions();
|
||||
void initExecutions ();
|
||||
|
||||
virtual string getXml ();
|
||||
|
||||
@ -303,6 +305,9 @@ namespace Pandora_Modules {
|
||||
int hasOutput ();
|
||||
void setTimestamp (time_t timestamp);
|
||||
time_t getTimestamp ();
|
||||
void setTimestampFile (string file_name);
|
||||
string getTimestampFile ();
|
||||
void updateTimestampFile ();
|
||||
void setIntensiveMatch (unsigned char intensive_match);
|
||||
unsigned char getIntensiveMatch ();
|
||||
bool isIntensive ();
|
||||
|
@ -41,7 +41,10 @@
|
||||
#include "pandora_module_snmpget.h"
|
||||
#include "../windows/pandora_wmi.h"
|
||||
#include "../pandora_strutils.h"
|
||||
#include "../misc/pandora_file.h"
|
||||
#include "../pandora.h"
|
||||
#include <list>
|
||||
#include <cmath>
|
||||
|
||||
using namespace Pandora;
|
||||
using namespace Pandora_Modules;
|
||||
@ -50,6 +53,7 @@ using namespace Pandora_Strutils;
|
||||
#define TOKEN_NAME ("module_name ")
|
||||
#define TOKEN_TYPE ("module_type ")
|
||||
#define TOKEN_INTERVAL ("module_interval ")
|
||||
#define TOKEN_ABSOLUTEINTERVAL ("module_absoluteinterval ")
|
||||
#define TOKEN_EXEC ("module_exec ")
|
||||
#define TOKEN_PROC ("module_proc ")
|
||||
#define TOKEN_SERVICE ("module_service ")
|
||||
@ -156,7 +160,8 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
list<string>::iterator iter;
|
||||
string module_name, module_type, module_exec;
|
||||
string module_min, module_max, module_description;
|
||||
string module_interval, module_proc, module_service;
|
||||
string module_interval, module_absoluteinterval;
|
||||
string module_proc, module_service;
|
||||
string module_freedisk, module_cpuusage, module_inventory;
|
||||
string module_freedisk_percent, module_freememory_percent;
|
||||
string module_dsn, module_freememory;
|
||||
@ -196,6 +201,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
module_max = "";
|
||||
module_description = "";
|
||||
module_interval = "";
|
||||
module_absoluteinterval = "";
|
||||
module_exec = "";
|
||||
module_proc = "";
|
||||
module_service = "";
|
||||
@ -290,6 +296,9 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
if (module_interval == "") {
|
||||
module_interval = parseLine (line, TOKEN_INTERVAL);
|
||||
}
|
||||
if (module_absoluteinterval == "") {
|
||||
module_absoluteinterval = parseLine (line, TOKEN_ABSOLUTEINTERVAL);
|
||||
}
|
||||
if (module_exec == "") {
|
||||
module_exec = parseLine (line, TOKEN_EXEC);
|
||||
}
|
||||
@ -603,6 +612,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
}
|
||||
}
|
||||
|
||||
if (module_absoluteinterval != "") {
|
||||
pos_macro = module_absoluteinterval.find(macro_name);
|
||||
if (pos_macro != string::npos){
|
||||
module_absoluteinterval.replace(pos_macro, macro_name.size(), macro_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (module_exec != "") {
|
||||
pos_macro = module_exec.find(macro_name);
|
||||
if (pos_macro != string::npos){
|
||||
@ -1323,6 +1339,61 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the module absolute interval */
|
||||
if (module_absoluteinterval != "") {
|
||||
int interval;
|
||||
|
||||
try {
|
||||
service = Pandora_Windows_Service::getInstance();
|
||||
|
||||
// Run once.
|
||||
if (module_absoluteinterval == "once") {
|
||||
interval = 0;
|
||||
}
|
||||
// Seconds.
|
||||
else if (module_absoluteinterval.back() == 's') {
|
||||
interval = strtoint (module_absoluteinterval.substr(0, module_absoluteinterval.size() - 1));
|
||||
}
|
||||
// Minutes.
|
||||
else if (module_absoluteinterval.back() == 'm') {
|
||||
interval = strtoint (module_absoluteinterval.substr(0, module_absoluteinterval.size() - 1)) * 60;
|
||||
}
|
||||
// Hours.
|
||||
else if (module_absoluteinterval.back() == 'h') {
|
||||
interval = strtoint (module_absoluteinterval.substr(0, module_absoluteinterval.size() - 1)) * 3600;
|
||||
}
|
||||
// Days.
|
||||
else if (module_absoluteinterval.back() == 'd') {
|
||||
interval = strtoint (module_absoluteinterval.substr(0, module_absoluteinterval.size() - 1)) * 86400;
|
||||
}
|
||||
// Number of agent intervals.
|
||||
else {
|
||||
interval = strtoint(module_absoluteinterval) * (service->getIntervalSec());
|
||||
}
|
||||
|
||||
// Convert from seconds to agent executions.
|
||||
interval = ceil(interval / double(service->getIntervalSec()));
|
||||
|
||||
// Set the module interval.
|
||||
module->setInterval (interval);
|
||||
module->setIntensiveInterval (interval);
|
||||
|
||||
// Compute the MD5 hash of the module's name.
|
||||
char module_name_md5[Pandora_File::MD5_BUF_SIZE];
|
||||
Pandora_File::md5(module_name.c_str(), module_name.size(), module_name_md5);
|
||||
|
||||
// Set the timestamp file.
|
||||
module->setTimestampFile(Pandora::getPandoraInstallDir().append("/ref/").append(module_name_md5).append(".ref"));
|
||||
} catch (Invalid_Conversion e) {
|
||||
pandoraLog ("Invalid absolute interval value \"%s\" for module %s",
|
||||
module_absoluteinterval.c_str (),
|
||||
module_name.c_str ());
|
||||
}
|
||||
catch (...) {
|
||||
// Should not happen. Ignore errors.
|
||||
}
|
||||
}
|
||||
|
||||
/* Module intensive condition */
|
||||
if (intensive_condition_list.size () > 0) {
|
||||
intensive_condition_iter = intensive_condition_list.begin ();
|
||||
@ -1337,6 +1408,9 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
module->setIntensiveInterval (module->getInterval () * (service->getInterval () / service->getIntensiveInterval ()));
|
||||
}
|
||||
|
||||
/* Initialize the module's execution counter. */
|
||||
module->initExecutions ();
|
||||
|
||||
/* Module cron */
|
||||
module->setCron (module_crontab);
|
||||
|
||||
@ -1374,6 +1448,18 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
||||
numeric = false;
|
||||
}
|
||||
|
||||
// Make sure modules that run once are asynchronous.
|
||||
if (module->getInterval() == 0) {
|
||||
type = module->getTypeInt();
|
||||
if (type == TYPE_GENERIC_DATA) {
|
||||
module->setType("async_data");
|
||||
} else if (type == TYPE_GENERIC_PROC) {
|
||||
module->setType("async_proc");
|
||||
} else if (type == TYPE_GENERIC_DATA_STRING) {
|
||||
module->setType("async_string");
|
||||
}
|
||||
}
|
||||
|
||||
if (numeric) {
|
||||
if (module_max != "") {
|
||||
try {
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.772 Build 230704")
|
||||
#define PANDORA_VERSION ("7.0NG.773.1 Build 230822")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -2197,6 +2197,11 @@ Pandora_Windows_Service::getInterval () {
|
||||
return this->interval;
|
||||
}
|
||||
|
||||
long
|
||||
Pandora_Windows_Service::getIntervalSec () {
|
||||
return this->interval_sec;
|
||||
}
|
||||
|
||||
long
|
||||
Pandora_Windows_Service::getIntensiveInterval () {
|
||||
return this->intensive_interval;
|
||||
|
@ -122,6 +122,7 @@ namespace Pandora {
|
||||
Pandora_Agent_Conf *getConf ();
|
||||
string getEHKey (string ehorus_conf);
|
||||
long getInterval ();
|
||||
long getIntervalSec ();
|
||||
long getIntensiveInterval ();
|
||||
string generateAgentName ();
|
||||
bool writeToBuffer (string temporal);
|
||||
|
@ -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 230704))"
|
||||
VALUE "ProductVersion", "(7.0NG.773.1(Build 230822))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,10 +1,10 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.772-230704
|
||||
Version: 7.0NG.773.1-230822
|
||||
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.
|
||||
|
@ -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-230704"
|
||||
pandora_version="7.0NG.773.1-230822"
|
||||
|
||||
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 ..
|
||||
|
2
pandora_console/composer.lock
generated
2
pandora_console/composer.lock
generated
@ -609,7 +609,7 @@
|
||||
}
|
||||
],
|
||||
"description": "PHP library for ChartJS",
|
||||
"homepage": "https://artica.es/",
|
||||
"homepage": "https://pandorafms.com/",
|
||||
"keywords": [
|
||||
"chartjs",
|
||||
"graph",
|
||||
|
@ -261,12 +261,27 @@ function agents_modules_load_js()
|
||||
}
|
||||
|
||||
function select_selected () {
|
||||
// $('#id_agents2 option').each(function(){
|
||||
// if($(this).attr('selected') === 'selected'){
|
||||
// $(this).prop('selected', true);
|
||||
// }
|
||||
// });
|
||||
var f = document.forms.filter_form;
|
||||
f.action = "index.php?sec=view&sec2=extensions/agents_modules";
|
||||
$('#filter_form').submit();
|
||||
}
|
||||
/* <![CDATA[ */
|
||||
function export_csv() {
|
||||
let group_id = $('#group_id option:selected').val();
|
||||
let module_group_id = $('#modulegroup option:selected').val();
|
||||
let agent_id = $('#id_agents2 option:selected').map((_, e) => e.value).get();
|
||||
let module_id = $('#module option:selected').map((_, e) => e.value).get();
|
||||
|
||||
let filters_array = {group_id: group_id, module_group_id:module_group_id, agent_id:agent_id, module_id:module_id}
|
||||
let jsonFilters = JSON.stringify(filters_array)
|
||||
let filters = window.btoa(jsonFilters)
|
||||
var f = document.forms.filter_form;
|
||||
|
||||
blockResubmit($(this));
|
||||
f.action = "extensions/agents_modules_csv.php?get_agents_module_csv=1&filters="+filters;
|
||||
$("#filter_form").submit();
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
@ -653,7 +668,7 @@ function mainAgentsModules()
|
||||
}
|
||||
|
||||
if ($config['pure'] != 1) {
|
||||
$show_filters = '<form method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters = '<form id="filter_form" method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td width="33%">'.$filter_type.'</td>';
|
||||
@ -679,6 +694,13 @@ function mainAgentsModules()
|
||||
'onclick' => 'select_selected()',
|
||||
],
|
||||
true
|
||||
).html_print_button(
|
||||
__('Export to CSV'),
|
||||
'srcbutton_csv',
|
||||
false,
|
||||
'export_csv()',
|
||||
['class' => 'secondary mini'],
|
||||
true,
|
||||
),
|
||||
],
|
||||
true
|
||||
|
117
pandora_console/extensions/agents_modules_csv.php
Normal file
117
pandora_console/extensions/agents_modules_csv.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* Export data.
|
||||
*
|
||||
* @category Tools
|
||||
* @package Pandora FMS
|
||||
* @subpackage Operation
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
require_once $config['homedir'].'/include/config.php';
|
||||
require_once $config['homedir'].'/include/functions_reporting.php';
|
||||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
*/
|
||||
require_once '../include/config.php';
|
||||
require_once '../include/functions_agents.php';
|
||||
require_once '../include/functions_reporting.php';
|
||||
require_once '../include/functions_modules.php';
|
||||
require_once '../include/functions_users.php';
|
||||
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
// ACL Check.
|
||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Agent view (Grouped)'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$get_agents_module_csv = get_parameter('get_agents_module_csv', 0);
|
||||
|
||||
|
||||
if ($get_agents_module_csv === '1') {
|
||||
// ***************************************************
|
||||
// Header output
|
||||
// ***************************************************
|
||||
$config['ignore_callback'] = true;
|
||||
while (@ob_end_clean()) {
|
||||
}
|
||||
|
||||
$filename = 'agents_module_view_'.date('Ymd').'-'.date('His');
|
||||
|
||||
// Set cookie for download control.
|
||||
setDownloadCookieToken();
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.csv"');
|
||||
// ***************************************************
|
||||
// Data processing
|
||||
// ***************************************************
|
||||
echo pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
|
||||
$json_filters = get_parameter('filters', '');
|
||||
|
||||
$filters = json_decode(
|
||||
base64_decode(
|
||||
get_parameter('filters', '')
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$results = export_agents_module_csv($filters);
|
||||
|
||||
$divider = $config['csv_divider'];
|
||||
$dataend = PHP_EOL;
|
||||
|
||||
$header_fields = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Data'),
|
||||
];
|
||||
|
||||
$out_csv = '';
|
||||
foreach ($header_fields as $key => $value) {
|
||||
$out_csv .= $value.$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
|
||||
foreach ($results as $result) {
|
||||
foreach ($result as $key => $value) {
|
||||
$out_csv .= io_safe_output($value).$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
}
|
||||
|
||||
echo io_safe_output($out_csv);
|
||||
|
||||
exit;
|
||||
}
|
@ -157,7 +157,6 @@ function extension_api_checker()
|
||||
}
|
||||
|
||||
$url = io_safe_output(get_parameter('url', ''));
|
||||
|
||||
$ip = io_safe_output(get_parameter('ip', '127.0.0.1'));
|
||||
$pandora_url = io_safe_output(get_parameter('pandora_url', $config['homeurl_static']));
|
||||
$apipass = io_safe_output(get_parameter('apipass', ''));
|
||||
@ -175,6 +174,17 @@ function extension_api_checker()
|
||||
|
||||
$api_execute = (bool) get_parameter('api_execute', false);
|
||||
|
||||
if ($url !== '') {
|
||||
$validate_url = parse_url($url);
|
||||
if ($validate_url['scheme'] === 'http' || $validate_url['scheme'] === 'https') {
|
||||
ui_print_success_message(__('Request successfully processed'));
|
||||
} else {
|
||||
ui_print_error_message(__('Incorrect URL'));
|
||||
$url = '';
|
||||
$api_execute = false;
|
||||
}
|
||||
}
|
||||
|
||||
$return_call_api = '';
|
||||
if ($api_execute === true) {
|
||||
$return_call_api = api_execute(
|
||||
|
@ -453,7 +453,7 @@ function resource_exportation_extension_main()
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', ['mode' => 'link'], true);
|
||||
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', '', true);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Visual console'),
|
||||
@ -465,7 +465,7 @@ function resource_exportation_extension_main()
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', ['mode' => 'link'], true);
|
||||
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', '', true);
|
||||
|
||||
if ($hook_enterprise === true) {
|
||||
add_rows_for_enterprise($table->data);
|
||||
|
@ -1692,3 +1692,19 @@ 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
|
||||
enterprise/godmode/wizards/Applications.class.php
|
||||
enterprise/godmode/wizards/Cloud.class.php
|
||||
enterprise/images/wizard/applications.png
|
||||
enterprise/images/wizard/cloud.png
|
||||
enterprise/images/wizard/consoletasks.png
|
File diff suppressed because one or more lines are too long
13
pandora_console/extras/mr/66.sql
Normal file
13
pandora_console/extras/mr/66.sql
Normal file
@ -0,0 +1,13 @@
|
||||
START TRANSACTION;
|
||||
|
||||
|
||||
UPDATE `twelcome_tip`
|
||||
SET title = 'Scheduled downtimes',
|
||||
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
|
||||
WHERE title = 'planned stops';
|
||||
|
||||
UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
|
||||
COMMIT;
|
81
pandora_console/general/admin_maintenance_mode.php
Normal file
81
pandora_console/general/admin_maintenance_mode.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* Static page to lock access to console
|
||||
*
|
||||
* @category Wizard
|
||||
* @package Pandora FMS
|
||||
* @subpackage Applications.VMware
|
||||
* @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.
|
||||
ui_require_css_file('maintenance');
|
||||
?>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<div class="responsive center padding-6">
|
||||
<p>
|
||||
<?php
|
||||
if (is_metaconsole() === true) {
|
||||
echo __('You cannot use this metaconsole until merging process is finished');
|
||||
} else {
|
||||
echo __('You cannot use this console until merging process is finished');
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
html_print_image(
|
||||
'images/pandora_tinylogo.png',
|
||||
false,
|
||||
['class' => 'responsive flex margn']
|
||||
);
|
||||
html_print_image(
|
||||
'images/maintenance.png',
|
||||
false,
|
||||
[
|
||||
'class' => 'responsive',
|
||||
'width' => 800,
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
setTimeout(
|
||||
function() {
|
||||
location.reload();
|
||||
},
|
||||
10000
|
||||
);
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
@ -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) {
|
||||
@ -212,16 +228,15 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
);
|
||||
|
||||
$autorefresh_list = json_decode(
|
||||
$select[0]['autorefresh_white_list']
|
||||
(empty($select[0]['autorefresh_white_list']) === false)
|
||||
? $select[0]['autorefresh_white_list']
|
||||
: ''
|
||||
);
|
||||
|
||||
$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
|
||||
) {
|
||||
@ -351,59 +366,37 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
$header_autorefresh_counter .= '</div>';
|
||||
}
|
||||
|
||||
// Button for feedback pandora.
|
||||
if (enterprise_installed() && $config['activate_feedback']) {
|
||||
$header_feedback = '<div id="feedback-icon-header">';
|
||||
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
|
||||
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
|
||||
$header_feedback .= html_print_image(
|
||||
'images/send_feedback@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Feedback'),
|
||||
'id' => 'feedback-header',
|
||||
'alt' => __('Feedback'),
|
||||
'style' => 'cursor: pointer;',
|
||||
]
|
||||
);
|
||||
$header_feedback .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Support.
|
||||
if (enterprise_installed()) {
|
||||
$header_support_link = $config['custom_support_url'];
|
||||
$modal_box = '<div id="modal_help" class="invisible">
|
||||
<div id="modal-feedback-form" class="invisible"></div>
|
||||
<div id="msg-header" class="invisible"></div>
|
||||
<a href="https://pandorafms.com/manual" target="_blank">'.__('Pandora documentation').'</a>';
|
||||
if (enterprise_installed() === true) {
|
||||
$modal_box .= '<a href="https://support.pandorafms.com/" target="_blank">'.__('Enterprise support ').'</a>';
|
||||
$modal_box .= '<a href="#" id="feedback-header">'.__('Give us feedback').'</a>';
|
||||
} else {
|
||||
$header_support_link = 'https://pandorafms.com/forums/';
|
||||
$modal_box .= '<a href="https://pandorafms.com/community/forums/" target="_blank">'.__('Community Support').'</a>';
|
||||
}
|
||||
|
||||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
|
||||
$header_support .= html_print_image(
|
||||
'images/support@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Go to support'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
$header_support .= '</a></div>';
|
||||
$modal_box .= '<hr class="separator" />';
|
||||
$modal_box .= '<a href="https://github.com/pandorafms/pandorafms/issues" target="_blank">'.__('Open an issue in Github').'</a>';
|
||||
$modal_box .= '<a href="https://discord.com/invite/xVt2ruSxmr" target="_blank">'.__('Join discord community').'</a>';
|
||||
$modal_box .= '</div>';
|
||||
|
||||
// Documentation.
|
||||
$header_docu = '<div id="header_docu">';
|
||||
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
|
||||
$header_docu .= html_print_image(
|
||||
'images/documentation@header.svg',
|
||||
true,
|
||||
$modal_help = html_print_div(
|
||||
[
|
||||
'title' => __('Go to documentation'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
'id' => 'modal-help-content',
|
||||
'content' => html_print_image(
|
||||
'images/help@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Help'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
).$modal_box,
|
||||
],
|
||||
true,
|
||||
);
|
||||
$header_docu .= '</a></div>';
|
||||
|
||||
|
||||
// User.
|
||||
@ -457,11 +450,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
echo '</span>';
|
||||
echo '</div>';
|
||||
echo '<div class="header_center"></div>';
|
||||
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
echo '<div class="header_right">'.$modal_help, $header_user, $header_logout.'</div>';
|
||||
} 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, $modal_help, $header_user, $header_logout.'</div>';
|
||||
}
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
@ -539,6 +532,54 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
element.style.display = "none"
|
||||
}
|
||||
|
||||
function notifications_clean_all() {
|
||||
let wrapper_inner = document.getElementById('notification-wrapper-inner');
|
||||
while (wrapper_inner.firstChild) {
|
||||
wrapper_inner.removeChild(wrapper_inner.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function mark_all_notification_as_read() {
|
||||
jQuery.post ("ajax.php",
|
||||
{
|
||||
"page" : "godmode/setup/setup_notifications",
|
||||
"mark_all_notification_as_read" : 1
|
||||
},
|
||||
function (data, status) {
|
||||
notifications_clean_all();
|
||||
location.reload();
|
||||
},
|
||||
"json"
|
||||
)
|
||||
.fail(function(xhr, textStatus, errorThrown){
|
||||
console.error(
|
||||
"Failed to mark al notification as read. Error: ",
|
||||
xhr.responseText
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function filter_notification() {
|
||||
let notification_type = '';
|
||||
$('.notification-item').hide();
|
||||
$(".checkbox_filter_notifications:checkbox:checked").each(function() {
|
||||
notification_type = $(this).val();
|
||||
console.log(notification_type);
|
||||
$('.notification-item[value='+notification_type+']').show();
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
});
|
||||
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
|
||||
if (notification_type == ''){
|
||||
$('.notification-item').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function click_on_notification_toast(event) {
|
||||
var match = /notification-(.*)-id-([0-9]+)/.exec(event.target.id);
|
||||
if (!match) {
|
||||
@ -904,11 +945,47 @@ 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 () {
|
||||
// Clean DOM.
|
||||
$("#feedback-header").empty();
|
||||
// Function charge Modal.
|
||||
show_feedback();
|
||||
});
|
||||
@ -1014,6 +1091,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).click(function(event) {
|
||||
if (!$(event.target).closest('#modal-help-content').length &&
|
||||
$('#modal_help').hasClass('invisible') === false) {
|
||||
$('#modal_help').addClass('invisible');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal-help-content').on('click', (e) => {
|
||||
if($(e.target).prop('tagName') === 'A') {
|
||||
$('#modal_help').addClass('invisible');
|
||||
} else {
|
||||
$('#modal_help').removeClass('invisible');
|
||||
}
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
|
||||
echo '<style>
|
||||
:root {';
|
||||
if ($config['style'] === 'pandora') {
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.50);';
|
||||
echo '--login-label-color: #545454;';
|
||||
echo '--login-text-color: #000;';
|
||||
$style_theme = 'white-theme';
|
||||
@ -237,16 +237,18 @@ if (is_metaconsole() === true) {
|
||||
);
|
||||
}
|
||||
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'enterprise/images/custom_logo_login/'.$config['custom_logo_login'];
|
||||
if (!isset($config['custom_logo_login'])) {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
} else {
|
||||
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'images/custom_logo_login/'.$config['custom_logo_login'];
|
||||
if (empty($config['custom_logo_login']) === true) {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,8 @@ if (!empty($news)) {
|
||||
|
||||
$output_news .= '</div></div>';
|
||||
} else {
|
||||
$text = str_replace('<script', '<script', $text);
|
||||
$text = str_replace('</script', '</script', $text);
|
||||
$output_news .= nl2br($text);
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,10 @@ echo '</div>';
|
||||
$(`#sub${this.id}`).hide();
|
||||
})
|
||||
} else if ($('#menu_full').hasClass('menu_full_collapsed')) {
|
||||
$(".arrow_menu_right").each(function() {
|
||||
$(this).removeClass('arrow_menu_right');
|
||||
$(this).addClass('arrow_menu_down');
|
||||
});
|
||||
localStorage.setItem("menuType", "classic");
|
||||
$('ul.submenu').css('left', '280px');
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
@ -273,6 +277,14 @@ echo '</div>';
|
||||
$('.menu_icon').mouseenter(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
$(".arrow_menu_down").each(function() {
|
||||
$(this).removeClass('arrow_menu_down');
|
||||
$(this).addClass('arrow_menu_right');
|
||||
});
|
||||
$(".arrow_menu_up").each(function() {
|
||||
$(this).removeClass('arrow_menu_up');
|
||||
$(this).addClass('arrow_menu_right');
|
||||
});
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
@ -305,6 +317,7 @@ echo '</div>';
|
||||
table_hover2 = $(this);
|
||||
handsIn2 = 1;
|
||||
openTime2 = new Date().getTime();
|
||||
$("#sub" + table_hover2[0].id).attr('style', 'display: none; position: fixed; left: 340px;');
|
||||
$("#sub" + table_hover2[0].id).show();
|
||||
if (typeof(table_noHover2) != 'undefined') {
|
||||
if ("ul#sub" + table_hover2[0].id != "ul#sub" + table_noHover2[0].id) {
|
||||
@ -315,6 +328,7 @@ echo '</div>';
|
||||
}).mouseleave(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
$("#sub" + $(this)[0].id).attr('style', 'display: none;');
|
||||
table_noHover2 = table_hover2;
|
||||
handsIn2 = 0;
|
||||
setTimeout(function() {
|
||||
@ -349,7 +363,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;
|
||||
}
|
||||
|
||||
@ -474,4 +488,10 @@ echo '</div>';
|
||||
return height_logo + height_tabs + padding_menu + height_position;
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
if (get_user_language($config['id_user']) == 'es') {
|
||||
?>
|
||||
$('#icon_god-extensions').find('span').attr('style', 'white-space: nowrap;');
|
||||
<?php } ?>
|
||||
</script>
|
@ -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) {
|
||||
|
@ -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');
|
||||
@ -300,7 +300,7 @@ if (enterprise_installed() === true) {
|
||||
// Parent agents.
|
||||
$paramsParentAgent = [];
|
||||
$paramsParentAgent['return'] = true;
|
||||
$paramsParentAgent['show_helptip'] = false;
|
||||
$paramsParentAgent['show_helptip'] = true;
|
||||
$paramsParentAgent['input_name'] = 'id_parent';
|
||||
$paramsParentAgent['print_hidden_input_idagent'] = true;
|
||||
$paramsParentAgent['hidden_input_idagent_name'] = 'id_agent_parent';
|
||||
@ -646,7 +646,7 @@ if (enterprise_installed() === true) {
|
||||
|
||||
// Parent agent.
|
||||
$tableAdvancedAgent->data['parent_agent'][] = html_print_label_input_block(
|
||||
__('Parent'),
|
||||
__('Agent parent'),
|
||||
ui_print_agent_autocomplete_input($paramsParentAgent)
|
||||
);
|
||||
|
||||
@ -931,7 +931,7 @@ foreach ($fields as $field) {
|
||||
// Filling the data.
|
||||
$combo = [];
|
||||
$combo = $field['combo_values'];
|
||||
$combo = explode(',', $combo);
|
||||
$combo = explode(',', (empty($combo) === true) ? '' : $combo);
|
||||
$combo_values = [];
|
||||
foreach ($combo as $value) {
|
||||
$combo_values[$value] = $value;
|
||||
@ -965,7 +965,7 @@ foreach ($fields as $field) {
|
||||
true
|
||||
);
|
||||
} else if ($field['is_link_enabled']) {
|
||||
list($link_text, $link_url) = json_decode($custom_value, true);
|
||||
list($link_text, $link_url) = json_decode(io_safe_output($custom_value), true);
|
||||
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
$link_text = '';
|
||||
@ -1205,15 +1205,30 @@ ui_require_jquery_file('bgiframe');
|
||||
$("#cascade_protection_module").attr("disabled", 'disabled');
|
||||
}
|
||||
|
||||
$("#checkbox-cascade_protection").change(function () {
|
||||
var checked = $("#checkbox-cascade_protection").is(":checked");
|
||||
|
||||
if (checked) {
|
||||
$("#text-id_parent").change(function(){
|
||||
const parent = $("#text-id_parent").val();
|
||||
if (parent != '') {
|
||||
$("#checkbox-cascade_protection").prop('checked', true);
|
||||
$("#cascade_protection_module").removeAttr("disabled");
|
||||
}
|
||||
else {
|
||||
$("#cascade_protection_module").val(0);
|
||||
$("#cascade_protection_module").attr("disabled", 'disabled');
|
||||
$("#text-id_parent").removeAttr("required");
|
||||
$("#cascade_protection_module").empty();
|
||||
$("#checkbox-cascade_protection").prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
$("#checkbox-cascade_protection").change(function () {
|
||||
var checked = $("#checkbox-cascade_protection").is(":checked"); if (checked) {
|
||||
$("#cascade_protection_module").removeAttr("disabled");
|
||||
$("#text-id_parent").attr("required", "required");
|
||||
}
|
||||
else {
|
||||
$("#cascade_protection_module").val(0);
|
||||
$("#cascade_protection_module").attr("disabled", 'disabled');
|
||||
$("#text-id_parent").removeAttr("required");
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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'],
|
||||
|
@ -460,6 +460,18 @@ if ($id_agente) {
|
||||
|
||||
$templatetab['active'] = ($tab === 'template');
|
||||
|
||||
// Policy tab.
|
||||
$policyTab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=policy&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');
|
||||
@ -1740,7 +1758,10 @@ if ($update_module) {
|
||||
];
|
||||
|
||||
|
||||
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
|
||||
if ($id_module_type === 30 || $id_module_type === 31
|
||||
|| $id_module_type === 32 || $id_module_type === 33
|
||||
|| $id_module_type === 38
|
||||
) {
|
||||
$plugin_parameter_split = explode('
', $values['plugin_parameter']);
|
||||
|
||||
$values['plugin_parameter'] = '';
|
||||
@ -1936,7 +1957,10 @@ if ($create_module) {
|
||||
'warning_time' => $warning_time,
|
||||
];
|
||||
|
||||
if ($id_module_type === 30 || $id_module_type === 31 || $id_module_type === 32 || $id_module_type === 33) {
|
||||
if ($id_module_type === 30 || $id_module_type === 31
|
||||
|| $id_module_type === 32 || $id_module_type === 33
|
||||
|| $id_module_type === 38
|
||||
) {
|
||||
$plugin_parameter_split = explode('
', $values['plugin_parameter']);
|
||||
|
||||
$values['plugin_parameter'] = '';
|
||||
@ -2428,6 +2452,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
|
||||
|
@ -996,6 +996,8 @@ if ($agents !== false) {
|
||||
$tableAgents->data[$key][6] = $actionButtonsColumn;
|
||||
}
|
||||
|
||||
$total_items = '<div class="total_pages">'.sprintf(__('Total items: %s'), $total_agents).'</div>';
|
||||
echo $total_items;
|
||||
html_print_table($tableAgents);
|
||||
|
||||
$tablePagination = ui_pagination(
|
||||
@ -1072,16 +1074,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>
|
||||
|
@ -407,8 +407,7 @@ if ($edit_module === true) {
|
||||
$help_header = 'local_module';
|
||||
}
|
||||
|
||||
if ($id_module_type === 6 || $id_module_type === 7
|
||||
) {
|
||||
if ($id_module_type === 6 || $id_module_type === 7) {
|
||||
$help_header = 'icmp_module_tab';
|
||||
}
|
||||
|
||||
@ -420,7 +419,7 @@ if ($edit_module === true) {
|
||||
$help_header = 'tcp_module_tab';
|
||||
}
|
||||
|
||||
if ($id_module_type >= 30 && $id_module_type <= 33) {
|
||||
if (($id_module_type >= 30 && $id_module_type <= 33) || $id_module_type === 38) {
|
||||
$help_header = 'webserver_module_tab';
|
||||
}
|
||||
}
|
||||
@ -1847,6 +1846,22 @@ $(document).ready (function () {
|
||||
setModuleType(type_name_selected);
|
||||
});
|
||||
|
||||
$('#checkbox-warning_inverse_string').change( function () {
|
||||
if ($(this).prop('checked') === true) {
|
||||
$('input[name="warning_thresholds_checks"]').val('warning_inverse');
|
||||
} else {
|
||||
$('input[name="warning_thresholds_checks"]').val('normal_warning');
|
||||
}
|
||||
});
|
||||
|
||||
$('#checkbox-critical_inverse_string').change( function () {
|
||||
if ($(this).prop('checked') === true) {
|
||||
$('input[name="critical_thresholds_checks"]').val('critical_inverse');
|
||||
} else {
|
||||
$('input[name="critical_thresholds_checks"]').val('normal_critical');
|
||||
}
|
||||
});
|
||||
|
||||
function setModuleType(type_name_selected) {
|
||||
if (type_name_selected.match(/_string$/) == null) {
|
||||
// Hide string fields.
|
||||
|
@ -233,7 +233,6 @@ if ($adopt === false) {
|
||||
}
|
||||
|
||||
$snmp_versions['1'] = 'v. 1';
|
||||
$snmp_versions['2'] = 'v. 2';
|
||||
$snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
|
||||
|
@ -171,6 +171,8 @@ foreach ($password_fields as $k => $p) {
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
changePluginSelect();
|
||||
if ($("#id_plugin").val() === 0) {
|
||||
changePluginSelect();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -113,7 +113,8 @@ if ($id_policy_module > 0) {
|
||||
$plugin_parameter_split = explode('
', $plugin_parameter);
|
||||
$plugin_parameter_final_split = '';
|
||||
|
||||
foreach ($plugin_parameter_split as $key => $value) {
|
||||
$new_plugin_parameter_split = array_filter($plugin_parameter_split, 'strlen');
|
||||
foreach ($new_plugin_parameter_split as $key => $value) {
|
||||
if (strpos($value, 'http_auth_user') === false && strpos($value, 'http_auth_pass') === false) {
|
||||
$plugin_parameter_final_split .= $value.'
';
|
||||
}
|
||||
@ -317,8 +318,7 @@ foreach ($texts as $code => $text) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(plugin_parameter).val(
|
||||
'task_begin\ncookie 0\nresource 0\ntask_end');
|
||||
$(plugin_parameter).val('task_begin\ncookie 0\nresource 0\ntask_end');
|
||||
|
||||
$('#button-btn_loadbasic').attr('disabled', 'disabled');
|
||||
|
||||
|
@ -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',
|
||||
@ -835,7 +835,7 @@ if ($downtimes === false && $filter_performed === false) {
|
||||
// If user have writting permissions.
|
||||
if (in_array($downtime['id_group'], $groupsAD) === true) {
|
||||
// Stop button.
|
||||
if ($downtime['type_execution'] === 'once'
|
||||
if (($downtime['type_execution'] === 'once' || $downtime['type_execution'] === 'periodically')
|
||||
&& (int) $downtime['executed'] === 1
|
||||
) {
|
||||
if ((bool) check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AW') === true
|
||||
|
@ -333,7 +333,7 @@ $show_table_filter .= ui_toggle(
|
||||
__('Search'),
|
||||
'search',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar '
|
||||
|
@ -725,17 +725,17 @@ if ($copy_command) {
|
||||
$is_management_allowed = is_management_allowed();
|
||||
if ($is_management_allowed === false) {
|
||||
if (is_metaconsole() === false) {
|
||||
$url = '<a target="_blank" href="'.ui_get_meta_url(
|
||||
$url_redirect = '<a target="_blank" href="'.ui_get_meta_url(
|
||||
'index.php?sec=advanced&sec2=godmode/alerts/alert_commands&tab=command&pure=0'
|
||||
).'">'.__('metaconsole').'</a>';
|
||||
} else {
|
||||
$url = __('any node');
|
||||
$url_redirect = __('any node');
|
||||
}
|
||||
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'This node is configured with centralized mode. All alert commands information is read only. Go to %s to manage it.',
|
||||
$url
|
||||
$url_redirect
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -807,12 +807,12 @@ foreach ($commands as $command) {
|
||||
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
||||
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
|
||||
if (is_user_admin($config['id_user']) === true) {
|
||||
$data['action'] = '<span class="inline_flex">';
|
||||
$data['action'] = '<span class="inline_flex">';
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&copy_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter ', 'title' => 'Duplicate']).'</a>';
|
||||
|
||||
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'&offset='.$offset_delete.'"
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'title' => 'Delete']).'</a>';
|
||||
$data['action'] .= '</span>';
|
||||
}
|
||||
}
|
||||
|
@ -40,27 +40,45 @@ $table->size = [];
|
||||
$table->style[0] = 'width: 50%';
|
||||
$table->style[1] = 'width: 50%';
|
||||
|
||||
// Add an agent selector
|
||||
if (! $id_agente) {
|
||||
$modules = [];
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'id_agent';
|
||||
$params['selectbox_id'] = 'id_agent_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['metaconsole_enabled'] = false;
|
||||
$params['metaconsole_enabled'] = true;
|
||||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax';
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
'<div class="w100p">'.ui_print_agent_autocomplete_input($params).'</div>'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Add an agent selector.
|
||||
if (! $id_agente) {
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'id_agent';
|
||||
$params['selectbox_id'] = 'id_agent_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['metaconsole_enabled'] = false;
|
||||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['print_hidden_input_idagent'] = true;
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
);
|
||||
}
|
||||
|
||||
$modules = [];
|
||||
|
||||
if ($id_agente) {
|
||||
$modules = agents_get_modules($id_agente, false, ['delete_pending' => 0]);
|
||||
if ($id_agente) {
|
||||
$modules = agents_get_modules($id_agente, false, ['delete_pending' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
@ -319,7 +337,8 @@ $(document).ready (function () {
|
||||
jQuery.post (<?php echo "'".ui_get_full_url(false, false, false, false)."'"; ?> + "ajax.php",
|
||||
{"page" : "operation/agentes/estado_agente",
|
||||
"get_agent_module_last_value" : 1,
|
||||
"id_agent_module" : this.value
|
||||
"id_agent_module" : this.value,
|
||||
"server_name" : $('#text-id_agent').val(),
|
||||
},
|
||||
function (data, status) {
|
||||
if (data === false) {
|
||||
@ -338,5 +357,4 @@ $(document).ready (function () {
|
||||
);
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
@ -912,7 +912,10 @@ foreach ($simple_alerts as $alert) {
|
||||
1,
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
[
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'title' => __('Enable'),
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
|
||||
} else {
|
||||
@ -922,7 +925,10 @@ foreach ($simple_alerts as $alert) {
|
||||
1,
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'main_menu_icon']
|
||||
[
|
||||
'class' => 'invert filter main_menu_icon',
|
||||
'title' => __('Disable'),
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('disable_alert', 1, true);
|
||||
}
|
||||
@ -940,7 +946,10 @@ foreach ($simple_alerts as $alert) {
|
||||
1,
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
[
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'title' => __('Standby off'),
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
|
||||
} else {
|
||||
@ -950,7 +959,10 @@ foreach ($simple_alerts as $alert) {
|
||||
1,
|
||||
'padding:0px; width: 22px; height: 22px;',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
[
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'title' => __('Standby on'),
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
|
||||
}
|
||||
@ -1139,8 +1151,7 @@ if (! $id_agente) {
|
||||
return false;
|
||||
});
|
||||
|
||||
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>")
|
||||
.hover (function () {
|
||||
$("input[name=disable]").hover (function () {
|
||||
$(this).attr ("src",
|
||||
<?php
|
||||
echo '"'.html_print_image(
|
||||
@ -1166,8 +1177,7 @@ if (! $id_agente) {
|
||||
}
|
||||
);
|
||||
|
||||
$("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>")
|
||||
.hover (function () {
|
||||
$("input[name=enable]").hover (function () {
|
||||
$(this).attr ("src",
|
||||
<?php
|
||||
echo '"'.html_print_image(
|
||||
@ -1193,8 +1203,7 @@ if (! $id_agente) {
|
||||
}
|
||||
);
|
||||
|
||||
$("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>")
|
||||
.hover (function () {
|
||||
$("input[name=standby_on]").hover (function () {
|
||||
$(this).attr ("src",
|
||||
<?php
|
||||
echo '"'.html_print_image(
|
||||
@ -1220,8 +1229,7 @@ if (! $id_agente) {
|
||||
}
|
||||
);
|
||||
|
||||
$("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>")
|
||||
.hover (function () {
|
||||
$("input[name=standby_off]").hover (function () {
|
||||
$(this).attr ("src",
|
||||
<?php
|
||||
echo '"'.html_print_image(
|
||||
|
@ -99,6 +99,19 @@ if ($update_alert) {
|
||||
}
|
||||
|
||||
if ($create_alert) {
|
||||
if (is_metaconsole()) {
|
||||
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$server_name = explode(' ', io_safe_output(get_parameter('id_agent')))[0];
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) !== NOERR) {
|
||||
echo json_encode(false);
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$id_alert_template = (int) get_parameter('template');
|
||||
$id_agent_module = (int) get_parameter('id_agent_module');
|
||||
|
||||
@ -203,9 +216,28 @@ if ($create_alert) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete_alert) {
|
||||
if (is_metaconsole()) {
|
||||
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$server_name = explode(' ', io_safe_output(get_parameter('id_agent')))[0];
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) !== NOERR) {
|
||||
echo json_encode(false);
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$id_alert_agent_module = (int) get_parameter('id_alert');
|
||||
|
||||
$temp = db_get_row('talert_template_modules', 'id', $id_alert_agent_module);
|
||||
@ -241,9 +273,27 @@ if ($delete_alert) {
|
||||
'',
|
||||
true
|
||||
);
|
||||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($add_action) {
|
||||
if (is_metaconsole()) {
|
||||
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$server_name = explode(' ', io_safe_output(get_parameter('id_agent')))[0];
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) !== NOERR) {
|
||||
echo json_encode(false);
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$id_action = (int) get_parameter('action_select');
|
||||
$id_alert_module = (int) get_parameter('id_alert_module');
|
||||
$fires_min = (int) get_parameter('fires_min');
|
||||
@ -280,9 +330,28 @@ if ($add_action) {
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($update_action) {
|
||||
if (is_metaconsole()) {
|
||||
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$server_name = explode(' ', io_safe_output(get_parameter('id_agent')))[0];
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) !== NOERR) {
|
||||
echo json_encode(false);
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$alert_id = (int) get_parameter('alert_id');
|
||||
$id_action = (int) get_parameter('action_select_ajax-'.$alert_id);
|
||||
$id_module_action = (int) get_parameter('id_module_action_ajax');
|
||||
@ -321,9 +390,28 @@ if ($update_action) {
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete_action) {
|
||||
if (is_metaconsole()) {
|
||||
if (enterprise_include_once('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
|
||||
$server_name = explode(' ', io_safe_output(get_parameter('id_agent')))[0];
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
if (metaconsole_load_external_db($connection) !== NOERR) {
|
||||
echo json_encode(false);
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$id_action = (int) get_parameter('id_action');
|
||||
$id_alert = (int) get_parameter('id_alert');
|
||||
|
||||
@ -348,6 +436,12 @@ if ($delete_action) {
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($enable_alert) {
|
||||
|
@ -262,7 +262,7 @@ $data[1] = '';
|
||||
$table_conditions->data[] = $data;
|
||||
|
||||
$data[0] = __('Use special days list');
|
||||
$data[1] = (isset($alert['special_day']) && $alert['special_day'] == 1) ? __('Yes') : __('No');
|
||||
$data[1] = (isset($template['special_day']) && (int) $template['special_day'] !== 0) ? __('Yes') : __('No');
|
||||
$table_conditions->data[] = $data;
|
||||
|
||||
$data[0] = __('Time threshold');
|
||||
@ -318,61 +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 (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);
|
||||
}
|
||||
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->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->data[$kaction][$k] = 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
|
||||
);
|
||||
} 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][1] = 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);
|
||||
@ -680,6 +678,23 @@ ui_require_javascript_file('pandora_fullcalendar');
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$('li#icon_oper-agents').addClass('selected');
|
||||
$('ul#subicon_oper-agents').show();
|
||||
$('#title_menu').children().last().removeClass('arrow_menu_down');
|
||||
$('#title_menu').children().last().addClass('arrow_menu_up');
|
||||
$('#title_menu').children().first().next().addClass('span_selected');
|
||||
$('li#Views').show();
|
||||
$('li#Views').children().first().children().last().removeClass('arrow_menu_down');
|
||||
$('li#Views').children().first().children().last().addClass('arrow_menu_up');
|
||||
$('li#Views').children().first().children().first().addClass('span_selected');
|
||||
$('li#Views').addClass('submenu_selected');
|
||||
$('li#Views').removeClass('submenu_not_selected');
|
||||
$('ul#subViews').show();
|
||||
var parent = $('div[title="Alert details"]').parent().parent();
|
||||
parent.addClass('selected');
|
||||
$('.sub_subMenu.selected').prepend(`<div class="element_submenu_selected left_3"></div>`);
|
||||
|
||||
|
||||
var calendarEl = document.getElementById('calendar_map');
|
||||
if(calendarEl){
|
||||
var eventsBBDD = $("#hidden-schedule").val();
|
||||
|
@ -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) {
|
||||
|
@ -184,7 +184,7 @@ if (empty($result) === false) {
|
||||
]
|
||||
).'</a> ';
|
||||
$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'),
|
||||
|
@ -287,7 +287,7 @@ foreach ($extensions as $file => $extension) {
|
||||
[
|
||||
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file,
|
||||
'image' => 'images/lightbulb_off.png',
|
||||
'title' => __('Delete'),
|
||||
'title' => __('Enable'),
|
||||
],
|
||||
true
|
||||
);
|
||||
@ -305,7 +305,7 @@ foreach ($extensions as $file => $extension) {
|
||||
[
|
||||
'href' => 'index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&disabled='.$file,
|
||||
'image' => 'images/lightbulb.png',
|
||||
'title' => __('Delete'),
|
||||
'title' => __('Disable'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -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,
|
||||
|
@ -103,6 +103,7 @@ if ($create_profiles) {
|
||||
$groups_id = get_parameter('groups_id', -1);
|
||||
$users_id = get_parameter('users_id', -1);
|
||||
$n_added = 0;
|
||||
$msg_error = __('Profiles cannot be added');
|
||||
|
||||
if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) {
|
||||
$result = false;
|
||||
@ -155,6 +156,8 @@ if ($create_profiles) {
|
||||
if ($return !== false) {
|
||||
$n_added++;
|
||||
}
|
||||
} else {
|
||||
$msg_error = __('The profile already exist on the user');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -182,7 +185,7 @@ if ($create_profiles) {
|
||||
ui_print_result_message(
|
||||
$n_added > 0,
|
||||
__('Profiles added successfully').'('.$n_added.')',
|
||||
__('Profiles cannot be added')
|
||||
$msg_error
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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>';
|
||||
|
@ -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>';
|
||||
|
@ -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', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -67,8 +67,27 @@ if (is_ajax()) {
|
||||
if ($get_users) {
|
||||
$id_group = get_parameter('id_group');
|
||||
$id_profile = get_parameter('id_profile');
|
||||
$get_all_groups = get_parameter('get_all_groups', '0');
|
||||
|
||||
if ($get_all_groups !== '0') {
|
||||
$profile_data = db_get_all_rows_sql(
|
||||
'SELECT *
|
||||
FROM tusuario_perfil
|
||||
WHERE `id_perfil` = "'.$id_profile[0].'"
|
||||
GROUP BY id_usuario'
|
||||
);
|
||||
} else {
|
||||
if (strlen($id_profile[0]) > 0 && strlen($id_group[0]) > 0) {
|
||||
$profile_data = db_get_all_rows_filter(
|
||||
'tusuario_perfil',
|
||||
[
|
||||
'id_perfil' => $id_profile[0],
|
||||
'id_grupo' => $id_group[0],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$profile_data = db_get_all_rows_filter('tusuario_perfil', ['id_perfil' => $id_profile[0], 'id_grupo' => $id_group[0]]);
|
||||
if (!users_is_admin()) {
|
||||
foreach ($profile_data as $user => $values) {
|
||||
if (users_is_admin($values['id_usuario'])) {
|
||||
@ -243,6 +262,21 @@ $data[2] .= html_print_select(
|
||||
);
|
||||
|
||||
array_push($table->data, $data);
|
||||
$table->data[1][0] = '';
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Show all groups'),
|
||||
html_print_checkbox_switch(
|
||||
'get_all_groups',
|
||||
1,
|
||||
$get_all_groups,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
' float-right'
|
||||
),
|
||||
['div_class' => 'center_align']
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
@ -273,7 +307,8 @@ $(document).ready (function () {
|
||||
{"page" : "godmode/massive/massive_delete_profiles",
|
||||
"get_users" : 1,
|
||||
"id_group[]" : $("#groups_id").val(),
|
||||
"id_profile[]" : $("#profiles_id").val()
|
||||
"id_profile[]" : $("#profiles_id").val(),
|
||||
"get_all_groups" : $('#checkbox-get_all_groups').is(':checked') ? 1 : 0
|
||||
},
|
||||
function (data, status) {
|
||||
options = "";
|
||||
@ -295,6 +330,10 @@ $(document).ready (function () {
|
||||
$("#profiles_id").change (function () {
|
||||
update_users();
|
||||
});
|
||||
|
||||
$("#checkbox-get_all_groups").change (function () {
|
||||
update_users();
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)');
|
||||
}
|
||||
|
||||
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 (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)');
|
||||
}
|
||||
|
||||
|
||||
$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
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ if (!$id && !isset($snmp_community)) {
|
||||
}
|
||||
|
||||
$snmp_versions['1'] = 'v. 1';
|
||||
$snmp_versions['2'] = 'v. 2';
|
||||
$snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
|
||||
|
@ -261,8 +261,8 @@ $table->data['first_line'][] = html_print_label_input_block(
|
||||
'assign_group',
|
||||
$assign_group,
|
||||
'',
|
||||
'',
|
||||
-1,
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
|
@ -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>';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user