mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'develop' into 'ent-10307-14480-anadir-informacion-del-usuario-al-poner-un-evento-in-process'
# Conflicts: # pandora_console/include/functions_events.php
This commit is contained in:
commit
2980e180d8
322
extras/deploy-scripts/deploy_ext_database_el8.sh
Normal file
322
extras/deploy-scripts/deploy_ext_database_el8.sh
Normal file
@ -0,0 +1,322 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#######################################################
|
||||||
|
# PandoraFMS Community online installation script
|
||||||
|
#######################################################
|
||||||
|
## Tested versions ##
|
||||||
|
# Centos 8.4, 8.5
|
||||||
|
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||||
|
# Almalinuz 8.4, 8.5
|
||||||
|
# RedHat 8.5
|
||||||
|
|
||||||
|
#Constants
|
||||||
|
S_VERSION='202302201'
|
||||||
|
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
|
||||||
|
|
||||||
|
|
||||||
|
# define default variables
|
||||||
|
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||||
|
[ "$MYVER" ] || MYVER=57
|
||||||
|
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||||
|
[ "$DBNAME" ] || DBNAME=pandora
|
||||||
|
[ "$DBUSER" ] || DBUSER=pandora
|
||||||
|
[ "$DBPASS" ] || DBPASS=pandora
|
||||||
|
[ "$DBPORT" ] || DBPORT=3306
|
||||||
|
[ "$DBROOTUSER" ] || DBROOTUSER=root
|
||||||
|
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
|
||||||
|
[ "$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")
|
||||||
|
|
||||||
|
# Ansi color code variables
|
||||||
|
red="\e[0;91m"
|
||||||
|
green="\e[0;92m"
|
||||||
|
cyan="\e[0;36m"
|
||||||
|
reset="\e[0m"
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
execute_cmd () {
|
||||||
|
local cmd="$1"
|
||||||
|
local msg="$2"
|
||||||
|
|
||||||
|
echo -e "${cyan}$msg...${reset}"
|
||||||
|
$cmd &>> "$LOGFILE"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
[ "$3" ] && echo "$3"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
rm -rf "$HOME"/pandora_deploy_tmp &>> "$LOGFILE"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "\e[1A\e ${cyan}$msg...${reset} ${green}OK${reset}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_cmd_status () {
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
[ "$1" ] && echo "$1"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${green}OK${reset}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_root_permissions () {
|
||||||
|
echo -en "${cyan}Checking root account... ${reset}"
|
||||||
|
if [ "$(whoami)" != "root" ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
echo "Please use a root account or sudo for installing Pandora FMS"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "${green}OK${reset}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Main
|
||||||
|
echo "Starting PandoraFMS External DB deployment EL8 ver. $S_VERSION"
|
||||||
|
|
||||||
|
# Centos Version
|
||||||
|
if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then
|
||||||
|
printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with RHEL/Almalinux/Centos/Rockylinux systems only${reset}\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo -en "${cyan}Check Centos Version...${reset}"
|
||||||
|
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ]
|
||||||
|
check_cmd_status 'Error OS version, RHEL/Almalinux/Centos/Rockylinux 8+ is expected'
|
||||||
|
|
||||||
|
#Detect OS
|
||||||
|
os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
|
||||||
|
execute_cmd "echo $os_name" "OS detected: ${os_name}"
|
||||||
|
|
||||||
|
# initialice logfile
|
||||||
|
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||||
|
echo "Community installer version: $S_VERSION" >> "$LOGFILE"
|
||||||
|
|
||||||
|
# Pre checks
|
||||||
|
# Root permisions
|
||||||
|
check_root_permissions
|
||||||
|
|
||||||
|
# Systemd
|
||||||
|
execute_cmd "systemctl status" "Checking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env please check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8'
|
||||||
|
|
||||||
|
# Check memomry greather or equal to 2G
|
||||||
|
execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)'
|
||||||
|
|
||||||
|
# Check disk size at least 10 Gb free space
|
||||||
|
execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)'
|
||||||
|
|
||||||
|
# Setting timezone
|
||||||
|
rm -rf /etc/localtime &>> "$LOGFILE"
|
||||||
|
execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ"
|
||||||
|
|
||||||
|
# Execute tools check
|
||||||
|
execute_cmd "awk --version" 'Checking needed tools: awk'
|
||||||
|
execute_cmd "grep --version" 'Checking needed tools: grep'
|
||||||
|
execute_cmd "sed --version" 'Checking needed tools: sed'
|
||||||
|
execute_cmd "dnf --version" 'Checking needed tools: dnf'
|
||||||
|
|
||||||
|
# Creating working directory
|
||||||
|
rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE"
|
||||||
|
mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE"
|
||||||
|
execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp"
|
||||||
|
|
||||||
|
## Extra steps on redhat envs
|
||||||
|
if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then
|
||||||
|
## In case REDHAT
|
||||||
|
# Check susbscription manager status:
|
||||||
|
echo -en "${cyan}Checking Red Hat Enterprise subscription... ${reset}"
|
||||||
|
subscription-manager list &>> "$LOGFILE"
|
||||||
|
subscription-manager status &>> "$LOGFILE"
|
||||||
|
check_cmd_status 'Error checking subscription status, make sure your server is activated and suscribed to Red Hat Enterprise repositories'
|
||||||
|
|
||||||
|
# Ckeck repolist
|
||||||
|
dnf repolist &>> "$LOGFILE"
|
||||||
|
echo -en "${cyan}Checking Red Hat Enterprise repolist... ${reset}"
|
||||||
|
dnf repolist | grep 'rhel-8-for-x86_64-baseos-rpms' &>> "$LOGFILE"
|
||||||
|
check_cmd_status 'Error checking repositories status, could try a subscription-manager attach command or contact sysadmin'
|
||||||
|
|
||||||
|
#install extra repos
|
||||||
|
extra_repos=" \
|
||||||
|
tar \
|
||||||
|
dnf-utils \
|
||||||
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
|
||||||
|
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
|
||||||
|
|
||||||
|
execute_cmd "dnf install -y $extra_repos" "Installing extra repositories"
|
||||||
|
execute_cmd "subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms" "Enabling subscription to codeready-builder"
|
||||||
|
else
|
||||||
|
# For alma/rocky/centos
|
||||||
|
extra_repos=" \
|
||||||
|
tar \
|
||||||
|
dnf-utils \
|
||||||
|
epel-release \
|
||||||
|
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
|
||||||
|
|
||||||
|
execute_cmd "dnf install -y $extra_repos" "Installing extra repositories"
|
||||||
|
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#Installing wget
|
||||||
|
execute_cmd "dnf install -y wget" "Installing wget"
|
||||||
|
|
||||||
|
|
||||||
|
# Install percona Database
|
||||||
|
execute_cmd "dnf module disable -y mysql" "Disabiling mysql module"
|
||||||
|
|
||||||
|
if [ "$MYVER" -eq '80' ] ; then
|
||||||
|
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
|
||||||
|
execute_cmd "dnf install -y percona-server-server percona-xtrabackup-24" "Installing Percona Server 80"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$MYVER" -ne '80' ] ; then
|
||||||
|
execute_cmd "dnf install -y Percona-Server-server-57 percona-xtrabackup-24" "Installing Percona Server 57"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Disabling SELINUX and firewalld
|
||||||
|
setenforce 0 &>> "$LOGFILE"
|
||||||
|
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE"
|
||||||
|
systemctl disable firewalld --now &>> "$LOGFILE"
|
||||||
|
|
||||||
|
# Adding standar cnf for initial setup.
|
||||||
|
cat > /etc/my.cnf << EO_CONFIG_TMP
|
||||||
|
[mysqld]
|
||||||
|
datadir=/var/lib/mysql
|
||||||
|
socket=/var/lib/mysql/mysql.sock
|
||||||
|
symbolic-links=0
|
||||||
|
log-error=/var/log/mysqld.log
|
||||||
|
pid-file=/var/run/mysqld/mysqld.pid
|
||||||
|
EO_CONFIG_TMP
|
||||||
|
|
||||||
|
#Configuring Database
|
||||||
|
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||||
|
execute_cmd "systemctl start mysqld" "Starting database engine"
|
||||||
|
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
|
||||||
|
|
||||||
|
export MYSQL_PWD=$DBROOTPASS
|
||||||
|
echo -en "${cyan}Creating Pandora FMS database...${reset}"
|
||||||
|
echo "create database $DBNAME" | mysql -u$DBROOTUSER -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."
|
||||||
|
|
||||||
|
echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
|
||||||
|
echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
|
||||||
|
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
|
||||||
|
|
||||||
|
#Generating my.cnf
|
||||||
|
cat > /etc/my.cnf << EO_CONFIG_F
|
||||||
|
[mysqld]
|
||||||
|
datadir=/var/lib/mysql
|
||||||
|
socket=/var/lib/mysql/mysql.sock
|
||||||
|
user=mysql
|
||||||
|
character-set-server=utf8
|
||||||
|
skip-character-set-client-handshake
|
||||||
|
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||||
|
symbolic-links=0
|
||||||
|
# Mysql optimizations for Pandora FMS
|
||||||
|
# Please check the documentation in http://pandorafms.com for better results
|
||||||
|
|
||||||
|
max_allowed_packet = 64M
|
||||||
|
innodb_buffer_pool_size = $POOL_SIZE
|
||||||
|
innodb_lock_wait_timeout = 90
|
||||||
|
innodb_file_per_table
|
||||||
|
innodb_flush_log_at_trx_commit = 0
|
||||||
|
innodb_flush_method = O_DIRECT
|
||||||
|
innodb_log_file_size = 64M
|
||||||
|
innodb_log_buffer_size = 16M
|
||||||
|
innodb_io_capacity = 100
|
||||||
|
thread_cache_size = 8
|
||||||
|
thread_stack = 256K
|
||||||
|
max_connections = 100
|
||||||
|
|
||||||
|
key_buffer_size=4M
|
||||||
|
read_buffer_size=128K
|
||||||
|
read_rnd_buffer_size=128K
|
||||||
|
sort_buffer_size=128K
|
||||||
|
join_buffer_size=4M
|
||||||
|
|
||||||
|
query_cache_type = 1
|
||||||
|
query_cache_size = 64M
|
||||||
|
query_cache_min_res_unit = 2k
|
||||||
|
query_cache_limit = 256K
|
||||||
|
|
||||||
|
#skip-log-bin
|
||||||
|
|
||||||
|
sql_mode=""
|
||||||
|
|
||||||
|
[mysqld_safe]
|
||||||
|
log-error=/var/log/mysqld.log
|
||||||
|
pid-file=/var/run/mysqld/mysqld.pid
|
||||||
|
|
||||||
|
EO_CONFIG_F
|
||||||
|
|
||||||
|
if [ "$MYVER" -eq '80' ] ; then
|
||||||
|
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||||
|
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
||||||
|
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||||
|
execute_cmd "systemctl enable mysqld --now" "Enabling Database service"
|
||||||
|
fi
|
||||||
|
export MYSQL_PWD=$DBPASS
|
||||||
|
|
||||||
|
|
||||||
|
# Kernel optimization
|
||||||
|
|
||||||
|
if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then
|
||||||
|
cat >> /etc/sysctl.conf <<EO_KO
|
||||||
|
# Pandora FMS Optimization
|
||||||
|
|
||||||
|
# default=5
|
||||||
|
net.ipv4.tcp_syn_retries = 3
|
||||||
|
|
||||||
|
# default=5
|
||||||
|
net.ipv4.tcp_synack_retries = 3
|
||||||
|
|
||||||
|
# default=1024
|
||||||
|
net.ipv4.tcp_max_syn_backlog = 65536
|
||||||
|
|
||||||
|
# default=124928
|
||||||
|
net.core.wmem_max = 8388608
|
||||||
|
|
||||||
|
# default=131071
|
||||||
|
net.core.rmem_max = 8388608
|
||||||
|
|
||||||
|
# default = 128
|
||||||
|
net.core.somaxconn = 1024
|
||||||
|
|
||||||
|
# default = 20480
|
||||||
|
net.core.optmem_max = 81920
|
||||||
|
|
||||||
|
EO_KO
|
||||||
|
|
||||||
|
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization"
|
||||||
|
fi
|
||||||
|
|
||||||
|
execute_cmd "echo done" "Percona server installed"
|
||||||
|
cd
|
||||||
|
execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files"
|
258
extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh
Normal file
258
extras/deploy-scripts/deploy_ext_database_ubuntu_2204.sh
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
##############################################################################################################
|
||||||
|
# PandoraFMS Community online installation script for Ubuntu 22.04
|
||||||
|
##############################################################################################################
|
||||||
|
## Tested versions ##
|
||||||
|
# Ubuntu 22.04.1
|
||||||
|
# Ubuntu 22.04.2
|
||||||
|
|
||||||
|
#avoid promps
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
export NEEDRESTART_SUSPEND=1
|
||||||
|
|
||||||
|
#Constants
|
||||||
|
PANDORA_CONSOLE=/var/www/html/pandora_console
|
||||||
|
PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
||||||
|
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||||
|
WORKDIR=/opt/pandora/deploy
|
||||||
|
|
||||||
|
|
||||||
|
S_VERSION='202302201'
|
||||||
|
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
|
||||||
|
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||||
|
|
||||||
|
# define default variables
|
||||||
|
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||||
|
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||||
|
[ "$DBNAME" ] || DBNAME=pandora
|
||||||
|
[ "$DBUSER" ] || DBUSER=pandora
|
||||||
|
[ "$DBPASS" ] || DBPASS=pandora
|
||||||
|
[ "$DBPORT" ] || DBPORT=3306
|
||||||
|
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
|
||||||
|
[ "$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")
|
||||||
|
|
||||||
|
|
||||||
|
# Ansi color code variables
|
||||||
|
red="\e[0;91m"
|
||||||
|
green="\e[0;92m"
|
||||||
|
cyan="\e[0;36m"
|
||||||
|
reset="\e[0m"
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
|
||||||
|
execute_cmd () {
|
||||||
|
local cmd="$1"
|
||||||
|
local msg="$2"
|
||||||
|
|
||||||
|
echo -e "${cyan}$msg...${reset}"
|
||||||
|
$cmd &>> "$LOGFILE"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
[ "$3" ] && echo "$3"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
rm -rf "$WORKDIR" &>> "$LOGFILE"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "\e[1A\e ${cyan}$msg...${reset} ${green}OK${reset}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_cmd_status () {
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
[ "$1" ] && echo "$1"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
rm -rf "$WORKDIR" &>> "$LOGFILE"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${green}OK${reset}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_root_permissions () {
|
||||||
|
echo -en "${cyan}Checking root account... ${reset}"
|
||||||
|
if [ "$(whoami)" != "root" ]; then
|
||||||
|
echo -e "${red}Fail${reset}"
|
||||||
|
echo "Please use a root account or sudo for installing Pandora FMS"
|
||||||
|
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
else
|
||||||
|
echo -e "${green}OK${reset}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## Main
|
||||||
|
echo "Starting PandoraFMS External DB deployment Ubuntu 22.04 ver. $S_VERSION"
|
||||||
|
|
||||||
|
# Ubuntu Version
|
||||||
|
if [ ! "$(grep -Ei 'Ubuntu' /etc/lsb-release)" ]; then
|
||||||
|
printf "\n ${red}Error this is not a Ubuntu system, this installer is compatible with Ubuntu systems only${reset}\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo -en "${cyan}Check Ubuntu Version...${reset}"
|
||||||
|
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9][0-9].[0-9][0-9])"$/\1/p' /etc/os-release) == "22.04" ]
|
||||||
|
check_cmd_status 'Error OS version, Ubuntu 22.04 is expected'
|
||||||
|
|
||||||
|
#Detect OS
|
||||||
|
os_name=$(grep ^PRETTY_NAME= /etc/os-release | cut -d '=' -f2 | tr -d '"')
|
||||||
|
execute_cmd "echo $os_name" "OS detected: ${os_name}"
|
||||||
|
|
||||||
|
# initialice logfile
|
||||||
|
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||||
|
echo "Community installer version: $S_VERSION" >> "$LOGFILE"
|
||||||
|
|
||||||
|
# Pre checks
|
||||||
|
# Root permisions
|
||||||
|
check_root_permissions
|
||||||
|
|
||||||
|
#Install awk, sed, grep if not present
|
||||||
|
execute_cmd "apt install -y gawk sed grep" 'Installing needed tools'
|
||||||
|
|
||||||
|
# Systemd
|
||||||
|
execute_cmd "systemctl --version" "Checking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env please check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8'
|
||||||
|
|
||||||
|
# Check memomry greather or equal to 2G
|
||||||
|
execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)'
|
||||||
|
|
||||||
|
# Check disk size at least 10 Gb free space
|
||||||
|
execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)'
|
||||||
|
|
||||||
|
# Setting timezone
|
||||||
|
rm -rf /etc/localtime &>> "$LOGFILE"
|
||||||
|
execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ"
|
||||||
|
|
||||||
|
# Execute tools check
|
||||||
|
execute_cmd "awk --version" 'Checking needed tools: awk'
|
||||||
|
execute_cmd "grep --version" 'Checking needed tools: grep'
|
||||||
|
execute_cmd "sed --version" 'Checking needed tools: sed'
|
||||||
|
execute_cmd "apt --version" 'Checking needed tools: apt'
|
||||||
|
|
||||||
|
# Creating working directory
|
||||||
|
rm -rf "$WORKDIR" &>> "$LOGFILE"
|
||||||
|
mkdir -p "$WORKDIR" &>> "$LOGFILE"
|
||||||
|
execute_cmd "cd $WORKDIR" "Moving to workdir: $WORKDIR"
|
||||||
|
|
||||||
|
## Install utils
|
||||||
|
execute_cmd "apt update" "Updating repos"
|
||||||
|
execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https" "Installing utils"
|
||||||
|
|
||||||
|
# Disabling apparmor and ufw
|
||||||
|
systemctl stop ufw.service &>> "$LOGFILE"
|
||||||
|
systemctl disable ufw &>> "$LOGFILE"
|
||||||
|
systemctl stop apparmor &>> "$LOGFILE"
|
||||||
|
systemctl disable apparmor &>> "$LOGFILE"
|
||||||
|
|
||||||
|
#install mysql
|
||||||
|
execute_cmd "curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb" "Downloading Percona repository for MySQL8"
|
||||||
|
execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_all.deb" "Installing Percona repository for MySQL8"
|
||||||
|
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
|
||||||
|
|
||||||
|
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
|
||||||
|
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
|
||||||
|
check_cmd_status "Error Installing MySql Server"
|
||||||
|
|
||||||
|
#Configuring Database
|
||||||
|
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||||
|
execute_cmd "systemctl start mysql" "Starting database engine"
|
||||||
|
|
||||||
|
echo """
|
||||||
|
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DBROOTPASS';
|
||||||
|
""" | mysql -uroot &>> "$LOGFILE"
|
||||||
|
|
||||||
|
export MYSQL_PWD=$DBROOTPASS
|
||||||
|
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."
|
||||||
|
|
||||||
|
echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||||
|
echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||||
|
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -uroot -P$DBPORT -h$DBHOST
|
||||||
|
fi
|
||||||
|
export MYSQL_PWD=$DBPASS
|
||||||
|
|
||||||
|
#Generating my.cnf
|
||||||
|
cat > /etc/mysql/my.cnf << EOF_DB
|
||||||
|
[mysqld]
|
||||||
|
datadir=/var/lib/mysql
|
||||||
|
user=mysql
|
||||||
|
character-set-server=utf8mb4
|
||||||
|
skip-character-set-client-handshake
|
||||||
|
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||||
|
symbolic-links=0
|
||||||
|
# Mysql optimizations for Pandora FMS
|
||||||
|
# Please check the documentation in http://pandorafms.com for better results
|
||||||
|
|
||||||
|
max_allowed_packet = 64M
|
||||||
|
innodb_buffer_pool_size = $POOL_SIZE
|
||||||
|
innodb_lock_wait_timeout = 90
|
||||||
|
innodb_file_per_table
|
||||||
|
innodb_flush_log_at_trx_commit = 0
|
||||||
|
innodb_flush_method = O_DIRECT
|
||||||
|
innodb_log_file_size = 64M
|
||||||
|
innodb_log_buffer_size = 16M
|
||||||
|
innodb_io_capacity = 300
|
||||||
|
thread_cache_size = 8
|
||||||
|
thread_stack = 256K
|
||||||
|
max_connections = 100
|
||||||
|
|
||||||
|
key_buffer_size=4M
|
||||||
|
read_buffer_size=128K
|
||||||
|
read_rnd_buffer_size=128K
|
||||||
|
sort_buffer_size=128K
|
||||||
|
join_buffer_size=4M
|
||||||
|
|
||||||
|
skip-log-bin
|
||||||
|
|
||||||
|
sql_mode=""
|
||||||
|
|
||||||
|
log-error=/var/log/mysql/error.log
|
||||||
|
[mysqld_safe]
|
||||||
|
log-error=/var/log/mysqld.log
|
||||||
|
pid-file=/var/run/mysqld/mysqld.pid
|
||||||
|
|
||||||
|
EOF_DB
|
||||||
|
|
||||||
|
execute_cmd "systemctl restart mysql" "Configuring and restarting database engine"
|
||||||
|
|
||||||
|
# Kernel optimization
|
||||||
|
if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then
|
||||||
|
cat >> /etc/sysctl.conf <<EO_KO
|
||||||
|
# Pandora FMS Optimization
|
||||||
|
|
||||||
|
# default=5
|
||||||
|
net.ipv4.tcp_syn_retries = 3
|
||||||
|
|
||||||
|
# default=5
|
||||||
|
net.ipv4.tcp_synack_retries = 3
|
||||||
|
|
||||||
|
# default=1024
|
||||||
|
net.ipv4.tcp_max_syn_backlog = 65536
|
||||||
|
|
||||||
|
# default=124928
|
||||||
|
net.core.wmem_max = 8388608
|
||||||
|
|
||||||
|
# default=131071
|
||||||
|
net.core.rmem_max = 8388608
|
||||||
|
|
||||||
|
# default = 128
|
||||||
|
net.core.somaxconn = 1024
|
||||||
|
|
||||||
|
# default = 20480
|
||||||
|
net.core.optmem_max = 81920
|
||||||
|
|
||||||
|
EO_KO
|
||||||
|
|
||||||
|
[ -d /dev/lxd/ ] || execute_cmd "sysctl --system" "Applying Kernel optimization"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove temporary files
|
||||||
|
execute_cmd "echo done" "Percona server installed"
|
||||||
|
cd "$HOME"
|
||||||
|
execute_cmd "rm -rf $WORKDIR" "Removing temporary files"
|
@ -431,7 +431,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
|
|||||||
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
|
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
|
||||||
|
|
||||||
# Copy gotty utility
|
# Copy gotty utility
|
||||||
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||||
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
||||||
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
||||||
|
|
||||||
@ -639,8 +639,8 @@ systemctl enable tentacle_serverd &>> $LOGFILE
|
|||||||
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
||||||
|
|
||||||
# Enabling condole cron
|
# Enabling condole cron
|
||||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||||
echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||||
## Enabling agent
|
## Enabling agent
|
||||||
systemctl enable pandora_agent_daemon &>> $LOGFILE
|
systemctl enable pandora_agent_daemon &>> $LOGFILE
|
||||||
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
## Tested versions ##
|
## Tested versions ##
|
||||||
# Centos 8.4, 8.5
|
# Centos 8.4, 8.5
|
||||||
# Rocky 8.4, 8.5, 8.6, 8.7
|
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||||
# Almalinuz 8.4, 8.5
|
# Almalinux 8.4, 8.5
|
||||||
# RedHat 8.5
|
# RedHat 8.5
|
||||||
|
|
||||||
#Constants
|
#Constants
|
||||||
@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||||||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||||
|
|
||||||
|
|
||||||
S_VERSION='202301251'
|
S_VERSION='202302201'
|
||||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||||
|
|
||||||
# define default variables
|
# define default variables
|
||||||
@ -107,6 +107,17 @@ check_root_permissions () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
installing_docker () {
|
||||||
|
#Installing docker for debug
|
||||||
|
echo "Start installig docker" &>> "$LOGFILE"
|
||||||
|
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &>> "$LOGFILE"
|
||||||
|
dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
|
||||||
|
systemctl disable --now docker &>> "$LOGFILE"
|
||||||
|
systemctl disable docker.socket --now &>> "$LOGFILE"
|
||||||
|
echo "End installig docker" &>> "$LOGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
|
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
|
||||||
|
|
||||||
@ -207,6 +218,7 @@ else
|
|||||||
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
|
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
execute_cmd "installing_docker" "Installing Docker for debug"
|
||||||
|
|
||||||
#Installing wget
|
#Installing wget
|
||||||
execute_cmd "dnf install -y wget" "Installing wget"
|
execute_cmd "dnf install -y wget" "Installing wget"
|
||||||
@ -454,7 +466,7 @@ innodb_flush_log_at_trx_commit = 0
|
|||||||
innodb_flush_method = O_DIRECT
|
innodb_flush_method = O_DIRECT
|
||||||
innodb_log_file_size = 64M
|
innodb_log_file_size = 64M
|
||||||
innodb_log_buffer_size = 16M
|
innodb_log_buffer_size = 16M
|
||||||
innodb_io_capacity = 100
|
innodb_io_capacity = 300
|
||||||
thread_cache_size = 8
|
thread_cache_size = 8
|
||||||
thread_stack = 256K
|
thread_stack = 256K
|
||||||
max_connections = 100
|
max_connections = 100
|
||||||
@ -483,6 +495,7 @@ EO_CONFIG_F
|
|||||||
if [ "$MYVER" -eq '80' ] ; then
|
if [ "$MYVER" -eq '80' ] ; then
|
||||||
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||||
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
||||||
|
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||||
@ -517,7 +530,7 @@ execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDOR
|
|||||||
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
|
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
|
||||||
|
|
||||||
# Copy gotty utility
|
# Copy gotty utility
|
||||||
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||||
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
||||||
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
||||||
|
|
||||||
@ -732,8 +745,8 @@ systemctl enable tentacle_serverd &>> "$LOGFILE"
|
|||||||
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
||||||
|
|
||||||
# Enabling condole cron
|
# Enabling condole cron
|
||||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||||
echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||||
## Enabling agent
|
## Enabling agent
|
||||||
systemctl enable pandora_agent_daemon &>> "$LOGFILE"
|
systemctl enable pandora_agent_daemon &>> "$LOGFILE"
|
||||||
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
||||||
@ -743,7 +756,7 @@ execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
|||||||
|
|
||||||
cat > /etc/issue.net << EOF_banner
|
cat > /etc/issue.net << EOF_banner
|
||||||
|
|
||||||
Welcome to Pandora FMS appliance on CentOS
|
Welcome to Pandora FMS appliance on RHEL/Rocky Linux 8
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
Go to Public http://$ipplublic/pandora_console$to to login web console
|
Go to Public http://$ipplublic/pandora_console$to to login web console
|
||||||
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
|
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
##############################################################################################################
|
##############################################################################################################
|
||||||
## Tested versions ##
|
## Tested versions ##
|
||||||
# Ubuntu 22.04.1
|
# Ubuntu 22.04.1
|
||||||
|
# Ubuntu 22.04.2
|
||||||
|
|
||||||
#avoid promps
|
#avoid promps
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||||||
WORKDIR=/opt/pandora/deploy
|
WORKDIR=/opt/pandora/deploy
|
||||||
|
|
||||||
|
|
||||||
S_VERSION='202301251'
|
S_VERSION='202302201'
|
||||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||||
|
|
||||||
@ -106,6 +107,21 @@ check_root_permissions () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
installing_docker () {
|
||||||
|
#Installing docker for debug
|
||||||
|
echo "Start installig docker" &>> "$LOGFILE"
|
||||||
|
mkdir -m 0755 -p /etc/apt/keyrings &>> "$LOGFILE"
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --yes --dearmor -o /etc/apt/keyrings/docker.gpg &>> "$LOGFILE"
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list &>> "$LOGFILE"
|
||||||
|
apt update -y &>> "$LOGFILE"
|
||||||
|
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin &>> "$LOGFILE"
|
||||||
|
systemctl disable docker --now &>> "$LOGFILE"
|
||||||
|
systemctl disable docker.socket --now &>> "$LOGFILE"
|
||||||
|
echo "End installig docker" &>> "$LOGFILE"
|
||||||
|
}
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION"
|
echo "Starting PandoraFMS Community deployment Ubuntu 22.04 ver. $S_VERSION"
|
||||||
|
|
||||||
@ -173,7 +189,7 @@ execute_cmd "cd $WORKDIR" "Moving to workdir: $WORKDIR"
|
|||||||
|
|
||||||
## Install utils
|
## Install utils
|
||||||
execute_cmd "apt update" "Updating repos"
|
execute_cmd "apt update" "Updating repos"
|
||||||
execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https" "Installing utils"
|
execute_cmd "apt install -y net-tools vim curl wget software-properties-common apt-transport-https ca-certificates gnupg lsb-release" "Installing utils"
|
||||||
|
|
||||||
#Installing Apache and php-fpm
|
#Installing Apache and php-fpm
|
||||||
[ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo"
|
[ -e "/etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list" ] || execute_cmd "add-apt-repository ppa:ondrej/php -y" "Enable ppa:ondrej/php repo"
|
||||||
@ -221,7 +237,8 @@ systemctl restart php$PHPVER-fpm &>> "$LOGFILE"
|
|||||||
php$PHPVER-xml \
|
php$PHPVER-xml \
|
||||||
php$PHPVER-yaml \
|
php$PHPVER-yaml \
|
||||||
libnet-telnet-perl \
|
libnet-telnet-perl \
|
||||||
whois"
|
whois \
|
||||||
|
cron"
|
||||||
execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||||
|
|
||||||
# Server dependencies
|
# Server dependencies
|
||||||
@ -254,10 +271,13 @@ server_dependencies=" \
|
|||||||
libnet-telnet-perl \
|
libnet-telnet-perl \
|
||||||
libjson-perl \
|
libjson-perl \
|
||||||
libencode-perl \
|
libencode-perl \
|
||||||
|
cron \
|
||||||
libgeo-ip-perl \
|
libgeo-ip-perl \
|
||||||
openjdk-8-jdk "
|
openjdk-8-jdk "
|
||||||
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||||
|
|
||||||
|
execute_cmd "installing_docker" "Installing Docker for debug"
|
||||||
|
|
||||||
# wmic and pandorawmic
|
# wmic and pandorawmic
|
||||||
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic"
|
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/wmic" "Downloading wmic"
|
||||||
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic"
|
execute_cmd "curl -O https://firefly.artica.es/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic"
|
||||||
@ -393,7 +413,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
|
|||||||
[mysqld]
|
[mysqld]
|
||||||
datadir=/var/lib/mysql
|
datadir=/var/lib/mysql
|
||||||
user=mysql
|
user=mysql
|
||||||
character-set-server=utf8
|
character-set-server=utf8mb4
|
||||||
skip-character-set-client-handshake
|
skip-character-set-client-handshake
|
||||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||||
symbolic-links=0
|
symbolic-links=0
|
||||||
@ -408,7 +428,7 @@ innodb_flush_log_at_trx_commit = 0
|
|||||||
innodb_flush_method = O_DIRECT
|
innodb_flush_method = O_DIRECT
|
||||||
innodb_log_file_size = 64M
|
innodb_log_file_size = 64M
|
||||||
innodb_log_buffer_size = 16M
|
innodb_log_buffer_size = 16M
|
||||||
innodb_io_capacity = 100
|
innodb_io_capacity = 300
|
||||||
thread_cache_size = 8
|
thread_cache_size = 8
|
||||||
thread_stack = 256K
|
thread_stack = 256K
|
||||||
max_connections = 100
|
max_connections = 100
|
||||||
@ -477,7 +497,7 @@ check_cmd_status "Error installing PandoraFMS Agent"
|
|||||||
|
|
||||||
# Copy gotty utility
|
# Copy gotty utility
|
||||||
cd $WORKDIR &>> "$LOGFILE"
|
cd $WORKDIR &>> "$LOGFILE"
|
||||||
execute_cmd "wget https://pandorafms.com/library/wp-content/uploads/2019/11/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
execute_cmd "wget https://firefly.pandorafms.com/pandorafms/utils/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
|
||||||
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
|
||||||
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
|
||||||
|
|
||||||
@ -731,9 +751,14 @@ systemctl enable pandora_server &>> "$LOGFILE"
|
|||||||
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
||||||
systemctl enable tentacle_serverd &>> "$LOGFILE"
|
systemctl enable tentacle_serverd &>> "$LOGFILE"
|
||||||
|
|
||||||
# Enabling condole cron
|
# Enabling console cron
|
||||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||||
echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||||
|
|
||||||
|
# Enabling pandoradb cron
|
||||||
|
execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron"
|
||||||
|
echo "@hourly root bash -c /etc/cron.hourly/pandora_db" >> /etc/crontab
|
||||||
|
|
||||||
|
|
||||||
## Enabling agent adn configuring Agente
|
## Enabling agent adn configuring Agente
|
||||||
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE"
|
sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF &>> "$LOGFILE"
|
||||||
@ -748,7 +773,7 @@ sed --follow-symlinks -i -e "s/^openssl_conf = openssl_init/#openssl_conf = open
|
|||||||
|
|
||||||
cat > /etc/issue.net << EOF_banner
|
cat > /etc/issue.net << EOF_banner
|
||||||
|
|
||||||
Welcome to Pandora FMS appliance on CentOS
|
Welcome to Pandora FMS appliance on Ubuntu
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
Go to Public http://$ipplublic/pandora_console$to to login web console
|
Go to Public http://$ipplublic/pandora_console$to to login web console
|
||||||
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
|
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
|
||||||
|
@ -277,8 +277,8 @@ export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
|
|||||||
EOF_ENV
|
EOF_ENV
|
||||||
|
|
||||||
echo ">> Enable discovery cron: "
|
echo ">> Enable discovery cron: "
|
||||||
#while true ; do wget -q -O - --no-check-certificate http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/pandora_console.log && sleep 60 ; done &
|
#while true ; do wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/pandora_console.log && sleep 60 ; done &
|
||||||
echo "*/5 * * * * wget -q -O - --no-check-certificate http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/log/cron.log" >> /opt/pandora/crontasks
|
echo "*/5 * * * * wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://localhost/pandora_console/enterprise/cron.php >> /var/www/html/pandora_console/log/cron.log" >> /opt/pandora/crontasks
|
||||||
|
|
||||||
echo ">> Enable pandora_db cron: "
|
echo ">> Enable pandora_db cron: "
|
||||||
/usr/bin/perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf
|
/usr/bin/perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, AIX version
|
# Version 7.0NG.769, AIX version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, FreeBSD Version
|
# Version 7.0NG.769, FreeBSD Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, HP-UX Version
|
# Version 7.0NG.769, HP-UX Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, GNU/Linux
|
# Version 7.0NG.769, GNU/Linux
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, GNU/Linux
|
# Version 7.0NG.769, GNU/Linux
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, Solaris Version
|
# Version 7.0NG.769, Solaris Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Base config file for Pandora FMS Windows Agent
|
# Base config file for Pandora FMS Windows Agent
|
||||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# This program is Free Software, you can redistribute it and/or modify it
|
# This program is Free Software, you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||||
# Foundation; either version 2 of the Licence or any later version
|
# Foundation; either version 2 of the Licence or any later version
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
#Pandora FMS Linux Agent
|
#Pandora FMS Linux Agent
|
||||||
#
|
#
|
||||||
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 4.0
|
%define version 4.0
|
||||||
%define release 1
|
%define release 1
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
#Pandora FMS Linux Agent
|
#Pandora FMS Linux Agent
|
||||||
#
|
#
|
||||||
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 4.0.1
|
%define version 4.0.1
|
||||||
%define release 1
|
%define release 1
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
##########################################################################
|
################################################################################
|
||||||
# pandora_agent_exec
|
# pandora_exec - Execute a command with a time limit.
|
||||||
#
|
#
|
||||||
# Executes the given command and prints its output to stdout. If the
|
# Copyright (c) 2008-2023 Artica PFMS S.L.
|
||||||
# execution times out or the command does not exist nothing is printed
|
|
||||||
# to stdout. This is part of Pandora FMS Plugin server, do not delete!.
|
|
||||||
#
|
|
||||||
# Usage: pandora_agent_exec <timeout in seconds> <command>
|
|
||||||
##########################################################################
|
|
||||||
# Copyright (c) 2008-2010 Ramon Novoa, rnovoa@gmail.com
|
|
||||||
# (c) 2008-2010 Artica Soluciones Tecnologicas S.L
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -22,37 +15,41 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##########################################################################
|
################################################################################
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use POSIX qw(WEXITSTATUS WIFEXITED);
|
||||||
|
|
||||||
# Check command line parameters
|
# Check command line arguments.
|
||||||
if ($#ARGV < 1) {
|
if ($#ARGV < 1) {
|
||||||
|
print("Usage: $0 <timeout in seconds> <command>\n");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @opts = @ARGV;
|
my @opts = @ARGV;
|
||||||
my $timeout = shift(@opts);
|
my $timeout = shift(@opts);
|
||||||
my $command = join(' ', @opts);
|
my $command = ($0 =~ m/_agent_exec$/) ? # For backward compatibility with pandora_agent.
|
||||||
my $output = '';
|
join(' ', @opts) :
|
||||||
my $ReturnCode = 0;
|
join(' ', map { quotemeta($_) } @opts);
|
||||||
|
|
||||||
# Execute the command
|
# Fork:
|
||||||
eval {
|
# * The child will run the command.
|
||||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
# * The parent will timeout if needed
|
||||||
alarm $timeout;
|
# and exit with the appropriate exit status.
|
||||||
|
my $pid = fork();
|
||||||
$output = `$command`;
|
if ($pid == 0) {
|
||||||
$ReturnCode = ($? >> 8) & 0xff;
|
setpgrp();
|
||||||
alarm 0;
|
exec($command);
|
||||||
};
|
} else {
|
||||||
|
eval {
|
||||||
# Timeout
|
local $SIG{ALRM} = sub { kill(9, -$pid); exit 1; };
|
||||||
if ($@ eq "alarm\n") {
|
alarm $timeout;
|
||||||
exit 3;
|
waitpid($pid, 0);
|
||||||
|
alarm 0;
|
||||||
|
if (WIFEXITED(${^CHILD_ERROR_NATIVE})) {
|
||||||
|
exit WEXITSTATUS(${^CHILD_ERROR_NATIVE});
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
print $output;
|
exit 1;
|
||||||
|
|
||||||
exit $ReturnCode;
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Fichero de configuracion base de agentes de Pandora
|
# Fichero de configuracion base de agentes de Pandora
|
||||||
# Base config file for Pandora agents
|
# Base config file for Pandora agents
|
||||||
# Version 7.0NG.768, AIX version
|
# Version 7.0NG.769, AIX version
|
||||||
|
|
||||||
# General Parameters
|
# General Parameters
|
||||||
# ==================
|
# ==================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Fichero de configuracion base de agentes de Pandora
|
# Fichero de configuracion base de agentes de Pandora
|
||||||
# Base config file for Pandora agents
|
# Base config file for Pandora agents
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# FreeBSD/IPSO version
|
# FreeBSD/IPSO version
|
||||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Fichero de configuracion base de agentes de Pandora
|
# Fichero de configuracion base de agentes de Pandora
|
||||||
# Base config file for Pandora agents
|
# Base config file for Pandora agents
|
||||||
# Version 7.0NG.768, HPUX Version
|
# Version 7.0NG.769, HPUX Version
|
||||||
|
|
||||||
# General Parameters
|
# General Parameters
|
||||||
# ==================
|
# ==================
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# please visit http://pandora.sourceforge.net
|
# please visit http://pandora.sourceforge.net
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#
|
#
|
||||||
#Pandora FMS Linux Agent
|
#Pandora FMS Linux Agent
|
||||||
#
|
#
|
||||||
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent
|
%define name pandorafms_agent
|
||||||
%define version 3.2
|
%define version 3.2
|
||||||
Summary: Pandora FMS Linux agent
|
Summary: Pandora FMS Linux agent
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# please visit http://pandora.sourceforge.net
|
# please visit http://pandora.sourceforge.net
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# please visit http://pandora.sourceforge.net
|
# please visit http://pandora.sourceforge.net
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Fichero de configuracion base de agentes de Pandora
|
# Fichero de configuracion base de agentes de Pandora
|
||||||
# Base config file for Pandora agents
|
# Base config file for Pandora agents
|
||||||
# Version 7.0NG.768, Solaris version
|
# Version 7.0NG.769, Solaris version
|
||||||
|
|
||||||
# General Parameters
|
# General Parameters
|
||||||
# ==================
|
# ==================
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, AIX version
|
# Version 7.0NG.769, AIX version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-agent-unix
|
package: pandorafms-agent-unix
|
||||||
Version: 7.0NG.768-230206
|
Version: 7.0NG.769-230222
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.768-230206"
|
pandora_version="7.0NG.769-230222"
|
||||||
|
|
||||||
echo "Test if you has the tools for to make the packages."
|
echo "Test if you has the tools for to make the packages."
|
||||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||||
|
@ -31,7 +31,7 @@ fi
|
|||||||
if [ "$#" -ge 2 ]; then
|
if [ "$#" -ge 2 ]; then
|
||||||
VERSION="$2"
|
VERSION="$2"
|
||||||
else
|
else
|
||||||
VERSION="7.0NG.768"
|
VERSION="7.0NG.769"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Path for the generated DMG file
|
# Path for the generated DMG file
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||||
</choice>
|
</choice>
|
||||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.768" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.769" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||||
</choice>
|
</choice>
|
||||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.768" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.769" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||||
<!-- <installation-check script="check()" />
|
<!-- <installation-check script="check()" />
|
||||||
<script>
|
<script>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||||
|
|
||||||
<key>CFBundleVersion</key> <string>7.0NG.768</string>
|
<key>CFBundleVersion</key> <string>7.0NG.769</string>
|
||||||
<key>CFBundleGetInfoString</key> <string>7.0NG.768 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
<key>CFBundleGetInfoString</key> <string>7.0NG.769 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||||
<key>CFBundleShortVersionString</key> <string>7.0NG.768</string>
|
<key>CFBundleShortVersionString</key> <string>7.0NG.769</string>
|
||||||
|
|
||||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, GNU/Linux
|
# Version 7.0NG.769, GNU/Linux
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, FreeBSD Version
|
# Version 7.0NG.769, FreeBSD Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, HP-UX Version
|
# Version 7.0NG.769, HP-UX Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, GNU/Linux
|
# Version 7.0NG.769, GNU/Linux
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, GNU/Linux
|
# Version 7.0NG.769, GNU/Linux
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, NetBSD Version
|
# Version 7.0NG.769, NetBSD Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base config file for Pandora FMS agents
|
# Base config file for Pandora FMS agents
|
||||||
# Version 7.0NG.768, Solaris Version
|
# Version 7.0NG.769, Solaris Version
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
|
@ -556,30 +556,38 @@ BEGIN {
|
|||||||
sub runCommand {
|
sub runCommand {
|
||||||
my ($self, $ref, $output_mode) = @_;
|
my ($self, $ref, $output_mode) = @_;
|
||||||
|
|
||||||
|
my $result;
|
||||||
if($self->load_libraries()) {
|
if($self->load_libraries()) {
|
||||||
# Functionality possible.
|
# Functionality possible.
|
||||||
my $command = $self->{'commands'}->{$ref};
|
my $command = $self->{'commands'}->{$ref};
|
||||||
my $result = $self->evaluate_command($ref);
|
$result = $self->evaluate_command($ref);
|
||||||
if (ref($result) eq "HASH") {
|
} else {
|
||||||
# Process command result.
|
$result = {
|
||||||
if (defined($output_mode) && $output_mode eq 'xml') {
|
'stderr' => 'Cannot use commands without YAML dependency, please install it.',
|
||||||
my $output = '';
|
'name' => 'YAML::Tiny',
|
||||||
$output .= "<cmd_report>\n";
|
'error_level' => 2,
|
||||||
$output .= " <cmd_response>\n";
|
};
|
||||||
$output .= " <cmd_name><![CDATA[".$result->{'name'}."]]></cmd_name>\n";
|
}
|
||||||
$output .= " <cmd_key><![CDATA[".$ref."]]></cmd_key>\n";
|
|
||||||
$output .= " <cmd_errorlevel><![CDATA[".$result->{'error_level'}."]]></cmd_errorlevel>\n";
|
|
||||||
$output .= " <cmd_stdout><![CDATA[".$result->{'stdout'}."]]></cmd_stdout>\n";
|
|
||||||
$output .= " <cmd_stderr><![CDATA[".$result->{'stderr'}."]]></cmd_stderr>\n";
|
|
||||||
$output .= " </cmd_response>\n";
|
|
||||||
$output .= "</cmd_report>\n";
|
|
||||||
|
|
||||||
return $output;
|
if (ref($result) eq "HASH") {
|
||||||
}
|
# Process command result.
|
||||||
return $result;
|
if (defined($output_mode) && $output_mode eq 'xml') {
|
||||||
} else {
|
my $output = '';
|
||||||
$self->set_last_error('Failed to process ['.$ref.']: '.$result);
|
$output .= "<cmd_report>\n";
|
||||||
|
$output .= " <cmd_response>\n";
|
||||||
|
$output .= " <cmd_name><![CDATA[".$result->{'name'}."]]></cmd_name>\n";
|
||||||
|
$output .= " <cmd_key><![CDATA[".$ref."]]></cmd_key>\n";
|
||||||
|
$output .= " <cmd_errorlevel><![CDATA[".$result->{'error_level'}."]]></cmd_errorlevel>\n";
|
||||||
|
$output .= " <cmd_stdout><![CDATA[".$result->{'stdout'}."]]></cmd_stdout>\n";
|
||||||
|
$output .= " <cmd_stderr><![CDATA[".$result->{'stderr'}."]]></cmd_stderr>\n";
|
||||||
|
$output .= " </cmd_response>\n";
|
||||||
|
$output .= "</cmd_report>\n";
|
||||||
|
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
$self->set_last_error('Failed to process ['.$ref.']: '.$result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -1014,8 +1022,8 @@ my $Sem = undef;
|
|||||||
# Semaphore used to control the number of threads
|
# Semaphore used to control the number of threads
|
||||||
my $ThreadSem = undef;
|
my $ThreadSem = undef;
|
||||||
|
|
||||||
use constant AGENT_VERSION => '7.0NG.768';
|
use constant AGENT_VERSION => '7.0NG.769';
|
||||||
use constant AGENT_BUILD => '230206';
|
use constant AGENT_BUILD => '230222';
|
||||||
|
|
||||||
# Agent log default file size maximum and instances
|
# Agent log default file size maximum and instances
|
||||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#
|
#
|
||||||
#Pandora FMS Linux Agent
|
#Pandora FMS Linux Agent
|
||||||
#
|
#
|
||||||
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.768
|
%define version 7.0NG.769
|
||||||
%define release 230206
|
%define release 230222
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
#
|
#
|
||||||
#Pandora FMS Linux Agent
|
#Pandora FMS Linux Agent
|
||||||
#
|
#
|
||||||
|
%global __os_install_post %{nil}
|
||||||
%define name pandorafms_agent_linux
|
%define name pandorafms_agent_linux
|
||||||
%define version 7.0NG.768
|
%define version 7.0NG.769
|
||||||
%define release 230206
|
%define release 230222
|
||||||
|
|
||||||
Summary: Pandora FMS Linux agent, PERL version
|
Summary: Pandora FMS Linux agent, PERL version
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
##########################################################################
|
################################################################################
|
||||||
# pandora_agent_exec
|
# pandora_exec - Execute a command with a time limit.
|
||||||
#
|
#
|
||||||
# Executes the given command and prints its output to stdout. If the
|
# Copyright (c) 2008-2023 Artica PFMS S.L.
|
||||||
# execution times out or the command does not exist nothing is printed
|
|
||||||
# to stdout. This is part of Pandora FMS Plugin server, do not delete!.
|
|
||||||
#
|
|
||||||
# Usage: pandora_agent_exec <timeout in seconds> <command>
|
|
||||||
##########################################################################
|
|
||||||
# Copyright (c) 2008-2010 Ramon Novoa, rnovoa@gmail.com
|
|
||||||
# (c) 2008-2010 Artica Soluciones Tecnologicas S.L
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -22,37 +15,41 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##########################################################################
|
################################################################################
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use POSIX qw(WEXITSTATUS WIFEXITED);
|
||||||
|
|
||||||
# Check command line parameters
|
# Check command line arguments.
|
||||||
if ($#ARGV < 1) {
|
if ($#ARGV < 1) {
|
||||||
|
print("Usage: $0 <timeout in seconds> <command>\n");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @opts = @ARGV;
|
my @opts = @ARGV;
|
||||||
my $timeout = shift(@opts);
|
my $timeout = shift(@opts);
|
||||||
my $command = join(' ', @opts);
|
my $command = ($0 =~ m/_agent_exec$/) ? # For backward compatibility with pandora_agent.
|
||||||
my $output = '';
|
join(' ', @opts) :
|
||||||
my $ReturnCode = 0;
|
join(' ', map { quotemeta($_) } @opts);
|
||||||
|
|
||||||
# Execute the command
|
# Fork:
|
||||||
eval {
|
# * The child will run the command.
|
||||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
# * The parent will timeout if needed
|
||||||
alarm $timeout;
|
# and exit with the appropriate exit status.
|
||||||
|
my $pid = fork();
|
||||||
$output = `$command`;
|
if ($pid == 0) {
|
||||||
$ReturnCode = ($? >> 8) & 0xff;
|
setpgrp();
|
||||||
alarm 0;
|
exec($command);
|
||||||
};
|
} else {
|
||||||
|
eval {
|
||||||
# Timeout
|
local $SIG{ALRM} = sub { kill(9, -$pid); exit 1; };
|
||||||
if ($@ eq "alarm\n") {
|
alarm $timeout;
|
||||||
exit 3;
|
waitpid($pid, 0);
|
||||||
|
alarm 0;
|
||||||
|
if (WIFEXITED(${^CHILD_ERROR_NATIVE})) {
|
||||||
|
exit WEXITSTATUS(${^CHILD_ERROR_NATIVE});
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
print $output;
|
exit 1;
|
||||||
|
|
||||||
exit $ReturnCode;
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.768"
|
PI_VERSION="7.0NG.769"
|
||||||
PI_BUILD="230206"
|
PI_BUILD="230222"
|
||||||
OS_NAME=`uname -s`
|
OS_NAME=`uname -s`
|
||||||
|
|
||||||
FORCE=0
|
FORCE=0
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Base config file for Pandora FMS Windows Agent
|
# Base config file for Pandora FMS Windows Agent
|
||||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# This program is Free Software, you can redistribute it and/or modify it
|
# This program is Free Software, you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||||
# Foundation; either version 2 of the Licence or any later version
|
# Foundation; either version 2 of the Licence or any later version
|
||||||
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||||||
{Yes}
|
{Yes}
|
||||||
|
|
||||||
AppName
|
AppName
|
||||||
{Pandora FMS Windows Agent v7.0NG.768}
|
{Pandora FMS Windows Agent v7.0NG.769}
|
||||||
|
|
||||||
ApplicationID
|
ApplicationID
|
||||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
Version
|
Version
|
||||||
{230206}
|
{230222}
|
||||||
|
|
||||||
ViewReadme
|
ViewReadme
|
||||||
{Yes}
|
{Yes}
|
||||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||||||
using namespace Pandora_Strutils;
|
using namespace Pandora_Strutils;
|
||||||
|
|
||||||
#define PATH_SIZE _MAX_PATH+1
|
#define PATH_SIZE _MAX_PATH+1
|
||||||
#define PANDORA_VERSION ("7.0NG.768 Build 230206")
|
#define PANDORA_VERSION ("7.0NG.769 Build 230222")
|
||||||
|
|
||||||
string pandora_path;
|
string pandora_path;
|
||||||
string pandora_dir;
|
string pandora_dir;
|
||||||
|
@ -11,7 +11,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Artica ST"
|
VALUE "LegalCopyright", "Artica ST"
|
||||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||||
VALUE "ProductVersion", "(7.0NG.768(Build 230206))"
|
VALUE "ProductVersion", "(7.0NG.769(Build 230222))"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "1.0.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-console
|
package: pandorafms-console
|
||||||
Version: 7.0NG.768-230206
|
Version: 7.0NG.769-230222
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.768-230206"
|
pandora_version="7.0NG.769-230222"
|
||||||
|
|
||||||
package_pear=0
|
package_pear=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -2,6 +2,8 @@ START TRANSACTION;
|
|||||||
|
|
||||||
ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0;
|
ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
ALTER TABLE `tmap` MODIFY COLUMN `id_group` TEXT NOT NULL default '';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `tmonitor_filter` (
|
CREATE TABLE IF NOT EXISTS `tmonitor_filter` (
|
||||||
`id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`id_name` VARCHAR(600) NOT NULL,
|
`id_name` VARCHAR(600) NOT NULL,
|
||||||
|
@ -359,6 +359,10 @@ if ($config['enterprise_installed']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CSRF validation.
|
// CSRF validation.
|
||||||
|
if (isset($_SESSION['csrf_code']) === true) {
|
||||||
|
unset($_SESSION['csrf_code']);
|
||||||
|
}
|
||||||
|
|
||||||
html_print_csrf_hidden();
|
html_print_csrf_hidden();
|
||||||
|
|
||||||
echo '</form></div>';
|
echo '</form></div>';
|
||||||
|
@ -498,10 +498,12 @@ if ($id_agente) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collection.
|
// Collection.
|
||||||
$collectiontab = enterprise_hook('collection_tab');
|
if ((int) $config['license_nms'] !== 1) {
|
||||||
|
$collectiontab = enterprise_hook('collection_tab');
|
||||||
|
|
||||||
if ($collectiontab == -1) {
|
if ($collectiontab == -1) {
|
||||||
$collectiontab = '';
|
$collectiontab = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NetworkConfigManager tab.
|
// NetworkConfigManager tab.
|
||||||
|
@ -141,11 +141,13 @@ if (isset($_GET['server'])) {
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$buttons['collections'] = [
|
if ((int) $config['license_nms'] !== 1) {
|
||||||
'active' => false,
|
$buttons['collections'] = [
|
||||||
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=collections&pure='.$pure.'">'.html_print_image('images/collection.png', true, ['title' => __('Collections')]).'</a>',
|
'active' => false,
|
||||||
|
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=collections&pure='.$pure.'">'.html_print_image('images/collection.png', true, ['title' => __('Collections')]).'</a>',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$buttons[$tab]['active'] = true;
|
$buttons[$tab]['active'] = true;
|
||||||
|
@ -992,7 +992,7 @@ if (($create != '') || ($view != '')) {
|
|||||||
echo '<div id="deploy_messages" class="invisible">';
|
echo '<div id="deploy_messages" class="invisible">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// The '%s' will be replaced in the javascript code of the function 'show_locked_dialog'
|
// The '%s' will be replaced in the javascript code of the function 'show_locked_dialog'.
|
||||||
echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>";
|
echo "<div id='dialog_locked' title='".__('List of modules and components created by "%s" ')."' class='invisible left'>";
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
||||||
@ -1041,12 +1041,11 @@ ui_require_javascript_file('pandora_modules');
|
|||||||
data: parameters,
|
data: parameters,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var title = $("#dialog_locked").prop('title').replace(/%s/, plugin_name);
|
var title = 'List of modules and components created by "'+ plugin_name +'"';
|
||||||
|
|
||||||
$("#dialog_locked")
|
$("#dialog_locked")
|
||||||
.prop('title', title)
|
|
||||||
.html(data)
|
.html(data)
|
||||||
.dialog ({
|
.dialog ({
|
||||||
|
title: title,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
modal: true,
|
modal: true,
|
||||||
@ -1062,7 +1061,6 @@ ui_require_javascript_file('pandora_modules');
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Add macro
|
// Add macro
|
||||||
var add_macro_click_event = function (event) {
|
var add_macro_click_event = function (event) {
|
||||||
|
@ -402,6 +402,11 @@ if ($delete_user === true) {
|
|||||||
__('There was a problem deleting the profile')
|
__('There was a problem deleting the profile')
|
||||||
);
|
);
|
||||||
} else if ($disable_user !== false) {
|
} else if ($disable_user !== false) {
|
||||||
|
// CSRF Validator.
|
||||||
|
if (html_print_csrf_error()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Disable_user.
|
// Disable_user.
|
||||||
$id_user = get_parameter('id', 0);
|
$id_user = get_parameter('id', 0);
|
||||||
|
|
||||||
@ -646,6 +651,8 @@ $limit = (int) $config['block_size'];
|
|||||||
$rowPair = true;
|
$rowPair = true;
|
||||||
$iterator = 0;
|
$iterator = 0;
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
|
// Creates csrf.
|
||||||
|
$csrf = html_print_csrf_hidden(true);
|
||||||
foreach ($info as $user_id => $user_info) {
|
foreach ($info as $user_id => $user_info) {
|
||||||
if (empty($user_id) === true) {
|
if (empty($user_id) === true) {
|
||||||
continue;
|
continue;
|
||||||
@ -815,6 +822,8 @@ foreach ($info as $user_id => $user_info) {
|
|||||||
$user_info['id_user'],
|
$user_info['id_user'],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
// Same csrf for every disable button for submit.
|
||||||
|
$data[6] .= $csrf;
|
||||||
$data[6] .= html_print_input_hidden(
|
$data[6] .= html_print_input_hidden(
|
||||||
'disable_user',
|
'disable_user',
|
||||||
$toDoAction,
|
$toDoAction,
|
||||||
|
@ -92,6 +92,9 @@ $node_id = (int) get_parameter('node_id', 0);
|
|||||||
if ($get_comments === true) {
|
if ($get_comments === true) {
|
||||||
$event = get_parameter('event', false);
|
$event = get_parameter('event', false);
|
||||||
$event_rep = (int) get_parameter('event_rep', 0);
|
$event_rep = (int) get_parameter('event_rep', 0);
|
||||||
|
$event_rep = get_parameter_post('event')['event_rep'];
|
||||||
|
$group_rep = get_parameter_post('event')['group_rep'];
|
||||||
|
|
||||||
if ($event === false) {
|
if ($event === false) {
|
||||||
return __('Failed to retrieve comments');
|
return __('Failed to retrieve comments');
|
||||||
}
|
}
|
||||||
@ -99,7 +102,7 @@ if ($get_comments === true) {
|
|||||||
$eventsGrouped = [];
|
$eventsGrouped = [];
|
||||||
// Consider if the event is grouped.
|
// Consider if the event is grouped.
|
||||||
$whereGrouped = '1=1';
|
$whereGrouped = '1=1';
|
||||||
if ($event_rep === EVENT_GROUP_REP_EVENTS) {
|
if ($group_rep === EVENT_GROUP_REP_EVENTS && $event_rep > 1) {
|
||||||
// Default grouped message filtering (evento and estado).
|
// Default grouped message filtering (evento and estado).
|
||||||
$whereGrouped = sprintf(
|
$whereGrouped = sprintf(
|
||||||
'`evento` = "%s"',
|
'`evento` = "%s"',
|
||||||
@ -120,7 +123,7 @@ if ($get_comments === true) {
|
|||||||
(int) $event['id_agentmodule']
|
(int) $event['id_agentmodule']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if ($event_rep === EVENT_GROUP_REP_EXTRAIDS) {
|
} else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
|
||||||
$whereGrouped = sprintf(
|
$whereGrouped = sprintf(
|
||||||
'`id_extra` = "%s"',
|
'`id_extra` = "%s"',
|
||||||
$event['id_extra']
|
$event['id_extra']
|
||||||
@ -1639,6 +1642,7 @@ if ($get_extended_event) {
|
|||||||
$comments = $event['comments'];
|
$comments = $event['comments'];
|
||||||
|
|
||||||
$event['similar_ids'] = $similar_ids;
|
$event['similar_ids'] = $similar_ids;
|
||||||
|
$event['group_rep'] = $group_rep;
|
||||||
|
|
||||||
if (isset($comments) === false) {
|
if (isset($comments) === false) {
|
||||||
$comments = $event['user_comment'];
|
$comments = $event['user_comment'];
|
||||||
@ -2407,6 +2411,18 @@ if ($drawConsoleSound === true) {
|
|||||||
$output .= '</span>';
|
$output .= '</span>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '<div class="elements-discovered-alerts"><ul></ul></div>';
|
$output .= '<div class="elements-discovered-alerts"><ul></ul></div>';
|
||||||
|
$output .= html_print_input_hidden(
|
||||||
|
'ajax_file_sound_console',
|
||||||
|
ui_get_full_url('ajax.php', false, false, false),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$output .= html_print_input_hidden(
|
||||||
|
'meta',
|
||||||
|
is_metaconsole(),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
$output .= '<div id="sound_event_details_window"></div>';
|
||||||
|
$output .= '<div id="sound_event_response_window"></div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
|
|
||||||
@ -2493,6 +2509,37 @@ if ($get_events_fired) {
|
|||||||
$filter = events_get_event_filter($filter_id);
|
$filter = events_get_event_filter($filter_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_metaconsole() === true) {
|
||||||
|
$servers = metaconsole_get_servers();
|
||||||
|
if (is_array($servers) === true) {
|
||||||
|
$servers = array_reduce(
|
||||||
|
$servers,
|
||||||
|
function ($carry, $item) {
|
||||||
|
$carry[$item['id']] = $item['server_name'];
|
||||||
|
return $carry;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$servers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($filter['server_id'] === '') {
|
||||||
|
$filter['server_id'] = array_keys($servers);
|
||||||
|
} else {
|
||||||
|
if (is_array($filter['server_id']) === false) {
|
||||||
|
if (is_numeric($filter['server_id']) === true) {
|
||||||
|
if ($filter['server_id'] !== 0) {
|
||||||
|
$filter['server_id'] = [$filter['server_id']];
|
||||||
|
} else {
|
||||||
|
$filter['server_id'] = array_keys($servers);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$filter['server_id'] = explode(',', $filter['server_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set time.
|
// Set time.
|
||||||
$filter['event_view_hr'] = 0;
|
$filter['event_view_hr'] = 0;
|
||||||
|
|
||||||
@ -2511,29 +2558,32 @@ if ($get_events_fired) {
|
|||||||
$return = [];
|
$return = [];
|
||||||
if (empty($data) === false) {
|
if (empty($data) === false) {
|
||||||
foreach ($data as $event) {
|
foreach ($data as $event) {
|
||||||
$return[] = [
|
$return[] = array_merge(
|
||||||
'fired' => $event['id_evento'],
|
$event,
|
||||||
'message' => ui_print_string_substr(
|
[
|
||||||
strip_tags(io_safe_output($event['evento'])),
|
'fired' => $event['id_evento'],
|
||||||
75,
|
'message' => ui_print_string_substr(
|
||||||
true,
|
strip_tags(io_safe_output($event['evento'])),
|
||||||
'9'
|
75,
|
||||||
),
|
true,
|
||||||
'priority' => ui_print_event_priority($event['criticity'], true, true),
|
'9'
|
||||||
'type' => events_print_type_img(
|
),
|
||||||
$event['event_type'],
|
'priority' => ui_print_event_priority($event['criticity'], true, true),
|
||||||
true
|
'type' => events_print_type_img(
|
||||||
),
|
$event['event_type'],
|
||||||
'timestamp' => ui_print_timestamp(
|
true
|
||||||
$event['timestamp'],
|
),
|
||||||
true,
|
'timestamp' => ui_print_timestamp(
|
||||||
['style' => 'font-size: 9pt; letter-spacing: 0.3pt;']
|
$event['timestamp'],
|
||||||
),
|
true,
|
||||||
];
|
['style' => 'font-size: 9pt; letter-spacing: 0.3pt;']
|
||||||
|
),
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo io_json_mb_encode($return);
|
echo io_safe_output(io_json_mb_encode($return));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$user_info = [
|
$user_info = [
|
||||||
'fullname' => $login,
|
'fullname' => db_escape_string_sql($login),
|
||||||
'comments' => 'Imported from '.$config['auth'],
|
'comments' => 'Imported from '.$config['auth'],
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||||||
$config['auth_error'] = __('User not found in database or incorrect password');
|
$config['auth_error'] = __('User not found in database or incorrect password');
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$user_info['fullname'] = $sr['cn'][0];
|
$user_info['fullname'] = db_escape_string_sql($sr['cn'][0]);
|
||||||
$user_info['email'] = $sr['mail'][0];
|
$user_info['email'] = $sr['mail'][0];
|
||||||
|
|
||||||
// Create the user.
|
// Create the user.
|
||||||
@ -1565,7 +1565,7 @@ function local_ldap_search(
|
|||||||
|
|
||||||
$filter = '';
|
$filter = '';
|
||||||
if (!empty($access_attr) && !empty($user)) {
|
if (!empty($access_attr) && !empty($user)) {
|
||||||
$filter = " -s sub '(".$access_attr.'='.$user.")' ";
|
$filter = ' -s sub '.escapeshellarg('('.$access_attr.'='.$user.')');
|
||||||
}
|
}
|
||||||
|
|
||||||
$tls = '';
|
$tls = '';
|
||||||
@ -1591,7 +1591,7 @@ function local_ldap_search(
|
|||||||
$ldap_admin_pass = ' -w '.escapeshellarg($ldap_admin_pass);
|
$ldap_admin_pass = ' -w '.escapeshellarg($ldap_admin_pass);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dn = " -b '".$dn."'";
|
$dn = ' -b '.escapeshellarg($dn);
|
||||||
$ldapsearch_command = 'ldapsearch -LLL -o ldif-wrap=no -o nettimeout='.$ldap_search_time.' -x'.$ldap_host.$ldap_version.' -E pr=10000/noprompt '.$ldap_admin_user.$ldap_admin_pass.$dn.$filter.$tls.' | grep -v "^#\|^$" | sed "s/:\+ /=>/g"';
|
$ldapsearch_command = 'ldapsearch -LLL -o ldif-wrap=no -o nettimeout='.$ldap_search_time.' -x'.$ldap_host.$ldap_version.' -E pr=10000/noprompt '.$ldap_admin_user.$ldap_admin_pass.$dn.$filter.$tls.' | grep -v "^#\|^$" | sed "s/:\+ /=>/g"';
|
||||||
$shell_ldap_search = explode("\n", shell_exec($ldapsearch_command));
|
$shell_ldap_search = explode("\n", shell_exec($ldapsearch_command));
|
||||||
foreach ($shell_ldap_search as $line) {
|
foreach ($shell_ldap_search as $line) {
|
||||||
|
@ -258,6 +258,14 @@ class ConsoleSupervisor
|
|||||||
$this->checkSyncQueueStatus();
|
$this->checkSyncQueueStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checkc agent missing libraries.
|
||||||
|
* NOTIF.AGENT.LIBRARY
|
||||||
|
*/
|
||||||
|
if ((bool) enterprise_installed() === true) {
|
||||||
|
$this->checkLibaryError();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -518,6 +526,14 @@ class ConsoleSupervisor
|
|||||||
$this->checkSyncQueueLength();
|
$this->checkSyncQueueLength();
|
||||||
$this->checkSyncQueueStatus();
|
$this->checkSyncQueueStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checkc agent missing libraries.
|
||||||
|
* NOTIF.AGENT.LIBRARY
|
||||||
|
*/
|
||||||
|
if ((bool) enterprise_installed() === true) {
|
||||||
|
$this->checkLibaryError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2379,7 +2395,7 @@ class ConsoleSupervisor
|
|||||||
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
||||||
$message_conf_cron .= __('Discovery relies on an appropriate cron setup.');
|
$message_conf_cron .= __('Discovery relies on an appropriate cron setup.');
|
||||||
$message_conf_cron .= '. '.__('Please, add the following line to your crontab file:');
|
$message_conf_cron .= '. '.__('Please, add the following line to your crontab file:');
|
||||||
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * <user> wget -q -O - --no-check-certificate ';
|
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * <user> wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
|
||||||
$message_conf_cron .= str_replace(
|
$message_conf_cron .= str_replace(
|
||||||
ENTERPRISE_DIR.'/meta/',
|
ENTERPRISE_DIR.'/meta/',
|
||||||
'',
|
'',
|
||||||
@ -2806,4 +2822,30 @@ class ConsoleSupervisor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Chechs if an agent has a dependency eror on omnishell
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function checkLibaryError()
|
||||||
|
{
|
||||||
|
$sql = 'SELECT COUNT(errorlevel) from tremote_command_target WHERE errorlevel = 2';
|
||||||
|
|
||||||
|
$error_dependecies = db_get_sql($sql);
|
||||||
|
if ($error_dependecies > 0) {
|
||||||
|
$this->notify(
|
||||||
|
[
|
||||||
|
'type' => 'NOTIF.AGENT.LIBRARY',
|
||||||
|
'title' => __('Agent dependency error'),
|
||||||
|
'message' => __(
|
||||||
|
'There are omnishell agents with dependency errors',
|
||||||
|
),
|
||||||
|
|
||||||
|
'url' => '__url__/index.php?sec=gextensions&sec2=enterprise/tools/omnishell',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,7 @@ class Diagnostics extends Wizard
|
|||||||
'getChartAjax',
|
'getChartAjax',
|
||||||
'formFeedback',
|
'formFeedback',
|
||||||
'createdScheduleFeedbackTask',
|
'createdScheduleFeedbackTask',
|
||||||
|
'getSystemDate',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -209,6 +210,7 @@ class Diagnostics extends Wizard
|
|||||||
'getAttachmentFolder',
|
'getAttachmentFolder',
|
||||||
'getInfoTagenteDatos',
|
'getInfoTagenteDatos',
|
||||||
'getServerThreads',
|
'getServerThreads',
|
||||||
|
'getSystemDate',
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($this->pdf === true) {
|
if ($this->pdf === true) {
|
||||||
@ -278,6 +280,10 @@ class Diagnostics extends Wizard
|
|||||||
$title = __('SQL show engine innodb status');
|
$title = __('SQL show engine innodb status');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'getSystemDate':
|
||||||
|
$title = __('Date system');
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Not possible.
|
// Not possible.
|
||||||
$title = '';
|
$title = '';
|
||||||
@ -516,6 +522,27 @@ class Diagnostics extends Wizard
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date system
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSystemDate(): string
|
||||||
|
{
|
||||||
|
$result = [
|
||||||
|
'error' => false,
|
||||||
|
'data' => [
|
||||||
|
'date' => [
|
||||||
|
'name' => __('System Date (Console)'),
|
||||||
|
'value' => date('H:i:s Y-m-d'),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database size stats.
|
* Database size stats.
|
||||||
*
|
*
|
||||||
@ -619,7 +646,7 @@ class Diagnostics extends Wizard
|
|||||||
$currentTime = time();
|
$currentTime = time();
|
||||||
|
|
||||||
$pandoraDbLastRun = __('Pandora DB has never been executed');
|
$pandoraDbLastRun = __('Pandora DB has never been executed');
|
||||||
if ($dateDbMantenaince !== false) {
|
if ($dateDbMantenaince !== false && empty($dateDbMantenaince) === false) {
|
||||||
$difference = ($currentTime - $dateDbMantenaince);
|
$difference = ($currentTime - $dateDbMantenaince);
|
||||||
$pandoraDbLastRun = human_time_description_raw(
|
$pandoraDbLastRun = human_time_description_raw(
|
||||||
$difference,
|
$difference,
|
||||||
|
@ -782,7 +782,9 @@ class NetworkMap
|
|||||||
if ($this->network) {
|
if ($this->network) {
|
||||||
// Network map, based on direct network.
|
// Network map, based on direct network.
|
||||||
$nodes = networkmap_get_nodes_from_ip_mask(
|
$nodes = networkmap_get_nodes_from_ip_mask(
|
||||||
$this->network
|
$this->network,
|
||||||
|
false,
|
||||||
|
'
'
|
||||||
);
|
);
|
||||||
} else if ($this->mapOptions['map_filter']['empty_map']) {
|
} else if ($this->mapOptions['map_filter']['empty_map']) {
|
||||||
// Empty map returns no data.
|
// Empty map returns no data.
|
||||||
@ -792,17 +794,22 @@ class NetworkMap
|
|||||||
|| $this->mapOptions['map_filter']['dont_show_subgroups'] == 1
|
|| $this->mapOptions['map_filter']['dont_show_subgroups'] == 1
|
||||||
) {
|
) {
|
||||||
// Show only current selected group.
|
// Show only current selected group.
|
||||||
$filter['id_grupo'] = $this->idGroup;
|
$filter['id_grupo'] = explode(',', $this->idGroup);
|
||||||
} else {
|
} else {
|
||||||
// Show current group and children.
|
// Show current group and children.
|
||||||
$childrens = groups_get_children($this->idGroup, null, true);
|
foreach (explode(',', $this->idGroup) as $key => $group) {
|
||||||
if (!empty($childrens)) {
|
$childrens = groups_get_children($group, null, true);
|
||||||
$childrens = array_keys($childrens);
|
if (!empty($childrens)) {
|
||||||
|
$childrens = array_keys($childrens);
|
||||||
|
|
||||||
$filter['id_grupo'] = $childrens;
|
if (empty($filter['id_grupo']) === false) {
|
||||||
$filter['id_grupo'][] = $this->idGroup;
|
$filter['id_grupo'] = array_merge($filter['id_grupo'], $childrens);
|
||||||
} else {
|
} else {
|
||||||
$filter['id_grupo'] = $this->idGroup;
|
$filter['id_grupo'] = $childrens;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$filter['id_grupo'][] = $group;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1189,6 +1196,10 @@ class NetworkMap
|
|||||||
$head .= 'overlap="scalexy";';
|
$head .= 'overlap="scalexy";';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($layout == 'spring1' || $layout == 'spring2') {
|
||||||
|
$head .= 'sep="'.$node_sep.'";';
|
||||||
|
}
|
||||||
|
|
||||||
if ($layout == 'flat') {
|
if ($layout == 'flat') {
|
||||||
$head .= 'ranksep="'.$rank_sep.'";';
|
$head .= 'ranksep="'.$rank_sep.'";';
|
||||||
}
|
}
|
||||||
@ -3498,6 +3509,7 @@ class NetworkMap
|
|||||||
url_background_grid: url_background_grid,
|
url_background_grid: url_background_grid,
|
||||||
refresh_time: '.$this->mapOptions['refresh_time'].',
|
refresh_time: '.$this->mapOptions['refresh_time'].',
|
||||||
font_size: '.$this->mapOptions['font_size'].',
|
font_size: '.$this->mapOptions['font_size'].',
|
||||||
|
method: '.$this->map['generation_method'].',
|
||||||
base_url_homedir: "'.ui_get_full_url(false).'"
|
base_url_homedir: "'.ui_get_full_url(false).'"
|
||||||
});
|
});
|
||||||
init_drag_and_drop();
|
init_drag_and_drop();
|
||||||
|
@ -84,6 +84,15 @@ class SatelliteCollection extends HTML
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((int) $config['license_nms'] === 0) {
|
||||||
|
db_pandora_audit(
|
||||||
|
AUDIT_LOG_NMS_VIOLATION,
|
||||||
|
'Trying to access satellite collections'
|
||||||
|
);
|
||||||
|
include $config['homedir'].'/general/noaccess.php';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Set the ajax controller.
|
// Set the ajax controller.
|
||||||
$this->ajaxController = $ajaxController;
|
$this->ajaxController = $ajaxController;
|
||||||
// Capture all parameters before start.
|
// Capture all parameters before start.
|
||||||
|
@ -413,73 +413,74 @@ class SnmpConsole extends HTML
|
|||||||
'class' => 'flex-row',
|
'class' => 'flex-row',
|
||||||
'inputs' => [
|
'inputs' => [
|
||||||
[
|
[
|
||||||
'label' => __('Alert'),
|
'label' => __('Alert'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'id' => 'filter_alert',
|
'id' => 'filter_alert',
|
||||||
'name' => 'filter_alert',
|
'input_class' => 'filter_input_datatable',
|
||||||
'class' => 'w200px',
|
'name' => 'filter_alert',
|
||||||
'fields' => $show_alerts,
|
'fields' => $show_alerts,
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'selected' => $this->filter_alert,
|
'selected' => $this->filter_alert,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Severity'),
|
'label' => __('Severity'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'id' => 'filter_severity',
|
'id' => 'filter_severity',
|
||||||
'name' => 'filter_severity',
|
'input_class' => 'filter_input_datatable',
|
||||||
'class' => 'w200px',
|
'name' => 'filter_severity',
|
||||||
'fields' => $severities,
|
'fields' => $severities,
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'selected' => $this->filter_severity,
|
'selected' => $this->filter_severity,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Free search'),
|
'label' => __('Free search'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => 'w400px',
|
'id' => 'filter_free_search',
|
||||||
'id' => 'filter_free_search',
|
'input_class' => 'filter_input_datatable',
|
||||||
'name' => 'filter_free_search',
|
'name' => 'filter_free_search',
|
||||||
'value' => $this->filter_free_search,
|
'value' => $this->filter_free_search,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Status'),
|
'label' => __('Status'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'id' => 'filter_status',
|
'id' => 'filter_status',
|
||||||
'name' => 'filter_status',
|
'input_class' => 'filter_input_datatable',
|
||||||
'class' => 'w200px',
|
'name' => 'filter_status',
|
||||||
'fields' => $status_array,
|
'fields' => $status_array,
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'selected' => $this->filter_status,
|
'selected' => $this->filter_status,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Group by Enterprise String/IP'),
|
'label' => __('Group by Enterprise String/IP'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'name' => 'filter_group_by',
|
'name' => 'filter_group_by',
|
||||||
'selected' => $this->filter_group_by,
|
'selected' => $this->filter_group_by,
|
||||||
'disabled' => false,
|
'disabled' => false,
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'id' => 'filter_group_by',
|
'id' => 'filter_group_by',
|
||||||
'fields' => [
|
'input_class' => 'filter_input_datatable',
|
||||||
|
'fields' => [
|
||||||
0 => __('No'),
|
0 => __('No'),
|
||||||
1 => __('Yes'),
|
1 => __('Yes'),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Max. hours old'),
|
'label' => __('Max. hours old'),
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => 'w200px',
|
'id' => 'filter_hours_ago',
|
||||||
'id' => 'filter_hours_ago',
|
'input_class' => 'filter_input_datatable',
|
||||||
'name' => 'filter_hours_ago',
|
'name' => 'filter_hours_ago',
|
||||||
'value' => $this->filter_hours_ago,
|
'value' => $this->filter_hours_ago,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => __('Trap type'),
|
'label' => __('Trap type'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'id' => 'filter_trap_type',
|
'id' => 'filter_trap_type',
|
||||||
'name' => 'filter_trap_type',
|
'input_class' => 'filter_input_datatable',
|
||||||
'class' => 'w200px',
|
'name' => 'filter_trap_type',
|
||||||
'fields' => $trap_types,
|
'fields' => $trap_types,
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'selected' => $this->filter_trap_type,
|
'selected' => $this->filter_trap_type,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
/**
|
/**
|
||||||
* Pandora build version and version
|
* Pandora build version and version
|
||||||
*/
|
*/
|
||||||
$build_version = 'PC230206';
|
$build_version = 'PC230222';
|
||||||
$pandora_version = 'v7.0NG.768';
|
$pandora_version = 'v7.0NG.769';
|
||||||
|
|
||||||
// Do not overwrite default timezone set if defined.
|
// Do not overwrite default timezone set if defined.
|
||||||
$script_tz = @date_default_timezone_get();
|
$script_tz = @date_default_timezone_get();
|
||||||
|
@ -6397,3 +6397,19 @@ function getBearerToken()
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check nms license on api.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function nms_check_api()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
if ((int) $config['license_nms'] === 1) {
|
||||||
|
returnError('license_error');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -198,6 +198,16 @@ function returnError($typeError, $returnType='string')
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'license_error':
|
||||||
|
returnData(
|
||||||
|
$returnType,
|
||||||
|
[
|
||||||
|
'type' => 'string',
|
||||||
|
'data' => __('License not allowed for this operation.'),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
returnData(
|
returnData(
|
||||||
$returnType,
|
$returnType,
|
||||||
|
@ -463,10 +463,6 @@ function config_update_config()
|
|||||||
if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) {
|
if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) {
|
||||||
$error_update[] = __('Ipam Ocuppied Manager Warning');
|
$error_update[] = __('Ipam Ocuppied Manager Warning');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_update_value('sap_license', get_parameter('sap_license'), true) === false) {
|
|
||||||
$error_update[] = __('SAP/R3 Plugin Licence');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Images File Manager functions.
|
* Images File Manager functions.
|
||||||
*
|
*
|
||||||
@ -96,7 +97,7 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||||||
|
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
if (!check_acl($config['id_user'], 0, 'AW')) {
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
AUDIT_LOG_ACL_VIOLATION,
|
AUDIT_LOG_ACL_VIOLATION,
|
||||||
'Trying to access File manager'
|
'Trying to access File manager'
|
||||||
@ -139,25 +140,8 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||||||
$nombre_archivo = sprintf('%s/%s', $real_directory, $filename);
|
$nombre_archivo = sprintf('%s/%s', $real_directory, $filename);
|
||||||
try {
|
try {
|
||||||
$mimeContentType = mime_content_type($_FILES['file']['tmp_name']);
|
$mimeContentType = mime_content_type($_FILES['file']['tmp_name']);
|
||||||
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
|
|
||||||
|
|
||||||
$validFileExtension = true;
|
if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) {
|
||||||
|
|
||||||
if (empty($fileExtension) === false) {
|
|
||||||
$filtered_types = array_filter(
|
|
||||||
$filterFilesType,
|
|
||||||
function ($value) use ($fileExtension) {
|
|
||||||
$mimeTypeExtensionName = explode('/', $value)[1];
|
|
||||||
return $mimeTypeExtensionName === $fileExtension;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (empty($filtered_types) === true) {
|
|
||||||
$validFileExtension = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($validFileExtension === true && (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true)) {
|
|
||||||
$result = copy($_FILES['file']['tmp_name'], $nombre_archivo);
|
$result = copy($_FILES['file']['tmp_name'], $nombre_archivo);
|
||||||
} else {
|
} else {
|
||||||
$error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.';
|
$error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.';
|
||||||
@ -240,7 +224,7 @@ function create_text_file($default_real_directory, $destination_directory)
|
|||||||
|
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
if (!check_acl($config['id_user'], 0, 'AW')) {
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
AUDIT_LOG_ACL_VIOLATION,
|
AUDIT_LOG_ACL_VIOLATION,
|
||||||
'Trying to access File manager'
|
'Trying to access File manager'
|
||||||
@ -310,7 +294,7 @@ if ($create_dir === true) {
|
|||||||
$testHash = md5($directory.$config['server_unique_identifier']);
|
$testHash = md5($directory.$config['server_unique_identifier']);
|
||||||
|
|
||||||
if ($hash !== $testHash) {
|
if ($hash !== $testHash) {
|
||||||
ui_print_error_message(__('Security error.'));
|
ui_print_error_message(__('Security error.'));
|
||||||
} else {
|
} else {
|
||||||
$dirname = filemanager_safe_directory((string) get_parameter('dirname'));
|
$dirname = filemanager_safe_directory((string) get_parameter('dirname'));
|
||||||
|
|
||||||
@ -366,7 +350,7 @@ if ($delete_file === true) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (unlink($filename) === true) {
|
if (unlink($filename) === true) {
|
||||||
$config['filemanager']['delete'] = 1;
|
$config['filemanager']['delete'] = 1;
|
||||||
} else {
|
} else {
|
||||||
$config['filemanager']['delete'] = 0;
|
$config['filemanager']['delete'] = 0;
|
||||||
}
|
}
|
||||||
@ -516,77 +500,116 @@ function filemanager_file_explorer(
|
|||||||
check_opened_dialog('create_folder');
|
check_opened_dialog('create_folder');
|
||||||
}
|
}
|
||||||
<?php if ($allowCreateText === true) : ?>
|
<?php if ($allowCreateText === true) : ?>
|
||||||
function show_create_text_file() {
|
function show_create_text_file() {
|
||||||
actions_dialog('create_text_file');
|
actions_dialog('create_text_file');
|
||||||
$("#create_text_file").css("display", "block");
|
$("#create_text_file").css("display", "block");
|
||||||
check_opened_dialog('create_text_file');
|
check_opened_dialog('create_text_file');
|
||||||
}
|
}
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
function show_upload_file() {
|
function show_upload_file() {
|
||||||
actions_dialog('upload_file');
|
actions_dialog('upload_file');
|
||||||
$("#upload_file").css("display", "block");
|
$("#upload_file").css("display", "block");
|
||||||
check_opened_dialog('upload_file');
|
check_opened_dialog('upload_file');
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_opened_dialog(check_opened){
|
function check_opened_dialog(check_opened) {
|
||||||
if(check_opened !== 'create_folder'){
|
if (check_opened !== 'create_folder') {
|
||||||
if (($("#create_folder").hasClass("ui-dialog-content") && $('#create_folder').dialog('isOpen') === true)) {
|
if (($("#create_folder").hasClass("ui-dialog-content") && $('#create_folder').dialog('isOpen') === true)) {
|
||||||
$('#create_folder').dialog('close');
|
$('#create_folder').dialog('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<?php if ($allowCreateText === true) : ?>
|
<?php if ($allowCreateText === true) : ?>
|
||||||
if(check_opened !== 'create_text_file'){
|
if (check_opened !== 'create_text_file') {
|
||||||
if (($("#create_text_file").hasClass("ui-dialog-content") && $('#create_text_file').dialog('isOpen') === true)) {
|
if (($("#create_text_file").hasClass("ui-dialog-content") && $('#create_text_file').dialog('isOpen') === true)) {
|
||||||
$('#create_text_file').dialog('close');
|
$('#create_text_file').dialog('close');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
if(check_opened !== 'upload_file'){
|
if (check_opened !== 'upload_file') {
|
||||||
if (($("#upload_file").hasClass("ui-dialog-content") && $('#upload_file').dialog('isOpen')) === true) {
|
if (($("#upload_file").hasClass("ui-dialog-content") && $('#upload_file').dialog('isOpen')) === true) {
|
||||||
$('#upload_file').dialog('close');
|
$('#upload_file').dialog('close');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function actions_dialog(action){
|
function actions_dialog(action) {
|
||||||
$('.'+action).addClass('file_table_modal_active');
|
$('.' + action).addClass('file_table_modal_active');
|
||||||
var title_action ='';
|
var title_action = '';
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'create_folder':
|
case 'create_folder':
|
||||||
title_action = "<?php echo __('Create a Directory'); ?>";
|
title_action = "<?php echo __('Create a Directory'); ?>";
|
||||||
break;
|
break;
|
||||||
<?php if ($allowCreateText === true) : ?>
|
<?php if ($allowCreateText === true) : ?>
|
||||||
case 'create_text_file':
|
case 'create_text_file':
|
||||||
title_action = "<?php echo __('Create a Text'); ?>";
|
title_action = "<?php echo __('Create a Text'); ?>";
|
||||||
break;
|
break;
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
case 'upload_file':
|
case 'upload_file':
|
||||||
title_action = "<?php echo __('Upload Files'); ?>";
|
title_action = "<?php echo __('Upload Files'); ?>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#'+action)
|
$('#' + action)
|
||||||
.dialog({
|
.dialog({
|
||||||
title: title_action,
|
title: title_action,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
modal: true,
|
modal: true,
|
||||||
overlay: {
|
overlay: {
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
background: "black"
|
background: "black"
|
||||||
},
|
},
|
||||||
width: 500,
|
width: 500,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
minHeight: 210,
|
minHeight: 210,
|
||||||
maxWidth: 800,
|
maxWidth: 800,
|
||||||
maxHeight: 300,
|
maxHeight: 300,
|
||||||
close: function () {
|
close: function() {
|
||||||
$('.'+action).removeClass('file_table_modal_active');
|
$('.' + action).removeClass('file_table_modal_active');
|
||||||
}
|
}
|
||||||
}).show();
|
}).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_modal_real_path(path) {
|
||||||
|
if (navigator.clipboard && window.isSecureContext) <?php $secure_con = true; ?>;
|
||||||
|
else <?php $secure_con = false; ?>;
|
||||||
|
$('#modal_real_path').addClass('file_table_modal_active');
|
||||||
|
$('#real_path').empty();
|
||||||
|
$('#real_path').html(path);
|
||||||
|
title_action = "<?php echo __('Real path'); ?>";
|
||||||
|
$('#modal_real_path')
|
||||||
|
.dialog({
|
||||||
|
title: title_action,
|
||||||
|
resizable: true,
|
||||||
|
draggable: true,
|
||||||
|
modal: true,
|
||||||
|
overlay: {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
},
|
||||||
|
width: 448,
|
||||||
|
minWidth: 448,
|
||||||
|
minHeight: 213,
|
||||||
|
maxWidth: 800,
|
||||||
|
maxHeight: 300,
|
||||||
|
close: function() {
|
||||||
|
$('#modal_real_path').removeClass('file_table_modal_active');
|
||||||
|
}
|
||||||
|
}).show();
|
||||||
|
|
||||||
|
$("#submit-submit").on("click", copyToClipboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyToClipboard() {
|
||||||
|
if (navigator.clipboard && window.isSecureContext) {
|
||||||
|
window.navigator.clipboard.writeText($("#real_path").text()).then(function() {
|
||||||
|
$('#modal_real_path').dialog('close');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
@ -703,9 +726,9 @@ function filemanager_file_explorer(
|
|||||||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) === 'php'
|
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) === 'php'
|
||||||
&& (is_readable($fileinfo['realpath']) === true || is_executable($fileinfo['realpath']) === true)
|
&& (is_readable($fileinfo['realpath']) === true || is_executable($fileinfo['realpath']) === true)
|
||||||
) {
|
) {
|
||||||
$error_message = __('This file could be executed by any user');
|
$error_message = __('This file could be executed by any user');
|
||||||
$error_message .= '. '.__('Make sure it can\'t perform dangerous tasks');
|
$error_message .= '. '.__('Make sure it can\'t perform dangerous tasks');
|
||||||
$data[1] = '<span class="error forced_title" data-title="'.$error_message.'" data-use_title_for_force_title="1">'.$data[1].'</span>';
|
$data[1] = '<span class="error forced_title" data-title="'.$error_message.'" data-use_title_for_force_title="1">'.$data[1].'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[2] = ui_print_timestamp(
|
$data[2] = ui_print_timestamp(
|
||||||
@ -719,11 +742,11 @@ function filemanager_file_explorer(
|
|||||||
$data[3] = ui_format_filesize($fileinfo['size']);
|
$data[3] = ui_format_filesize($fileinfo['size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions buttons
|
// Actions buttons
|
||||||
// Delete button.
|
// Delete button.
|
||||||
$data[4] = '';
|
$data[4] = '';
|
||||||
$data[4] .= '<span style="display: flex">';
|
$data[4] .= '<span style="display: flex">';
|
||||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||||
if (is_writable($fileinfo['realpath']) === true
|
if (is_writable($fileinfo['realpath']) === true
|
||||||
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
|
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
|
||||||
&& ($readOnly === false)
|
&& ($readOnly === false)
|
||||||
@ -764,9 +787,16 @@ function filemanager_file_explorer(
|
|||||||
$data[4] .= '</a>';
|
$data[4] .= '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[4] .= '</span>';
|
if (is_writable($fileinfo['realpath']) === true
|
||||||
|
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
|
||||||
|
&& ($readOnly === false)
|
||||||
|
) {
|
||||||
|
$data[4] .= '<a href="javascript: show_modal_real_path(`'.$fileinfo['realpath'].'`);">'.html_print_image('images/book_edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Real path'), 'class' => 'invert_filter']).'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
array_push($table->data, $data);
|
$data[4] .= '</span>';
|
||||||
|
|
||||||
|
array_push($table->data, $data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ui_print_info_message(
|
ui_print_info_message(
|
||||||
@ -859,7 +889,7 @@ function filemanager_file_explorer(
|
|||||||
'content' => html_print_input_file(
|
'content' => html_print_input_file(
|
||||||
'file',
|
'file',
|
||||||
true,
|
true,
|
||||||
[ 'style' => 'border:0; padding:0; width:100%' ]
|
['style' => 'border:0; padding:0; width:100%']
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
true
|
true
|
||||||
@ -942,6 +972,22 @@ function filemanager_file_explorer(
|
|||||||
);
|
);
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
|
|
||||||
|
// Show Modal Real Path
|
||||||
|
$modal_real_path = "<div><b>Real path to plugin execution is:</b></div>
|
||||||
|
<div id='real_path'></div>";
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'on' || $_SERVER['SERVER_NAME'] == 'localhost' || $_SERVER['SERVER_NAME'] == '127.0.0.1') {
|
||||||
|
$modal_real_path .= "<div style='float:right;margin: 5em 0 0 auto';>".html_print_submit_button(__('Copy'), 'submit', false, 'class="sub next"', true).'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html_print_div(
|
||||||
|
[
|
||||||
|
'id' => 'modal_real_path',
|
||||||
|
'class' => 'invisible',
|
||||||
|
'content' => $modal_real_path,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
} else {
|
} else {
|
||||||
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";
|
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";
|
||||||
|
@ -797,6 +797,7 @@ if (is_ajax()) {
|
|||||||
$db_fragmentation = json_decode($d->getTablesFragmentation());
|
$db_fragmentation = json_decode($d->getTablesFragmentation());
|
||||||
$sys_info = json_decode($d->getSystemInfo());
|
$sys_info = json_decode($d->getSystemInfo());
|
||||||
$php_sys = json_decode($d->getPHPSetup());
|
$php_sys = json_decode($d->getPHPSetup());
|
||||||
|
$system_date = json_decode($d->getSystemDate());
|
||||||
|
|
||||||
$fragmentation_status = '';
|
$fragmentation_status = '';
|
||||||
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
|
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
|
||||||
@ -1030,6 +1031,14 @@ if (is_ajax()) {
|
|||||||
<p>'.$sys_info->data->ipInfo->value.'</p>
|
<p>'.$sys_info->data->ipInfo->value.'</p>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 15%;">
|
||||||
|
<p><span>'.$system_date->data->date->name.'</span></p>
|
||||||
|
</th>
|
||||||
|
<th style="width: 85%;">
|
||||||
|
<p>'.$system_date->data->date->value.'</p>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -519,12 +519,13 @@ function modules_delete_agent_module($id_agent_module)
|
|||||||
'disabled' => 1,
|
'disabled' => 1,
|
||||||
'delete_pending' => 1,
|
'delete_pending' => 1,
|
||||||
];
|
];
|
||||||
$result = db_process_sql_update(
|
$id_agent = db_process_sql_update(
|
||||||
'tagente_modulo',
|
'tagente_modulo',
|
||||||
$values,
|
$values,
|
||||||
['id_agente_modulo' => $id_borrar_modulo]
|
['id_agente_modulo' => $id_borrar_modulo]
|
||||||
);
|
);
|
||||||
if ($result === false) {
|
|
||||||
|
if ($id_agent === false) {
|
||||||
$error++;
|
$error++;
|
||||||
} else {
|
} else {
|
||||||
// Set flag to update module status count.
|
// Set flag to update module status count.
|
||||||
@ -562,7 +563,7 @@ function modules_delete_agent_module($id_agent_module)
|
|||||||
$result = db_process_delete_temp(
|
$result = db_process_delete_temp(
|
||||||
'ttag_module',
|
'ttag_module',
|
||||||
'id_agente_modulo',
|
'id_agente_modulo',
|
||||||
$id_borrar_modulo
|
$id_agent
|
||||||
);
|
);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
$error++;
|
$error++;
|
||||||
|
@ -1126,6 +1126,10 @@ function networkmap_open_graph(
|
|||||||
$head .= 'overlap="scalexy";';
|
$head .= 'overlap="scalexy";';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($layout == 'spring1' || $layout == 'spring2') {
|
||||||
|
$head .= 'sep="'.$node_sep.'";';
|
||||||
|
}
|
||||||
|
|
||||||
if ($layout === 'flat') {
|
if ($layout === 'flat') {
|
||||||
$head .= 'ranksep="'.$rank_sep.'";';
|
$head .= 'ranksep="'.$rank_sep.'";';
|
||||||
} else if ($layout === 'spring2') {
|
} else if ($layout === 'spring2') {
|
||||||
@ -1356,9 +1360,10 @@ function networkmap_get_types($strict_user=false)
|
|||||||
*/
|
*/
|
||||||
function networkmap_get_nodes_from_ip_mask(
|
function networkmap_get_nodes_from_ip_mask(
|
||||||
$ip_mask,
|
$ip_mask,
|
||||||
$return_ids_only=false
|
$return_ids_only=false,
|
||||||
|
$separator=',',
|
||||||
) {
|
) {
|
||||||
$list_ip_masks = explode(',', $ip_mask);
|
$list_ip_masks = explode($separator, $ip_mask);
|
||||||
|
|
||||||
if (empty($list_ip_masks) === true) {
|
if (empty($list_ip_masks) === true) {
|
||||||
return [];
|
return [];
|
||||||
|
@ -55,10 +55,30 @@ function draw_minimap() {
|
|||||||
var relation_min_nodes = minimap_relation;
|
var relation_min_nodes = minimap_relation;
|
||||||
var relation_minimap_w = 2;
|
var relation_minimap_w = 2;
|
||||||
var relation_minimap_h = 2;
|
var relation_minimap_h = 2;
|
||||||
if (graph.nodes.length > 100) {
|
if (graph.nodes.length > 100 && graph.nodes.length < 500) {
|
||||||
relation_min_nodes = 0.01;
|
relation_min_nodes = 0.01;
|
||||||
relation_minimap_w = (graph.nodes.length / 100) * 2.5;
|
relation_minimap_w = (graph.nodes.length / 100) * 2.5;
|
||||||
relation_minimap_h = 1.5;
|
relation_minimap_h = 1.5;
|
||||||
|
} else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) {
|
||||||
|
if (typeof method != "undefined" && method == 4) {
|
||||||
|
relation_min_nodes = 0.002;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
|
||||||
|
relation_minimap_h = 3;
|
||||||
|
} else {
|
||||||
|
relation_min_nodes = 0.008;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
|
||||||
|
relation_minimap_h = 3;
|
||||||
|
}
|
||||||
|
} else if (graph.nodes.length >= 1000) {
|
||||||
|
if (typeof method != "undefined" && method == 4) {
|
||||||
|
relation_min_nodes = 0.001;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 1000) * 4.5;
|
||||||
|
relation_minimap_h = 4;
|
||||||
|
} else {
|
||||||
|
relation_min_nodes = 0.0015;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 1000) * 3.5;
|
||||||
|
relation_minimap_h = 3.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw the items and lines
|
//Draw the items and lines
|
||||||
@ -1792,10 +1812,30 @@ function init_minimap() {
|
|||||||
var relation_minimap_w = 2;
|
var relation_minimap_w = 2;
|
||||||
var relation_minimap_h = 2;
|
var relation_minimap_h = 2;
|
||||||
|
|
||||||
if (graph.nodes.length > 100) {
|
if (graph.nodes.length > 100 && graph.nodes.length < 500) {
|
||||||
relation_min_nodes = 0.01;
|
relation_min_nodes = 0.01;
|
||||||
relation_minimap_w = (graph.nodes.length / 100) * 2.5;
|
relation_minimap_w = (graph.nodes.length / 100) * 2.5;
|
||||||
relation_minimap_h = 1.5;
|
relation_minimap_h = 1.5;
|
||||||
|
} else if (graph.nodes.length >= 500 && graph.nodes.length < 1000) {
|
||||||
|
if (typeof method != "undefined" && method == 4) {
|
||||||
|
relation_min_nodes = 0.002;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
|
||||||
|
relation_minimap_h = 3;
|
||||||
|
} else {
|
||||||
|
relation_min_nodes = 0.008;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 500) * 2.5;
|
||||||
|
relation_minimap_h = 3;
|
||||||
|
}
|
||||||
|
} else if (graph.nodes.length >= 1000) {
|
||||||
|
if (typeof method != "undefined" && method == 4) {
|
||||||
|
relation_min_nodes = 0.001;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 1000) * 4.5;
|
||||||
|
relation_minimap_h = 4;
|
||||||
|
} else {
|
||||||
|
relation_min_nodes = 0.0015;
|
||||||
|
relation_minimap_w = (graph.nodes.length / 1000) * 3.5;
|
||||||
|
relation_minimap_h = 3.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#minimap_" + networkmap_id).bind("mousemove", function(event) {
|
$("#minimap_" + networkmap_id).bind("mousemove", function(event) {
|
||||||
@ -3092,6 +3132,10 @@ function init_graph(parameter_object) {
|
|||||||
window.refresh_time = parameter_object.refresh_time;
|
window.refresh_time = parameter_object.refresh_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof parameter_object.method != "undefined") {
|
||||||
|
window.method = parameter_object.method;
|
||||||
|
}
|
||||||
|
|
||||||
var rect_center_x = graph.nodes[0].x;
|
var rect_center_x = graph.nodes[0].x;
|
||||||
var rect_center_y = graph.nodes[0].y;
|
var rect_center_y = graph.nodes[0].y;
|
||||||
|
|
||||||
|
@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
// Show the modal window of an event
|
// Show the modal window of an event
|
||||||
function show_event_dialog(event, dialog_page) {
|
function show_event_dialog(event, dialog_page) {
|
||||||
var ajax_file = $("#hidden-ajax_file").val();
|
var ajax_file = getUrlAjax();
|
||||||
|
|
||||||
|
var view = ``;
|
||||||
|
|
||||||
|
if ($("#event_details_window").length) {
|
||||||
|
view = "#event_details_window";
|
||||||
|
} else if ($("#sound_event_details_window").length) {
|
||||||
|
view = "#sound_event_details_window";
|
||||||
|
}
|
||||||
|
|
||||||
if (dialog_page == undefined) {
|
if (dialog_page == undefined) {
|
||||||
dialog_page = "general";
|
dialog_page = "general";
|
||||||
@ -39,7 +47,7 @@ function show_event_dialog(event, dialog_page) {
|
|||||||
filter: values
|
filter: values
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
$("#event_details_window")
|
$(view)
|
||||||
.hide()
|
.hide()
|
||||||
.empty()
|
.empty()
|
||||||
.append(data)
|
.append(data)
|
||||||
@ -122,7 +130,7 @@ function execute_response(event_id, server_id) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// If cannot get response abort it
|
// If cannot get response abort it
|
||||||
@ -153,7 +161,7 @@ function execute_response_massive(events, response_id, response_parameters) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
// If cannot get response abort it
|
// If cannot get response abort it
|
||||||
@ -203,7 +211,7 @@ function execute_response_massive(events, response_id, response_parameters) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$(".container-massive-events-response").append(data);
|
$(".container-massive-events-response").append(data);
|
||||||
@ -240,13 +248,21 @@ function show_response_dialog(response_id, response) {
|
|||||||
params.push({ name: "server_id", value: response.server_id });
|
params.push({ name: "server_id", value: response.server_id });
|
||||||
params.push({ name: "response", value: JSON.stringify(response) });
|
params.push({ name: "response", value: JSON.stringify(response) });
|
||||||
|
|
||||||
|
var view = ``;
|
||||||
|
|
||||||
|
if ($("#event_response_window").length) {
|
||||||
|
view = "#event_response_window";
|
||||||
|
} else if ($("#sound_event_response_window").length) {
|
||||||
|
view = "#sound_event_response_window";
|
||||||
|
}
|
||||||
|
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$("#event_response_window")
|
$(view)
|
||||||
.hide()
|
.hide()
|
||||||
.empty()
|
.empty()
|
||||||
.append(data)
|
.append(data)
|
||||||
@ -292,7 +308,7 @@ function perform_response(response, response_id, index) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var out = data.replace(/[\n|\r]/g, "<br>");
|
var out = data.replace(/[\n|\r]/g, "<br>");
|
||||||
@ -321,7 +337,7 @@ function event_change_status(event_ids, server_id) {
|
|||||||
server_id: server_id
|
server_id: server_id
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$("#button-status_button").removeAttr("disabled");
|
$("#button-status_button").removeAttr("disabled");
|
||||||
@ -350,9 +366,12 @@ function event_change_status(event_ids, server_id) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#table_events")
|
if ($("#table_events").length) {
|
||||||
.DataTable()
|
$("#table_events")
|
||||||
.draw(false);
|
.DataTable()
|
||||||
|
.draw(false);
|
||||||
|
}
|
||||||
|
|
||||||
$("#notification_status_success").show();
|
$("#notification_status_success").show();
|
||||||
|
|
||||||
$("#general_status")
|
$("#general_status")
|
||||||
@ -385,7 +404,7 @@ function event_change_owner(event_id, server_id) {
|
|||||||
new_owner: new_owner
|
new_owner: new_owner
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
async: true,
|
async: true,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@ -404,9 +423,12 @@ function event_change_owner(event_id, server_id) {
|
|||||||
// if (typeof dt_events !== "undefined") {
|
// if (typeof dt_events !== "undefined") {
|
||||||
// dt_events.draw(false);
|
// dt_events.draw(false);
|
||||||
// }
|
// }
|
||||||
$("#table_events")
|
|
||||||
.DataTable()
|
if ($("#table_events").length) {
|
||||||
.draw(false);
|
$("#table_events")
|
||||||
|
.DataTable()
|
||||||
|
.draw(false);
|
||||||
|
}
|
||||||
$("#notification_owner_success").show();
|
$("#notification_owner_success").show();
|
||||||
if (new_owner == -1) {
|
if (new_owner == -1) {
|
||||||
$("#extended_event_general_page table td.general_owner").html(
|
$("#extended_event_general_page table td.general_owner").html(
|
||||||
@ -460,7 +482,7 @@ function event_comment(current_event) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params.join("&"),
|
data: params.join("&"),
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function() {
|
success: function() {
|
||||||
$("#button-comment_button").removeAttr("disabled");
|
$("#button-comment_button").removeAttr("disabled");
|
||||||
@ -485,7 +507,7 @@ function update_event(table, id_evento, type, event_rep, row, server_id) {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
async: true,
|
async: true,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
data: {
|
data: {
|
||||||
page: "include/ajax/events",
|
page: "include/ajax/events",
|
||||||
validate_event: type.validate_event,
|
validate_event: type.validate_event,
|
||||||
@ -776,7 +798,7 @@ function show_response_dialog_massive(response_id, response_parameters) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// If cannot get response abort it
|
// If cannot get response abort it
|
||||||
@ -914,7 +936,7 @@ function process_buffers(buffers) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params.join("&"),
|
data: params.join("&"),
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: getUrlAjax(),
|
||||||
async: true,
|
async: true,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@ -1030,8 +1052,10 @@ function openSoundEventModal(settings) {
|
|||||||
|
|
||||||
function test_sound_button(test_sound, urlSound) {
|
function test_sound_button(test_sound, urlSound) {
|
||||||
if (test_sound === true) {
|
if (test_sound === true) {
|
||||||
|
$("#button-melody_sound").addClass("blink-image");
|
||||||
add_audio(urlSound);
|
add_audio(urlSound);
|
||||||
} else {
|
} else {
|
||||||
|
$("#button-melody_sound").removeClass("blink-image");
|
||||||
remove_audio();
|
remove_audio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1147,6 +1171,7 @@ function check_event_sound(settings) {
|
|||||||
// Add elements.
|
// Add elements.
|
||||||
data.forEach(function(element) {
|
data.forEach(function(element) {
|
||||||
var li = document.createElement("li");
|
var li = document.createElement("li");
|
||||||
|
var b64 = btoa(JSON.stringify(element));
|
||||||
li.insertAdjacentHTML(
|
li.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
'<div class="li-priority">' + element.priority + "</div>"
|
'<div class="li-priority">' + element.priority + "</div>"
|
||||||
@ -1157,7 +1182,7 @@ function check_event_sound(settings) {
|
|||||||
);
|
);
|
||||||
li.insertAdjacentHTML(
|
li.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
'<div class="li-title">' + element.message + "</div>"
|
`<div class="li-title"><a href="javascript:" onclick="show_event_dialog('${b64}')">${element.message}</a></div>`
|
||||||
);
|
);
|
||||||
li.insertAdjacentHTML(
|
li.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
@ -1185,10 +1210,12 @@ function table_info_response_event(response_id, event_id, server_id, massive) {
|
|||||||
params.push({ name: "server_id", value: server_id });
|
params.push({ name: "server_id", value: server_id });
|
||||||
params.push({ name: "event_id", value: event_id });
|
params.push({ name: "event_id", value: event_id });
|
||||||
|
|
||||||
|
var url = getUrlAjax();
|
||||||
|
|
||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: url,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (response) {
|
if (response) {
|
||||||
@ -1201,7 +1228,7 @@ function table_info_response_event(response_id, event_id, server_id, massive) {
|
|||||||
jQuery.ajax({
|
jQuery.ajax({
|
||||||
data: params,
|
data: params,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: $("#hidden-ajax_file").val(),
|
url: url,
|
||||||
dataType: "html",
|
dataType: "html",
|
||||||
success: function(output) {
|
success: function(output) {
|
||||||
if (massive === true) {
|
if (massive === true) {
|
||||||
@ -1216,3 +1243,11 @@ function table_info_response_event(response_id, event_id, server_id, massive) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUrlAjax() {
|
||||||
|
if ($("#hidden-ajax_file").length) {
|
||||||
|
return $("#hidden-ajax_file").val();
|
||||||
|
} else if ($("#hidden-ajax_file_sound_console").length) {
|
||||||
|
return $("#hidden-ajax_file_sound_console").val();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -301,3 +301,59 @@
|
|||||||
background: #e63c52;
|
background: #e63c52;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Firefox old*/
|
||||||
|
@-moz-keyframes blink {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes blink {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* IE */
|
||||||
|
@-ms-keyframes blink {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Opera and prob css3 final iteration */
|
||||||
|
@keyframes blink {
|
||||||
|
0% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.blink-image {
|
||||||
|
-moz-animation: blink normal 2s infinite ease-in-out; /* Firefox */
|
||||||
|
-webkit-animation: blink normal 2s infinite ease-in-out; /* Webkit */
|
||||||
|
-ms-animation: blink normal 2s infinite ease-in-out; /* IE */
|
||||||
|
animation: blink normal 2s infinite ease-in-out; /* Opera and prob css3 final iteration */
|
||||||
|
filter: hue-rotate(120deg);
|
||||||
|
}
|
||||||
|
@ -323,6 +323,27 @@ a.pandora_pagination.current:hover {
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter_input_datatable {
|
||||||
|
width: 45% !important;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex-direction: row;
|
||||||
|
max-width: 450px;
|
||||||
|
min-width: 400px;
|
||||||
|
}
|
||||||
|
.filter_input_datatable input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.filter_input_datatable label {
|
||||||
|
width: 93px;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.filter_input_datatable .select2.select2-container {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.datatable_filter.content li.filter_input_datatable {
|
||||||
|
margin: 1em 0;
|
||||||
|
}
|
||||||
/* Default datatable filter style */
|
/* Default datatable filter style */
|
||||||
.datatable_filter.content {
|
.datatable_filter.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -337,6 +358,7 @@ a.pandora_pagination.current:hover {
|
|||||||
.datatable_filter.content li {
|
.datatable_filter.content li {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
margin: 1em auto;
|
margin: 1em auto;
|
||||||
|
padding: 0px 10px;
|
||||||
}
|
}
|
||||||
.sorting_desc {
|
.sorting_desc {
|
||||||
background: url(../../images/sort_down_green.png) no-repeat;
|
background: url(../../images/sort_down_green.png) no-repeat;
|
||||||
|
@ -1049,6 +1049,7 @@ if (isset($_GET['bye'])) {
|
|||||||
header_remove('Set-Cookie');
|
header_remove('Set-Cookie');
|
||||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||||
|
|
||||||
|
generate_csrf_code();
|
||||||
// Process logout.
|
// Process logout.
|
||||||
include 'general/logoff.php';
|
include 'general/logoff.php';
|
||||||
|
|
||||||
|
@ -130,8 +130,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style='padding-bottom: 50px'>
|
<div style='padding-bottom: 50px'>
|
||||||
<?php
|
<?php
|
||||||
$version = '7.0NG.768';
|
$version = '7.0NG.769';
|
||||||
$build = '230206';
|
$build = '230222';
|
||||||
$banner = "v$version Build $build";
|
$banner = "v$version Build $build";
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ if ($new_networkmap) {
|
|||||||
$offset_x = '';
|
$offset_x = '';
|
||||||
$offset_y = '';
|
$offset_y = '';
|
||||||
$scale_z = 0.5;
|
$scale_z = 0.5;
|
||||||
$node_sep = 10;
|
$node_sep = 0.25;
|
||||||
$rank_sep = 1.0;
|
$rank_sep = 0.5;
|
||||||
$mindist = 1.0;
|
$mindist = 1.0;
|
||||||
$kval = 5;
|
$kval = 0.3;
|
||||||
$refresh_time = 300;
|
$refresh_time = 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,6 +273,25 @@ if (!empty($result)) {
|
|||||||
if ($not_found) {
|
if ($not_found) {
|
||||||
ui_print_error_message(__('Not found networkmap.'));
|
ui_print_error_message(__('Not found networkmap.'));
|
||||||
} else {
|
} else {
|
||||||
|
if ($disabled_source === false) {
|
||||||
|
echo '<div id="map_loading" style="width: 98%;height: 1000px; background-color: rgba(245, 245, 245, .3);position: absolute;display: flex;justify-content: center;align-items: center;flex-direction: column-reverse;">';
|
||||||
|
echo html_print_image('images/spinner.gif', true, 'width: 50px;height: 50px;');
|
||||||
|
echo '<div>'.__('Creating map...').'</div>';
|
||||||
|
echo '</div>';
|
||||||
|
$info1 = __('To create a network map that visually recreates link-level (L2) relationships, you must first discover these relationships with Discovery Server. Network maps only reflect relationships that have already been discovered.');
|
||||||
|
$separator = '<br>';
|
||||||
|
$info2 = __('Discovery Server discovers relationships between interfaces (L2) through SNMP and relationships between hosts (L3) through route discovery.');
|
||||||
|
$info3 = __('You can also create these relationships manually by editing nodes or re-passing a discovery task after adding new information (for example by adding new SNMP communities).');
|
||||||
|
$info4 = __('See our documentation for more information.');
|
||||||
|
ui_print_info_message(
|
||||||
|
[
|
||||||
|
'no_close' => false,
|
||||||
|
'message' => $info1.$separator.$info2.$separator.$info3.$separator.$info4,
|
||||||
|
],
|
||||||
|
'style="width: 98%;"'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$table = new stdClass();
|
$table = new stdClass();
|
||||||
$table->id = 'form_editor';
|
$table->id = 'form_editor';
|
||||||
|
|
||||||
@ -337,7 +356,14 @@ if ($not_found) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data[3][0] = __('Description');
|
$table->data[3][0] = __('Description');
|
||||||
$table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true);
|
$table->data[3][1] = html_print_input_text(
|
||||||
|
'description',
|
||||||
|
$description,
|
||||||
|
'',
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
$table->data[4][0] = __('Position X');
|
$table->data[4][0] = __('Position X');
|
||||||
$table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true);
|
$table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true);
|
||||||
@ -352,7 +378,23 @@ if ($not_found) {
|
|||||||
$table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
|
$table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
|
||||||
|
|
||||||
$table->data['source'][0] = __('Source');
|
$table->data['source'][0] = __('Source');
|
||||||
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true, $disabled_source).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true, $disabled_source).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true, $disabled_source);
|
$table->data['source'][1] = html_print_select(
|
||||||
|
[
|
||||||
|
'group' => __('Group'),
|
||||||
|
'recon_task' => __('Discovery task'),
|
||||||
|
'ip_mask' => __('CIDR IP mask'),
|
||||||
|
],
|
||||||
|
'source',
|
||||||
|
$source,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
$table->data['source_data_recon_task'][0] = __('Source from recon task');
|
$table->data['source_data_recon_task'][0] = __('Source from recon task');
|
||||||
$table->data['source_data_recon_task'][0] .= ui_print_help_tip(
|
$table->data['source_data_recon_task'][0] .= ui_print_help_tip(
|
||||||
@ -378,18 +420,28 @@ if ($not_found) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
||||||
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $ip_mask, '', 20, 255, true, $disabled_source);
|
$table->data['source_data_ip_mask'][1] = html_print_textarea(
|
||||||
|
'ip_mask',
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
$ip_mask,
|
||||||
|
'style="width: 238px"',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
$table->data['source_data_group'][0] = __('Source group');
|
$table->data['source_data_group'][0] = __('Source group');
|
||||||
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
|
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
|
||||||
$config['id_user'],
|
$config['id_user'],
|
||||||
'AR',
|
'AR',
|
||||||
true,
|
true,
|
||||||
'id_group',
|
'id_group[]',
|
||||||
$id_group,
|
explode(',', $id_group),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
|
true,
|
||||||
true
|
true
|
||||||
).'</div>';
|
).'</div>';
|
||||||
$table->data['source_data_group'][1] .= html_print_image(
|
$table->data['source_data_group'][1] .= html_print_image(
|
||||||
@ -498,8 +550,9 @@ if ($not_found) {
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("input[name='source']").on('change', function() {
|
$("#map_loading").hide();
|
||||||
var source = $("input[name='source']:checked").val();
|
$("#source").change(function() {
|
||||||
|
const source = $(this).val();
|
||||||
|
|
||||||
if (source == 'recon_task') {
|
if (source == 'recon_task') {
|
||||||
$("#form_editor-source_data_ip_mask")
|
$("#form_editor-source_data_ip_mask")
|
||||||
@ -510,7 +563,6 @@ $(document).ready(function() {
|
|||||||
.css('display', 'none');
|
.css('display', 'none');
|
||||||
$("#form_editor-source_data_recon_task")
|
$("#form_editor-source_data_recon_task")
|
||||||
.css('display', '');
|
.css('display', '');
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (source == 'ip_mask') {
|
else if (source == 'ip_mask') {
|
||||||
$("#form_editor-source_data_ip_mask")
|
$("#form_editor-source_data_ip_mask")
|
||||||
@ -565,7 +617,7 @@ $(document).ready(function() {
|
|||||||
$("#form_editor-kval")
|
$("#form_editor-kval")
|
||||||
.css('display', 'none');
|
.css('display', 'none');
|
||||||
$("#form_editor-nodesep")
|
$("#form_editor-nodesep")
|
||||||
.css('display', '');
|
.css('display', 'none');
|
||||||
}
|
}
|
||||||
else if (method == 'neato') {
|
else if (method == 'neato') {
|
||||||
$("#form_editor-ranksep")
|
$("#form_editor-ranksep")
|
||||||
@ -599,16 +651,14 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("input[name='source']").trigger("change");
|
$("#source").trigger("change");
|
||||||
$("#method").trigger("change");
|
$("#method").trigger("change");
|
||||||
|
|
||||||
|
|
||||||
// Control if id_group has changed.
|
// Control if id_group has changed.
|
||||||
var id_group_old = $("#id_group").val();
|
var id_group_old = $("#id_group").val();
|
||||||
var id_group_changed = false;
|
var id_group_changed = false;
|
||||||
|
|
||||||
$("#id_group").on('change',{id_group_old: id_group_old}, function () {
|
$("#id_group").on('change',{id_group_old: id_group_old}, function () {
|
||||||
|
|
||||||
var id_group_new = $("#id_group").val();
|
var id_group_new = $("#id_group").val();
|
||||||
if((id_group_old != id_group_new) && (update_networkmap == 1 )) {
|
if((id_group_old != id_group_new) && (update_networkmap == 1 )) {
|
||||||
id_group_changed = true;
|
id_group_changed = true;
|
||||||
@ -625,7 +675,7 @@ $(document).ready(function() {
|
|||||||
update_networkmap = $("input[name='update_networkmap']").val();
|
update_networkmap = $("input[name='update_networkmap']").val();
|
||||||
|
|
||||||
$( "#submit-crt" ).click(function( event ) {
|
$( "#submit-crt" ).click(function( event ) {
|
||||||
|
$("#map_loading").show();
|
||||||
if(update_networkmap == 1 && id_group_changed === true) {
|
if(update_networkmap == 1 && id_group_changed === true) {
|
||||||
confirmDialog({
|
confirmDialog({
|
||||||
title: '<?php echo __('Are you sure?'); ?>',
|
title: '<?php echo __('Are you sure?'); ?>',
|
||||||
@ -643,7 +693,6 @@ $(document).ready(function() {
|
|||||||
})
|
})
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#refresh_time_units").trigger("change");
|
$("#refresh_time_units").trigger("change");
|
||||||
|
@ -182,7 +182,7 @@ if ($save_empty_networkmap === true) {
|
|||||||
|
|
||||||
$values = [];
|
$values = [];
|
||||||
$values['name'] = $name;
|
$values['name'] = $name;
|
||||||
$values['id_group'] = $id_group;
|
$values['id_group'] = implode(',', $id_group);
|
||||||
|
|
||||||
$values['generation_method'] = 4;
|
$values['generation_method'] = 4;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ if ($new_networkmap || $save_networkmap) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($save_networkmap) {
|
if ($save_networkmap) {
|
||||||
$id_group = (int) get_parameter('id_group', 0);
|
$id_group = get_parameter('id_group', 0);
|
||||||
$id_group_map = (int) get_parameter('id_group_map', 0);
|
$id_group_map = (int) get_parameter('id_group_map', 0);
|
||||||
|
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ if ($new_networkmap || $save_networkmap) {
|
|||||||
|
|
||||||
$values = [];
|
$values = [];
|
||||||
$values['name'] = $name;
|
$values['name'] = $name;
|
||||||
$values['id_group'] = $id_group;
|
$values['id_group'] = implode(',', $id_group);
|
||||||
$values['source_period'] = 60;
|
$values['source_period'] = 60;
|
||||||
$values['width'] = $width;
|
$values['width'] = $width;
|
||||||
$values['height'] = $height;
|
$values['height'] = $height;
|
||||||
@ -333,7 +333,7 @@ if ($new_networkmap || $save_networkmap) {
|
|||||||
|
|
||||||
if ($source == 'group') {
|
if ($source == 'group') {
|
||||||
$values['source'] = 0;
|
$values['source'] = 0;
|
||||||
$values['source_data'] = $id_group;
|
$values['source_data'] = implode(',', $id_group);
|
||||||
} else if ($source == 'recon_task') {
|
} else if ($source == 'recon_task') {
|
||||||
$values['source'] = 1;
|
$values['source'] = 1;
|
||||||
$values['source_data'] = $recon_task_id;
|
$values['source_data'] = $recon_task_id;
|
||||||
@ -444,7 +444,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($update_networkmap) {
|
if ($update_networkmap) {
|
||||||
$id_group = (int) get_parameter('id_group', 0);
|
$id_group = get_parameter('id_group', 0);
|
||||||
// Get id of old group source to check changes.
|
// Get id of old group source to check changes.
|
||||||
$id_group_old = db_get_value('id_group', 'tmap', 'id', $id);
|
$id_group_old = db_get_value('id_group', 'tmap', 'id', $id);
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
|
|||||||
|
|
||||||
$values = [];
|
$values = [];
|
||||||
$values['name'] = $name;
|
$values['name'] = $name;
|
||||||
$values['id_group'] = $id_group;
|
$values['id_group'] = implode(',', $id_group);
|
||||||
$values['id_group_map'] = $id_group_map;
|
$values['id_group_map'] = $id_group_map;
|
||||||
|
|
||||||
$description = get_parameter('description', '');
|
$description = get_parameter('description', '');
|
||||||
|
@ -171,7 +171,23 @@ if (is_ajax() === true) {
|
|||||||
$table->data[6][1] = html_print_input_text('scale_z', $map_filter['z_dash'], '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
|
$table->data[6][1] = html_print_input_text('scale_z', $map_filter['z_dash'], '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true);
|
||||||
|
|
||||||
$table->data['source'][0] = __('Source');
|
$table->data['source'][0] = __('Source');
|
||||||
$table->data['source'][1] = html_print_radio_button('source', 'group', __('Group'), $source, true).html_print_radio_button('source', 'recon_task', __('Discovery task'), $source, true).html_print_radio_button('source', 'ip_mask', __('CIDR IP mask'), $source, true);
|
$table->data['source'][1] = html_print_select(
|
||||||
|
[
|
||||||
|
'group' => __('Group'),
|
||||||
|
'recon_task' => __('Discovery task'),
|
||||||
|
'ip_mask' => __('CIDR IP mask'),
|
||||||
|
],
|
||||||
|
'source',
|
||||||
|
$source,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||||
$sql = sprintf(
|
$sql = sprintf(
|
||||||
@ -221,7 +237,16 @@ if (is_ajax() === true) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
|
||||||
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $map_info['source_data'], '', 20, 255, true);
|
$table->data['source_data_ip_mask'][1] = html_print_textarea(
|
||||||
|
'ip_mask',
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
$map_info['source_data'],
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
$disabled_source
|
||||||
|
);
|
||||||
|
|
||||||
$dont_show_subgroups = 0;
|
$dont_show_subgroups = 0;
|
||||||
if (isset($map_filter['dont_show_subgroups'])) {
|
if (isset($map_filter['dont_show_subgroups'])) {
|
||||||
@ -296,8 +321,8 @@ if (is_ajax() === true) {
|
|||||||
$map_form .= html_print_table($table, true);
|
$map_form .= html_print_table($table, true);
|
||||||
|
|
||||||
$map_form .= '<script>
|
$map_form .= '<script>
|
||||||
$("input[name=\'source\']").on(\'change\', function() {
|
$("#source").change(function() {
|
||||||
var source = $("input[name=\'source\']:checked").val();
|
const source = $(this).val();
|
||||||
|
|
||||||
if (source == \'recon_task\') {
|
if (source == \'recon_task\') {
|
||||||
$("#form_editor-source_data_ip_mask")
|
$("#form_editor-source_data_ip_mask")
|
||||||
@ -389,7 +414,7 @@ if (is_ajax() === true) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("input[name=\'source\']").trigger("change");
|
$("#source").trigger("change");
|
||||||
$("#method").trigger("change");
|
$("#method").trigger("change");
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ $autosearch = false;
|
|||||||
// It is validated if it receives parameters different from those it has by default.
|
// It is validated if it receives parameters different from those it has by default.
|
||||||
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
||||||
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|
|| $ag_modulename !== '' || $refr !== 0 || $offset !== 0 || $status !== 4
|
||||||
|| $modulegroup !== -1 || $tag_filter !== 0 || $sortField !== ''
|
|| $modulegroup !== -1 || (bool) array_filter($tag_filter) !== false || $sortField !== ''
|
||||||
|| $sort !== 'none' || $id_module !== 0 || $module_option !== 1
|
|| $sort !== 'none' || $id_module !== 0 || $module_option !== 1
|
||||||
|| $min_hours_status !== ''
|
|| $min_hours_status !== ''
|
||||||
) {
|
) {
|
||||||
@ -276,6 +276,7 @@ if ($loaded_filter['id_filter'] > 0) {
|
|||||||
if (is_array($tag_filter) === false) {
|
if (is_array($tag_filter) === false) {
|
||||||
$tag_filter = json_decode($tag_filter, true);
|
$tag_filter = json_decode($tag_filter, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tag_filter === '') {
|
if ($tag_filter === '') {
|
||||||
$tag_filter = [0 => 0];
|
$tag_filter = [0 => 0];
|
||||||
}
|
}
|
||||||
@ -459,17 +460,17 @@ if ($all_tags === false) {
|
|||||||
$sql_conditions_tags = '';
|
$sql_conditions_tags = '';
|
||||||
|
|
||||||
if (!users_is_admin()) {
|
if (!users_is_admin()) {
|
||||||
$sql_conditions_tags = tags_get_acl_tags(
|
$sql_conditions_tags = tags_get_acl_tags(
|
||||||
$config['id_user'],
|
$config['id_user'],
|
||||||
($recursion) ? $all_groups : $ag_group,
|
($recursion) ? array_flip($all_groups) : $ag_group,
|
||||||
'AR',
|
'AR',
|
||||||
'module_condition',
|
'module_condition',
|
||||||
'AND',
|
'AND',
|
||||||
'tagente_modulo',
|
'tagente_modulo',
|
||||||
true,
|
true,
|
||||||
[],
|
[],
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_numeric($sql_conditions_tags)) {
|
if (is_numeric($sql_conditions_tags)) {
|
||||||
$sql_conditions_tags = ' AND 1 = 0';
|
$sql_conditions_tags = ' AND 1 = 0';
|
||||||
|
@ -1473,9 +1473,11 @@ if ($tab == 'inventory') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collection.
|
// Collection.
|
||||||
$collectiontab = enterprise_hook('collection_tab');
|
if ((int) $config['license_nms'] !== 1) {
|
||||||
if ($collectiontab == -1) {
|
$collectiontab = enterprise_hook('collection_tab');
|
||||||
$collectiontab = '';
|
if ($collectiontab == -1) {
|
||||||
|
$collectiontab = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,6 +239,13 @@ $server_id = get_parameter(
|
|||||||
($filter['server_id'] ?? '')
|
($filter['server_id'] ?? '')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (empty($id_agent) === true) {
|
||||||
|
$id_agent = get_parameter(
|
||||||
|
'id_agent',
|
||||||
|
($filter['id_agent'] ?? '')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
$servers = metaconsole_get_servers();
|
$servers = metaconsole_get_servers();
|
||||||
if (is_array($servers) === true) {
|
if (is_array($servers) === true) {
|
||||||
@ -2413,8 +2420,6 @@ try {
|
|||||||
100,
|
100,
|
||||||
200,
|
200,
|
||||||
500,
|
500,
|
||||||
1000,
|
|
||||||
-1,
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
$config['block_size'],
|
$config['block_size'],
|
||||||
@ -2423,8 +2428,6 @@ try {
|
|||||||
100,
|
100,
|
||||||
200,
|
200,
|
||||||
500,
|
500,
|
||||||
1000,
|
|
||||||
'All',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'order' => [
|
'order' => [
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# Pandora FMS Console
|
# Pandora FMS Console
|
||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.768
|
%define version 7.0NG.769
|
||||||
%define release 230206
|
%define release 230222
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# Pandora FMS Console
|
# Pandora FMS Console
|
||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.768
|
%define version 7.0NG.769
|
||||||
%define release 230206
|
%define release 230222
|
||||||
|
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# Pandora FMS Console
|
# Pandora FMS Console
|
||||||
#
|
#
|
||||||
%define name pandorafms_console
|
%define name pandorafms_console
|
||||||
%define version 7.0NG.768
|
%define version 7.0NG.769
|
||||||
%define release 230206
|
%define release 230222
|
||||||
%define httpd_name httpd
|
%define httpd_name httpd
|
||||||
# User and Group under which Apache is running
|
# User and Group under which Apache is running
|
||||||
%define httpd_name apache2
|
%define httpd_name apache2
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# This code is licensed under GPL 2.0 license.
|
# This code is licensed under GPL 2.0 license.
|
||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
PI_VERSION="7.0NG.768"
|
PI_VERSION="7.0NG.769"
|
||||||
FORCE=0
|
FORCE=0
|
||||||
DESTDIR=""
|
DESTDIR=""
|
||||||
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`
|
||||||
|
@ -2323,7 +2323,7 @@ CREATE TABLE IF NOT EXISTS `tsessions_php` (
|
|||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
CREATE TABLE IF NOT EXISTS `tmap` (
|
CREATE TABLE IF NOT EXISTS `tmap` (
|
||||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`id_group` INT UNSIGNED NOT NULL DEFAULT 0,
|
`id_group` TEXT NOT NULL DEFAULT '',
|
||||||
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
|
`id_user` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`type` INT UNSIGNED NOT NULL DEFAULT 0,
|
`type` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
`subtype` INT UNSIGNED NOT NULL DEFAULT 0,
|
`subtype` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
@ -97,7 +97,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||||||
('first_login', 0),
|
('first_login', 0),
|
||||||
('mins_fail_pass', 5),
|
('mins_fail_pass', 5),
|
||||||
('number_attempts', 5),
|
('number_attempts', 5),
|
||||||
('enable_pass_policy_admin', 0),
|
('enable_pass_policy_admin', 1),
|
||||||
('enable_pass_history', 0),
|
('enable_pass_history', 0),
|
||||||
('compare_pass', 3),
|
('compare_pass', 3),
|
||||||
('meta_style', 'meta_pandora'),
|
('meta_style', 'meta_pandora'),
|
||||||
@ -112,10 +112,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||||||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||||
('custom_report_front_header', ''),
|
('custom_report_front_header', ''),
|
||||||
('custom_report_front_footer', ''),
|
('custom_report_front_footer', ''),
|
||||||
('MR', 60),
|
('MR', 61),
|
||||||
('identification_reminder', 1),
|
('identification_reminder', 1),
|
||||||
('identification_reminder_timestamp', 0),
|
('identification_reminder_timestamp', 0),
|
||||||
('current_package', 768),
|
('current_package', 769),
|
||||||
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.00097656250000":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'),
|
('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.00097656250000":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'),
|
||||||
('custom_docs_logo', 'default_docs.png'),
|
('custom_docs_logo', 'default_docs.png'),
|
||||||
('custom_support_logo', 'default_support.png'),
|
('custom_support_logo', 'default_support.png'),
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package: pandorafms-server
|
package: pandorafms-server
|
||||||
Version: 7.0NG.768-230206
|
Version: 7.0NG.769-230222
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: admin
|
Section: admin
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
pandora_version="7.0NG.768-230206"
|
pandora_version="7.0NG.769-230222"
|
||||||
|
|
||||||
package_cpan=0
|
package_cpan=0
|
||||||
package_pandora=1
|
package_pandora=1
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
##########################################################################
|
################################################################################
|
||||||
# pandora_exec
|
# pandora_exec - Execute a command with a time limit.
|
||||||
#
|
#
|
||||||
# Executes the given command and prints its output to stdout. If the
|
# Copyright (c) 2008-2023 Artica PFMS S.L.
|
||||||
# execution times out or the command does not exist nothing is printed
|
|
||||||
# to stdout. This is part of Pandora FMS Plugin server, do not delete!.
|
|
||||||
#
|
|
||||||
# Usage: pandora_exec <timeout in seconds> <command>
|
|
||||||
##########################################################################
|
|
||||||
# Copyright (c) 2008 Ramon Novoa, rnovoa@gmail.com
|
|
||||||
# (c) 2008 Artica Soluciones Tecnologicas S.L
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -22,41 +15,41 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
##########################################################################
|
################################################################################
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use POSIX qw(WEXITSTATUS WIFEXITED);
|
||||||
|
|
||||||
# Check command line parameters
|
# Check command line arguments.
|
||||||
if ($#ARGV < 1) {
|
if ($#ARGV < 1) {
|
||||||
|
print("Usage: $0 <timeout in seconds> <command>\n");
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @opts = @ARGV;
|
my @opts = @ARGV;
|
||||||
my $timeout = shift(@opts);
|
my $timeout = shift(@opts);
|
||||||
my $command;
|
my $command = ($0 =~ m/_agent_exec$/) ? # For backward compatibility with pandora_agent.
|
||||||
foreach my $arg (@opts) {
|
join(' ', @opts) :
|
||||||
$command .= $^O ne 'MSWin32' ? quotemeta ($arg) . ' ' : '"' . $arg . '" ';
|
join(' ', map { quotemeta($_) } @opts);
|
||||||
}
|
|
||||||
chomp ($command);
|
|
||||||
my $output = '';
|
|
||||||
my $ReturnCode = 0;
|
|
||||||
|
|
||||||
# Execute the command
|
# Fork:
|
||||||
eval {
|
# * The child will run the command.
|
||||||
local $SIG{ALRM} = sub { die "alarm\n" };
|
# * The parent will timeout if needed
|
||||||
alarm $timeout;
|
# and exit with the appropriate exit status.
|
||||||
|
my $pid = fork();
|
||||||
$output = `$command`;
|
if ($pid == 0) {
|
||||||
$ReturnCode = ($? >> 8) & 0xff;
|
setpgrp();
|
||||||
alarm 0;
|
exec($command);
|
||||||
};
|
} else {
|
||||||
|
eval {
|
||||||
# Timeout
|
local $SIG{ALRM} = sub { kill(9, -$pid); exit 1; };
|
||||||
if ($@ eq "alarm\n") {
|
alarm $timeout;
|
||||||
exit 3;
|
waitpid($pid, 0);
|
||||||
|
alarm 0;
|
||||||
|
if (WIFEXITED(${^CHILD_ERROR_NATIVE})) {
|
||||||
|
exit WEXITSTATUS(${^CHILD_ERROR_NATIVE});
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
print $output;
|
exit 1;
|
||||||
|
|
||||||
exit $ReturnCode;
|
|
||||||
|
@ -387,112 +387,114 @@ sub pandora_server_tasks ($) {
|
|||||||
my $counter = 0;
|
my $counter = 0;
|
||||||
my $first_run = 1;
|
my $first_run = 1;
|
||||||
while ($THRRUN == 1) {
|
while ($THRRUN == 1) {
|
||||||
if (pandora_is_master($pa_config) == 1) {
|
eval {
|
||||||
|
if (pandora_is_master($pa_config) == 1) {
|
||||||
|
|
||||||
# TASKS EXECUTED ONCE
|
# TASKS EXECUTED ONCE
|
||||||
# -------------------
|
# -------------------
|
||||||
if ($first_run == 1) {
|
if ($first_run == 1) {
|
||||||
$first_run = 0;
|
$first_run = 0;
|
||||||
|
|
||||||
# Update the agent cache.
|
# Update the agent cache.
|
||||||
enterprise_hook('update_agent_cache', [\%Config]);
|
enterprise_hook('update_agent_cache', [\%Config]);
|
||||||
}
|
}
|
||||||
|
|
||||||
# TASKS EXECUTED EVERY 5 SECONDS (Low latency tasks)
|
# TASKS EXECUTED EVERY 5 SECONDS (Low latency tasks)
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
if (($counter % 5) == 0) {
|
if (($counter % 5) == 0) {
|
||||||
|
|
||||||
# Update forced alerts
|
# Update forced alerts
|
||||||
pandora_exec_forced_alerts ($pa_config, $dbh);
|
pandora_exec_forced_alerts ($pa_config, $dbh);
|
||||||
|
|
||||||
my @agents = get_db_rows ($dbh, 'SELECT id_agente, update_alert_count FROM tagente WHERE update_alert_count=1');
|
my @agents = get_db_rows ($dbh, 'SELECT id_agente, update_alert_count FROM tagente WHERE update_alert_count=1');
|
||||||
foreach my $agent (@agents) {
|
foreach my $agent (@agents) {
|
||||||
if ($agent->{'update_alert_count'} == 1) {
|
if ($agent->{'update_alert_count'} == 1) {
|
||||||
pandora_update_agent_alert_count ($pa_config, $dbh, $agent->{'id_agente'});
|
pandora_update_agent_alert_count ($pa_config, $dbh, $agent->{'id_agente'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# TASKS EXECUTED EVERY 30 SECONDS (Mid latency tasks)
|
||||||
|
# ---------------------------------------------------
|
||||||
|
if (($counter % 30) == 0) {
|
||||||
|
|
||||||
|
# Update module status and fired alert counts
|
||||||
|
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_secondary_groups FROM tagente WHERE (update_module_count=1 OR update_secondary_groups=1)');
|
||||||
|
foreach my $agent (@agents) {
|
||||||
|
logger ($pa_config, "Updating module status and fired alert counts for agent " . $agent->{'nombre'}, 10);
|
||||||
|
|
||||||
|
if ($agent->{'update_module_count'} == 1) {
|
||||||
|
pandora_update_agent_module_count ($pa_config, $dbh, $agent->{'id_agente'});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($agent->{'update_secondary_groups'} == 1) {
|
||||||
|
pandora_update_secondary_groups_cache ($pa_config, $dbh, $agent->{'id_agente'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keepalive module control.(very DB intensive, not run frecuently
|
||||||
|
pandora_module_keep_alive_nd ($pa_config, $dbh);
|
||||||
|
|
||||||
|
# Set the status of unknown modules
|
||||||
|
pandora_module_unknown ($pa_config, $dbh);
|
||||||
|
|
||||||
|
# Check if an autodisabled agent needs to be autodisable
|
||||||
|
pandora_disable_autodisable_agents ($pa_config, $dbh);
|
||||||
|
}
|
||||||
|
|
||||||
|
# TASKS EXECUTED EVERY 60 SECONDS (High latency tasks)
|
||||||
|
# ----------------------------------------------------
|
||||||
|
if (($counter % 60) == 0) {
|
||||||
|
# Downtimes are executed only 30 x Server Threshold secs
|
||||||
|
pandora_planned_downtime ($pa_config, $dbh);
|
||||||
|
|
||||||
|
# Realtime stats (Only master server!) - ( VERY HEAVY !)
|
||||||
|
# Realtimestats == 1, generated by WEB Console, not by server!
|
||||||
|
if (defined($pa_config->{"realtimestats"}) && $pa_config->{"realtimestats"} == 0){
|
||||||
|
|
||||||
|
# Check if I need to refresh stats
|
||||||
|
my $last_execution_stats = get_db_value ($dbh, "SELECT MAX(utimestamp) FROM tgroup_stat");
|
||||||
|
if (!defined($last_execution_stats) || $last_execution_stats < (time() - $pa_config->{"stats_interval"})){
|
||||||
|
pandora_group_statistics ($pa_config, $dbh);
|
||||||
|
pandora_server_statistics ($pa_config, $dbh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if snmptrapd is freeze.
|
||||||
|
pandora_snmptrapd_still_working ($pa_config, $dbh);
|
||||||
|
|
||||||
|
# Event auto-expiry
|
||||||
|
my $expiry_time = $pa_config->{"event_expiry_time"};
|
||||||
|
my $expiry_window = $pa_config->{"event_expiry_window"};
|
||||||
|
if ($expiry_time > 0 && $expiry_window > 0 && $expiry_window > $expiry_time) {
|
||||||
|
my $time_ref = time ();
|
||||||
|
my $expiry_limit = $time_ref - $expiry_time;
|
||||||
|
my $expiry_window = $time_ref - $expiry_window;
|
||||||
|
db_do ($dbh, 'UPDATE tevento SET estado=1, ack_utimestamp=? WHERE estado=0 AND utimestamp < ? AND utimestamp > ?', $time_ref, $expiry_limit, $expiry_window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# TASKS EXECUTED EVERY 30 SECONDS (Mid latency tasks)
|
# COMMON TASKS (master and non-master)
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
if (($counter % 30) == 0) {
|
if (($counter % 30) == 0) {
|
||||||
|
# Update configuration options from the console.
|
||||||
|
pandora_get_sharedconfig ($pa_config, $dbh);
|
||||||
|
|
||||||
# Update module status and fired alert counts
|
# Rotate the log file.
|
||||||
my @agents = get_db_rows ($dbh, 'SELECT id_agente, nombre, update_module_count, update_secondary_groups FROM tagente WHERE (update_module_count=1 OR update_secondary_groups=1)');
|
pandora_rotate_logfile($pa_config);
|
||||||
foreach my $agent (@agents) {
|
|
||||||
logger ($pa_config, "Updating module status and fired alert counts for agent " . $agent->{'nombre'}, 10);
|
|
||||||
|
|
||||||
if ($agent->{'update_module_count'} == 1) {
|
# Set event storm protection
|
||||||
pandora_update_agent_module_count ($pa_config, $dbh, $agent->{'id_agente'});
|
pandora_set_event_storm_protection (pandora_get_tconfig_token ($dbh, 'event_storm_protection', 0));
|
||||||
}
|
|
||||||
|
|
||||||
if ($agent->{'update_secondary_groups'} == 1) {
|
|
||||||
pandora_update_secondary_groups_cache ($pa_config, $dbh, $agent->{'id_agente'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Keepalive module control.(very DB intensive, not run frecuently
|
|
||||||
pandora_module_keep_alive_nd ($pa_config, $dbh);
|
|
||||||
|
|
||||||
# Set the status of unknown modules
|
|
||||||
pandora_module_unknown ($pa_config, $dbh);
|
|
||||||
|
|
||||||
# Check if an autodisabled agent needs to be autodisable
|
|
||||||
pandora_disable_autodisable_agents ($pa_config, $dbh);
|
|
||||||
}
|
}
|
||||||
|
# Pandora self monitoring
|
||||||
# TASKS EXECUTED EVERY 60 SECONDS (High latency tasks)
|
if (defined($pa_config->{"self_monitoring"})
|
||||||
# ----------------------------------------------------
|
&& $pa_config->{"self_monitoring"} == 1
|
||||||
if (($counter % 60) == 0) {
|
&& !is_metaconsole($pa_config)
|
||||||
# Downtimes are executed only 30 x Server Threshold secs
|
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
|
||||||
pandora_planned_downtime ($pa_config, $dbh);
|
pandora_self_monitoring ($pa_config, $dbh);
|
||||||
|
|
||||||
# Realtime stats (Only master server!) - ( VERY HEAVY !)
|
|
||||||
# Realtimestats == 1, generated by WEB Console, not by server!
|
|
||||||
if (defined($pa_config->{"realtimestats"}) && $pa_config->{"realtimestats"} == 0){
|
|
||||||
|
|
||||||
# Check if I need to refresh stats
|
|
||||||
my $last_execution_stats = get_db_value ($dbh, "SELECT MAX(utimestamp) FROM tgroup_stat");
|
|
||||||
if (!defined($last_execution_stats) || $last_execution_stats < (time() - $pa_config->{"stats_interval"})){
|
|
||||||
pandora_group_statistics ($pa_config, $dbh);
|
|
||||||
pandora_server_statistics ($pa_config, $dbh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if snmptrapd is freeze.
|
|
||||||
pandora_snmptrapd_still_working ($pa_config, $dbh);
|
|
||||||
|
|
||||||
# Event auto-expiry
|
|
||||||
my $expiry_time = $pa_config->{"event_expiry_time"};
|
|
||||||
my $expiry_window = $pa_config->{"event_expiry_window"};
|
|
||||||
if ($expiry_time > 0 && $expiry_window > 0 && $expiry_window > $expiry_time) {
|
|
||||||
my $time_ref = time ();
|
|
||||||
my $expiry_limit = $time_ref - $expiry_time;
|
|
||||||
my $expiry_window = $time_ref - $expiry_window;
|
|
||||||
db_do ($dbh, 'UPDATE tevento SET estado=1, ack_utimestamp=? WHERE estado=0 AND utimestamp < ? AND utimestamp > ?', $time_ref, $expiry_limit, $expiry_window);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
# COMMON TASKS (master and non-master)
|
|
||||||
# ---------------------------------------------------------------
|
|
||||||
if (($counter % 30) == 0) {
|
|
||||||
# Update configuration options from the console.
|
|
||||||
pandora_get_sharedconfig ($pa_config, $dbh);
|
|
||||||
|
|
||||||
# Rotate the log file.
|
|
||||||
pandora_rotate_logfile($pa_config);
|
|
||||||
|
|
||||||
# Set event storm protection
|
|
||||||
pandora_set_event_storm_protection (pandora_get_tconfig_token ($dbh, 'event_storm_protection', 0));
|
|
||||||
}
|
|
||||||
# Pandora self monitoring
|
|
||||||
if (defined($pa_config->{"self_monitoring"})
|
|
||||||
&& $pa_config->{"self_monitoring"} == 1
|
|
||||||
&& !is_metaconsole($pa_config)
|
|
||||||
&& $counter % $pa_config->{'self_monitoring_interval'} == 0) {
|
|
||||||
pandora_self_monitoring ($pa_config, $dbh);
|
|
||||||
}
|
|
||||||
|
|
||||||
# Avoid counter overflow
|
# Avoid counter overflow
|
||||||
if ($counter >= ~0){
|
if ($counter >= ~0){
|
||||||
@ -799,7 +801,7 @@ sub main() {
|
|||||||
# Testing API url
|
# Testing API url
|
||||||
my $curl_execution = "'".$Config{'console_api_url'}."?op=get&op2=test&apipass=".$Config{"console_api_pass"}."&user=".$Config{"console_user"}."&pass=".$Config{"console_pass"}."'";
|
my $curl_execution = "'".$Config{'console_api_url'}."?op=get&op2=test&apipass=".$Config{"console_api_pass"}."&user=".$Config{"console_user"}."&pass=".$Config{"console_pass"}."'";
|
||||||
# More than 30 secs is highly unrecommendated
|
# More than 30 secs is highly unrecommendated
|
||||||
my $command = $Config{'plugin_exec'}.' 30 curl '.$curl_execution.' 2>/dev/null';
|
my $command = $Config{'plugin_exec'}.' 30 curl --cookie-jar /tmp/cron-session-cookies '.$curl_execution.' 2>/dev/null';
|
||||||
my $exe_testing_api = `$command`;
|
my $exe_testing_api = `$command`;
|
||||||
my @res_testing_api = split(',', $exe_testing_api);
|
my @res_testing_api = split(',', $exe_testing_api);
|
||||||
if ( $res_testing_api[0] ne 'OK' ) {
|
if ( $res_testing_api[0] ne 'OK' ) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
# Pandora FMS Server Parameters
|
# Pandora FMS Server Parameters
|
||||||
# Pandora FMS, the Flexible Monitoring System.
|
# Pandora FMS, the Flexible Monitoring System.
|
||||||
# Version 7.0NG.768
|
# Version 7.0NG.769
|
||||||
# Licensed under GPL license v2,
|
# Licensed under GPL license v2,
|
||||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||||
# http://www.pandorafms.com
|
# http://www.pandorafms.com
|
||||||
@ -598,6 +598,9 @@ unknown_events 1
|
|||||||
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
|
# Time interval (as a multiple of the module interval) before a module becomes unknown. Twice the module's interval by default.
|
||||||
#unknown_interval 2
|
#unknown_interval 2
|
||||||
|
|
||||||
|
# Number of unknown modules that will be processed per iteration.
|
||||||
|
unknown_block_size 1000
|
||||||
|
|
||||||
# Maximum executing time of an alert (in seconds)
|
# Maximum executing time of an alert (in seconds)
|
||||||
global_alert_timeout 15
|
global_alert_timeout 15
|
||||||
|
|
||||||
|
@ -45,8 +45,8 @@ our @EXPORT = qw(
|
|||||||
);
|
);
|
||||||
|
|
||||||
# version: Defines actual version of Pandora Server for this module only
|
# version: Defines actual version of Pandora Server for this module only
|
||||||
my $pandora_version = "7.0NG.768";
|
my $pandora_version = "7.0NG.769";
|
||||||
my $pandora_build = "230206";
|
my $pandora_build = "230222";
|
||||||
our $VERSION = $pandora_version." ".$pandora_build;
|
our $VERSION = $pandora_version." ".$pandora_build;
|
||||||
|
|
||||||
# Setup hash
|
# Setup hash
|
||||||
@ -527,33 +527,35 @@ sub pandora_load_config {
|
|||||||
|
|
||||||
$pa_config->{"unknown_updates"} = 0; # 7.0.718
|
$pa_config->{"unknown_updates"} = 0; # 7.0.718
|
||||||
|
|
||||||
$pa_config->{"provisioningserver"} = 1; # 7.0 720
|
$pa_config->{"provisioningserver"} = 1; # 7.0.720
|
||||||
$pa_config->{"provisioningserver_threads"} = 1; # 7.0 720
|
$pa_config->{"provisioningserver_threads"} = 1; # 7.0.720
|
||||||
$pa_config->{"provisioning_cache_interval"} = 300; # 7.0 720
|
$pa_config->{"provisioning_cache_interval"} = 300; # 7.0.720
|
||||||
|
|
||||||
$pa_config->{"autoconfigure_agents"} = 1; # 7.0 725
|
$pa_config->{"autoconfigure_agents"} = 1; # 7.0.725
|
||||||
$pa_config->{"autoconfigure_agents_threshold"} = 300; #7.0 764
|
$pa_config->{"autoconfigure_agents_threshold"} = 300; #7.0.764
|
||||||
|
|
||||||
$pa_config->{'snmp_extlog'} = ""; # 7.0 726
|
$pa_config->{'snmp_extlog'} = ""; # 7.0.726
|
||||||
|
|
||||||
$pa_config->{"fsnmp"} = "/usr/bin/pandorafsnmp"; # 7.0 732
|
$pa_config->{"fsnmp"} = "/usr/bin/pandorafsnmp"; # 7.0.732
|
||||||
|
|
||||||
$pa_config->{"event_inhibit_alerts"} = 0; # 7.0 737
|
$pa_config->{"event_inhibit_alerts"} = 0; # 7.0.737
|
||||||
|
|
||||||
$pa_config->{"alertserver"} = 0; # 7.0 756
|
$pa_config->{"alertserver"} = 0; # 7.0.756
|
||||||
$pa_config->{"alertserver_threads"} = 1; # 7.0 756
|
$pa_config->{"alertserver_threads"} = 1; # 7.0.756
|
||||||
$pa_config->{"alertserver_warn"} = 180; # 7.0 756
|
$pa_config->{"alertserver_warn"} = 180; # 7.0.756
|
||||||
$pa_config->{"alertserver_queue"} = 0; # 7.0 764
|
$pa_config->{"alertserver_queue"} = 0; # 7.0.764
|
||||||
|
|
||||||
$pa_config->{'ncmserver'} = 0; # 7.0 758
|
$pa_config->{'ncmserver'} = 0; # 7.0.758
|
||||||
$pa_config->{'ncmserver_threads'} = 1; # 7.0 758
|
$pa_config->{'ncmserver_threads'} = 1; # 7.0.758
|
||||||
$pa_config->{'ncm_ssh_utility'} = '/usr/share/pandora_server/util/ncm_ssh_extension'; # 7.0 758
|
$pa_config->{'ncm_ssh_utility'} = '/usr/share/pandora_server/util/ncm_ssh_extension'; # 7.0.758
|
||||||
|
|
||||||
$pa_config->{"pandora_service_cmd"} = 'service pandora_server'; # 7.0 761
|
$pa_config->{"pandora_service_cmd"} = 'service pandora_server'; # 7.0.761
|
||||||
$pa_config->{"tentacle_service_cmd"} = 'service tentacle_serverd'; # 7.0 761
|
$pa_config->{"tentacle_service_cmd"} = 'service tentacle_serverd'; # 7.0.761
|
||||||
$pa_config->{"tentacle_service_watchdog"} = 1; # 7.0 761
|
$pa_config->{"tentacle_service_watchdog"} = 1; # 7.0.761
|
||||||
|
|
||||||
$pa_config->{"dataserver_smart_queue"} = 0; # 765.
|
$pa_config->{"dataserver_smart_queue"} = 0; # 7.0.765
|
||||||
|
|
||||||
|
$pa_config->{"unknown_block_size"} = 1000; # 7.0.769
|
||||||
|
|
||||||
# Check for UID0
|
# Check for UID0
|
||||||
if ($pa_config->{"quiet"} != 0){
|
if ($pa_config->{"quiet"} != 0){
|
||||||
|
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