Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of brutus.artica.es:artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones
This commit is contained in:
commit
1e384fd054
extras
deploy-scripts
deploy_ext_database_el8.shdeploy_ext_database_ubuntu_2204.shpandora_deploy_community.shpandora_deploy_community_el8.shpandora_deploy_community_ubuntu_2204.sh
docker/centos8/pandora-stack/sources
pandora_agents
pc
shellscript
aix
bsd-ipso
hp-ux
linux
mac_osx
openWRT
solaris
unix
AIX
DEBIAN
Darwin
dmg
pandora_agent.confFreeBSD
HP-UX
Linux
NT4
NetBSD
SunOS
pandora_agentpandora_agent.redhat.specpandora_agent.specpandora_agent_installerwin32
pandora_console
DEBIAN
extensions
extras/mr
general
godmode
include
ajax
class
config_process.phpfunctions_config.phpfunctions_filemanager.phpfunctions_html.phpfunctions_menu.phpfunctions_modules.phpfunctions_networkmap.phpjavascript
languages
styles
operation
agentes
events
pandora_server
DEBIAN
bin
conf
lib/PandoraFMS
pandora_server.redhat.specpandora_server.specpandora_server_installerutil
|
@ -9,7 +9,7 @@
|
|||
# RedHat 8.5
|
||||
|
||||
#Constants
|
||||
S_VERSION='202302081'
|
||||
S_VERSION='202302201'
|
||||
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
|
||||
|
||||
|
||||
|
@ -275,6 +275,8 @@ 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"
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
##############################################################################################################
|
||||
## Tested versions ##
|
||||
# Ubuntu 22.04.1
|
||||
# Ubuntu 22.04.2
|
||||
|
||||
#avoid promps
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||
WORKDIR=/opt/pandora/deploy
|
||||
|
||||
|
||||
S_VERSION='202302081'
|
||||
S_VERSION='202302201'
|
||||
LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
|
||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||
|
||||
|
@ -181,7 +182,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
|
|||
[mysqld]
|
||||
datadir=/var/lib/mysql
|
||||
user=mysql
|
||||
character-set-server=utf8
|
||||
character-set-server=utf8mb4
|
||||
skip-character-set-client-handshake
|
||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
|
@ -196,7 +197,7 @@ 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
|
||||
innodb_io_capacity = 300
|
||||
thread_cache_size = 8
|
||||
thread_stack = 256K
|
||||
max_connections = 100
|
||||
|
|
|
@ -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"
|
||||
|
||||
# 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
|
||||
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"
|
||||
|
||||
# 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"
|
||||
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
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
## Enabling agent
|
||||
systemctl enable pandora_agent_daemon &>> $LOGFILE
|
||||
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
## Tested versions ##
|
||||
# Centos 8.4, 8.5
|
||||
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||
# Almalinuz 8.4, 8.5
|
||||
# Almalinux 8.4, 8.5
|
||||
# RedHat 8.5
|
||||
|
||||
#Constants
|
||||
|
@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='202301251'
|
||||
S_VERSION='202302201'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
|
@ -107,6 +107,17 @@ check_root_permissions () {
|
|||
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
|
||||
echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION"
|
||||
|
||||
|
@ -207,6 +218,7 @@ else
|
|||
execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools"
|
||||
fi
|
||||
|
||||
execute_cmd "installing_docker" "Installing Docker for debug"
|
||||
|
||||
#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_log_file_size = 64M
|
||||
innodb_log_buffer_size = 16M
|
||||
innodb_io_capacity = 100
|
||||
innodb_io_capacity = 300
|
||||
thread_cache_size = 8
|
||||
thread_stack = 256K
|
||||
max_connections = 100
|
||||
|
@ -483,6 +495,7 @@ 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"
|
||||
|
@ -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"
|
||||
|
||||
# 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
|
||||
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"
|
||||
|
||||
# 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"
|
||||
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
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
## Enabling agent
|
||||
systemctl enable pandora_agent_daemon &>> "$LOGFILE"
|
||||
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
|
||||
|
||||
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
|
||||
$(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 ##
|
||||
# Ubuntu 22.04.1
|
||||
# Ubuntu 22.04.2
|
||||
|
||||
#avoid promps
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
@ -16,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||
WORKDIR=/opt/pandora/deploy
|
||||
|
||||
|
||||
S_VERSION='202301251'
|
||||
S_VERSION='202302201'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||
|
||||
|
@ -106,6 +107,21 @@ check_root_permissions () {
|
|||
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
|
||||
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
|
||||
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
|
||||
[ -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-yaml \
|
||||
libnet-telnet-perl \
|
||||
whois"
|
||||
whois \
|
||||
cron"
|
||||
execute_cmd "apt install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
# Server dependencies
|
||||
|
@ -254,10 +271,13 @@ server_dependencies=" \
|
|||
libnet-telnet-perl \
|
||||
libjson-perl \
|
||||
libencode-perl \
|
||||
cron \
|
||||
libgeo-ip-perl \
|
||||
openjdk-8-jdk "
|
||||
execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
execute_cmd "installing_docker" "Installing Docker for debug"
|
||||
|
||||
# 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/pandorawmic" "Downloading pandorawmic"
|
||||
|
@ -393,7 +413,7 @@ cat > /etc/mysql/my.cnf << EOF_DB
|
|||
[mysqld]
|
||||
datadir=/var/lib/mysql
|
||||
user=mysql
|
||||
character-set-server=utf8
|
||||
character-set-server=utf8mb4
|
||||
skip-character-set-client-handshake
|
||||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
|
@ -408,7 +428,7 @@ 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
|
||||
innodb_io_capacity = 300
|
||||
thread_cache_size = 8
|
||||
thread_stack = 256K
|
||||
max_connections = 100
|
||||
|
@ -477,7 +497,7 @@ check_cmd_status "Error installing PandoraFMS Agent"
|
|||
|
||||
# Copy gotty utility
|
||||
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
|
||||
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"
|
||||
systemctl enable tentacle_serverd &>> "$LOGFILE"
|
||||
|
||||
# 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"
|
||||
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 console cron
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
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
|
||||
$(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
|
||||
|
||||
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 &
|
||||
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
|
||||
#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 --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: "
|
||||
/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
|
||||
# Version 7.0NG.768, AIX version
|
||||
# Version 7.0NG.769, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, FreeBSD Version
|
||||
# Version 7.0NG.769, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Version 7.0NG.769, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Version 7.0NG.769, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, Solaris Version
|
||||
# Version 7.0NG.769, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (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
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 4.0
|
||||
%define release 1
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 4.0.1
|
||||
%define release 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.768, AIX version
|
||||
# Version 7.0NG.769, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.768
|
||||
# Version 7.0NG.769
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.768, HPUX Version
|
||||
# Version 7.0NG.769, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768
|
||||
# Version 7.0NG.769
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent
|
||||
%define version 3.2
|
||||
Summary: Pandora FMS Linux agent
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768
|
||||
# Version 7.0NG.769
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768
|
||||
# Version 7.0NG.769
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.768, Solaris version
|
||||
# Version 7.0NG.769, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, AIX version
|
||||
# Version 7.0NG.769, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.768-230210
|
||||
Version: 7.0NG.769-230222
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230210"
|
||||
pandora_version="7.0NG.769-230222"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.768"
|
||||
VERSION="7.0NG.769"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.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">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</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()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.768</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.768 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.768</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.769</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.769</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Version 7.0NG.769, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, FreeBSD Version
|
||||
# Version 7.0NG.769, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# 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,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Version 7.0NG.769, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Version 7.0NG.769, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, NetBSD Version
|
||||
# Version 7.0NG.769, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.768, Solaris Version
|
||||
# Version 7.0NG.769, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -556,30 +556,38 @@ BEGIN {
|
|||
sub runCommand {
|
||||
my ($self, $ref, $output_mode) = @_;
|
||||
|
||||
my $result;
|
||||
if($self->load_libraries()) {
|
||||
# Functionality possible.
|
||||
my $command = $self->{'commands'}->{$ref};
|
||||
my $result = $self->evaluate_command($ref);
|
||||
if (ref($result) eq "HASH") {
|
||||
# Process command result.
|
||||
if (defined($output_mode) && $output_mode eq 'xml') {
|
||||
my $output = '';
|
||||
$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";
|
||||
$result = $self->evaluate_command($ref);
|
||||
} else {
|
||||
$result = {
|
||||
'stderr' => 'Cannot use commands without YAML dependency, please install it.',
|
||||
'name' => 'YAML::Tiny',
|
||||
'error_level' => 2,
|
||||
};
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
$self->set_last_error('Failed to process ['.$ref.']: '.$result);
|
||||
if (ref($result) eq "HASH") {
|
||||
# Process command result.
|
||||
if (defined($output_mode) && $output_mode eq 'xml') {
|
||||
my $output = '';
|
||||
$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;
|
||||
|
@ -1014,8 +1022,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.768';
|
||||
use constant AGENT_BUILD => '230210';
|
||||
use constant AGENT_VERSION => '7.0NG.769';
|
||||
use constant AGENT_BUILD => '230222';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230210"
|
||||
PI_VERSION="7.0NG.769"
|
||||
PI_BUILD="230222"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (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
|
||||
# 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
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.768}
|
||||
{Pandora FMS Windows Agent v7.0NG.769}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230210}
|
||||
{230222}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230210")
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230222")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230210))"
|
||||
VALUE "ProductVersion", "(7.0NG.769(Build 230222))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.768-230210
|
||||
Version: 7.0NG.769-230222
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230210"
|
||||
pandora_version="7.0NG.769-230222"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Resources exportation view.
|
||||
*
|
||||
* @category Extensions.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars.
|
||||
if (isset($_GET['get_ptr'])) {
|
||||
if ($_GET['get_ptr'] == 1) {
|
||||
$ownDir = dirname(__FILE__).'/';
|
||||
|
@ -123,13 +139,6 @@ function output_xml_report($id)
|
|||
|
||||
$agent = null;
|
||||
switch (io_safe_output($item['type'])) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
break;
|
||||
|
||||
case 'simple_baseline_graph':
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 'custom_graph':
|
||||
case 'automatic_custom_graph':
|
||||
|
@ -169,30 +178,6 @@ function output_xml_report($id)
|
|||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 'max_value':
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 'min_value':
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
break;
|
||||
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
echo '<text><![CDATA['.io_safe_output($item['text'])."]]></text>\n";
|
||||
break;
|
||||
|
@ -224,18 +209,6 @@ function output_xml_report($id)
|
|||
echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
|
||||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_agent':
|
||||
break;
|
||||
|
||||
case 'alert_report_group':
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
echo '<url><![CDATA['.io_safe_output($values['external_source']).']]></url>';
|
||||
break;
|
||||
|
@ -245,6 +218,29 @@ function output_xml_report($id)
|
|||
echo '<line_separator><![CDATA['.io_safe_output($item['line_separator']).']]></line_separator>';
|
||||
echo '<column_separator><![CDATA['.io_safe_output($item['header_definition']).']]></column_separator>';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
case 'simple_baseline_graph':
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
case 8:
|
||||
case 'max_value':
|
||||
case 9:
|
||||
case 'min_value':
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
case 'event_report_module':
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
case 'alert_report_group':
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
}
|
||||
|
||||
echo "</item>\n";
|
||||
|
@ -417,25 +413,42 @@ function resource_exportation_extension_main()
|
|||
|
||||
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
|
||||
|
||||
ui_print_page_header(__('Resource exportation'), 'images/extensions.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Resource exportation'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resource exporting'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div class=notify>';
|
||||
echo __('This extension makes exportation of resource template more easy.').' '.__('You can export resource templates in .ptr format.');
|
||||
echo '</div>';
|
||||
|
||||
echo '<br /><br />';
|
||||
ui_print_warning_message(
|
||||
__('This extension makes exportation of resource template more easy.').'<br>'.__('You can export resource templates in .ptr format.')
|
||||
);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->style[0] = 'width: 30%;';
|
||||
$table->style[1] = 'width: 10%;';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox m2020';
|
||||
$table->id = 'resource_exportation_table';
|
||||
$table->style = [];
|
||||
$table->style[0] = 'width: 0';
|
||||
$table->style[1] = 'width: 0';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Report');
|
||||
$table->data[0][1] = html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true);
|
||||
$table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', 'class="sub config"', true);
|
||||
$table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['icon' => 'cog', 'mode' => 'secondary mini'], true);
|
||||
$table->data[1][0] = __('Visual console');
|
||||
$table->data[1][1] = html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true);
|
||||
$table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', 'class="sub config"', true);
|
||||
$table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['icon' => 'cog', 'mode' => 'secondary mini'], true);
|
||||
|
||||
if ($hook_enterprise === true) {
|
||||
add_rows_for_enterprise($table->data);
|
||||
|
|
|
@ -2,6 +2,8 @@ START TRANSACTION;
|
|||
|
||||
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` (
|
||||
`id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_name` VARCHAR(600) NOT NULL,
|
||||
|
|
|
@ -402,6 +402,10 @@ echo '
|
|||
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
|
||||
|
||||
// CSRF validation.
|
||||
if (isset($_SESSION['csrf_code']) === true) {
|
||||
unset($_SESSION['csrf_code']);
|
||||
}
|
||||
|
||||
html_print_csrf_hidden();
|
||||
|
||||
echo '</form></div>';
|
||||
|
|
|
@ -84,8 +84,8 @@ if (isset($_GET['server']) === true) {
|
|||
|
||||
$table->cellpadding = 4;
|
||||
$table->cellspacing = 4;
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox m2020';
|
||||
$table->id = 'server_update_form';
|
||||
|
||||
$table->data[] = [
|
||||
__('Name'),
|
||||
|
@ -129,17 +129,24 @@ if (isset($_GET['server']) === true) {
|
|||
|
||||
html_print_table($table);
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons w100p',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
$actionButtons = [];
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
__('Update'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
);
|
||||
|
||||
$actionButtons[] = html_print_go_back_button(
|
||||
'index.php?sec=gservers&sec2=godmode/servers/modificar_server',
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
['type' => 'form_action'],
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
@ -250,6 +257,10 @@ if (isset($_GET['server']) === true) {
|
|||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage Servers'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -992,7 +992,7 @@ if (($create != '') || ($view != '')) {
|
|||
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>';
|
||||
|
||||
|
@ -1003,50 +1003,49 @@ ui_require_javascript_file('pandora_modules');
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var locked = <?php echo (int) json_encode((int) $locked); ?>;
|
||||
|
||||
|
||||
function update_preview() {
|
||||
var command = $('#form_execute').val();
|
||||
var parameters = $('#form_parameters').val();
|
||||
|
||||
|
||||
var i = 1;
|
||||
|
||||
|
||||
while (1) {
|
||||
if ($('#text-field' + i + '_value').val() == undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($('#text-field'+i+'_value').val() != '') {
|
||||
parameters = parameters
|
||||
.replace('_field' + i + '_',
|
||||
$('#text-field' + i + '_value').val());
|
||||
}
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
$('#command_preview').html(_.escape(command) + ' ' + _.escape(parameters));
|
||||
}
|
||||
|
||||
|
||||
function show_locked_dialog(id_plugin, plugin_name) {
|
||||
var parameters = {};
|
||||
parameters['page'] = "godmode/servers/plugin";
|
||||
parameters["get_list_modules_and_component_locked_plugin"] = 1;
|
||||
parameters["id_plugin"] = id_plugin;
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
data: parameters,
|
||||
dataType: "html",
|
||||
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")
|
||||
.prop('title', title)
|
||||
.html(data)
|
||||
.dialog ({
|
||||
title: title,
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
|
@ -1061,8 +1060,7 @@ ui_require_javascript_file('pandora_modules');
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Add macro
|
||||
var add_macro_click_event = function (event) {
|
||||
|
@ -1092,34 +1090,34 @@ ui_require_javascript_file('pandora_modules');
|
|||
update_preview();
|
||||
}
|
||||
$('div#delete_macro_button>a').click(delete_macro_click_event);
|
||||
|
||||
|
||||
update_preview();
|
||||
|
||||
|
||||
$('.command_component').keyup(function() {
|
||||
update_preview();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var add_macro_click_locked_event = function (event) {
|
||||
var message = '<?php echo __('Some modules or components are using the plugin'); ?>.'
|
||||
+ '\n' + '<?php echo __('The modules or components should be updated manually or using the bulk operations for plugins after this change'); ?>.'
|
||||
+ '\n'
|
||||
+ '\n' + '<?php echo __('Are you sure you want to perform this action?'); ?>';
|
||||
|
||||
|
||||
if (!confirm(message)) {
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var macros_click_locked_event = function (event) {
|
||||
alert("<?php echo __('The plugin macros cannot be updated because some modules or components are using the plugin'); ?>");
|
||||
}
|
||||
|
||||
|
||||
if (locked) {
|
||||
$('a#add_macro_btn').click(add_macro_click_locked_event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -54,15 +54,13 @@ if ($servers === false) {
|
|||
}
|
||||
|
||||
$table = new StdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->class = 'info_table m2020';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->size = [];
|
||||
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
|
||||
// $table->style[0] = 'font-weight: bold';
|
||||
$table->align = [];
|
||||
$table->align[1] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
|
@ -196,12 +194,11 @@ foreach ($servers as $server) {
|
|||
if ($server['type'] === 'recon') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/first_task/icono_grande_reconserver.png',
|
||||
'images/snmp-trap@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Manage Discovery tasks'),
|
||||
'style' => 'width:21px;height:21px;',
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
|
||||
]
|
||||
);
|
||||
|
@ -211,22 +208,22 @@ foreach ($servers as $server) {
|
|||
if ($server['type'] === 'data') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/target.png',
|
||||
'images/change-active.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Reset module status and fired alert counts'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
} else if ($server['type'] === 'enterprise snmp') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/target.png',
|
||||
'images/change-active.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Claim back SNMP modules'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
|
@ -234,11 +231,11 @@ foreach ($servers as $server) {
|
|||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
|
@ -246,22 +243,22 @@ foreach ($servers as $server) {
|
|||
if (($names_servers[$safe_server_name] === true) && ($server['type'] === 'data' || $server['type'] === 'enterprise satellite')) {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/agent.png',
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Manage satellite hosts'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/remote_configuration.png',
|
||||
'images/remote_configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Remote configuration'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
|
@ -270,12 +267,12 @@ foreach ($servers as $server) {
|
|||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||
$data[8] .= html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'onclick' => "if (! confirm ('".__('Modules run by this server will stop working. Do you want to continue?')."')) return false",
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
|
|
|
@ -416,6 +416,11 @@ if ($delete_user === true) {
|
|||
__('There was a problem deleting the profile')
|
||||
);
|
||||
} else if ($disable_user !== false) {
|
||||
// CSRF Validator.
|
||||
if (html_print_csrf_error()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable_user.
|
||||
$id_user = get_parameter('id', 0);
|
||||
|
||||
|
@ -662,6 +667,8 @@ $limit = (int) $config['block_size'];
|
|||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
$cont = 0;
|
||||
// Creates csrf.
|
||||
$csrf = html_print_csrf_hidden(true);
|
||||
foreach ($info as $user_id => $user_info) {
|
||||
if (empty($user_id) === true) {
|
||||
continue;
|
||||
|
@ -854,6 +861,8 @@ foreach ($info as $user_id => $user_info) {
|
|||
$user_info['id_user'],
|
||||
true
|
||||
);
|
||||
// Same csrf for every disable button for submit.
|
||||
$data[6] .= $csrf;
|
||||
$data[6] .= html_print_input_hidden(
|
||||
'disable_user',
|
||||
$toDoAction,
|
||||
|
|
|
@ -92,6 +92,9 @@ $node_id = (int) get_parameter('node_id', 0);
|
|||
if ($get_comments === true) {
|
||||
$event = get_parameter('event', false);
|
||||
$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) {
|
||||
return __('Failed to retrieve comments');
|
||||
}
|
||||
|
@ -99,7 +102,7 @@ if ($get_comments === true) {
|
|||
$eventsGrouped = [];
|
||||
// Consider if the event is grouped.
|
||||
$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).
|
||||
$whereGrouped = sprintf(
|
||||
'`evento` = "%s"',
|
||||
|
@ -120,7 +123,7 @@ if ($get_comments === true) {
|
|||
(int) $event['id_agentmodule']
|
||||
);
|
||||
}
|
||||
} else if ($event_rep === EVENT_GROUP_REP_EXTRAIDS) {
|
||||
} else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
|
||||
$whereGrouped = sprintf(
|
||||
'`id_extra` = "%s"',
|
||||
$event['id_extra']
|
||||
|
@ -1647,6 +1650,7 @@ if ($get_extended_event) {
|
|||
$comments = $event['comments'];
|
||||
|
||||
$event['similar_ids'] = $similar_ids;
|
||||
$event['group_rep'] = $group_rep;
|
||||
|
||||
if (isset($comments) === false) {
|
||||
$comments = $event['user_comment'];
|
||||
|
|
|
@ -1149,7 +1149,7 @@ if (check_login()) {
|
|||
$last_status_change_text = __('Time elapsed since last status change: ');
|
||||
$last_status_change_text .= (empty($module['last_status_change']) === false) ? human_time_comparation($module['last_status_change']) : __('N/A');
|
||||
|
||||
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, false, $last_status_change_text);
|
||||
$data[4] .= ui_print_status_image($status, htmlspecialchars($title), true, false, false, true, $last_status_change_text);
|
||||
if ($show_context_help_first_time === false) {
|
||||
$show_context_help_first_time = true;
|
||||
|
||||
|
@ -1158,6 +1158,7 @@ if (check_login()) {
|
|||
}
|
||||
}
|
||||
|
||||
hd($data[4], true);
|
||||
// Module thresholds.
|
||||
$data[5] = '';
|
||||
if ((int) $module['id_tipo_modulo'] !== 25) {
|
||||
|
|
|
@ -258,6 +258,14 @@ class ConsoleSupervisor
|
|||
$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->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') {
|
||||
$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 .= '<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(
|
||||
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',
|
||||
'formFeedback',
|
||||
'createdScheduleFeedbackTask',
|
||||
'getSystemDate',
|
||||
];
|
||||
|
||||
|
||||
|
@ -209,6 +210,7 @@ class Diagnostics extends Wizard
|
|||
'getAttachmentFolder',
|
||||
'getInfoTagenteDatos',
|
||||
'getServerThreads',
|
||||
'getSystemDate',
|
||||
];
|
||||
|
||||
if ($this->pdf === true) {
|
||||
|
@ -278,6 +280,10 @@ class Diagnostics extends Wizard
|
|||
$title = __('SQL show engine innodb status');
|
||||
break;
|
||||
|
||||
case 'getSystemDate':
|
||||
$title = __('Date system');
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
$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.
|
||||
*
|
||||
|
@ -619,7 +646,7 @@ class Diagnostics extends Wizard
|
|||
$currentTime = time();
|
||||
|
||||
$pandoraDbLastRun = __('Pandora DB has never been executed');
|
||||
if ($dateDbMantenaince !== false) {
|
||||
if ($dateDbMantenaince !== false && empty($dateDbMantenaince) === false) {
|
||||
$difference = ($currentTime - $dateDbMantenaince);
|
||||
$pandoraDbLastRun = human_time_description_raw(
|
||||
$difference,
|
||||
|
|
|
@ -782,7 +782,9 @@ class NetworkMap
|
|||
if ($this->network) {
|
||||
// Network map, based on direct network.
|
||||
$nodes = networkmap_get_nodes_from_ip_mask(
|
||||
$this->network
|
||||
$this->network,
|
||||
false,
|
||||
'
'
|
||||
);
|
||||
} else if ($this->mapOptions['map_filter']['empty_map']) {
|
||||
// Empty map returns no data.
|
||||
|
@ -792,17 +794,22 @@ class NetworkMap
|
|||
|| $this->mapOptions['map_filter']['dont_show_subgroups'] == 1
|
||||
) {
|
||||
// Show only current selected group.
|
||||
$filter['id_grupo'] = $this->idGroup;
|
||||
$filter['id_grupo'] = explode(',', $this->idGroup);
|
||||
} else {
|
||||
// Show current group and children.
|
||||
$childrens = groups_get_children($this->idGroup, null, true);
|
||||
if (!empty($childrens)) {
|
||||
$childrens = array_keys($childrens);
|
||||
foreach (explode(',', $this->idGroup) as $key => $group) {
|
||||
$childrens = groups_get_children($group, null, true);
|
||||
if (!empty($childrens)) {
|
||||
$childrens = array_keys($childrens);
|
||||
|
||||
$filter['id_grupo'] = $childrens;
|
||||
$filter['id_grupo'][] = $this->idGroup;
|
||||
} else {
|
||||
$filter['id_grupo'] = $this->idGroup;
|
||||
if (empty($filter['id_grupo']) === false) {
|
||||
$filter['id_grupo'] = array_merge($filter['id_grupo'], $childrens);
|
||||
} else {
|
||||
$filter['id_grupo'] = $childrens;
|
||||
}
|
||||
} else {
|
||||
$filter['id_grupo'][] = $group;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1189,6 +1196,10 @@ class NetworkMap
|
|||
$head .= 'overlap="scalexy";';
|
||||
}
|
||||
|
||||
if ($layout == 'spring1' || $layout == 'spring2') {
|
||||
$head .= 'sep="'.$node_sep.'";';
|
||||
}
|
||||
|
||||
if ($layout == 'flat') {
|
||||
$head .= 'ranksep="'.$rank_sep.'";';
|
||||
}
|
||||
|
@ -3498,6 +3509,7 @@ class NetworkMap
|
|||
url_background_grid: url_background_grid,
|
||||
refresh_time: '.$this->mapOptions['refresh_time'].',
|
||||
font_size: '.$this->mapOptions['font_size'].',
|
||||
method: '.$this->map['generation_method'].',
|
||||
base_url_homedir: "'.ui_get_full_url(false).'"
|
||||
});
|
||||
init_drag_and_drop();
|
||||
|
|
|
@ -413,73 +413,74 @@ class SnmpConsole extends HTML
|
|||
'class' => 'flex-row',
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Alert'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_alert',
|
||||
'name' => 'filter_alert',
|
||||
'class' => 'w200px',
|
||||
'fields' => $show_alerts,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_alert,
|
||||
'label' => __('Alert'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_alert',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_alert',
|
||||
'fields' => $show_alerts,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_alert,
|
||||
],
|
||||
[
|
||||
'label' => __('Severity'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_severity',
|
||||
'name' => 'filter_severity',
|
||||
'class' => 'w200px',
|
||||
'fields' => $severities,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_severity,
|
||||
'label' => __('Severity'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_severity',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_severity',
|
||||
'fields' => $severities,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_severity,
|
||||
],
|
||||
[
|
||||
'label' => __('Free search'),
|
||||
'type' => 'text',
|
||||
'class' => 'w400px',
|
||||
'id' => 'filter_free_search',
|
||||
'name' => 'filter_free_search',
|
||||
'value' => $this->filter_free_search,
|
||||
'label' => __('Free search'),
|
||||
'type' => 'text',
|
||||
'id' => 'filter_free_search',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_free_search',
|
||||
'value' => $this->filter_free_search,
|
||||
],
|
||||
[
|
||||
'label' => __('Status'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_status',
|
||||
'name' => 'filter_status',
|
||||
'class' => 'w200px',
|
||||
'fields' => $status_array,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_status,
|
||||
'label' => __('Status'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_status',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_status',
|
||||
'fields' => $status_array,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_status,
|
||||
],
|
||||
[
|
||||
'label' => __('Group by Enterprise String/IP'),
|
||||
'type' => 'select',
|
||||
'name' => 'filter_group_by',
|
||||
'selected' => $this->filter_group_by,
|
||||
'disabled' => false,
|
||||
'return' => true,
|
||||
'id' => 'filter_group_by',
|
||||
'fields' => [
|
||||
'label' => __('Group by Enterprise String/IP'),
|
||||
'type' => 'select',
|
||||
'name' => 'filter_group_by',
|
||||
'selected' => $this->filter_group_by,
|
||||
'disabled' => false,
|
||||
'return' => true,
|
||||
'id' => 'filter_group_by',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'fields' => [
|
||||
0 => __('No'),
|
||||
1 => __('Yes'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => __('Max. hours old'),
|
||||
'type' => 'text',
|
||||
'class' => 'w200px',
|
||||
'id' => 'filter_hours_ago',
|
||||
'name' => 'filter_hours_ago',
|
||||
'value' => $this->filter_hours_ago,
|
||||
'label' => __('Max. hours old'),
|
||||
'type' => 'text',
|
||||
'id' => 'filter_hours_ago',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_hours_ago',
|
||||
'value' => $this->filter_hours_ago,
|
||||
],
|
||||
[
|
||||
'label' => __('Trap type'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_trap_type',
|
||||
'name' => 'filter_trap_type',
|
||||
'class' => 'w200px',
|
||||
'fields' => $trap_types,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_trap_type,
|
||||
'label' => __('Trap type'),
|
||||
'type' => 'select',
|
||||
'id' => 'filter_trap_type',
|
||||
'input_class' => 'filter_input_datatable',
|
||||
'name' => 'filter_trap_type',
|
||||
'fields' => $trap_types,
|
||||
'return' => true,
|
||||
'selected' => $this->filter_trap_type,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230210';
|
||||
$pandora_version = 'v7.0NG.768';
|
||||
$build_version = 'PC230222';
|
||||
$pandora_version = 'v7.0NG.769';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -463,10 +463,6 @@ function config_update_config()
|
|||
if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) {
|
||||
$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;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Images File Manager functions.
|
||||
*
|
||||
|
@ -96,7 +97,7 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
if (!check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'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);
|
||||
try {
|
||||
$mimeContentType = mime_content_type($_FILES['file']['tmp_name']);
|
||||
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
|
||||
|
||||
$validFileExtension = 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)) {
|
||||
if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) {
|
||||
$result = copy($_FILES['file']['tmp_name'], $nombre_archivo);
|
||||
} else {
|
||||
$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();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
if (!check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access File manager'
|
||||
|
@ -310,7 +294,7 @@ if ($create_dir === true) {
|
|||
$testHash = md5($directory.$config['server_unique_identifier']);
|
||||
|
||||
if ($hash !== $testHash) {
|
||||
ui_print_error_message(__('Security error.'));
|
||||
ui_print_error_message(__('Security error.'));
|
||||
} else {
|
||||
$dirname = filemanager_safe_directory((string) get_parameter('dirname'));
|
||||
|
||||
|
@ -366,7 +350,7 @@ if ($delete_file === true) {
|
|||
}
|
||||
} else {
|
||||
if (unlink($filename) === true) {
|
||||
$config['filemanager']['delete'] = 1;
|
||||
$config['filemanager']['delete'] = 1;
|
||||
} else {
|
||||
$config['filemanager']['delete'] = 0;
|
||||
}
|
||||
|
@ -516,77 +500,116 @@ function filemanager_file_explorer(
|
|||
check_opened_dialog('create_folder');
|
||||
}
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
function show_create_text_file() {
|
||||
actions_dialog('create_text_file');
|
||||
$("#create_text_file").css("display", "block");
|
||||
check_opened_dialog('create_text_file');
|
||||
}
|
||||
function show_create_text_file() {
|
||||
actions_dialog('create_text_file');
|
||||
$("#create_text_file").css("display", "block");
|
||||
check_opened_dialog('create_text_file');
|
||||
}
|
||||
<?php endif ?>
|
||||
|
||||
function show_upload_file() {
|
||||
actions_dialog('upload_file');
|
||||
$("#upload_file").css("display", "block");
|
||||
check_opened_dialog('upload_file');
|
||||
}
|
||||
|
||||
function check_opened_dialog(check_opened){
|
||||
if(check_opened !== 'create_folder'){
|
||||
function check_opened_dialog(check_opened) {
|
||||
if (check_opened !== 'create_folder') {
|
||||
if (($("#create_folder").hasClass("ui-dialog-content") && $('#create_folder').dialog('isOpen') === true)) {
|
||||
$('#create_folder').dialog('close');
|
||||
}
|
||||
}
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
if(check_opened !== 'create_text_file'){
|
||||
if (($("#create_text_file").hasClass("ui-dialog-content") && $('#create_text_file').dialog('isOpen') === true)) {
|
||||
$('#create_text_file').dialog('close');
|
||||
if (check_opened !== 'create_text_file') {
|
||||
if (($("#create_text_file").hasClass("ui-dialog-content") && $('#create_text_file').dialog('isOpen') === true)) {
|
||||
$('#create_text_file').dialog('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php endif ?>
|
||||
if(check_opened !== 'upload_file'){
|
||||
if (check_opened !== 'upload_file') {
|
||||
if (($("#upload_file").hasClass("ui-dialog-content") && $('#upload_file').dialog('isOpen')) === true) {
|
||||
$('#upload_file').dialog('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function actions_dialog(action){
|
||||
$('.'+action).addClass('file_table_modal_active');
|
||||
var title_action ='';
|
||||
function actions_dialog(action) {
|
||||
$('.' + action).addClass('file_table_modal_active');
|
||||
var title_action = '';
|
||||
switch (action) {
|
||||
case 'create_folder':
|
||||
title_action = "<?php echo __('Create a Directory'); ?>";
|
||||
title_action = "<?php echo __('Create a Directory'); ?>";
|
||||
break;
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
case 'create_text_file':
|
||||
title_action = "<?php echo __('Create a Text'); ?>";
|
||||
break;
|
||||
<?php endif ?>
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
case 'create_text_file':
|
||||
title_action = "<?php echo __('Create a Text'); ?>";
|
||||
break;
|
||||
<?php endif ?>
|
||||
case 'upload_file':
|
||||
title_action = "<?php echo __('Upload Files'); ?>";
|
||||
title_action = "<?php echo __('Upload Files'); ?>";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$('#'+action)
|
||||
.dialog({
|
||||
title: title_action,
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 500,
|
||||
minWidth: 500,
|
||||
minHeight: 210,
|
||||
maxWidth: 800,
|
||||
maxHeight: 300,
|
||||
close: function () {
|
||||
$('.'+action).removeClass('file_table_modal_active');
|
||||
}
|
||||
}).show();
|
||||
$('#' + action)
|
||||
.dialog({
|
||||
title: title_action,
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 500,
|
||||
minWidth: 500,
|
||||
minHeight: 210,
|
||||
maxWidth: 800,
|
||||
maxHeight: 300,
|
||||
close: function() {
|
||||
$('.' + action).removeClass('file_table_modal_active');
|
||||
}
|
||||
}).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>
|
||||
<?php
|
||||
|
@ -703,9 +726,9 @@ function filemanager_file_explorer(
|
|||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) === 'php'
|
||||
&& (is_readable($fileinfo['realpath']) === true || is_executable($fileinfo['realpath']) === true)
|
||||
) {
|
||||
$error_message = __('This file could be executed by any user');
|
||||
$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>';
|
||||
$error_message = __('This file could be executed by any user');
|
||||
$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[2] = ui_print_timestamp(
|
||||
|
@ -719,11 +742,11 @@ function filemanager_file_explorer(
|
|||
$data[3] = ui_format_filesize($fileinfo['size']);
|
||||
}
|
||||
|
||||
// Actions buttons
|
||||
// Delete button.
|
||||
$data[4] = '';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||
// Actions buttons
|
||||
// Delete button.
|
||||
$data[4] = '';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||
if (is_writable($fileinfo['realpath']) === true
|
||||
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
|
||||
&& ($readOnly === false)
|
||||
|
@ -764,9 +787,16 @@ function filemanager_file_explorer(
|
|||
$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 {
|
||||
ui_print_info_message(
|
||||
|
@ -859,7 +889,7 @@ function filemanager_file_explorer(
|
|||
'content' => html_print_input_file(
|
||||
'file',
|
||||
true,
|
||||
[ 'style' => 'border:0; padding:0; width:100%' ]
|
||||
['style' => 'border:0; padding:0; width:100%']
|
||||
),
|
||||
],
|
||||
true
|
||||
|
@ -942,6 +972,22 @@ function filemanager_file_explorer(
|
|||
);
|
||||
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>';
|
||||
} else {
|
||||
echo "<div style='text-align: right; width: ".$table->width."; color:#AC4444; margin-bottom:10px;'>";
|
||||
|
@ -1088,4 +1134,4 @@ function filemanager_safe_directory(
|
|||
}
|
||||
|
||||
return $directory;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3474,7 +3474,8 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
|
|||
$classes = '';
|
||||
$fixedId = '';
|
||||
$iconStyle = '';
|
||||
$spanStyle = 'margin-top: 4px;';
|
||||
// $spanStyle = 'margin-top: 4px;';
|
||||
$spanStyle = '';
|
||||
if (empty($name) === true) {
|
||||
$name = 'unnamed';
|
||||
}
|
||||
|
|
|
@ -837,6 +837,7 @@ if (is_ajax()) {
|
|||
$db_fragmentation = json_decode($d->getTablesFragmentation());
|
||||
$sys_info = json_decode($d->getSystemInfo());
|
||||
$php_sys = json_decode($d->getPHPSetup());
|
||||
$system_date = json_decode($d->getSystemDate());
|
||||
|
||||
$fragmentation_status = '';
|
||||
if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) {
|
||||
|
@ -1098,6 +1099,14 @@ if (is_ajax()) {
|
|||
<p>'.$sys_info->data->ipInfo->value.'</p>
|
||||
</th>
|
||||
</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>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -519,12 +519,13 @@ function modules_delete_agent_module($id_agent_module)
|
|||
'disabled' => 1,
|
||||
'delete_pending' => 1,
|
||||
];
|
||||
$result = db_process_sql_update(
|
||||
$id_agent = db_process_sql_update(
|
||||
'tagente_modulo',
|
||||
$values,
|
||||
['id_agente_modulo' => $id_borrar_modulo]
|
||||
);
|
||||
if ($result === false) {
|
||||
|
||||
if ($id_agent === false) {
|
||||
$error++;
|
||||
} else {
|
||||
// Set flag to update module status count.
|
||||
|
@ -562,7 +563,7 @@ function modules_delete_agent_module($id_agent_module)
|
|||
$result = db_process_delete_temp(
|
||||
'ttag_module',
|
||||
'id_agente_modulo',
|
||||
$id_borrar_modulo
|
||||
$id_agent
|
||||
);
|
||||
if ($result === false) {
|
||||
$error++;
|
||||
|
|
|
@ -1126,6 +1126,10 @@ function networkmap_open_graph(
|
|||
$head .= 'overlap="scalexy";';
|
||||
}
|
||||
|
||||
if ($layout == 'spring1' || $layout == 'spring2') {
|
||||
$head .= 'sep="'.$node_sep.'";';
|
||||
}
|
||||
|
||||
if ($layout === 'flat') {
|
||||
$head .= 'ranksep="'.$rank_sep.'";';
|
||||
} else if ($layout === 'spring2') {
|
||||
|
@ -1356,9 +1360,10 @@ function networkmap_get_types($strict_user=false)
|
|||
*/
|
||||
function networkmap_get_nodes_from_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) {
|
||||
return [];
|
||||
|
@ -1375,14 +1380,14 @@ function networkmap_get_nodes_from_ip_mask(
|
|||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM `tagente`
|
||||
INNER JOIN
|
||||
(SELECT DISTINCT `id_agent` FROM
|
||||
INNER JOIN
|
||||
(SELECT DISTINCT `id_agent` FROM
|
||||
(SELECT `id_agente` AS "id_agent", `direccion` AS "ip"
|
||||
FROM `tagente`
|
||||
FROM `tagente`
|
||||
UNION
|
||||
SELECT ag.`id_agent`, a.`ip`
|
||||
FROM `taddress_agent` ag
|
||||
INNER JOIN `taddress` a
|
||||
FROM `taddress_agent` ag
|
||||
INNER JOIN `taddress` a
|
||||
ON ag.id_a=a.id_a
|
||||
) t_tmp
|
||||
WHERE (-1 << %d) & INET_ATON(t_tmp.ip) = INET_ATON("%s")
|
||||
|
|
|
@ -55,10 +55,30 @@ function draw_minimap() {
|
|||
var relation_min_nodes = minimap_relation;
|
||||
var relation_minimap_w = 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_minimap_w = (graph.nodes.length / 100) * 2.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
|
||||
|
@ -1792,10 +1812,30 @@ function init_minimap() {
|
|||
var relation_minimap_w = 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_minimap_w = (graph.nodes.length / 100) * 2.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) {
|
||||
|
@ -3092,6 +3132,10 @@ function init_graph(parameter_object) {
|
|||
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_y = graph.nodes[0].y;
|
||||
|
||||
|
|
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
|
@ -458,7 +458,7 @@ ul li {
|
|||
top: 0;
|
||||
left: 0;
|
||||
background-color: #ffffff;
|
||||
border-right: 1px solid #c1ccdc;
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
.button_collapse {
|
||||
|
@ -482,7 +482,7 @@ ul li {
|
|||
|
||||
.menu_full_classic,
|
||||
.button_classic {
|
||||
width: 280px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.menu_full_collapsed,
|
||||
|
@ -551,7 +551,7 @@ ul li {
|
|||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
.page_classic {
|
||||
padding-left: 280px;
|
||||
padding-left: 250px;
|
||||
}
|
||||
|
||||
.page_collapsed {
|
||||
|
@ -559,7 +559,7 @@ ul li {
|
|||
}
|
||||
|
||||
.header_table_classic {
|
||||
padding-left: 300px;
|
||||
padding-left: 270px;
|
||||
/* 280 + 35 */
|
||||
}
|
||||
|
||||
|
|
|
@ -153,17 +153,20 @@ html {
|
|||
}
|
||||
|
||||
body {
|
||||
background-color: #f6f7fb;
|
||||
background-color: #fbfbfb;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100%;
|
||||
font-weight: 400;
|
||||
font-family: "Pandora-Regular";
|
||||
-webkit-font-smoothing: antialiased;
|
||||
color: #333;
|
||||
font-family: "lato";
|
||||
-webkit-font-smoothing: initial;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
body * {
|
||||
font-family: "lato";
|
||||
}
|
||||
body.body-report {
|
||||
display: block;
|
||||
}
|
||||
|
@ -1386,7 +1389,7 @@ div#head {
|
|||
height: 60px;
|
||||
padding-top: 0px;
|
||||
margin: 0 auto;
|
||||
border-bottom: 1px solid #c1ccdc;
|
||||
border-bottom: 1px solid #eee;
|
||||
min-width: 882px;
|
||||
background-color: #fff;
|
||||
color: #000;
|
||||
|
@ -1747,7 +1750,7 @@ div.title_line {
|
|||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #c1ccdc;
|
||||
border-bottom: 1px solid #eee;
|
||||
/* width: calc(100% + 3em); */
|
||||
width: -webkit-fill-available;
|
||||
width: -moz-available;
|
||||
|
@ -1756,7 +1759,7 @@ div.title_line {
|
|||
height: 53px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
/* margin-left: -3em;*/
|
||||
/* margin-left: -3em; */
|
||||
}
|
||||
|
||||
/* Breadcrum */
|
||||
|
@ -1945,7 +1948,7 @@ div#agent_wizard_subtabs {
|
|||
#menu_tab_left li span {
|
||||
color: #161628;
|
||||
font-size: 15px;
|
||||
font-family: Pandora-Bold;
|
||||
/*font-family: 'Lato';*/
|
||||
}
|
||||
|
||||
/* New styles for data box */
|
||||
|
@ -1991,8 +1994,12 @@ table.databox {
|
|||
border: 2px solid #c0ccdc;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
width: calc(100% - 40px);
|
||||
width: -webkit-fill-available;
|
||||
/*
|
||||
width: -webkit-fill-available;
|
||||
width: -moz-available;
|
||||
*/
|
||||
}
|
||||
|
||||
.databox > tbody > tr > td {
|
||||
|
@ -2547,13 +2554,13 @@ div#pandora_logo_header {
|
|||
}
|
||||
|
||||
.header_title {
|
||||
font-size: 12px;
|
||||
color: #161628;
|
||||
font-size: 11pt;
|
||||
color: #444;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.header_subtitle {
|
||||
font-size: 15px;
|
||||
font-size: 10pt;
|
||||
color: #8a96a6;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
@ -2745,7 +2752,8 @@ td.cellBig {
|
|||
|
||||
.info_box .title * {
|
||||
font-size: 14pt;
|
||||
font-family: "Pandora-Bold";
|
||||
/*font-family: "lato";*/
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info_box .icon {
|
||||
|
@ -2906,7 +2914,7 @@ input#text-id_parent.ac_input {
|
|||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: inherit;
|
||||
/*font-family: inherit;*/
|
||||
}
|
||||
|
||||
/* plugins */
|
||||
|
@ -6483,7 +6491,7 @@ table.table_modal_alternate tr td:first-child {
|
|||
|
||||
.bars-graph-rotate .flot-text .flot-x-axis div .break_word {
|
||||
word-break: break-word;
|
||||
font-family: "lato" !important;
|
||||
/*font-family: "lato" !important;*/
|
||||
}
|
||||
|
||||
.flot-text .flot-x-axis div {
|
||||
|
@ -9896,7 +9904,7 @@ div#err_msg_centralised {
|
|||
.inputFile {
|
||||
background-color: #f6f7fb;
|
||||
height: 16px;
|
||||
font-family: "Pandora-Regular";
|
||||
/*font-family: "lato";*/
|
||||
font-size: 12px;
|
||||
padding: 5.5pt 20pt;
|
||||
cursor: pointer;
|
||||
|
@ -9921,7 +9929,7 @@ select {
|
|||
border: 2px solid #c0ccdc;
|
||||
border-radius: 6px;
|
||||
height: 38px;
|
||||
font-family: "Pandora-Regular";
|
||||
/*font-family: "lato";*/
|
||||
font-size: 12px;
|
||||
color: #333333;
|
||||
padding-left: 12px;
|
||||
|
@ -9975,7 +9983,7 @@ input[type="submit"] {
|
|||
box-shadow: 0px 3px 6px #c7c7c7;
|
||||
letter-spacing: 0px;
|
||||
color: #ffffff;
|
||||
font-family: Pandora-Regular;
|
||||
/*font-family: "lato";*/
|
||||
font-size: 16px;
|
||||
margin-left: 1em;
|
||||
cursor: pointer;
|
||||
|
@ -10025,7 +10033,7 @@ button.submitButton {
|
|||
min-width: 110px;
|
||||
height: 42px;
|
||||
font-size: 14px;
|
||||
font-family: "Pandora-Regular";
|
||||
/*font-family: "lato";*/
|
||||
align-items: center;
|
||||
line-height: 24px;
|
||||
box-shadow: 0px 3px 6px #c7c7c7;
|
||||
|
@ -10603,7 +10611,7 @@ tr.bring_next_field {
|
|||
-moz-box-sizing: border-box !important;
|
||||
box-sizing: border-box !important;
|
||||
cursor: pointer;
|
||||
font-family: "Pandora-Regular" !important;
|
||||
/*font-family: "lato" !important;*/
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
|
@ -10761,7 +10769,8 @@ tr.bring_next_field {
|
|||
.floating_form td {
|
||||
font-size: 13px;
|
||||
min-height: 32px;
|
||||
font-family: "Pandora-Bold";
|
||||
/*font-family: "lato";*/
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.floating_form td.subinput {
|
||||
|
@ -11066,7 +11075,7 @@ span.subsection_header_title {
|
|||
height: 18px;
|
||||
}
|
||||
.regular_font {
|
||||
font-family: "Pandora-Regular" !important;
|
||||
font-family: "lato" !important;
|
||||
}
|
||||
|
||||
.width_available {
|
||||
|
@ -11213,7 +11222,7 @@ form#satellite_conf_edit > fieldset.full-column {
|
|||
.input_sub_placeholder {
|
||||
font-size: 8pt;
|
||||
color: #8a96a6;
|
||||
font-family: "Pandora-Regular";
|
||||
/*font-family: "lato";*/
|
||||
}
|
||||
|
||||
#principal_action_buttons input,
|
||||
|
|
|
@ -93,11 +93,12 @@
|
|||
background-color: #fff;
|
||||
border-spacing: 0;
|
||||
overflow: hidden;
|
||||
border-radius: 6px;
|
||||
border: 2px solid #c0ccdc;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #c0ccdc;
|
||||
width: -webkit-fill-available;
|
||||
width: -moz-available;
|
||||
margin-bottom: 50px !important;
|
||||
margin-bottom: 50px;
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.info_table > tbody > tr:nth-child(even) {
|
||||
|
@ -158,7 +159,7 @@
|
|||
|
||||
.info_table > thead > tr * {
|
||||
font-size: 12px;
|
||||
font-family: "Pandora-Bold";
|
||||
font-weight: bold;
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
|
@ -404,6 +405,27 @@ a.pandora_pagination.current:hover {
|
|||
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 */
|
||||
.datatable_filter.content {
|
||||
display: flex;
|
||||
|
@ -418,6 +440,7 @@ a.pandora_pagination.current:hover {
|
|||
.datatable_filter.content li {
|
||||
flex: 1 1 auto;
|
||||
margin: 1em auto;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.sorting_desc {
|
||||
background: url(../../images/sort_down_green.png) no-repeat;
|
||||
|
@ -483,7 +506,7 @@ a.pandora_pagination.current:hover {
|
|||
flex: 0 1 auto;
|
||||
font-size: 15px;
|
||||
color: #14524f;
|
||||
font-family: "Pandora-Bold";
|
||||
font-weight: bold;
|
||||
margin: 4px 0 7px;
|
||||
}
|
||||
|
||||
|
|
|
@ -1054,6 +1054,7 @@ if (isset($_GET['bye'])) {
|
|||
header_remove('Set-Cookie');
|
||||
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
|
||||
|
||||
generate_csrf_code();
|
||||
// Process logout.
|
||||
include 'general/logoff.php';
|
||||
|
||||
|
|
|
@ -130,8 +130,8 @@
|
|||
</div>
|
||||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.768';
|
||||
$build = '230210';
|
||||
$version = '7.0NG.769';
|
||||
$build = '230222';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -57,10 +57,10 @@ if ($new_networkmap) {
|
|||
$offset_x = '';
|
||||
$offset_y = '';
|
||||
$scale_z = 0.5;
|
||||
$node_sep = 10;
|
||||
$rank_sep = 1.0;
|
||||
$node_sep = 0.25;
|
||||
$rank_sep = 0.5;
|
||||
$mindist = 1.0;
|
||||
$kval = 5;
|
||||
$kval = 0.3;
|
||||
$refresh_time = 300;
|
||||
}
|
||||
|
||||
|
@ -273,6 +273,25 @@ if (!empty($result)) {
|
|||
if ($not_found) {
|
||||
ui_print_error_message(__('Not found networkmap.'));
|
||||
} 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->id = 'form_editor';
|
||||
|
||||
|
@ -337,7 +356,14 @@ if ($not_found) {
|
|||
);
|
||||
|
||||
$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][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['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] .= 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'][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'][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'AR',
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'id_group[]',
|
||||
explode(',', $id_group),
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true
|
||||
).'</div>';
|
||||
$table->data['source_data_group'][1] .= html_print_image(
|
||||
|
@ -498,9 +550,10 @@ if ($not_found) {
|
|||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input[name='source']").on('change', function() {
|
||||
var source = $("input[name='source']:checked").val();
|
||||
|
||||
$("#map_loading").hide();
|
||||
$("#source").change(function() {
|
||||
const source = $(this).val();
|
||||
|
||||
if (source == 'recon_task') {
|
||||
$("#form_editor-source_data_ip_mask")
|
||||
.css('display', 'none');
|
||||
|
@ -510,7 +563,6 @@ $(document).ready(function() {
|
|||
.css('display', 'none');
|
||||
$("#form_editor-source_data_recon_task")
|
||||
.css('display', '');
|
||||
|
||||
}
|
||||
else if (source == 'ip_mask') {
|
||||
$("#form_editor-source_data_ip_mask")
|
||||
|
@ -565,7 +617,7 @@ $(document).ready(function() {
|
|||
$("#form_editor-kval")
|
||||
.css('display', 'none');
|
||||
$("#form_editor-nodesep")
|
||||
.css('display', '');
|
||||
.css('display', 'none');
|
||||
}
|
||||
else if (method == 'neato') {
|
||||
$("#form_editor-ranksep")
|
||||
|
@ -598,17 +650,15 @@ $(document).ready(function() {
|
|||
.css('display', '');
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='source']").trigger("change");
|
||||
|
||||
$("#source").trigger("change");
|
||||
$("#method").trigger("change");
|
||||
|
||||
|
||||
// Control if id_group has changed.
|
||||
var id_group_old = $("#id_group").val();
|
||||
var id_group_changed = false;
|
||||
|
||||
$("#id_group").on('change',{id_group_old: id_group_old}, function () {
|
||||
|
||||
var id_group_new = $("#id_group").val();
|
||||
if((id_group_old != id_group_new) && (update_networkmap == 1 )) {
|
||||
id_group_changed = true;
|
||||
|
@ -625,7 +675,7 @@ $(document).ready(function() {
|
|||
update_networkmap = $("input[name='update_networkmap']").val();
|
||||
|
||||
$( "#submit-crt" ).click(function( event ) {
|
||||
|
||||
$("#map_loading").show();
|
||||
if(update_networkmap == 1 && id_group_changed === true) {
|
||||
confirmDialog({
|
||||
title: '<?php echo __('Are you sure?'); ?>',
|
||||
|
@ -643,7 +693,6 @@ $(document).ready(function() {
|
|||
})
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#refresh_time_units").trigger("change");
|
||||
|
|
|
@ -182,7 +182,7 @@ if ($save_empty_networkmap === true) {
|
|||
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['id_group'] = $id_group;
|
||||
$values['id_group'] = implode(',', $id_group);
|
||||
|
||||
$values['generation_method'] = 4;
|
||||
|
||||
|
@ -237,7 +237,7 @@ if ($new_networkmap || $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);
|
||||
|
||||
|
||||
|
@ -292,7 +292,7 @@ if ($new_networkmap || $save_networkmap) {
|
|||
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['id_group'] = $id_group;
|
||||
$values['id_group'] = implode(',', $id_group);
|
||||
$values['source_period'] = 60;
|
||||
$values['width'] = $width;
|
||||
$values['height'] = $height;
|
||||
|
@ -333,7 +333,7 @@ if ($new_networkmap || $save_networkmap) {
|
|||
|
||||
if ($source == 'group') {
|
||||
$values['source'] = 0;
|
||||
$values['source_data'] = $id_group;
|
||||
$values['source_data'] = implode(',', $id_group);
|
||||
} else if ($source == 'recon_task') {
|
||||
$values['source'] = 1;
|
||||
$values['source_data'] = $recon_task_id;
|
||||
|
@ -444,7 +444,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
|
|||
}
|
||||
|
||||
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.
|
||||
$id_group_old = db_get_value('id_group', 'tmap', 'id', $id);
|
||||
|
||||
|
@ -480,7 +480,7 @@ else if ($update_networkmap || $copy_networkmap || $delete) {
|
|||
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['id_group'] = $id_group;
|
||||
$values['id_group'] = implode(',', $id_group);
|
||||
$values['id_group_map'] = $id_group_map;
|
||||
|
||||
$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['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')) {
|
||||
$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'][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;
|
||||
if (isset($map_filter['dont_show_subgroups'])) {
|
||||
|
@ -296,9 +321,9 @@ if (is_ajax() === true) {
|
|||
$map_form .= html_print_table($table, true);
|
||||
|
||||
$map_form .= '<script>
|
||||
$("input[name=\'source\']").on(\'change\', function() {
|
||||
var source = $("input[name=\'source\']:checked").val();
|
||||
|
||||
$("#source").change(function() {
|
||||
const source = $(this).val();
|
||||
|
||||
if (source == \'recon_task\') {
|
||||
$("#form_editor-source_data_ip_mask")
|
||||
.css(\'display\', \'none\');
|
||||
|
@ -388,8 +413,8 @@ if (is_ajax() === true) {
|
|||
.css(\'display\', \'\');
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=\'source\']").trigger("change");
|
||||
|
||||
$("#source").trigger("change");
|
||||
$("#method").trigger("change");
|
||||
</script>';
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ $autosearch = false;
|
|||
// It is validated if it receives parameters different from those it has by default.
|
||||
if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
|
||||
|| $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
|
||||
|| $min_hours_status !== ''
|
||||
) {
|
||||
|
|
|
@ -239,6 +239,13 @@ $server_id = get_parameter(
|
|||
($filter['server_id'] ?? '')
|
||||
);
|
||||
|
||||
if (empty($id_agent) === true) {
|
||||
$id_agent = get_parameter(
|
||||
'id_agent',
|
||||
($filter['id_agent'] ?? '')
|
||||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$servers = metaconsole_get_servers();
|
||||
if (is_array($servers) === true) {
|
||||
|
@ -574,37 +581,37 @@ if (is_ajax() === true) {
|
|||
|
||||
// Event severity prepared.
|
||||
switch ($tmp->criticity) {
|
||||
case EVENT_CRIT_CRITICAL;
|
||||
case EVENT_CRIT_CRITICAL:
|
||||
$text = __('CRITICAL');
|
||||
$color = COL_CRITICAL;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_MAINTENANCE;
|
||||
case EVENT_CRIT_MAINTENANCE:
|
||||
$text = __('MAINTENANCE');
|
||||
$color = COL_MAINTENANCE;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_INFORMATIONAL;
|
||||
case EVENT_CRIT_INFORMATIONAL:
|
||||
$text = __('INFORMATIONAL');
|
||||
$color = COL_INFORMATIONAL;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_MAJOR;
|
||||
case EVENT_CRIT_MAJOR:
|
||||
$text = __('MAJOR');
|
||||
$color = COL_MAJOR;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_MINOR;
|
||||
case EVENT_CRIT_MINOR:
|
||||
$text = __('MINOR');
|
||||
$color = COL_MINOR;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_NORMAL;
|
||||
case EVENT_CRIT_NORMAL:
|
||||
$text = __('NORMAL');
|
||||
$color = COL_NORMAL;
|
||||
break;
|
||||
|
||||
case EVENT_CRIT_WARNING;
|
||||
case EVENT_CRIT_WARNING:
|
||||
$text = __('WARNING');
|
||||
$color = COL_WARNING;
|
||||
break;
|
||||
|
@ -652,43 +659,43 @@ if (is_ajax() === true) {
|
|||
|
||||
// Event type prepared.
|
||||
switch ($tmp->event_type) {
|
||||
case EVENTS_ALERT_FIRED;
|
||||
case EVENTS_ALERT_RECOVERED;
|
||||
case EVENTS_ALERT_CEASED;
|
||||
case EVENTS_ALERT_MANUAL_VALIDATION;
|
||||
case EVENTS_ALERT_FIRED:
|
||||
case EVENTS_ALERT_RECOVERED:
|
||||
case EVENTS_ALERT_CEASED:
|
||||
case EVENTS_ALERT_MANUAL_VALIDATION:
|
||||
$text = __('ALERT');
|
||||
$color = COL_ALERTFIRED;
|
||||
break;
|
||||
|
||||
case EVENTS_RECON_HOST_DETECTED;
|
||||
case EVENTS_SYSTEM;
|
||||
case EVENTS_ERROR;
|
||||
case EVENTS_NEW_AGENT;
|
||||
case EVENTS_CONFIGURATION_CHANGE;
|
||||
case EVENTS_RECON_HOST_DETECTED:
|
||||
case EVENTS_SYSTEM:
|
||||
case EVENTS_ERROR:
|
||||
case EVENTS_NEW_AGENT:
|
||||
case EVENTS_CONFIGURATION_CHANGE:
|
||||
$text = __('SYSTEM');
|
||||
$color = COL_MAINTENANCE;
|
||||
break;
|
||||
|
||||
case EVENTS_GOING_UP_WARNING;
|
||||
case EVENTS_GOING_DOWN_WARNING;
|
||||
case EVENTS_GOING_UP_WARNING:
|
||||
case EVENTS_GOING_DOWN_WARNING:
|
||||
$text = __('WARNING');
|
||||
$color = COL_WARNING;
|
||||
break;
|
||||
|
||||
case EVENTS_GOING_DOWN_NORMAL;
|
||||
case EVENTS_GOING_UP_NORMAL;
|
||||
case EVENTS_GOING_DOWN_NORMAL:
|
||||
case EVENTS_GOING_UP_NORMAL:
|
||||
$text = __('NORMAL');
|
||||
$color = COL_NORMAL;
|
||||
break;
|
||||
|
||||
case EVENTS_GOING_DOWN_CRITICAL;
|
||||
case EVENTS_GOING_UP_CRITICAL;
|
||||
case EVENTS_GOING_DOWN_CRITICAL:
|
||||
case EVENTS_GOING_UP_CRITICAL:
|
||||
$text = __('CRITICAL');
|
||||
$color = COL_CRITICAL;
|
||||
break;
|
||||
|
||||
case EVENTS_UNKNOWN;
|
||||
case EVENTS_GOING_UNKNOWN;
|
||||
case EVENTS_UNKNOWN:
|
||||
case EVENTS_GOING_UNKNOWN:
|
||||
default:
|
||||
$text = __('UNKNOWN');
|
||||
$color = COL_UNKNOWN;
|
||||
|
@ -702,29 +709,29 @@ if (is_ajax() === true) {
|
|||
// Module status.
|
||||
// Event severity prepared.
|
||||
switch ($tmp->module_status) {
|
||||
case AGENT_MODULE_STATUS_NORMAL;
|
||||
case AGENT_MODULE_STATUS_NORMAL:
|
||||
$text = __('NORMAL');
|
||||
$color = COL_NORMAL;
|
||||
break;
|
||||
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD;
|
||||
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
||||
$text = __('CRITICAL');
|
||||
$color = COL_CRITICAL;
|
||||
break;
|
||||
|
||||
case AGENT_MODULE_STATUS_NO_DATA;
|
||||
case AGENT_MODULE_STATUS_NO_DATA:
|
||||
$text = __('NOT INIT');
|
||||
$color = COL_NOTINIT;
|
||||
break;
|
||||
|
||||
case AGENT_MODULE_STATUS_CRITICAL_ALERT;
|
||||
case AGENT_MODULE_STATUS_NORMAL_ALERT;
|
||||
case AGENT_MODULE_STATUS_WARNING_ALERT;
|
||||
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
||||
case AGENT_MODULE_STATUS_NORMAL_ALERT:
|
||||
case AGENT_MODULE_STATUS_WARNING_ALERT:
|
||||
$text = __('ALERT');
|
||||
$color = COL_ALERTFIRED;
|
||||
break;
|
||||
|
||||
case AGENT_MODULE_STATUS_WARNING;
|
||||
case AGENT_MODULE_STATUS_WARNING:
|
||||
$text = __('WARNING');
|
||||
$color = COL_WARNING;
|
||||
break;
|
||||
|
@ -2418,8 +2425,6 @@ try {
|
|||
100,
|
||||
200,
|
||||
500,
|
||||
1000,
|
||||
-1,
|
||||
],
|
||||
[
|
||||
$config['block_size'],
|
||||
|
@ -2428,8 +2433,6 @@ try {
|
|||
100,
|
||||
200,
|
||||
500,
|
||||
1000,
|
||||
'All',
|
||||
],
|
||||
],
|
||||
'order' => [
|
||||
|
@ -2659,7 +2662,7 @@ function process_datatables_callback(table, settings) {
|
|||
|
||||
function countdown_repeat() {
|
||||
var until_time = new Date();
|
||||
until_time.setTime (until_time.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
until_time.setTime (until_time.getTime () + parseInt(<?php echo($config['refr'] * 1000); ?>));
|
||||
return until_time;
|
||||
}
|
||||
|
||||
|
@ -3077,7 +3080,7 @@ $(document).ready( function() {
|
|||
//Autorefresh in fullscreen
|
||||
var pure = '<?php echo $pure; ?>';
|
||||
if(pure == 1){
|
||||
var refresh_interval = parseInt('<?php echo ($config['refr'] * 1000); ?>');
|
||||
var refresh_interval = parseInt('<?php echo($config['refr'] * 1000); ?>');
|
||||
var until_time='';
|
||||
|
||||
// If autorefresh is disabled, don't show the countdown
|
||||
|
@ -3088,7 +3091,7 @@ $(document).ready( function() {
|
|||
|
||||
function events_refresh() {
|
||||
until_time = new Date();
|
||||
until_time.setTime (until_time.getTime () + parseInt(<?php echo ($config['refr'] * 1000); ?>));
|
||||
until_time.setTime (until_time.getTime () + parseInt(<?php echo($config['refr'] * 1000); ?>));
|
||||
|
||||
$("#refrcounter").countdown ({
|
||||
until: until_time,
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Pandora FMS Console
|
||||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_VERSION="7.0NG.769"
|
||||
FORCE=0
|
||||
DESTDIR=""
|
||||
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` (
|
||||
`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 '',
|
||||
`type` 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),
|
||||
('mins_fail_pass', 5),
|
||||
('number_attempts', 5),
|
||||
('enable_pass_policy_admin', 0),
|
||||
('enable_pass_policy_admin', 1),
|
||||
('enable_pass_history', 0),
|
||||
('compare_pass', 3),
|
||||
('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_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
('MR', 60),
|
||||
('MR', 61),
|
||||
('identification_reminder', 1),
|
||||
('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"}'),
|
||||
('custom_docs_logo', 'default_docs.png'),
|
||||
('custom_support_logo', 'default_support.png'),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.768-230210
|
||||
Version: 7.0NG.769-230222
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230210"
|
||||
pandora_version="7.0NG.769-230222"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -801,7 +801,7 @@ sub main() {
|
|||
# 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"}."'";
|
||||
# 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 @res_testing_api = split(',', $exe_testing_api);
|
||||
if ( $res_testing_api[0] ne 'OK' ) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#############################################################################
|
||||
# Pandora FMS Server Parameters
|
||||
# Pandora FMS, the Flexible Monitoring System.
|
||||
# Version 7.0NG.768
|
||||
# Version 7.0NG.769
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -45,8 +45,8 @@ our @EXPORT = qw(
|
|||
);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230210";
|
||||
my $pandora_version = "7.0NG.769";
|
||||
my $pandora_build = "230222";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -5628,16 +5628,26 @@ sub pandora_server_statistics ($$) {
|
|||
# Non-dataserver LAG calculation:
|
||||
if ($server->{"server_type"} != DATASERVER){
|
||||
|
||||
$lag_row = get_db_single_row ($dbh, "SELECT COUNT(tagente_modulo.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - utimestamp - current_interval) AS lag
|
||||
FROM tagente_estado, tagente_modulo
|
||||
WHERE utimestamp > 0
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.id_tipo_modulo < 5
|
||||
AND tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
||||
AND current_interval > 0
|
||||
AND (UNIX_TIMESTAMP() - utimestamp) < ( current_interval * 10)
|
||||
AND running_by = ?
|
||||
AND (UNIX_TIMESTAMP() - utimestamp) > (current_interval * 1.1)", $server->{"id_server"});
|
||||
$lag_row = get_db_single_row ($dbh,
|
||||
"SELECT COUNT(tam.id_agente_modulo) AS module_lag, AVG(UNIX_TIMESTAMP() - tae.last_execution_try - tae.current_interval) AS lag
|
||||
FROM (
|
||||
SELECT tagente_estado.last_execution_try, tagente_estado.current_interval, tagente_estado.id_agente_modulo
|
||||
FROM tagente_estado
|
||||
WHERE tagente_estado.current_interval > 0
|
||||
AND tagente_estado.last_execution_try > 0
|
||||
AND tagente_estado.running_by = ?
|
||||
) tae
|
||||
JOIN (
|
||||
SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag
|
||||
FROM tagente_modulo LEFT JOIN tagente
|
||||
ON tagente_modulo.id_agente = tagente.id_agente
|
||||
WHERE tagente.disabled = 0
|
||||
AND tagente_modulo.disabled = 0
|
||||
AND tagente_modulo.id_tipo_modulo < 5
|
||||
) tam
|
||||
ON tae.id_agente_modulo = tam.id_agente_modulo
|
||||
WHERE (UNIX_TIMESTAMP() - tae.last_execution_try) < ( tae.current_interval * 10)
|
||||
AND (tam.flag = 1 OR (UNIX_TIMESTAMP() - tae.last_execution_try) > tae.current_interval)", $server->{"id_server"});
|
||||
}
|
||||
# Dataserver LAG calculation:
|
||||
else {
|
||||
|
|
|
@ -221,10 +221,14 @@ sub data_consumer ($$) {
|
|||
|
||||
if ($task->{'type'} == DISCOVERY_APP_SAP) {
|
||||
# SAP TASK, retrieve license.
|
||||
$task->{'sap_license'} = pandora_get_config_value(
|
||||
$dbh,
|
||||
'sap_license'
|
||||
);
|
||||
if (defined($task->{'field4'}) && $task->{'field4'} ne "") {
|
||||
$task->{'sap_license'} = $task->{'field4'};
|
||||
} else {
|
||||
$task->{'sap_license'} = pandora_get_config_value(
|
||||
$dbh,
|
||||
'sap_license'
|
||||
);
|
||||
}
|
||||
|
||||
# Retrieve credentials for task (optional).
|
||||
if (defined($task->{'auth_strings'})
|
||||
|
|
|
@ -33,8 +33,8 @@ use base 'Exporter';
|
|||
our @ISA = qw(Exporter);
|
||||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230210";
|
||||
my $pandora_version = "7.0NG.769";
|
||||
my $pandora_build = "230222";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#
|
||||
# Pandora FMS Server
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -109,6 +110,12 @@ rm -fr $RPM_BUILD_ROOT
|
|||
getent passwd pandora >/dev/null || \
|
||||
/usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora
|
||||
|
||||
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
|
||||
if [ $((current_ver)) -lt 13 ] ; then
|
||||
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
%post
|
||||
|
@ -176,6 +183,12 @@ if [ "$1" = "1" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
|
||||
if [ $((current_ver)) -lt 13 ] ; then
|
||||
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/sbin/service pandora_server stop >/dev/null 2>&1 || :
|
||||
/sbin/service tentacle_serverd stop >/dev/null 2>&1 || :
|
||||
/sbin/chkconfig --del pandora_server
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#
|
||||
# Pandora FMS Server
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 230210
|
||||
%define version 7.0NG.769
|
||||
%define release 230222
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
@ -100,7 +101,11 @@ if [ "`id pandora | grep uid | wc -l`" = 0 ]
|
|||
then
|
||||
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
|
||||
fi
|
||||
exit 0
|
||||
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
|
||||
if [ $((current_ver)) -lt 13 ] ; then
|
||||
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%post
|
||||
if [ `command -v systemctl` ];
|
||||
|
@ -172,6 +177,12 @@ if [ "$1" = "1" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
|
||||
if [ $((current_ver)) -lt 13 ] ; then
|
||||
echo "perl Thread::Semaphore version >= 2.13 should be installed. Current version installed ver: $(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/etc/init.d/pandora_server stop &>/dev/null
|
||||
/etc/init.d/tentacle_serverd stop &>/dev/null
|
||||
chkconfig --del pandora_server
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230210"
|
||||
PI_VERSION="7.0NG.769"
|
||||
PI_BUILD="230222"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.768 Build 230210";
|
||||
my $version = "7.0NG.769 Build 230222";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
@ -53,6 +53,9 @@ my $SMALL_OPERATION_STEP = 1000; # 1000 is default
|
|||
# Timeout for lock acquisition.
|
||||
my $LOCK_TIMEOUT = 60;
|
||||
|
||||
# Cron cookies file.
|
||||
my $COOKIES_FILE = '/tmp/cron-session-cookies';
|
||||
|
||||
# FLUSH in each IO
|
||||
$| = 1;
|
||||
|
||||
|
@ -1067,12 +1070,17 @@ sub pandora_delete_old_session_data {
|
|||
|
||||
$ulimit_timestamp = time() - $session_timeout;
|
||||
|
||||
log_message ('PURGE', "Deleting old session data from tsessions_php\n");
|
||||
log_message ('PURGE', "Deleting old session data from tsessions_php");
|
||||
while(db_delete_limit ($dbh, 'tsessions_php', 'last_active < ?', $SMALL_OPERATION_STEP, $ulimit_timestamp) ne '0E0') {
|
||||
usleep (10000);
|
||||
};
|
||||
|
||||
db_do ($dbh, "DELETE FROM tsessions_php WHERE data IS NULL OR id_session REGEXP '^cron-'");
|
||||
|
||||
# Delete cron cookies file
|
||||
log_message ('PURGE', "Deleting cron session file");
|
||||
unlink($COOKIES_FILE);
|
||||
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue