10755-Confict

This commit is contained in:
Pablo Aragon 2023-04-17 15:47:42 +02:00
commit 53bbae5264
104 changed files with 2179 additions and 1165 deletions

View File

@ -15,7 +15,7 @@ LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$MYVER" ] || MYVER=57
[ "$MYVER" ] || MYVER=80
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
@ -27,6 +27,7 @@ LOGFILE="/tmp/deploy-ext-db-$(date +%F).log"
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
# Ansi color code variables
red="\e[0;91m"
green="\e[0;92m"

View File

@ -11,22 +11,25 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='2022050901'
S_VERSION='202304111'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$MYVER" ] || MYVER=80
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
[ "$DBPASS" ] || DBPASS=pandora
[ "$DBPORT" ] || DBPORT=3306
[ "$DBROOTUSER" ] || DBROOTUSER=root
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
# Ansi color code variables
red="\e[0;91m"
@ -130,7 +133,10 @@ check_root_permissions
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
#advicing BETA PROGRAM
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER
# Connectivity
check_repo_connection
@ -174,7 +180,15 @@ execute_cmd "yum-config-manager --enable remi-php80" "Configuring PHP"
# Install percona Database
#[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf
execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server"
if [ "$MYVER" -eq '80' ] ; then
execute_cmd "percona-release setup ps80 -y" "Enabling mysql80 module"
execute_cmd "yum install -y percona-server-server percona-xtrabackup-80" "Installing Percona Server 80"
fi
if [ "$MYVER" -ne '80' ] ; then
execute_cmd "yum install -y Percona-Server-server-57 percona-xtrabackup-24" "Installing Percona Server 57"
fi
# Console dependencies
console_dependencies=" \
@ -348,21 +362,32 @@ EO_CONFIG_TMP
#Configuring Database
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
echo """
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -uroot &>> "$LOGFILE"
fi
export MYSQL_PWD=$DBROOTPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."
execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
if [ "$MYVER" -eq '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = 'Pandor4!';
UNINSTALL COMPONENT 'file://component_validate_password';
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = '$DBROOTPASS';
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"
fi
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
export MYSQL_PWD=$DBPASS
if [ "$MYVER" -ne '80' ] ; then
echo """
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR '$DBROOTUSER'@'localhost' = PASSWORD('$DBROOTPASS');
""" | mysql --connect-expired-password -u$DBROOTUSER &>> "$LOGFILE"fi
fi
export MYSQL_PWD=$DBROOTPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support."
echo "CREATE USER \"$DBUSER\"@'%' IDENTIFIED BY \"$DBPASS\";" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
echo "ALTER USER \"$DBUSER\"@'%' IDENTIFIED WITH mysql_native_password BY \"$DBPASS\"" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%'" | mysql -u$DBROOTUSER -P$DBPORT -h$DBHOST
#Generating my.cnf
cat > /etc/my.cnf << EO_CONFIG_F
@ -401,6 +426,8 @@ query_cache_size = 64M
query_cache_min_res_unit = 2k
query_cache_limit = 256K
#skip-log-bin
sql_mode=""
[mysqld_safe]
@ -409,17 +436,35 @@ pid-file=/var/run/mysqld/mysqld.pid
EO_CONFIG_F
execute_cmd "systemctl restart mysqld" "Configuring database engine"
if [ "$MYVER" -eq '80' ] ; then
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
sed -i -e "s/character-set-server=utf8/character-set-server=utf8mb4/g" /etc/my.cnf
fi
execute_cmd "systemctl restart mysqld" "Configuring database engine"
execute_cmd "systemctl enable mysqld --now" "Enabling Database service"
fi
export MYSQL_PWD=$DBPASS
#Define packages
if [ "$PANDORA_BETA" -eq '0' ] ; then
#Define packages
if [ "$PANDORA_LTS" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
elif [ "$PANDORA_LTS" -ne '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
elif [ "$PANDORA_BETA" -ne '0' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi
# if beta is enable
if [ "$PANDORA_BETA" -eq '1' ] ; then
PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi
# Downloading Pandora Packages

View File

@ -14,12 +14,12 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
S_VERSION='202302201'
S_VERSION='202304111'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$MYVER" ] || MYVER=57
[ "$MYVER" ] || MYVER=80
[ "$PHPVER" ] || PHPVER=8
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
@ -149,8 +149,8 @@ check_root_permissions
#advicing BETA PROGRAM
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER
# Connectivity
@ -327,12 +327,15 @@ console_dependencies=" \
mod_ssl \
libzstd \
openldap-clients \
chromium \
http://firefly.artica.es/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
# Server dependencies
server_dependencies=" \
perl \
@ -516,9 +519,9 @@ fi
# if beta is enable
if [ "$PANDORA_BETA" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
fi
# Downloading Pandora Packages

View File

@ -17,7 +17,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
WORKDIR=/opt/pandora/deploy
S_VERSION='202302201'
S_VERSION='202304111'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
rm -f $LOGFILE &> /dev/null # remove last log before start
@ -153,8 +153,8 @@ check_root_permissions
#advicing BETA PROGRAM
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
echo -e $INSTALLING_VER
# Connectivity
@ -304,8 +304,9 @@ ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
# Chrome
rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome"
execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome"
CHROME_VERSION=google-chrome-stable_110.0.5481.177-1_amd64.deb
execute_cmd "wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}" "Downloading google chrome"
execute_cmd "apt install -y ./${CHROME_VERSION}" "Intalling google chrome"
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
# SDK VMware perl dependencies
@ -466,9 +467,9 @@ elif [ "$PANDORA_LTS" -ne '1' ] ; then
fi
if [ "$PANDORA_BETA" -eq '1' ] ; then
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
fi
# Downloading Pandora Packages

View File

@ -8,265 +8,135 @@ RUN dnf install -y --setopt=tsflags=nodocs \
dnf-utils \
http://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf module reset -y php && dnf module install -y php:remi-7.4
RUN dnf module reset -y php && dnf module install -y php:remi-8.0
RUN dnf config-manager --set-enabled powertools
# Install console dependencies
RUN dnf install -y --setopt=tsflags=nodocs \
php \
php-mcrypt \php-cli \
php-gd \
php-curl \
php-session \
php-mysqlnd \
php-ldap \
php-zip \
php-zlib \
php-fileinfo \
php-gettext \
php-snmp \
php-mbstring \
php-pecl-zip \
php-xmlrpc \
libxslt \
wget \
php-xml \
httpd \
mod_php \
atk \
avahi-libs \
cairo \
cups-libs \
fribidi \
gd \
gdk-pixbuf2 \
ghostscript \
graphite2 \
graphviz \
gtk2 \
harfbuzz \
hicolor-icon-theme \
hwdata \
jasper-libs \
lcms2 \
libICE \
libSM \
libXaw \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXfixes \
libXft \
libXi \
libXinerama \
libXmu \
libXrandr \
libXrender \
libXt \
libXxf86vm \
libcroco \
libdrm \
libfontenc \
libglvnd \
libglvnd-egl \
libglvnd-glx \
libpciaccess \
librsvg2 \
libthai \
libtool-ltdl \
libwayland-client \
libwayland-server \
libxshmfence \
mesa-libEGL \
mesa-libGL \
mesa-libgbm \
mesa-libglapi \
pango \
pixman \
nfdump \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-misc \
poppler-data \
php-yaml
php \
postfix \
php-mcrypt \
php-cli \
php-gd \
php-curl \
php-session \
php-mysqlnd \
php-ldap \
php-zip \
php-zlib \
php-fileinfo \
php-gettext \
php-snmp \
php-mbstring \
php-pecl-zip \
php-xmlrpc \
libxslt \
wget \
php-xml \
httpd \
mod_php \
atk \
avahi-libs \
cairo \
cups-libs \
fribidi \
gd \
gdk-pixbuf2 \
ghostscript \
graphite2 \
graphviz \
gtk2 \
harfbuzz \
hicolor-icon-theme \
hwdata \
jasper-libs \
lcms2 \
libICE \
libSM \
libXaw \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXfixes \
libXft \
libXi \
libXinerama \
libXmu \
libXrandr \
libXrender \
libXt \
libXxf86vm \
libcroco \
libdrm \
libfontenc \
libglvnd \
libglvnd-egl \
libglvnd-glx \
libpciaccess \
librsvg2 \
libthai \
libtool-ltdl \
libwayland-client \
libwayland-server \
libxshmfence \
mesa-libEGL \
mesa-libGL \
mesa-libgbm \
mesa-libglapi \
pango \
pixman \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-misc \
poppler-data \
php-yaml \
libzstd \
openldap-clients \
http://firefly.artica.es/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm
RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/
# Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts
# Install server dependencies
RUN dnf install -y --setopt=tsflags=nodocs \
GeoIP \
GeoIP-GeoLite-data \
dwz \
efi-srpm-macros \
ghc-srpm-macros \
go-srpm-macros \
ocaml-srpm-macros \
openblas-srpm-macros \
perl \
perl-Algorithm-Diff \
perl-Archive-Tar \
perl-Archive-Zip \
perl-Attribute-Handlers \
perl-B-Debug \
perl-CPAN \
perl-CPAN-Meta \
perl-CPAN-Meta-Requirements \
perl-CPAN-Meta-YAML \
perl-Compress-Bzip2 \
perl-Config-Perl-V \
perl-DBD-MySQL \
perl-DBI \
perl-DB_File \
perl-Data-Dump \
perl-Data-OptList \
perl-Data-Section \
perl-Devel-PPPort \
perl-Devel-Peek \
perl-Devel-SelfStubber \
perl-Devel-Size \
perl-Digest-HMAC \
perl-Digest-SHA \
perl-Encode-Locale \
perl-Encode-devel \
perl-Env \
perl-ExtUtils-CBuilder \
perl-ExtUtils-Command \
perl-ExtUtils-Embed \
perl-ExtUtils-Install \
perl-ExtUtils-MM-Utils \
perl-ExtUtils-MakeMaker \
perl-ExtUtils-Manifest \
perl-ExtUtils-Miniperl \
perl-ExtUtils-ParseXS \
perl-File-Fetch \
perl-File-HomeDir \
perl-File-Listing \
perl-File-Which \
perl-Filter \
perl-Filter-Simple \
perl-Geo-IP \
perl-HTML-Parser \
perl-HTML-Tagset \
perl-HTML-Tree \
perl-HTTP-Cookies \
perl-HTTP-Date \
perl-HTTP-Message \
perl-HTTP-Negotiate \
perl-IO-HTML \
perl-IO-Socket-INET6 \
perl-IO-Zlib \
perl-IO-stringy \
perl-IPC-Cmd \
perl-IPC-SysV \
perl-IPC-System-Simple \
perl-JSON \
perl-JSON-PP \
perl-LWP-MediaTypes \
perl-Locale-Codes \
perl-Locale-Maketext \
perl-Locale-Maketext-Simple \
perl-MRO-Compat \
perl-Math-BigInt \
perl-Math-BigInt-FastCalc \
perl-Math-BigRat \
perl-Memoize \
perl-Module-Build \
perl-Module-CoreList \
perl-Module-CoreList-tools \
perl-Module-Load \
perl-Module-Load-Conditional \
perl-Module-Loaded \
perl-Module-Metadata \
perl-NTLM \
perl-Net-HTTP \
perl-Net-Ping \
perl-NetAddr-IP \
perl-Package-Generator \
perl-Params-Check \
perl-Params-Util \
perl-Perl-OSType \
perl-PerlIO-via-QuotedPrint \
perl-Pod-Checker \
perl-Pod-Html \
perl-Pod-Parser \
perl-SelfLoader \
perl-Socket6 \
perl-Software-License \
perl-Sub-Exporter \
perl-Sub-Install \
perl-Sys-Syslog \
perl-Test \
perl-Test-Harness \
perl-Test-Simple \
perl-Text-Balanced \
perl-Text-Diff \
perl-Text-Glob \
perl-Text-Template \
perl-Thread-Queue \
perl-Time-Piece \
perl-TimeDate \
perl-Try-Tiny \
perl-Unicode-Collate \
perl-WWW-RobotRules \
perl-XML-NamespaceSupport \
perl-XML-Parser \
perl-XML-SAX \
perl-XML-SAX-Base \
perl-XML-Simple \
perl-XML-Twig \
perl-autodie \
perl-bignum \
perl-devel \
perl-encoding \
perl-experimental \
perl-inc-latest \
perl-libnetcfg \
perl-libwww-perl \
perl-local-lib \
perl-open \
perl-perlfaq \
perl-srpm-macros \
perl-utils \
perl-version \
python-srpm-macros \
python3-pyparsing \
python3-rpm-macros \
qt5-srpm-macros \
redhat-rpm-config \
rust-srpm-macros \
systemtap-sdt-devel \
perl-TermReadKey \
perl \
perl-DBD-MySQL \
perl-DBI \
initscripts \
vim \
fping \
perl-IO-Compress \
perl-Time-HiRes \
perl-Math-Complex \
libnsl \
mysql \
java \
net-snmp-utils \
net-tools \
nmap-ncat \
nmap \
net-snmp-utils \
sudo \
expect \
openssh-clients \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm
# Install server dependencies
RUN dnf install -y --setopt=tsflags=nodocs \
perl \
vim \
fping \
perl-IO-Compress \
nmap \
sudo \
perl-Time-HiRes \
nfdump \
net-snmp-utils \
"perl(NetAddr::IP)" \
"perl(Sys::Syslog)" \
"perl(DBI)" \
"perl(XML::Simple)" \
"perl(Geo::IP)" \
"perl(IO::Socket::INET6)" \
"perl(XML::Twig)" \
expect \
openssh-clients \
java \
bind-utils \
whois \
libnsl \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
https://firefly.artica.es/centos8/pandorawmic-1.0.0-1.x86_64.rpm ; dnf clean all
# Install utils
RUN dnf install -y supervisor chromium crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
RUN dnf install -y supervisor mysql chromium crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
# SDK VMware perl dependencies
RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm
# Instant client Oracle
RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
# Install IPAM dependencies
RUN dnf install -y http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm "perl(NetAddr::IP)" "perl(Sys::Syslog)" "perl(DBI)" "perl(XML::Simple)" "perl(Geo::IP)" "perl(IO::Socket::INET6)" "perl(XML::Twig)" "perl(DBD::mysql)" --setopt=tsflags=nodocs
EXPOSE 80 443 41121 162/udp

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.770-230404
Version: 7.0NG.770-230417
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230404"
PI_BUILD="230417"
OS_NAME=`uname -s`
FORCE=0

File diff suppressed because it is too large Load Diff

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230404}
{230417}
ViewReadme
{Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.770-230404
Version: 7.0NG.770-230417
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -224,7 +224,7 @@ function pandora_realtime_graphs()
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
'box-flat white_table_graph'
);
$chart[time()]['graph'] = '0';

View File

@ -189,6 +189,12 @@ CREATE TABLE IF NOT EXISTS `tfavmenu_user` (
`section` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`));
ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring` TINYINT UNSIGNED NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_max` INTEGER NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_critical` float(20,2) NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `traffic_warning` float(20,2) NOT NULL default 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tnetflow_filter` ADD COLUMN `netflow_monitoring_interval` INT UNSIGNED NOT NULL DEFAULT 300;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('legacy_database_ha', 1);
COMMIT;

View File

@ -117,12 +117,12 @@ if (empty($config['random_background']) === false) {
unset($random_backgrounds[0], $random_backgrounds[1]);
$random_background = array_rand($random_backgrounds);
$background_url = 'images/backgrounds/random_backgrounds/'.$random_backgrounds[$random_background];
$background_100 = 'background-size: 100% 100% !important; ';
$background_100 = 'background-size: cover !important; background-position: center !important; ';
}
if (empty($config['login_background']) === false) {
$background_url = 'images/backgrounds/'.$config['login_background'];
$background_100 = 'background-size: 100% 100% !important; ';
$background_100 = 'background-size: cover !important; background-position: center !important; ';
}
// Support for Internet Explorer and Microsoft Edge browsers

View File

@ -636,7 +636,8 @@ $tableAdvancedAgent->data['secondary_groups'][] = html_print_label_input_block(
__('Secondary groups'),
html_print_select_agent_secondary(
$agent,
$id_agente
$id_agente,
['selected_post' => $secondary_groups]
)
);

View File

@ -228,7 +228,7 @@ if ($create_agent) {
$cps = (int) get_parameter_switch('cps', -1);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) {
@ -343,7 +343,7 @@ if ($create_agent) {
'agents_update_secondary_groups',
[
$id_agente,
explode(',', $secondary_groups),
$secondary_groups,
[],
]
);
@ -992,7 +992,7 @@ if ($update_agent) {
$cps = get_parameter_switch('cps', -1);
$old_values = db_get_row('tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
$satellite_server = (int) get_parameter('satellite_server', 0);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
@ -1185,13 +1185,27 @@ if ($update_agent) {
"Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}';
$secondary_groups_selected = enterprise_hook(
'agents_get_secondary_groups',
[$id_agente]
);
$delete_secondary_groups = [];
foreach ($secondary_groups_selected['plain'] as $v_selected) {
if (in_array($v_selected, $secondary_groups) === false) {
array_push($delete_secondary_groups, $v_selected);
}
}
// Create the secondary groups.
enterprise_hook(
'agents_update_secondary_groups',
[
$id_agente,
explode(',', $secondary_groups),
[],
$secondary_groups,
$delete_secondary_groups,
true,
]
);

View File

@ -237,8 +237,9 @@ if (db_get_num_rows($sql) == 0) {
$table->head[5] = __('Actions');
$table->align = [];
$table->align[5] = 'left';
$i = 0;
foreach ($result as $row) {
$table->cellclass[$i++][5] = 'table_action_buttons';
$data = [];
$sql = sprintf('SELECT id_policy FROM tpolicy_modules_inventory WHERE id = %d', $row['id_policy_module_inventory']);

View File

@ -1184,6 +1184,11 @@ html_print_div(
}
});
var show_dialog_create = "<?php echo get_parameter('show_dialog_create', 0); ?>";
if (show_dialog_create !== '0'){
$('#button-create_module').click();
}
});

View File

@ -227,7 +227,7 @@ if (is_ajax()) {
'field'.$i.'_value',
'text/plain',
'',
$content_type == 'text/plain',
'',
$is_management_allowed,
'',
'',
@ -239,7 +239,7 @@ if (is_ajax()) {
'field'.$i.'_value',
'text/html',
'',
$content_type == 'text/html',
'text/html',
$is_management_allowed,
'',
'',

View File

@ -712,7 +712,6 @@ $(document).ready (function () {
old_recovery_value =
$("[name=field" + i + "_recovery_value]").val();
}
// Replace the old column with the new
$table_macros_field.replaceWith(field_row);
if (old_value != '' || old_recovery_value != '') {
@ -720,12 +719,14 @@ $(document).ready (function () {
if (inputType == 'radio') {
if(old_value == 'text/plain'){
if ($("[name=field" + i + "_value]").val() == 'text/plain') {
$("[name=field" + i + "_value]").attr('checked','checked');
$("[name=field" + i + "_value][value='text/plain']").attr('checked','checked');
$("[name=field" + i + "_value][value='text/html']").removeAttr("checked")
}
}
else{
if($("[name=field" + i + "_value]").val() == 'text/html') {
$("[name=field" + i + "_value]").attr('checked','checked');
$("[name=field" + i + "_value]").val()
if ($("[name=field" + i + "_value]").val() == 'text/html') {
$("[name=field" + i + "_value][value='text/html']").attr('checked','checked');
}
}
if(old_recovery_value == 'text/plain'){

View File

@ -120,6 +120,16 @@ if (is_metaconsole() === true) {
// Data before table.
$files = list_files(((is_metaconsole() === true) ? '../../' : '').'images/', '@groups.svg', 1, 0);
$files_old = list_files('images/groups_small/', 'png', 1, 0);
foreach ($files_old as $key => $f) {
// Remove from the list the non-desired .png files.
if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) {
unset($files_old[$key]);
}
}
$files = array_merge($files, $files_old);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
@ -133,10 +143,19 @@ $table->data[0][0] = html_print_label_input_block(
html_print_input_text('name', $name, '', 35, 100, true)
);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
$input_icon = html_print_select($files, 'icon', $icon, '', 'None', '', true, false, true, '', false, 'width: 100%;');
$input_icon .= ' <span id="icon_preview" class="mrgn_lft_05em">';
if (empty($icon) === false) {
$input_icon .= html_print_image('images/'.$icon, true);
if (empty($extension) === true || $extension === 'png') {
$input_icon .= html_print_image('images/groups_small/'.$icon, true);
} else {
$input_icon .= html_print_image('images/'.$icon, true);
}
}
$input_icon .= '</span>';
@ -304,12 +323,17 @@ echo '</form>';
function icon_changed () {
var inputs = [];
var data = this.value;
var extension = data.split('.').pop();
$('#icon_preview').fadeOut ('normal', function () {
$('#icon_preview').empty ();
if (data != "") {
var params = [];
params.push("get_image_path=1");
params.push("img_src=images/" + data);
if (extension === 'png') {
params.push("img_src=images/groups_small/" + data);
} else {
params.push("img_src=images/" + data);
}
params.push("page=include/ajax/skins.ajax");
params.push("only_src=1");
jQuery.ajax ({

View File

@ -65,7 +65,7 @@ if (is_ajax() === true) {
$group = [
'id_grupo' => 0,
'nombre' => 'None',
'icon' => 'world',
'icon' => 'world@svg.svg',
'parent' => 0,
'disabled' => 0,
'custom_id' => null,
@ -920,8 +920,19 @@ if ($tab == 'tree') {
}
if ($group['icon'] != '') {
$extension = pathinfo($group['icon'], PATHINFO_EXTENSION);
if (empty($extension) === true) {
$group['icon'] .= '.png';
}
if (empty($extension) === true || $extension === 'png') {
$path = 'images/groups_small/'.$group['icon'];
} else {
$path = 'images/'.$group['icon'];
}
$table->data[$key][2] = html_print_image(
'images/'.$group['icon'],
$path,
true,
[
'style' => '',

View File

@ -177,9 +177,8 @@ if ($access_console_node === true) {
$sub2['godmode/modules/manage_module_templates']['text'] = __('Module templates');
$sub2['godmode/modules/manage_module_templates']['id'] = 'module_templates';
$sub2['godmode/modules/private_enterprise_numbers']['text'] = __('Private Enterprise Numbers');
enterprise_hook('local_components_menu');
$sub2['godmode/modules/private_enterprise_numbers']['id'] = 'private_Enterprise_Numbers';
$sub2['enterprise/godmode/modules/local_components']['text'] = __('Local components');
$sub2['enterprise/godmode/modules/local_components']['id'] = 'local_components';
$sub2['godmode/modules/manage_network_components']['text'] = __('Remote components');
$sub2['godmode/modules/manage_network_components']['id'] = 'network_components';
$sub['templates']['sub2'] = $sub2;

View File

@ -26,6 +26,17 @@
* ============================================================================
*/
// 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.
global $config;
require_once $config['homedir'].'/include/functions_ui.php';
@ -94,6 +105,11 @@ if ($id) {
$src_port = $filter['src_port'];
$aggregate = $filter['aggregate'];
$advanced_filter = $filter['advanced_filter'];
$netflow_monitoring = $filter['netflow_monitoring'];
$traffic_max = $filter['traffic_max'];
$traffic_critical = $filter['traffic_critical'];
$traffic_warning = $filter['traffic_warning'];
$netflow_monitoring_interval = $filter['netflow_monitoring_interval'];
} else {
$name = '';
$assign_group = '';
@ -103,6 +119,11 @@ if ($id) {
$src_port = '';
$aggregate = 'dstip';
$advanced_filter = '';
$netflow_monitoring = false;
$traffic_max = 0;
$traffic_critical = 0;
$traffic_warning = 0;
$netflow_monitoring_interval = 300;
}
if ($update) {
@ -114,20 +135,31 @@ if ($update) {
$dst_port = get_parameter('dst_port', '');
$src_port = get_parameter('src_port', '');
$advanced_filter = get_parameter('advanced_filter', '');
$netflow_monitoring = (bool) get_parameter('netflow_monitoring', false);
$traffic_max = get_parameter('traffic_max', 0);
$traffic_critical = get_parameter('traffic_critical', 0);
$traffic_warning = get_parameter('traffic_warning', 0);
$netflow_monitoring_interval = get_parameter('netflow_monitoring_interval', 300);
if ($name == '') {
ui_print_error_message(__('Not updated. Blank name'));
} else {
$values = [
'id_sg' => $id,
'id_name' => $name,
'id_group' => $assign_group,
'aggregate' => $aggregate,
'ip_dst' => $ip_dst,
'ip_src' => $ip_src,
'dst_port' => $dst_port,
'src_port' => $src_port,
'advanced_filter' => $advanced_filter,
'id_sg' => $id,
'id_name' => $name,
'id_group' => $assign_group,
'aggregate' => $aggregate,
'ip_dst' => $ip_dst,
'ip_src' => $ip_src,
'dst_port' => $dst_port,
'src_port' => $src_port,
'advanced_filter' => $advanced_filter,
'netflow_monitoring' => $netflow_monitoring,
'traffic_max' => $traffic_max,
'traffic_critical' => $traffic_critical,
'traffic_warning' => $traffic_warning,
'netflow_monitoring_interval' => $netflow_monitoring_interval,
];
// Save filter args.
@ -152,16 +184,27 @@ if ($create) {
$dst_port = get_parameter('dst_port', '');
$src_port = get_parameter('src_port', '');
$advanced_filter = (string) get_parameter('advanced_filter', '');
$netflow_monitoring = (bool) get_parameter('netflow_monitoring', false);
$traffic_max = get_parameter('traffic_max', 0);
$traffic_critical = get_parameter('traffic_critical', 0);
$traffic_warning = get_parameter('traffic_warning', 0);
$netflow_monitoring_interval = get_parameter('netflow_monitoring_interval', 300);
$values = [
'id_name' => $name,
'id_group' => $assign_group,
'ip_dst' => $ip_dst,
'ip_src' => $ip_src,
'dst_port' => $dst_port,
'src_port' => $src_port,
'aggregate' => $aggregate,
'advanced_filter' => $advanced_filter,
'id_name' => $name,
'id_group' => $assign_group,
'ip_dst' => $ip_dst,
'ip_src' => $ip_src,
'dst_port' => $dst_port,
'src_port' => $src_port,
'aggregate' => $aggregate,
'advanced_filter' => $advanced_filter,
'netflow_monitoring' => $netflow_monitoring,
'traffic_max' => $traffic_max,
'traffic_critical' => $traffic_critical,
'traffic_warning' => $traffic_warning,
'netflow_monitoring_interval' => $netflow_monitoring_interval,
];
// Save filter args
@ -203,6 +246,8 @@ $table->data['first_line'][] = html_print_label_input_block(
false,
20,
80,
true,
false,
true
)
);
@ -329,6 +374,77 @@ $table->data['advanced_filters'][] = html_print_label_input_block(
);
// Netflow server options.
$table->colspan['netflow_monitoring'][] = 2;
$table->data['netflow_monitoring'][] = html_print_label_input_block(
__('Enable Netflow monitoring'),
html_print_checkbox_switch(
'netflow_monitoring',
1,
(bool) $netflow_monitoring,
true,
false,
'displayMonitoringFilter()'
).ui_print_input_placeholder(
__('Allows you to create an agent that monitors the traffic volume of this filter. It also creates a module that measures if the traffic of any IP of this filter exceeds a certain threshold. A text type module will be created with the traffic rate for each IP within this filter every five minutes (the 10 IP\'s with the most traffic). Only available for Enterprise version.'),
true
)
);
$table->data['netflow_server_filters'][] = html_print_label_input_block(
__('Netflow monitoring interval'),
html_print_input_number(
[
'step' => 1,
'name' => 'netflow_monitoring_interval',
'id' => 'netflow_monitoring_interval',
'value' => $netflow_monitoring_interval,
]
).ui_print_input_placeholder(__('Netflow monitoring interval in secs.'), true)
);
$table->data['netflow_server_filters'][] = html_print_label_input_block(
__('Maximum traffic value of the filter'),
html_print_input_number(
[
'step' => 1,
'name' => 'traffic_max',
'id' => 'traffic_max',
'value' => $traffic_max,
]
).ui_print_input_placeholder(__('Specifies the maximum rate (in bytes/sec) of traffic in the filter. It is then used to calculate the % of maximum traffic per IP.'), true)
);
$table->colspan['netflow_thresholds'][] = 1;
$table->data['netflow_thresholds'][] = html_print_label_input_block(
__('CRITICAL threshold for the maximum % of traffic for an IP.'),
html_print_input_number(
[
'step' => 0.01,
'name' => 'traffic_critical',
'id' => 'traffic_critical',
'value' => $traffic_critical,
'size' => 40,
'maxlength' => 80,
]
).ui_print_input_placeholder(__('If this % is exceeded by any IP within the filter, a CRITICAL status will be generated.'), true)
);
$table->data['netflow_thresholds'][] = html_print_label_input_block(
__('WARNING threshold for the maximum % of traffic for an IP.'),
html_print_input_number(
[
'step' => 0.01,
'name' => 'traffic_warning',
'id' => 'traffic_warning',
'value' => $traffic_warning,
'size' => 40,
'maxlength' => 80,
]
).ui_print_input_placeholder(__('If this % is exceeded by any IP within the filter, a WARNING status will be generated.'), true)
);
$hiddens = '';
if ($id) {
$buttonTitle = __('Update');
@ -368,10 +484,10 @@ html_print_action_buttons(
else {
displayAdvancedFilter ();
}
displayMonitoringFilter();
});
function displayAdvancedFilter () {
console.log('papapa advanced filter');
// Erase the normal filter
document.getElementById("text-ip_dst").value = '';
document.getElementById("text-ip_src").value = '';
@ -391,9 +507,9 @@ html_print_action_buttons(
};
function displayNormalFilter () {
console.log('papapa normal filter');
// Erase the advanced filter
document.getElementById("textarea_advanced_filter").value = '';
// Hide the advanced filter
//document.getElementById("table1-7").style.display = 'none';
$("#table1-advanced_filters").css("display", "none");
@ -407,4 +523,24 @@ html_print_action_buttons(
document.getElementById("table1-6").style.display = '';
*/
};
function displayMonitoringFilter () {
var checked = $('#checkbox-netflow_monitoring').prop('checked');
if(checked == false) {
// Reset values.
$("#netflow_monitoring_interval").val(300);
$("#traffic_max").val(0);
$("#traffic_critical").val(0);
$("#traffic_warning").val(0);
// Hide filters.
$("#table1-netflow_server_filters").hide();
$("#table1-netflow_thresholds").hide();
} else {
// Show filters.
$("#table1-netflow_server_filters").show();
$("#table1-netflow_thresholds").show();
}
};
</script>

View File

@ -117,6 +117,7 @@ $period = SECONDS_1DAY;
$search = '';
$full_text = 0;
$log_number = 1000;
$inventory_regular_expression = '';
// Added support for projection graphs.
$period_pg = SECONDS_5DAY;
$projection_period = SECONDS_5DAY;
@ -940,6 +941,7 @@ switch ($action) {
$inventory_modules = $es['inventory_modules'];
$id_agents = $es['id_agents'];
$recursion = $item['recursion'];
$inventory_regular_expression = $es['inventory_regular_expression'];
$idAgent = $es['id_agents'];
$idAgentModule = $inventory_modules;
@ -1231,8 +1233,8 @@ $class = 'databox filters';
?>
<?php
$servers_all_opt = array_merge(['all' => 'All nodes'], $servers);
if ($meta) {
if (is_metaconsole() === true) {
$servers_all_opt = array_merge(['all' => 'All nodes'], $servers);
?>
<tr id="row_servers_all_opt" class="datos">
<td class="bolder"><?php echo __('Server'); ?></td>
@ -2196,6 +2198,15 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_regular_expression" class="datos">
<td class="bolder"><?php echo __('Regular expression'); ?></td>
<td>
<?php
html_print_input_text('inventory_regular_expression', $inventory_regular_expression, '', false, 255, false, false, false, '', 'w50p');
?>
</td>
</tr>
<tr id="row_date" class="datos">
<td class="bolder"><?php echo __('Date'); ?></td>
<td class="mx180px">
@ -4271,7 +4282,7 @@ function print_SLA_list($width, $action, $idItem=null)
echo '</td>';
echo '<td class="sla_list_action_col center">';
echo '<a href="javascript: deleteSLARow('.$item['id'].');">';
echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter']);
echo html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']);
echo '</a>';
echo '</td>';
echo '</tr>';
@ -4314,7 +4325,7 @@ function print_SLA_list($width, $action, $idItem=null)
html_print_image(
'images/delete.svg',
false,
['class' => 'invert_filter']
['class' => 'invert_filter main_menu_icon']
);
?>
</a>
@ -4738,7 +4749,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameAgentFailover).$server_name_element.'</td>
<td>'.printSmallFont($nameModuleFailover).'</td>
<td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>
</td>
</tr>';
} else {
@ -4746,7 +4757,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameAgent).$server_name_element.'</td>
<td>'.printSmallFont($nameModule).'</td>
<td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>
</td>
</tr>';
}
@ -4756,7 +4767,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
<td>'.printSmallFont($nameModule).'</td>
<td>'.printSmallFont($operation[$item['operation']]).'</td>
<td class="center">
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter']).'</a>
<a href="javascript: deleteGeneralRow('.$item['id'].');">'.html_print_image('images/delete.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>
</td>
</tr>';
}
@ -4796,7 +4807,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
html_print_image(
'images/delete.svg',
false,
['class' => 'invert_filter']
['class' => 'invert_filter main_menu_icon']
);
?>
</a>
@ -6445,6 +6456,7 @@ function chooseType() {
$("#row_date").hide();
$("#row_agent_multi").hide();
$("#row_module_multi").hide();
$('#row_regular_expression').hide();
$("#row_event_graphs").hide();
$("#row_event_graph_by_agent").hide();
$("#row_event_graph_by_user").hide();
@ -7154,6 +7166,7 @@ function chooseType() {
$("#row_group").show();
$("#row_agent_multi").show();
$("#row_module_multi").show();
$('#row_regular_expression').show();
$("#row_date").show();
$("#id_agents")

View File

@ -1756,6 +1756,7 @@ switch ($action) {
$es['inventory_modules'] = get_parameter(
'inventory_modules'
);
$es['inventory_regular_expression'] = get_parameter('inventory_regular_expression', '');
$description = get_parameter('description');
$values['external_source'] = json_encode($es);
$good_format = true;
@ -2538,6 +2539,7 @@ switch ($action) {
$es['inventory_modules'] = get_parameter(
'inventory_modules'
);
$es['inventory_regular_expression'] = get_parameter('inventory_regular_expression', '');
$values['external_source'] = json_encode($es);
$good_format = true;
break;

View File

@ -116,6 +116,22 @@ function get_list_os_icons_dir()
}
}
$items2 = scandir($config['homedir'].'/images/os_icons');
foreach ($items2 as $item2) {
if (strstr($item2, '_small.png') || strstr($item2, '_small.gif')
|| strstr($item2, '_small.jpg')
) {
continue;
}
if (strstr($item2, '.png') || strstr($item2, '.gif')
|| strstr($item2, '.jpg')
) {
$return[$item2] = $item2;
}
}
return $return;
}
@ -124,10 +140,15 @@ function get_list_os_icons_dir()
<script type="text/javascript">
function show_icon_OS() {
var extension = $("#icon").val().split('.').pop();
var params = [];
params.push("get_image_path=1");
params.push('img_src=images/' + $("#icon").val());
if (extension !== 'svg') {
params.push('img_src=images/os_icons/' + $("#icon").val());
} else {
params.push('img_src=images/' + $("#icon").val());
}
params.push("page=include/ajax/skins.ajax");
jQuery.ajax ({
data: params.join ("&"),

View File

@ -431,7 +431,7 @@ $table->data[$i++][] = html_print_label_input_block(
$table->colspan[$i][] = 2;
$table->data[$i++][] = html_print_label_input_block(
__('Timezone setup'),
__('Server timezone setup'),
html_print_div(
[
'class' => '',

View File

@ -344,7 +344,7 @@ if ($new_user === true && (bool) $config['admin_can_add_user'] === true) {
$user_info['metaconsole_access_node'] = 0;
}
if ((bool) $config['ehorus_user_level_conf'] === true) {
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
$user_info['ehorus_user_level_user'] = '';
$user_info['ehorus_user_level_pass'] = '';
$user_info['ehorus_user_level_enabled'] = true;
@ -1247,7 +1247,7 @@ $allowedIP .= ui_print_help_tip(__('Add the source IPs that will allow console a
$allowedIP .= html_print_checkbox_switch(
'allowed_ip_active',
0,
$user_info['allowed_ip_active'],
($user_info['allowed_ip_active'] ?? 0),
true
);
$allowedIP .= '</p>';
@ -1255,7 +1255,7 @@ $allowedIP .= html_print_textarea(
'allowed_ip_list',
2,
65,
$user_info['allowed_ip_list'],
($user_info['allowed_ip_list'] ?? 0),
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
true
);
@ -1323,20 +1323,6 @@ $home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home
true
).'</p>';
/*
$home_screen .= html_print_select(
$values,
'section',
io_safe_output($user_info['section']),
'show_data_section();',
'',
-1,
true,
false,
false
).'</div>';
*/
$dashboards = Manager::getDashboards(
-1,
-1,
@ -1358,7 +1344,6 @@ $home_screen .= '<div id="show_db" style="display: none; width: 100%;">';
$home_screen .= html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true);
$home_screen .= '</div>';
$layouts = visual_map_get_user_layouts($config['id_user'], true);
$layouts_aux = [];
if ($layouts === false) {
@ -1459,7 +1444,7 @@ $default_event_filter = '<div class="label_select"><p class="edit_user_labels">'
$default_event_filter .= html_print_select(
$event_filter,
'default_event_filter',
$user_info['default_event_filter'],
($user_info['default_event_filter'] ?? 0),
'',
'',
__('None'),
@ -1661,14 +1646,12 @@ if ((bool) $config['admin_can_add_user'] === true) {
}
echo '</div>';
if ($new_user === true) {
html_print_input_hidden('json_profile', $json_profile);
}
html_print_input_hidden('json_profile', $json_profile);
echo '</form>';
// User Profile definition table. (Only where user is not creating).
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}
@ -1720,7 +1703,7 @@ $delete_image = html_print_input_image(
true,
[
'onclick' => 'delete_profile(event, this)',
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
@ -1891,7 +1874,7 @@ if (is_metaconsole() === false) {
profile_text = `<a href="index.php?sec2=godmode/users/configure_profile&id=${profile}">${profile_text}</a>`;
group_img = `<img id="img_group_${aux}" src="" data-title="${group_text}" data-use_title_for_force_title="1" class="invert_filter main_menu_icon bot forced_title" alt="${group_text}"/>`;
group_text = `<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=${group}">${group_img}${group_text}</a>`;
group_text = `<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=${group}">${group_img} ${group_text}</a>`;
$('#table_profiles tr:last').before(
`<tr>
@ -2258,4 +2241,4 @@ if (is_metaconsole() === false) {
/* ]]> */
</script>
</script>

View File

@ -970,7 +970,7 @@ foreach ($info as $user_id => $user_info) {
*/
$userListActionButtons[] = html_print_menu_button(
[
'href' => ui_get_full_url(
'href' => ui_get_full_url(
sprintf(
'index.php?sec=%s&amp;sec2=godmode/users/user_list&user_del=1&pure=%s&delete_user=%s',
$sec,
@ -978,8 +978,9 @@ foreach ($info as $user_id => $user_info) {
$user_info['id_user']
)
),
'image' => 'images/delete.svg',
'title' => __('Delete'),
'image' => 'images/delete.svg',
'title' => __('Delete'),
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
],
true
);

View File

@ -374,7 +374,13 @@ if (users_is_admin() === true) {
);
}
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true);
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch(
'show_tips_startup',
1,
(isset($user_info['show_tips_startup']) === false) ? true : $user_info['show_tips_startup'],
true
);
$userManagementTable->data['show_tips_startup'][1] = '<span>'.__('Show usage tips at startup').'</span>';
// Session time input.
@ -537,7 +543,7 @@ $userManagementTable->data['captions_autorefreshTime'][0] = __('Time for autoref
$userManagementTable->data['fields_autorefreshTime'][0] = html_print_select(
get_refresh_time_array(),
'time_autorefresh',
$user_info['time_autorefresh'],
($user_info['time_autorefresh'] ?? 0),
'',
'',
'',
@ -594,7 +600,7 @@ $userManagementTable->data['captions_blocksize_eventfilter'][1] = __('Event filt
$userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_select(
$event_filter,
'default_event_filter',
$user_info['default_event_filter'],
($user_info['default_event_filter'] ?? 0),
'',
'',
__('None'),
@ -700,7 +706,7 @@ $userManagementTable->data['fields_addSettings'][1] = html_print_div(
'allowed_ip_list',
5,
65,
$user_info['allowed_ip_list'],
($user_info['allowed_ip_list'] ?? ''),
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
true
),
@ -720,7 +726,7 @@ $allowAllIpsContent[] = html_print_div(
'content' => html_print_checkbox_switch(
'allowed_ip_active',
0,
$user_info['allowed_ip_active'],
($user_info['allowed_ip_active'] ?? 0),
true
),
],
@ -736,13 +742,15 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
true
);
// QR Code and API Token advice.
html_print_div(
[
'id' => 'api_qrcode_display',
'content' => $CodeQRTable.$apiTokenContent,
]
);
if (isset($CodeQRTable) === true || isset($apiTokenContent) === true) {
// QR Code and API Token advice.
html_print_div(
[
'id' => 'api_qrcode_display',
'content' => $CodeQRTable.$apiTokenContent,
]
);
}
html_print_table($userManagementTable);

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="512px" height="512px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:0.991" fill="#000000" d="M 233.5,-0.5 C 248.167,-0.5 262.833,-0.5 277.5,-0.5C 366.072,10.0146 433.238,53.3479 479,129.5C 496.968,162.07 507.802,196.737 511.5,233.5C 511.5,248.167 511.5,262.833 511.5,277.5C 500.985,366.072 457.652,433.238 381.5,479C 348.93,496.968 314.263,507.802 277.5,511.5C 262.833,511.5 248.167,511.5 233.5,511.5C 144.928,500.985 77.7616,457.652 32,381.5C 14.0316,348.93 3.19825,314.263 -0.5,277.5C -0.5,262.833 -0.5,248.167 -0.5,233.5C 10.0146,144.928 53.3479,77.7616 129.5,32C 162.07,14.0316 196.737,3.19825 233.5,-0.5 Z M 254.5,39.5 C 256.193,40.4749 257.693,41.8082 259,43.5C 278.833,71.3333 298.667,99.1667 318.5,127C 304.504,127.5 290.504,127.667 276.5,127.5C 276.5,148.833 276.5,170.167 276.5,191.5C 262.5,191.5 248.5,191.5 234.5,191.5C 234.5,170.167 234.5,148.833 234.5,127.5C 220.496,127.667 206.496,127.5 192.5,127C 213.8,98.2136 234.466,69.0469 254.5,39.5 Z M 127.5,192.5 C 156.815,213.475 186.148,234.475 215.5,255.5C 186.245,276.377 157.078,297.377 128,318.5C 127.5,304.504 127.333,290.504 127.5,276.5C 106.167,276.5 84.8333,276.5 63.5,276.5C 63.5,262.5 63.5,248.5 63.5,234.5C 84.8333,234.5 106.167,234.5 127.5,234.5C 127.5,220.5 127.5,206.5 127.5,192.5 Z M 382.5,192.5 C 383.496,206.323 383.829,220.323 383.5,234.5C 404.833,234.5 426.167,234.5 447.5,234.5C 447.5,248.5 447.5,262.5 447.5,276.5C 426.167,276.5 404.833,276.5 383.5,276.5C 383.667,290.504 383.5,304.504 383,318.5C 353.922,297.377 324.755,276.377 295.5,255.5C 324.744,234.723 353.744,213.723 382.5,192.5 Z M 234.5,319.5 C 248.5,319.5 262.5,319.5 276.5,319.5C 276.5,340.833 276.5,362.167 276.5,383.5C 290.504,383.333 304.504,383.5 318.5,384C 297.377,413.078 276.377,442.245 255.5,471.5C 234.623,442.245 213.623,413.078 192.5,384C 206.496,383.5 220.496,383.333 234.5,383.5C 234.5,362.167 234.5,340.833 234.5,319.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -37,6 +37,7 @@ require_once 'include/functions_ui.php';
require_once 'include/functions_db.php';
require_once 'include/functions_io.php';
require_once 'include/functions.php';
require_once $config['homedir'].'/include/class/HTML.class.php';
enterprise_include_once('meta/include/functions_events_meta.php');
enterprise_include_once('include/functions_metaconsole.php');

View File

@ -137,6 +137,7 @@ if (is_ajax() === true) {
switch ($type) {
case 0:
case 3:
default:
$label = __('Group');
$input = html_print_input(
@ -234,10 +235,6 @@ if (is_ajax() === true) {
'5'
);
break;
case 3:
// Empty.
break;
}
echo html_print_label_input_block(
@ -246,6 +243,7 @@ if (is_ajax() === true) {
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_top_10px',
'div_id' => 'filter_type',
]
);
}
@ -259,10 +257,19 @@ if (is_ajax() === true) {
$nd->connect();
}
echo '<div class="box-flat white_table_graph">';
switch ($type) {
case 3:
case 2:
$data = db_get_row('tagente_modulo', 'id_agente_modulo', $id);
$sql = sprintf(
'SELECT * FROM tagente_modulo ag
INNER JOIN tagente_estado ae ON ag.id_agente_modulo = ae.id_agente_modulo
WHERE ag.id_agente_modulo = %d',
$id
);
$data = db_get_row_sql($sql);
// Nombre.
$link = sprintf(
@ -298,6 +305,92 @@ if (is_ajax() === true) {
echo '<p class="title-dialog">'.__('Module group').'</p>';
echo '<p class="info-dialog">'.$group.'</p>';
echo '</div>';
$graph_type = return_graphtype($data['module_type']);
$url = ui_get_full_url('operation/agentes/stat_win.php', false, false, false);
$handle = dechex(crc32($data['id_agente_modulo'].$data['module_name']));
$win_handle = 'day_'.$handle;
$graph_params = [
'type' => $graph_type,
'period' => SECONDS_1DAY,
'id' => $data['id_agente_modulo'],
'refresh' => SECONDS_10MINUTES,
];
$graph_params_str = http_build_query($graph_params);
$link = 'winopeng_var(\''.$url.'?'.$graph_params_str.'\',\''.$win_handle.'\', 800, 480)';
$img_graph = html_print_anchor(
[
'href' => 'javascript:'.$link,
'content' => html_print_image('images/module-graph.svg', true, ['border' => '0', 'alt' => '', 'class' => 'invert_filter main_menu_icon']),
],
true
);
echo '<div class="div-dialog">';
echo '<p class="title-dialog">'.__('Data').'</p>';
$data_module = '';
if (is_numeric($data['datos'])) {
$data_module = remove_right_zeros(
number_format(
$data['datos'],
$config['graph_precision'],
$config['decimal_separator'],
$config['thousand_separator']
)
);
echo '<p class="info-dialog">'.$data_module.' '.$data['unit'].'&nbsp;&nbsp;&nbsp;'.$img_graph.'</p>';
} else {
$data_module = $data['datos'];
echo '<p class="info-dialog">'.$data['datos'].' '.$data['unit'].'&nbsp;&nbsp;&nbsp;'.$img_graph.'</p>';
}
echo '</div>';
echo '<div class="div-dialog">';
echo '<p class="title-dialog">'.__('Date of last data').'</p>';
echo '<p class="info-dialog">'.date('Y-m-d H:i:s', $data['utimestamp']).'</p>';
echo '</div>';
$status = modules_get_agentmodule_status($id);
switch ($status) {
case AGENT_MODULE_STATUS_NORMAL:
$status = ui_print_status_image('module_ok.png', $data_module, true);
break;
case AGENT_MODULE_STATUS_CRITICAL_BAD:
$status = ui_print_status_image('module_critical.png', $data_module, false);
break;
case AGENT_MODULE_STATUS_WARNING:
$status = ui_print_status_image('module_warning.png', $data_module, false);
break;
case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT:
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
$status = ui_print_status_image('module_alertsfired.png', $data_module, false);
break;
case 4:
$status = ui_print_status_image('module_no_data.png', $data_module, false);
break;
default:
case AGENT_MODULE_STATUS_UNKNOWN:
$status = ui_print_status_image('module_unknown.png', $data_module, false);
break;
}
echo '<div class="div-dialog">';
echo '<p class="title-dialog">'.__('Status').'</p>';
echo '<div class="status_rounded_rectangles">'.$status.'</div>';
echo '</div>';
break;
case 1:
@ -381,6 +474,43 @@ if (is_ajax() === true) {
echo '<p class="info-dialog">'.$data['comentarios'].'</p>';
echo '</div>';
// Last contact.
$lastContactDate = ui_print_timestamp($data['ultimo_contacto'], true);
$remoteContactDate = ($data['ultimo_contacto_remoto'] === '01-01-1970 00:00:00') ? __('Never') : date_w_fixed_tz($data['ultimo_contacto_remoto']);
$lastAndRemoteContact = sprintf('%s / %s', $lastContactDate, $remoteContactDate);
echo '<div class="div-dialog">';
echo '<p class="title-dialog">'.__('Last contact').' / '.__('Remote').'</p>';
echo '<p class="info-dialog">'.$lastAndRemoteContact.'</p>';
echo '</div>';
// Next contact progress.
$progress = agents_get_next_contact($id);
$tempTimeToShow = ($data['intervalo'] - (strtotime('now') - strtotime($data['ultimo_contacto'])));
$progressCaption = ($tempTimeToShow >= 0) ? sprintf('%d s', $tempTimeToShow) : __('Out of bounds');
$ajaxNextContactInterval = (empty($data['intervalo']) === true) ? 0 : (100 / $data['intervalo']);
echo '<div class="div-dialog">';
echo '<p class="title-dialog">'.__('Next contact').'</p>';
echo '<p class="info-dialog">'.ui_progress(
$progress,
'80%',
'1.2',
'#ececec',
true,
$progressCaption,
[
'page' => 'operation/agentes/ver_agente',
'interval' => $ajaxNextContactInterval,
'data' => [
'id_agente' => $id,
'refresh_contact' => 1,
],
]
).'</p>';
echo '</div>';
// Group.
$secondary_groups = '';
$secondary = enterprise_hook('agents_get_secondary_groups', [$data['id_agente']]);
@ -394,6 +524,27 @@ if (is_ajax() === true) {
echo '<p class="info-dialog">'.groups_get_name($data['id_grupo']).$secondary_groups.'</p>';
echo '</div>';
echo '<div class="div-dialog">';
echo graph_agent_status(
$id,
150,
150,
true,
false,
false,
true
);
echo '</div>';
echo '<div class="div-dialog" style="justify-content: center;">';
echo reporting_tiny_stats(
$data,
true,
'agent',
// Useless.
':',
true
);
echo '</div>';
// Events.
$result_graph_event = enterprise_hook(
@ -419,6 +570,8 @@ if (is_ajax() === true) {
break;
}
echo '</div>';
if (empty($id_server) === false) {
$nd->disconnect();
}

View File

@ -1361,7 +1361,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('Plugin server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
} else {
@ -1371,7 +1371,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('WMI server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
} else {
@ -1380,7 +1380,7 @@ class AgentWizard extends HTML
true,
[
'title' => __('Network server'),
'class' => 'invert_filter',
'class' => 'invert_filter main_menu_icon',
]
);
}
@ -4096,16 +4096,16 @@ class AgentWizard extends HTML
'title' => __('Modules selected'),
'alt' => __('Modules selected'),
'id' => 'image-info-modules-'.$idBlock,
'class' => 'hidden',
'class' => 'hidden main_menu_icon',
]
);
$blockTitle .= '</b>';
}
} else {
$blockTitle = '<b>'.$block['name'];
$classImg = '';
$classImg = 'main_menu_icon ';
if ($activeModules === 0) {
$classImg = 'hidden';
$classImg .= 'hidden';
}
$blockTitle .= '&nbsp;&nbsp;';

View File

@ -134,7 +134,7 @@ class AuditLog extends HTML
ui_print_standard_header(
__('%s audit', get_product_name()).' &raquo; '.__('Review Logs'),
'images/gm_log.png',
'images/gm_log@svg.svg',
false,
'',
false,

View File

@ -282,7 +282,6 @@ class Heatmap
while (cont <= limit) {
if (typeof lista[cont] !== 'undefined') {
const rect = document.getElementsByName(`${lista[cont]['id']}`);
console.log(rect[0]);
$(`#${rect[0].id}`).removeClass();
$(`#${rect[0].id}`).addClass(`${lista[cont]['status']} hover`);
}
@ -938,10 +937,27 @@ class Heatmap
if (users_is_admin() === false) {
$user_groups = array_keys(users_get_groups($config['user'], 'AR', false));
if (empty($user_groups) === false) {
if (empty($this->filter) === false && empty(current($this->filter)) === false) {
$user_groups = array_intersect($this->filter, $user_groups);
$id_user_groups = sprintf(
'INNER JOIN tagente a ON a.id_agente = ae.id_agente
AND a.id_grupo IN (%s)',
implode(',', $user_groups)
);
} else {
$id_user_groups = sprintf(
'INNER JOIN tagente a ON a.id_agente = ae.id_agente
AND a.id_grupo IN (%s)',
implode(',', $user_groups)
);
}
}
} else {
if (empty($this->filter) === false && empty(current($this->filter)) === false) {
$id_user_groups = sprintf(
'INNER JOIN tagente a ON a.id_agente = ae.id_agente
AND a.id_grupo IN (%s)',
implode(',', $user_groups)
implode(',', $this->filter)
);
}
}
@ -1292,13 +1308,31 @@ class Heatmap
const id = name.split('|')[0];
const server = name.split('|')[1];
let height = 400;
let width = 530;
switch (type) {
case 0:
height = 670;
width = 460;
break;
case 2:
case 3:
height = 450;
width = 460;
break;
default:
break;
}
$("#info_dialog").dialog({
resizable: true,
draggable: true,
modal: true,
closeOnEscape: true,
height: 400,
width: 530,
height: height,
width: width,
title: '<?php echo __('Info'); ?>',
open: function() {
$.ajax({
@ -1325,13 +1359,23 @@ class Heatmap
if (count($groups) > 1 && $this->group === 1 && $this->dashboard === false) {
$x_back = 0;
$y_back = 0;
$x_text_correction = 0.25;
if ($count_result <= 100) {
if ($count_result <= 10) {
$fontSize = 'small-size';
$stroke = 'small-stroke';
} else {
} else if ($count_result > 10 && $count_result <= 100) {
$fontSize = 'tiny-size';
$stroke = 'tiny-stroke';
} else if ($count_result > 100 && $count_result <= 1000) {
$fontSize = 'medium-size';
$stroke = 'medium-stroke';
} else if ($count_result > 1000 && $count_result <= 10000) {
$fontSize = 'big-size';
$stroke = 'big-stroke';
} else {
$fontSize = 'huge-size';
$stroke = 'huge-stroke';
}
echo '<polyline points="0,0 '.$Xaxis.',0" class="polyline '.$stroke.'" />';
@ -1385,7 +1429,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.((($x_position - $x_back) / 2) + $x_back).'" y="'.($y_position + 1).'"
echo '<text x="'.((($x_position - $x_back) / 2) + $x_back - $x_text_correction).'" y="'.($y_position + 1 - 0.01).'"
class="'.$fontSize.'">'.$name.'</text>';
$x_back = $x_position;
@ -1436,7 +1480,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.(($x_position) / 2).'" y="'.($y_position + 1).'"
echo '<text x="'.(($x_position) / 2 - $x_text_correction).'" y="'.($y_position + 1 - 0.01).'"
class="'.$fontSize.'">'.$name.'</text>';
// Bottom-right of last line.
@ -1493,7 +1537,7 @@ class Heatmap
echo '<polyline points="'.$points.'" class="polyline '.$stroke.'" />';
// Name.
echo '<text x="'.(($x_position) / 2).'" y="'.($y_position + 1).'"
echo '<text x="'.(($x_position) / 2 - $x_text_correction).'" y="'.($y_position + 1 - 0.02).'"
class="'.$fontSize.'">'.$name.'</text>';
// Bottom-top of last line.

View File

@ -3245,7 +3245,7 @@ class NetworkMap
$table->data['template_row']['node_target'] = '';
$table->data['template_row']['edit'] = '';
$table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/pixel_green.png', true, ['class' => 'main_menu_icon']).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true).'</span>';
$table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/pixel_green.png', true, ['class' => 'circle-relations']).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true, ['class' => 'circle-relations']).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true, ['class' => 'circle-relations']).'</span>';
// <span class="edit_icon"><a class="edit_icon_link" title="'.__('Update').'" href="#">'.html_print_image('images/edit.svg', true, ['class' => 'invert_filter']).'</a></span>';
$table->data['template_row']['edit'] .= '<a class="delete_icon" href="#">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'style' => 'padding: 10px']).'</a>';

View File

@ -1443,7 +1443,7 @@ class SnmpConsole extends HTML
binding_vars.forEach(function(oid) {
string += oid+'<br/>';
});
variableBindings = `<td align="left" colspan="8">${string}</td>`;
variableBindings = `<td align="left" colspan="8" class="break-word w200px">${string}</td>`;
}
tr.after(`<tr id="show_" role="row">${labelBindings}${variableBindings}</tr>`);

View File

@ -570,7 +570,7 @@ class TipsWindow
$sql = sprintf(
'SELECT id, name AS language, title, text, url, enable
FROM twelcome_tip t
LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_0900_ai_ci
LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci
%s %s %s',
$filter,
$order,
@ -582,7 +582,7 @@ class TipsWindow
$sqlCount = sprintf(
'SELECT count(*)
FROM twelcome_tip t
LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_0900_ai_ci
LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci
%s',
$filter
);

View File

@ -133,6 +133,11 @@ class Tree
protected function getEmptyModuleFilterStatus()
{
if ($this->filter['statusModule'] === 'fired') {
$this->filter['statusModuleOriginal'] = $this->filter['statusModule'];
$this->filter['statusModule'] = -1;
}
return (
!isset($this->filter['statusModule']) ||
$this->filter['statusModule'] == -1
@ -219,6 +224,10 @@ class Tree
$agent_status_filter = ' AND (ta.critical_count > 0
OR ta.warning_count > 0) ';
break;
case AGENT_STATUS_ALERT_FIRED:
$agent_status_filter = ' AND ta.fired_count > 0 ';
break;
}
return $agent_status_filter;
@ -284,6 +293,11 @@ class Tree
protected function getModuleStatusFilter()
{
if ($this->filter['statusModule'] === 'fired') {
$this->filter['statusModuleOriginal'] = $this->filter['statusModule'];
$this->filter['statusModule'] = -1;
}
$show_init_condition = ($this->filter['show_not_init_agents']) ? '' : ' AND ta.notinit_count <> ta.total_count';
if ($this->getEmptyModuleFilterStatus()) {
@ -294,6 +308,10 @@ class Tree
return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)';
}
if ($this->filter['statusModule'] === 'fired') {
return ' AND ta.fired_count > 0';
}
$field_filter = modules_get_counter_by_states($this->filter['statusModule']);
if ($field_filter === false) {
return ' AND 1=0';
@ -333,6 +351,11 @@ class Tree
protected function getModuleStatusFilterFromTestado($state=false, $without_ands=false)
{
if ($this->filter['statusModule'] === 'fired') {
$this->filter['statusModuleOriginal'] = $this->filter['statusModule'];
$this->filter['statusModule'] = -1;
}
$selected_status = ($state !== false && $state !== self::TV_DEFAULT_AGENT_STATUS) ? $state : $this->filter['statusModule'];
$filter = [modules_get_state_condition($selected_status)];
@ -811,6 +834,11 @@ class Tree
protected function processAgent(&$agent, $server=false)
{
if ($this->filter['statusModule'] === 'fired') {
$this->filter['statusModuleOriginal'] = $this->filter['statusModule'];
$this->filter['statusModule'] = -1;
}
global $config;
$agent['type'] = 'agent';

View File

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

View File

@ -440,6 +440,7 @@ define('SERVER_TYPE_MIGRATION', 20);
define('SERVER_TYPE_ALERT', 21);
define('SERVER_TYPE_CORRELATION', 22);
define('SERVER_TYPE_NCM', 23);
define('SERVER_TYPE_NETFLOW', 24);
// REPORTS.
define('REPORT_TOP_N_MAX', 1);

View File

@ -5272,7 +5272,7 @@ function events_page_comments($event, $ajax=false, $groupedComments=[])
'<b>%s %s %s%s</b>',
$c['action'],
__('by'),
get_user_fullname($c['id_user']).' ('.$c['id_user'].')',
get_user_fullname(io_safe_input($c['id_user'])).' ('.io_safe_input($c['id_user']).')',
$eventIdExplanation
);

View File

@ -4934,7 +4934,7 @@ function iterate_group_array($groups, &$data_agents)
break;
}
$tooltip_content = html_print_image('images/groups_small/'.$group['icon'].'.png', true).'&nbsp;'.__('Group').': <b>'.$group_aux['name'].'</b>';
$tooltip_content = html_print_image('images/'.$group['icon'], true).'&nbsp;'.__('Group').': <b>'.$group_aux['name'].'</b>';
$group_aux['tooltip_content'] = $tooltip_content;
$group_aux['children'] = [];
@ -4975,10 +4975,10 @@ function graph_monitor_wheel($width=550, $height=600, $filter=false)
if ($filter['group'] != 0) {
$filter_subgroups = '';
if (!$filter['dont_show_subgroups']) {
$filter_subgroups = ' || parent = '.$filter['group'];
$filter_subgroups = ' || parent IN ('.$filter['group'].')';
}
$groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo = '.$filter['group'].$filter_subgroups);
$groups = db_get_all_rows_sql('SELECT * FROM tgrupo where id_grupo IN ('.$filter['group'].') '.$filter_subgroups);
$groups_ax = [];
foreach ($groups as $g) {

View File

@ -445,6 +445,15 @@ function groups_get_icon($id_group)
} else {
$icon = (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
if (empty($extension) === true || $extension === 'png') {
$icon = 'groups_small/'.$icon;
}
if (empty($icon) === true) {
$icon = 'unknown@groups.svg';
}

View File

@ -6435,7 +6435,11 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
[$id_agente]
);
$name = 'secondary_groups_selected'.$options['extra_id'];
if ($options['selected_post'] !== null) {
$secondary_groups_selected['plain'] = $options['selected_post'];
}
$name = 'secondary_groups_selected[]'.$options['extra_id'];
if ($options['only_select'] === true) {
$name = 'secondary_groups'.$options['extra_id'].'[]';
}
@ -6455,7 +6459,7 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
$name,
// Selected.
// No select any by default.
$secondary_groups_selected['for_select'],
$secondary_groups_selected['plain'],
// Script.
// Javascript onChange code.
'',

View File

@ -36,7 +36,8 @@ function inventory_get_data(
$return_mode=false,
$order_by_agent=false,
$node='',
$pagination_url_parameters=[]
$pagination_url_parameters=[],
$regular_expression=''
) {
global $config;
@ -268,7 +269,15 @@ function inventory_get_data(
$i++;
}
$data[] = $temp_row;
if ($regular_expression !== '') {
if (is_array(preg_grep('/'.$regular_expression.'/', $temp_row))) {
if (count(preg_grep('/'.$regular_expression.'/', $temp_row)) > 0) {
$data[] = $temp_row;
}
}
} else {
$data[] = $temp_row;
}
}
}
@ -756,8 +765,10 @@ function inventory_get_datatable(
foreach ($rows as $row) {
$data_rows = explode(PHP_EOL, $row['data']);
foreach ($data_rows as $data_key => $data_value) {
$row['data'] = $data_value;
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
if (empty($data_value) === false) {
$row['data'] = $data_value;
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
}
}
}

View File

@ -68,6 +68,8 @@ function menu_print_menu(&$menu)
$sec2 = 'godmode/alerts/alert_commands';
} else if ($sec2 === 'enterprise/godmode/setup/edit_skin') {
$sec2 = 'enterprise/godmode/setup/setup_skins';
} else if ($sec2 === 'operation/agentes/networkmap.dinamic') {
$sec2 = 'operation/agentes/pandora_networkmap';
} else if ($sec2 === 'godmode/gis_maps/configure_gis_map') {
$map_id = (string) get_parameter('map_id');
if (empty($map_id) === false) {

View File

@ -3170,6 +3170,7 @@ function reporting_inventory($report, $content, $type)
$date = $es['date'];
$description = $content['description'];
$inventory_regular_expression = $es['inventory_regular_expression'];
switch ($type) {
case 'data':
@ -3179,7 +3180,11 @@ function reporting_inventory($report, $content, $type)
$date,
'',
false,
'csv'
'csv',
false,
'',
[],
$inventory_regular_expression
);
break;
@ -3190,7 +3195,11 @@ function reporting_inventory($report, $content, $type)
$date,
'',
false,
'hash'
'hash',
false,
'',
[],
$inventory_regular_expression
);
break;
}

View File

@ -1996,6 +1996,13 @@ function reporting_html_inventory($table, $item, $pdf=0)
&& is_array($type_modules) === true
) {
foreach ($type_modules as $key_type_module => $type_module) {
$print_table = true;
foreach ($type_module as $key => $module) {
if (count($module['data']) == 0) {
unset($type_module[$key]);
}
}
$table1 = new stdClass();
$table1->width = '99%';
$table1->class = 'info_table';
@ -2006,57 +2013,62 @@ function reporting_html_inventory($table, $item, $pdf=0)
if (isset($type_module) === true
&& is_array($type_module) === true
) {
foreach ($type_module as $key_type => $module) {
if (isset($module['data']) === true
&& is_array($module['data']) === true
) {
array_pop($module['data']);
foreach ($module['data'] as $k_module => $v_module) {
$str_key = $key_type_module.'-'.$key_type.'-'.$k_module;
$table1->head[0] = __('Agent');
$table1->head[1] = __('Module');
$table1->head[2] = __('Date');
$table1->headstyle[0] = 'text-align: left';
$table1->headstyle[1] = 'text-align: left';
$table1->headstyle[2] = 'text-align: left';
$table1->cellstyle[$str_key][0] = 'text-align: left;';
$table1->cellstyle[$str_key][1] = 'text-align: left;';
$table1->cellstyle[$str_key][2] = 'text-align: left;';
$table1->data[$str_key][0] = $module['agent_name'];
$table1->data[$str_key][1] = $key_type_module;
$dateModule = explode(' ', $module['timestamp']);
$table1->data[$str_key][2] = $dateModule[0];
if (isset($v_module) === true
&& is_array($v_module) === true
) {
foreach ($v_module as $k => $v) {
$table1->head[$k] = $k;
$table1->headstyle[$k] = 'text-align: left';
$table1->cellstyle[$str_key][$k] = 'text-align: left;';
if ($pdf === 0) {
$table1->data[$str_key][$k] = $v;
} else {
// Workaround to prevent table columns from growing indefinitely in PDFs.
$table1->data[$str_key][$k] = preg_replace(
'/([^\s]{30})(?=[^\s])/',
'$1'.'<br>',
$v
);
if (count($type_module) > 0) {
foreach ($type_module as $key_type => $module) {
if (isset($module['data']) === true
&& is_array($module['data']) === true
) {
foreach ($module['data'] as $k_module => $v_module) {
$str_key = $key_type_module.'-'.$key_type.'-'.$k_module;
$table1->head[0] = __('Agent');
$table1->head[1] = __('Module');
$table1->head[2] = __('Date');
$table1->headstyle[0] = 'text-align: left';
$table1->headstyle[1] = 'text-align: left';
$table1->headstyle[2] = 'text-align: left';
$table1->cellstyle[$str_key][0] = 'text-align: left;';
$table1->cellstyle[$str_key][1] = 'text-align: left;';
$table1->cellstyle[$str_key][2] = 'text-align: left;';
$table1->data[$str_key][0] = $module['agent_name'];
$table1->data[$str_key][1] = $key_type_module;
$dateModule = explode(' ', $module['timestamp']);
$table1->data[$str_key][2] = $dateModule[0];
if (isset($v_module) === true
&& is_array($v_module) === true
) {
foreach ($v_module as $k => $v) {
$table1->head[$k] = $k;
$table1->headstyle[$k] = 'text-align: left';
$table1->cellstyle[$str_key][$k] = 'text-align: left;';
if ($pdf === 0) {
$table1->data[$str_key][$k] = $v;
} else {
// Workaround to prevent table columns from growing indefinitely in PDFs.
$table1->data[$str_key][$k] = preg_replace(
'/([^\s]{30})(?=[^\s])/',
'$1'.'<br>',
$v
);
}
}
}
}
}
}
} else {
$print_table = false;
}
} else {
$print_table = false;
}
if ($pdf === 0) {
if ($pdf === 0 && $print_table === true) {
$table->colspan[$key_type_module]['cell'] = 3;
$table->data[$key_type_module]['cell'] = html_print_table(
$table1,
true
);
} else {
} else if ($print_table === true) {
$return_pdf .= html_print_table(
$table1,
true
@ -5986,8 +5998,14 @@ function reporting_get_events($data, $links=false)
$table_events->size[2] = '10%';
$table_events->size[3] = '10%';
$event_view = '<fieldset class="tactical_set">
<legend>'.__('Important Events by Criticity').'</legend>'.html_print_table($table_events, true).'</fieldset>';
$tooltip = ui_print_help_tip(
__(
'Event count corresponds to events within the last hour'
),
true
);
$event_view = '<fieldset class="tactical_set"><legend>'.__('Important Events by Criticity').$tooltip.'</legend>'.html_print_table($table_events, true).'</fieldset>';
}
return $event_view;

View File

@ -860,6 +860,19 @@ function servers_get_info($id_server=-1)
$id_modulo = 0;
break;
case SERVER_TYPE_NETFLOW:
$server['img'] = html_print_image(
'images/netflow@svg.svg',
true,
[
'title' => __('Netflow server'),
'class' => 'main_menu_icon invert_filter',
]
);
$server['type'] = 'netflow';
$id_modulo = 0;
break;
default:
$server['img'] = '';
$server['type'] = 'unknown';

View File

@ -321,16 +321,20 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
$group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']);
/*
if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) {
if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) {
// Actions table
echo '<div class="actions_treeview" style="text-align: right">';
echo '<div class="actions_treeview flex flex-evenly">';
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].$url_hash.'">';
html_print_submit_button(__('Go to module edition'), 'upd_button', false, 'class="sub config"');
html_print_submit_button(
__('Go to module edition'),
'upd_button',
false,
['class' => 'secondary mini']
);
echo '</a>';
echo '</div>';
}*/
}
// id_module and id_agent hidden
echo '<div id="ids" class="invisible">';
@ -921,9 +925,50 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
false,
'',
'white-box-content mrgn_top_0 mrgn_btn_0px border-bottom-gray',
'white_table_flex margin-bottom-20'
'white_table_flex'
);
if ($user_access_node && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
$buttons_act = '<div style="text-align: right" class="margin-bottom-20 margin-top-20 flex flex-evenly">';
if ($agent['id_os'] == CLUSTER_OS_ID) {
$cluster = PandoraFMS\Cluster::loadFromAgentId(
$agent['id_agente']
);
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=reporting&sec2=operation/cluster/cluster&op=update&id='.$cluster->id().'">';
$buttons_act .= html_print_submit_button(
__('Go to cluster edition'),
'upd_button',
false,
['class' => 'secondary mini'],
true
);
} else {
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'&tab=module&show_dialog_create=1">';
$buttons_act .= html_print_submit_button(
__('Go to module creation'),
'upd_button',
false,
['class' => 'secondary mini no_decoration'],
true
);
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'">';
$buttons_act .= html_print_submit_button(
__('Go to agent edition'),
'upd_button',
false,
['class' => 'secondary mini no_decoration'],
true
);
}
$buttons_act .= '</a>';
$buttons_act .= '</div>';
}
echo $buttons_act;
if (empty($server_data) === false && is_metaconsole() === true) {
metaconsole_restore_db();
}

View File

@ -712,7 +712,18 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
$output = '';
$icon = ($id_group > 0) ? (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group) : 'unknown@groups.svg';
$icon = 'world@svg.svg';
if ($id_group > 0) {
$icon = db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group);
if (empty($icon) === true) {
$icon = 'unknown@groups.svg';
}
}
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
// Don't show link in metaconsole.
if (is_metaconsole() === true) {
@ -756,10 +767,14 @@ function ui_print_group_icon($id_group, $return=false, $path='', $style='', $lin
}
}
$icon = (str_contains($icon, '.svg') === true) ? $icon : $icon.'.svg';
$icon = (str_contains($icon, '.svg') === true || str_contains($icon, '.png') === true) ? $icon : $icon.'.svg';
$folder = '';
if (str_contains($icon, '.png')) {
$folder = 'groups_small/';
}
$output .= html_print_image(
'images/'.$icon,
'images/'.$folder.$icon,
true,
[
'style' => $style,
@ -876,6 +891,17 @@ function ui_print_os_icon(
$no_in_meta = (is_metaconsole() === false);
$icon = (string) db_get_value('icon_name', 'tconfig_os', 'id_os', (int) $id_os);
$extension = pathinfo($icon, PATHINFO_EXTENSION);
if (empty($extension) === true) {
$icon .= '.png';
}
if (empty($extension) === true || $extension === 'png'
|| $extension === 'jpg' || $extension === 'gif' && $subfolder === '.'
) {
$subfolder = 'os_icons';
}
$os_name = get_os_name($id_os);
if (empty($icon) === true) {
if ($only_src) {
@ -6944,7 +6970,7 @@ function ui_get_favicon()
global $config;
if (empty($config['custom_favicon'])) {
return (!is_metaconsole()) ? 'images/pandora.ico' : 'enterprise/meta/images/favicon_meta.ico';
return (!is_metaconsole()) ? 'images/pandora.ico' : '/images/custom_favicon/favicon_meta.ico';
}
return 'images/custom_favicon/'.$config['custom_favicon'];

View File

@ -844,7 +844,7 @@ function edit_node(data_node, dblClick) {
"update_fictional_node(" + node_selected.id_db + ");"
);
$("#node_options-node_name-2 input").attr(
$("#button-upd_only_node").attr(
"onclick",
"update_node_name(" + node_selected.id_db + ");"
);
@ -3886,6 +3886,9 @@ function draw_elements_graph() {
.attr("node_id", function(d) {
return d.id + networkmap_id;
})
.attr("style", function(d) {
return d.id === 0 ? "filter: invert(0%)" : "";
})
.attr("id", "image2995")
.classed("dragable_node", true) //own dragable
.on("mouseover", function(d) {

View File

@ -1571,16 +1571,12 @@ function type_change() {
var type = document.getElementById("type").value;
switch (type) {
case "3":
$("#li_tags").hide();
$("#li_groups").hide();
$("#li_module_groups").hide();
break;
case "2":
$("#li_tags").hide();
$("#li_groups").hide();
$("#li_module_groups").show();
break;
case "1":
$("#li_tags").show();
$("#li_groups").hide();
@ -1588,6 +1584,7 @@ function type_change() {
break;
default:
case "3":
case "0":
$("#li_tags").hide();
$("#li_groups").show();

View File

@ -652,13 +652,19 @@ var TreeController = {
typeof element.icon != "undefined" &&
element.icon.length > 0
) {
var extension = element.icon.split(".").pop();
$content.append(
'<div class="node-icon"><div class="node-icon-container"><img src="' +
(controller.baseURL.length > 0 ? controller.baseURL : "") +
(controller.baseURL.indexOf("meta") !== -1
? "../../images/"
: "images/") +
element.icon +
(extension === "png" || extension === element.icon
? "groups_small/"
: "") +
(extension === element.icon
? element.icon + ".png"
: element.icon) +
'" class="invert_filter"/></div></div>'
);
} else if (
@ -1375,7 +1381,6 @@ var TreeController = {
.removeClass("leaf-closed")
.removeClass("leaf-error")
.addClass("leaf-loading");
$.ajax({
url: controller.ajaxURL,
type: "POST",
@ -1407,6 +1412,53 @@ var TreeController = {
data.tree.length > 0) ||
$group.length > 0
) {
if (controller.filter.statusModule === "fired") {
var newData = { success: data.success, tree: [] };
data.tree.forEach(element => {
// Agents.
if (
typeof element.counters !== "undefined" &&
element.counters.alerts > 0
) {
var treeTmp = element;
treeTmp.counters.critical = 0;
treeTmp.counters.not_init = 0;
treeTmp.counters.ok = 0;
treeTmp.counters.unknown = 0;
treeTmp.counters.warning = 0;
treeTmp.counters.total =
element.counters.alerts;
treeTmp.critical_count = 0;
treeTmp.normal_count = 0;
treeTmp.notinit_count = 0;
treeTmp.unknown_count = 0;
treeTmp.warning_count = 0;
treeTmp.total_count = element.fired_count;
treeTmp.state_critical = 0;
treeTmp.state_normal = 0;
treeTmp.state_notinit = 0;
treeTmp.state_unknown = 0;
treeTmp.state_warning = 0;
treeTmp.state_total = element.fired_count;
newData.tree.push(treeTmp);
data = newData;
}
// Modules.
if (element.alerts > 0) {
var treeTmp = element;
newData.tree.push(treeTmp);
data = newData;
}
});
}
$node.addClass("leaf-open");
if ($group.length <= 0) {
@ -1507,6 +1559,34 @@ var TreeController = {
this.reload();
},
init: function(data) {
if (data.filter.statusModule === "fired") {
const newData = {
ajaxUrl: data.ajaxURL,
baseURL: data.baseURL,
counterTitle: data.counterTitle,
detailRecipient: data.detailRecipient,
emptyMessage: data.emptyMessage,
filter: data.filter,
foundMessage: data.foundMessage,
page: data.page,
recipient: data.recipient,
tree: []
};
data.tree.forEach(element => {
if (element.counters.alerts > 0) {
element.counters.critical = 0;
element.counters.not_init = 0;
element.counters.ok = 0;
element.counters.unknown = 0;
element.counters.warning = 0;
element.counters.total = element.counters.alerts;
newData.tree.push(element);
}
});
data = newData;
}
if (
typeof data.recipient !== "undefined" &&
data.recipient.length > 0

View File

@ -764,6 +764,7 @@ class ClusterWizard extends \HTML
'action' => $target_url,
'method' => 'POST',
'extra' => 'autocomplete="false"',
'id' => 'cluster-edit-'.($this->page + 1),
];
if ($load_success === false && $this->page !== 0) {
@ -1245,17 +1246,16 @@ class ClusterWizard extends \HTML
}
// Submit button.
$form['inputs'][] = [
'arguments' => [
'name' => 'next',
'label' => $str,
'type' => 'submit',
'attributes' => [
'icon' => 'wand',
'mode' => 'primary',
],
'return' => true,
$form['submit-external-input'] = [
'name' => 'next',
'label' => $str,
'type' => 'submit',
'attributes' => [
'icon' => 'wand',
'mode' => 'primary',
'form' => 'cluster-edit-'.($this->page + 1),
],
'return' => true,
];
return $form;

View File

@ -302,9 +302,16 @@ class GroupsStatusWidget extends Widget
);
$data .= '</span>';
$url = $config['homeurl'];
$url .= 'index.php?sec=estado&sec2=operation/agentes/estado_agente';
$url .= '&refr=60&group_id='.$this->values['groupId'];
if (is_metaconsole() === true) {
$url = $config['homeurl'];
$url .= 'index.php?sec=monitoring&sec2=operation/tree&refr=0&tab=group&pure='.$config['pure'];
$url .= '&refr=60&searchGroup='.groups_get_name($this->values['groupId']);
} else {
$url = $config['homeurl'];
$url .= 'index.php?sec=estado&sec2=operation/agentes/estado_agente';
$url .= '&refr=60&group_id='.$this->values['groupId'];
}
$data .= '<h1>';
$data .= '<a href="'.$url.'">';
$data .= groups_get_name($this->values['groupId']);

View File

@ -264,7 +264,7 @@ class HeatmapWidget extends Widget
// Filters.
$inputs[] = [
'label' => __('Groups'),
'style' => ($values['type'] === '0') ? '' : 'display:none',
'style' => ($values['type'] === '0' || $values['type'] === '3') ? '' : 'display:none',
'id' => 'li_groups',
'arguments' => [
'type' => 'select_groups',
@ -363,6 +363,7 @@ class HeatmapWidget extends Widget
break;
case 0:
case 3:
$values['groups'] = \get_parameter('groups', 0);
break;

View File

@ -239,6 +239,10 @@ class TreeViewWidget extends Widget
$values['agentStatus'] = AGENT_STATUS_UNKNOWN;
break;
case 4:
$values['agentStatus'] = AGENT_STATUS_ALERT_FIRED;
break;
case 5:
$values['agentStatus'] = AGENT_STATUS_NOT_INIT;
break;
@ -292,6 +296,10 @@ class TreeViewWidget extends Widget
$values['moduleStatus'] = AGENT_MODULE_STATUS_NOT_NORMAL;
break;
case 'fired':
$values['moduleStatus'] = 'fired';
break;
default:
case -1:
$values['moduleStatus'] = -1;
@ -389,13 +397,14 @@ class TreeViewWidget extends Widget
// Agents status.
$fields = [
AGENT_STATUS_ALL => __('All'),
AGENT_STATUS_NORMAL => __('Normal'),
AGENT_STATUS_WARNING => __('Warning'),
AGENT_STATUS_CRITICAL => __('Critical'),
AGENT_STATUS_UNKNOWN => __('Unknown'),
AGENT_STATUS_NOT_INIT => __('Not init'),
AGENT_STATUS_NOT_NORMAL => __('Not normal'),
AGENT_STATUS_ALL => __('All'),
AGENT_STATUS_NORMAL => __('Normal'),
AGENT_STATUS_WARNING => __('Warning'),
AGENT_STATUS_CRITICAL => __('Critical'),
AGENT_STATUS_UNKNOWN => __('Unknown'),
AGENT_STATUS_NOT_INIT => __('Not init'),
AGENT_STATUS_NOT_NORMAL => __('Not normal'),
AGENT_STATUS_ALERT_FIRED => __('Fired alerts'),
];
$inputs[] = [
@ -430,6 +439,7 @@ class TreeViewWidget extends Widget
AGENT_MODULE_STATUS_UNKNOWN => __('Unknown'),
AGENT_MODULE_STATUS_NOT_INIT => __('Not init'),
AGENT_MODULE_STATUS_NOT_NORMAL => __('Not normal'),
'fired' => __('Fired alerts'),
];
if (is_metaconsole() === false) {

View File

@ -704,7 +704,7 @@ class Group extends Entity
$agent['total_count'],
$agent['notinit_count']
);
$data[$key]['alias'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent['id_agente'].'"><b>'.$agent['alias'].'</b></a>';
$data[$key]['alias'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'"><b>'.$agent['alias'].'</b></a>';
$data[$key]['status'] = $status_img;
$data[$key]['alerts'] = agents_tree_view_alert_img($agent['fired_count']);
}

View File

@ -185,8 +185,6 @@
.hover:hover {
filter: brightness(1.5);
stroke-width: 0.009;
stroke: black;
}
.group {
@ -255,13 +253,14 @@ div#heatmap-controls div.heatmap-refr > div {
.title-dialog {
width: 40%;
font-weight: bold;
font-weight: bold !important;
padding-left: 20px;
}
.info-dialog {
width: 60%;
font-weight: bold;
display: flex;
align-items: center;
}
.polyline {
@ -271,17 +270,77 @@ div#heatmap-controls div.heatmap-refr > div {
}
.small-stroke {
stroke-width: 0.03;
stroke-width: 0.005;
}
.tiny-stroke {
stroke-width: 0.01;
}
.medium-stroke {
stroke-width: 0.02;
}
.big-stroke {
stroke-width: 0.05;
stroke-width: 0.03;
}
.huge-stroke {
stroke-width: 0.04;
}
.small-size {
font-size: 0.2px;
font-size: 1%;
}
.tiny-size {
font-size: 2%;
}
.medium-size {
font-size: 4%;
}
.big-size {
font-size: 0.4px;
font-size: 6%;
}
.huge-size {
font-size: 8%;
}
.progress_main {
height: 2.5em;
border: 2px solid #82b92e;
position: relative;
width: 100%;
display: inline-block;
display: flex;
border-radius: 4px;
line-height: 9pt;
font-size: 9pt;
}
.progress_main_noborder {
height: 2.5em;
position: relative;
width: 100%;
display: inline-block;
display: flex;
}
.progress_main:before {
content: attr(data-label);
position: absolute;
text-align: center;
left: 0;
right: 0;
margin-top: 0.2em;
}
.progress {
width: 0%;
background: #82b92e;
height: 100%;
float: left;
}

View File

@ -166,7 +166,7 @@ div.login_logo_icon {
div.login_logo_icon img {
margin: 0 auto;
max-height: 185px;
max-height: 150px;
max-width: 300px;
}
@ -346,19 +346,21 @@ div.text_banner_login {
span.span1 {
display: block;
max-width: 700px;
font-size: 80pt;
line-height: 80pt;
font-size: 6vw;
line-height: 6vw;
font-family: "lato-bolder";
color: #fff;
margin-right: 30px;
}
span.span2 {
display: block;
max-width: 700px;
font-size: 30pt;
line-height: 30pt;
font-size: 3vw;
line-height: 3vw;
font-family: "lato-bolder";
color: #fff;
margin-right: 30px;
}
div.img_banner_login img {
@ -384,16 +386,16 @@ div.img_banner_login img {
span.span1 {
display: block;
max-width: 500px;
font-size: 60pt;
line-height: 60pt;
font-size: 6vw;
line-height: 6vw;
font-weight: bold;
color: #fff;
}
span.span2 {
display: block;
max-width: 500px;
font-size: 20pt;
line-height: 20pt;
font-size: 3vw;
line-height: 3vw;
font-family: "lato-bolder";
color: #fff;
}

View File

@ -12,6 +12,10 @@
stroke-width: 5;
}
.node_image {
filter: invert(100%) brightness(125%);
}
.node_children {
stroke: #00f;
}
@ -33,3 +37,8 @@
.holding_area_link {
stroke-dasharray: 12, 3;
}
img.circle-relations {
width: 12px;
border-radius: 50%;
}

View File

@ -241,7 +241,7 @@ table tbody tr td h4 {
a {
color: #3f3f3f;
text-decoration: none;
text-decoration: none !important;
}
a:hover {
@ -11905,3 +11905,7 @@ div.parent_graph > p.legend_background > table > tbody {
div.parent_graph > p.legend_background > table > tbody > tr {
margin-right: 20px;
}
.break-word {
word-wrap: break-word;
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.770';
$build = '230404';
$build = '230417';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -25,6 +25,11 @@
* GNU General Public License for more details.
* ============================================================================
*/
:root {
--primary-color: #14524f;
--secondary-color: #ffffff;
--input-border: #c0ccdc;
}
@font-face {
font-family: "lato";
@ -1505,3 +1510,39 @@ div.nodata_container {
.visual-console-container-dashboard a:visited {
color: inherit !important;
}
/* SVG icons mask */
.module_background_state {
mask: url(../../../images/modules@svg.svg) no-repeat center / contain;
-webkit-mask: url(../../../images/modules@svg.svg) no-repeat center / contain;
margin: 0 auto;
}
.alert_background_state {
mask: url(../../../images/alert@svg.svg) no-repeat center / contain;
-webkit-mask: url(../../../images/alert@svg.svg) no-repeat center / contain;
margin: 0 auto;
}
div.main_menu_icon,
img.main_menu_icon[src$=".svg"] {
width: 18px;
height: 18px;
}
img.os-big-icon[src$=".svg"] {
width: 100px;
height: 100px;
}
div.noresizevc.graph.adapted_sparse
div.flot-x-axis.flot-x1-axis.xAxis.x1Axis
> div.flot-tick-label.tickLabel:nth-child(odd) {
visibility: hidden !important;
}
div.noresizevc.graph.adapted_sparse
div.flot-x-axis.flot-x1-axis.xAxis.x1Axis
> div.flot-tick-label.tickLabel:first-child {
visibility: visible !important;
}

View File

@ -213,8 +213,8 @@ class Agent
false,
false,
false,
false,
true
['class' => 'invert_filter os-big-icon'],
false
).'</div>';
$html .= '<div class="agent_list_ips">';
$html .= $ip.' - '.groups_get_name($this->agent['id_grupo'], true);

View File

@ -206,6 +206,7 @@ class ModuleGraph
$graph = grafico_modulo_sparse($params);
if ($this->draw_events) {
$this->width = 100;
$graph .= '<br>';
$graph .= graphic_module_events(
$this->id,

View File

@ -218,7 +218,7 @@ foreach ($rows as $row) {
}
if ($idModuleInventory != $row['id_module_inventory']) {
if (isset($table) === true && $rowTable >= 1) {
if (isset($table) === true && $rowTable > 1) {
html_print_table($table);
unset($table);
$rowTable = 1;
@ -310,17 +310,16 @@ foreach ($rows as $row) {
$rowTable++;
}
if ($iterator1 > 5) {
// PRINT COUNT TOTAL.
$table->data[$rowTable][0] = '<b>'.__('Total').': </b>'.$iterator1;
$rowTable++;
}
// PRINT COUNT TOTAL.
$table->colspan[$rowTable][0] = 10;
$table->data[$rowTable][0] = '<b>'.__('Total').': </b>'.$iterator1;
$rowTable++;
}
$idModuleInventory = $row['id_module_inventory'];
}
if (isset($table) === true && $rowTable >= 1) {
if (isset($table) === true && $rowTable > 1) {
html_print_table($table);
$printedTables++;
}

View File

@ -51,6 +51,7 @@ if (! check_acl($config['id_user'], $group, 'AR') || $module_id == 0) {
return;
}
$table = new stdClass();
$table->cellpadding = 3;
$table->cellspacing = 3;
$table->width = '98%';
@ -183,6 +184,7 @@ if ($config['history_db_enabled'] == 1) {
echo '</h4>';
$formtable = new stdClass();
$formtable->width = '98%';
$formtable->class = 'databox';
$formtable->data = [];

View File

@ -331,16 +331,7 @@ if ((bool) $has_remote_conf) {
}
}
// $table_agent_count_modules .= ui_print_help_tip(__('Agent statuses are re-calculated by the server, they are not shown in real time.'), true);
/*
$table_agent = html_print_div(
[
'class' => 'agent_details_header',
'content' => $table_agent_header,
],
true
);
*/
$table_agent = $agentStatusHeader.'
<div class="agent_details_content">
<div class="agent_details_graph">
@ -352,26 +343,6 @@ $table_agent = $agentStatusHeader.'
</div>';
/*
$table_agent = '
<div class="agent_details_header">
'.$table_agent_header.'
</div>
<div class="agent_details_content">
<div class="agent_details_graph">
'.$table_agent_graph.'
<div class="agent_details_bullets">
'.$table_agent_count_modules.'
</div>
</div>
<div class="agent_details_info">
'.$alive_animation.$table_agent_os.$table_agent_ip.$table_agent_version.$table_agent_description.$remote_cfg.'
</div>
</div>';
*/
/*
* END: TABLE AGENT BUILD.
*/

View File

@ -2,7 +2,7 @@
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 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
@ -11,7 +11,7 @@
// 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
// Load global vars.
global $config;
check_login();
@ -39,7 +39,7 @@ if (defined('_activeTab_') && _activeTab_ != '_activeTab_') {
$tab = $activeTab;
}
// Networkmap id required
// Networkmap id required.
if (!isset($id)) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -49,7 +49,7 @@ if (!isset($id)) {
exit;
}
// Get the group for ACL
// Get the group for ACL.
if (!isset($store_group)) {
$store_group = db_get_value('id_group', 'tmap', 'id', $id);
if ($store_group === false) {
@ -62,7 +62,7 @@ if (!isset($store_group)) {
}
}
// ACL for the networkmap permission
// ACL for the networkmap permission.
if (!isset($networkmap_read)) {
$networkmap_read = check_acl($config['id_user'], $store_group, 'MR');
}
@ -91,12 +91,12 @@ $strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_use
$networkmap = db_get_row('tmap', 'id', $id);
$pure = (int) get_parameter('pure', 0);
// Main code
// Main code.
if ($pure == 1) {
$buttons['screen'] = [
'active' => false,
'text' => '<a href="index.php?sec=network&amp;'.'sec2=operation/agentes/networkmap.dinamic&amp;'.'activeTab=radial_dynamic&amp;id_networkmap='.$id.'">'.html_print_image(
'images/normal_screen.png',
'images/exit_fullscreen@svg.svg',
true,
[
'title' => __('Normal screen'),
@ -109,7 +109,7 @@ if ($pure == 1) {
$buttons['screen'] = [
'active' => false,
'text' => '<a href="index.php?sec=network&amp;'.'sec2=operation/agentes/networkmap.dinamic&amp;'.'pure=1&amp;activeTab=radial_dynamic&amp;id_networkmap='.$id.'">'.html_print_image(
'images/full_screen.png',
'images/fullscreen@svg.svg',
true,
[
'title' => __('Full screen'),
@ -120,7 +120,7 @@ if ($pure == 1) {
$buttons['list'] = [
'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;'.'sec2=operation/agentes/pandora_networkmap">'.html_print_image(
'images/list.png',
'images/file-collection@svg.svg',
true,
[
'title' => __('List of networkmap'),
@ -132,16 +132,24 @@ if ($pure == 1) {
}
if ($dashboard != 1) {
ui_print_page_header(
// Header.
ui_print_standard_header(
io_safe_output($networkmap['name']),
'images/bricks.png',
false,
'network_map_enterprise_list',
false,
$buttons,
false,
'',
$config['item_title_size_text']
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Network maps'),
],
]
);
}
@ -208,14 +216,14 @@ switch ($networkmap['generation_method']) {
break;
}
// Set filter
// Set filter.
$filter = networkmap_get_filter($layout);
if (!isset($text_filter)) {
$text_filter = '';
}
// Generate dot file
// Generate dot file.
$graph = networkmap_generate_hash(
__('Pandora FMS'),
$group,

View File

@ -156,7 +156,6 @@ if ($ag_freestring !== '' || $moduletype !== '' || $datatype !== ''
$userRequest = (bool) get_parameter('uptbutton');
if ($userRequest === false) {
$autosearch = true;
$status = AGENT_MODULE_STATUS_NOT_NORMAL;
}
if (is_metaconsole() === false) {

View File

@ -30,7 +30,7 @@ use PandoraFMS\Enterprise\Metaconsole\Node;
global $config;
require_once 'include/functions_gis.php';
require_once $config['homedir'].'/include/functions_gis.php';
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/include/functions_groups.php';
require_once $config['homedir'].'/include/functions_modules.php';
@ -1442,22 +1442,24 @@ $alerttab['active'] = ($tab === 'alert');
// Inventory.
$inventoryCount = db_get_num_rows('SELECT id_agent_module_inventory FROM tagent_module_inventory WHERE id_agente = '.$agent['id_agente']);
$inventorytab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
'images/hardware-software-component@svg.svg',
true,
[
'class' => 'main_menu_icon invert_filter',
'title' => __('Inventory'),
]
).'</a>';
if ($tab == 'inventory') {
$inventorytab['active'] = true;
} else {
$inventorytab['active'] = false;
if ($inventoryCount > 0) {
$inventorytab['text'] = html_print_menu_button(
[
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=inventory&id_agente='.$id_agente,
'image' => 'images/hardware-software-component@svg.svg',
'title' => __('Inventory'),
],
true
);
if ($tab === 'inventory') {
$inventorytab['active'] = true;
} else {
$inventorytab['active'] = false;
}
}
// Collection.
if ((int) $config['license_nms'] !== 1) {
$collectiontab = enterprise_hook('collection_tab');
@ -1475,9 +1477,8 @@ if ($policyTab === ENTERPRISE_NOT_HOOK) {
$policyTab = '';
}
// Omnishell.
$tasks = count_tasks_agent($id_agente);
$tasks = enterprise_hook('count_tasks_agent', [$id_agente]);
if ($tasks === true) {
$omnishellTab = enterprise_hook('omnishell_tab');
@ -1587,7 +1588,7 @@ if (enterprise_installed() === true && (bool) $config['log_collector'] === true)
$log_viewer_tab['text'] = html_print_menu_button(
[
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=log_viewer&id_agente='.$id_agente,
'image' => 'images/gm_log.png',
'image' => 'images/gm_log@svg.svg',
'title' => __('Log Viewer'),
],
true
@ -1917,7 +1918,7 @@ switch ($tab) {
if ((bool) $config['pure'] === false) {
ui_print_standard_header(
__('Agent main view'),
__('Agent main view').' ( '.strtolower(agents_get_alias($id_agente)).' )',
$icon,
false,
($help_header ?? ''),
@ -1936,6 +1937,12 @@ if ((bool) $config['pure'] === false) {
'link' => '',
'label' => $tab_name,
],
],
[
'id_element' => $id_agente,
'url' => 'operation/agentes/ver_agente&id_agente='.$id_agente,
'label' => agents_get_alias($id_agente),
'section' => 'Agents',
]
);
}

View File

@ -538,22 +538,27 @@ if (is_ajax() === true) {
);
$user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone'];
if (!$user_timezone) {
$timezone = timezone_open(date_default_timezone_get());
$datetime_eur = date_create('now', timezone_open($config['timezone']));
$dif = timezone_offset_get($timezone, $datetime_eur);
date($config['date_format'], $dif);
if (!date('I')) {
// For summer -3600sec.
$dif -= 3600;
}
if (empty($user_timezone) === true) {
if (date_default_timezone_get() !== $config['timezone']) {
$timezone = timezone_open(date_default_timezone_get());
$datetime_eur = date_create('now', timezone_open($config['timezone']));
$dif = timezone_offset_get($timezone, $datetime_eur);
date($config['date_format'], $dif);
if (!date('I')) {
// For summer -3600sec.
$dif -= 3600;
}
$total_sec = strtotime($tmp->timestamp);
$total_sec += $dif;
$last_contact = date($config['date_format'], $total_sec);
$last_contact_value = ui_print_timestamp($last_contact, true);
$total_sec = strtotime($tmp->timestamp);
$total_sec += $dif;
$last_contact = date($config['date_format'], $total_sec);
$last_contact_value = ui_print_timestamp($last_contact, true);
} else {
$title = date($config['date_format'], strtotime($tmp->timestamp));
$value = human_time_comparation(strtotime($tmp->timestamp), 'large');
$last_contact_value = '<span title="'.$title.'">'.$value.'</span>';
}
} else {
$user_timezone = users_get_user_by_id($_SESSION['id_usuario'])['timezone'];
date_default_timezone_set($user_timezone);
$title = date($config['date_format'], strtotime($tmp->timestamp));
$value = human_time_comparation(strtotime($tmp->timestamp), 'large');
@ -1209,17 +1214,17 @@ foreach ((array) $tags as $id_tag => $tag) {
if (is_array($tag_with) === true
&& ((array_search($id_tag, $tag_with) === false) || (array_search($id_tag, $tag_with) === null))
) {
$tags_select_with[$id_tag] = ui_print_truncate_text($tag, 50, true);
$tags_select_with[$id_tag] = $tag;
} else {
$tag_with_temp[$id_tag] = ui_print_truncate_text($tag, 50, true);
$tag_with_temp[$id_tag] = $tag;
}
if (is_array($tag_without) === true
&& ((array_search($id_tag, $tag_without) === false) || (array_search($id_tag, $tag_without) === null))
) {
$tags_select_without[$id_tag] = ui_print_truncate_text($tag, 50, true);
$tags_select_without[$id_tag] = $tag;
} else {
$tag_without_temp[$id_tag] = ui_print_truncate_text($tag, 50, true);
$tag_without_temp[$id_tag] = $tag;
}
}
@ -1255,7 +1260,16 @@ $data[0] = html_print_select(
true,
true,
'select_tags',
false
false,
false,
false,
false,
false,
'',
false,
false,
false,
25
);
$data[1] = html_print_image(
@ -1297,7 +1311,16 @@ $data[2] = html_print_select(
true,
true,
'select_tags',
false
false,
false,
false,
false,
false,
'',
false,
false,
false,
25
);
$tabletags_with->data[] = $data;
@ -1330,7 +1353,16 @@ $data[0] = html_print_select(
true,
true,
'select_tags',
false
false,
false,
false,
false,
false,
'',
false,
false,
false,
25
);
$data[1] = html_print_image(
'images/darrowright.png',
@ -1368,7 +1400,16 @@ $data[2] = html_print_select(
true,
true,
'select_tags',
false
false,
false,
false,
false,
false,
'',
false,
false,
false,
25
);
$tabletags_without->data[] = $data;
$tabletags_without->rowclass[] = '';

View File

@ -93,7 +93,12 @@ $filter['ip_src'] = get_parameter('ip_src', '');
$filter['dst_port'] = get_parameter('dst_port', '');
$filter['src_port'] = get_parameter('src_port', '');
$filter['advanced_filter'] = get_parameter('advanced_filter', '');
$filter['router_ip'] = get_parameter('router_ip');
$filter['netflow_monitoring'] = (bool) get_parameter('netflow_monitoring');
$filter['netflow_monitoring_interval'] = (int) get_parameter('netflow_monitoring_interval', 300);
$filter['traffic_max'] = get_parameter('traffic_max', 0);
$filter['traffic_critical'] = get_parameter('traffic_critical', 0);
$filter['traffic_warning'] = get_parameter('traffic_warning', 0);
// Read chart configuration.
$chart_type = get_parameter('chart_type', 'netflow_area');
@ -360,6 +365,67 @@ $advanced_toggle .= '<td colspan="2">'.$radio_buttons.'</td>';
$advanced_toggle .= '<td><b>'.__('Source ip').'</b></td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_text('router_ip', $filter['router_ip'], false, 40, 80, true).'</td>';
$advanced_toggle .= '</tr>';
// Netflow server options.
$advanced_toggle .= '<tr>';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Enable Netflow monitoring').ui_print_help_tip(__('Allows you to create an agent that monitors the traffic volume of this filter. It also creates a module that measures if the traffic of any IP of this filter exceeds a certain threshold. A text type module will be created with the traffic rate for each IP within this filter every five minutes (the 10 IP\'s with the most traffic). Only available for Enterprise version.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_checkbox_switch(
'netflow_monitoring',
1,
(bool) $filter['netflow_monitoring'],
true,
false,
'displayMonitoringFilter()',
).'</td>';
$advanced_toggle .= '<tr id="netlofw_monitoring_filters">';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Netflow monitoring interval').ui_print_help_tip(__('Netflow monitoring interval in secs.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_number(
[
'step' => 1,
'name' => 'netflow_monitoring_interval',
'id' => 'netflow_monitoring_interval',
'value' => $filter['netflow_monitoring_interval'],
]
).'</td>';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('Maximum traffic value of the filter').ui_print_help_tip(__('Specifies the maximum rate (in bytes/sec) of traffic in the filter. It is then used to calculate the % of maximum traffic per IP.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_number(
[
'step' => 1,
'name' => 'traffic_max',
'id' => 'traffic_max',
'value' => $filter['traffic_max'],
]
).'</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= '<tr id="netlofw_monitoring_thresholds">';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('CRITICAL threshold for the maximum % of traffic for an IP.').ui_print_help_tip(__('If this % is exceeded by any IP within the filter, a CRITICAL status will be generated.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_number(
[
'step' => 0.01,
'name' => 'traffic_critical',
'id' => 'traffic_critical',
'value' => $filter['traffic_critical'],
]
).'</td>';
$advanced_toggle .= "<td style='font-weight:bold;'>".__('WARNING threshold for the maximum % of traffic of an IP.').ui_print_help_tip(__('If this % is exceeded by any IP within the filter, a WARNING status will be generated.'), true).'</td>';
$advanced_toggle .= '<td colspan="2">'.html_print_input_number(
[
'step' => 0.01,
'name' => 'traffic_warning',
'id' => 'traffic_warning',
'value' => $filter['traffic_warning'],
]
).'</td>';
$advanced_toggle .= '</tr>';
$advanced_toggle .= '</table>';
@ -713,6 +779,26 @@ ui_include_time_picker();
// Show the normal filter
$(".filter_normal").show();
};
function displayMonitoringFilter () {
var checked = $('#checkbox-netflow_monitoring').prop('checked');
if(checked == false) {
// Reset values.
$("#netflow_monitoring_interval").val(300);
$("#traffic_max").val(0);
$("#traffic_critical").val(0);
$("#traffic_warning").val(0);
// Hide filters.
$("#netlofw_monitoring_filters").hide();
$("#netlofw_monitoring_thresholds").hide();
} else {
// Show filters.
$("#netlofw_monitoring_filters").show();
$("#netlofw_monitoring_thresholds").show();
}
}
// Ask the user to define a name for the filter in order to save it
function defineFilterName () {
@ -736,7 +822,6 @@ ui_include_time_picker();
$("#filter_id").change(function () {
var filter_type;
// Hide information and name/group row
$(".filter_save").hide();
@ -755,6 +840,12 @@ ui_include_time_picker();
$("#text-router_ip").val('');
$("#textarea_advanced_filter").val('');
$("#aggregate").val('');
$("#traffic_max").val('');
$("#traffic_critical").val('');
$("#traffic_warning").val('');
$("#netflow_monitoring_interval").val(300);
$('#checkbox-netflow_monitoring').prop('checked', false);
// Hide update filter button
$("#submit-update_button").hide();
@ -824,18 +915,31 @@ ui_include_time_picker();
$("#textarea_advanced_filter").val(val);
if (i == 'aggregate')
$("#aggregate").val(val);
if (i == 'netflow_monitoring')
$("#checkbox-netflow_monitoring").prop('checked', val == "0" ? false : true);
// Hide or show monitoring filters.
displayMonitoringFilter();
if (i == 'netflow_monitoring_interval')
$("#netflow_monitoring_interval").val(val);
if (i == 'traffic_max')
$("#traffic_max").val(val);
if (i == 'traffic_critical')
$("#traffic_critical").val(val);
if (i == 'traffic_warning')
$("#traffic_warning").val(val);
});
}
<?php echo ', "json");'; ?>
// Shows update filter button
$("#submit-update_button").show();
}
});
$(document).ready( function() {
displayMonitoringFilter();
// Update visibility of controls.
nf_view_click_period();
// Hide update filter button

View File

@ -22,6 +22,9 @@ $searchModules = check_acl($config['id_user'], 0, 'AR');
if (!$modules || !$searchModules) {
echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
} else {
// Show the modal window of an module.
echo '<div id="module_details_dialog" class=""></div>';
$table = new stdClass();
$table->cellpadding = 4;
$table->cellspacing = 4;
@ -173,14 +176,16 @@ if (!$modules || !$searchModules) {
$win_handle = dechex(crc32($module['id_agente_modulo'].$module['module_name']));
$link = "winopeng('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES."', "."'day_".$win_handle."')";
$link_module_detail = 'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$module['id_agente'].', '."'', 0, ".SECONDS_1DAY.", '".$module['module_name']."')";
$graphCell = '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => 0, 'alt' => '']).'</a>';
$graphCell .= '&nbsp;'."<a href='index.php?".'sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$module['id_agente'].'&amp;tab=data_view&period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo']."'>".html_print_image(
'images/binary.png',
$graphCell = '<a href="javascript:'.$link.'">'.html_print_image('images/module-graph.svg', true, ['border' => 0, 'alt' => '', 'class' => 'main_menu_icon invert_filter' ]).'</a>';
$graphCell .= '&nbsp;<a href="javascript:'.$link_module_detail.'">'.html_print_image(
'images/simple-value.svg',
true,
[
'border' => '0',
'alt' => '',
'class' => 'main_menu_icon invert_filter',
]
).'</a>';
}
@ -258,3 +263,105 @@ if (!$modules || !$searchModules) {
]
);
}
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
?>
<script type="text/javascript">
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) {
var server_name = '';
var extra_parameters = '';
if ($('input[name=selection_mode]:checked').val()) {
period = $('#period').val();
var selection_mode = $('input[name=selection_mode]:checked').val();
var date_from = $('#text-date_from').val();
var time_from = $('#text-time_from').val();
var date_to = $('#text-date_to').val();
var time_to = $('#text-time_to').val();
extra_parameters = '&selection_mode=' + selection_mode + '&date_from=' + date_from + '&date_to=' + date_to + '&time_from=' + time_from + '&time_to=' + time_to;
}
// Get the free text in both options
var freesearch = $('#text-freesearch').val();
if (freesearch != null && freesearch !== '') {
var free_checkbox = $('input[name=free_checkbox]:checked').val();
extra_parameters += '&freesearch=' + freesearch;
if (free_checkbox == 1) {
extra_parameters += '&free_checkbox=1';
} else {
extra_parameters += '&free_checkbox=0';
}
}
title = <?php echo '"'.__('Module: ').'"'; ?>;
$.ajax({
type: "POST",
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
data: "page=include/ajax/module&get_module_detail=1&server_name=" + server_name + "&id_agent=" + id_agent + "&id_module=" + module_id + "&offset=" + offset + "&period=" + period + extra_parameters,
dataType: "html",
success: function(data) {
$("#module_details_dialog").hide()
.empty()
.append(data)
.dialog({
resizable: true,
draggable: true,
modal: true,
title: title + module_name,
overlay: {
opacity: 0.5,
background: "black"
},
width: 650,
height: 500
})
.show();
refresh_pagination_callback(module_id, id_agent, "", module_name);
datetime_picker_callback();
forced_title_callback();
}
});
}
function refresh_pagination_callback (module_id, id_agent, server_name,module_name) {
$(".binary_dialog").click( function() {
var classes = $(this).attr('class');
classes = classes.split(' ');
var offset_class = classes[2];
offset_class = offset_class.split('_');
var offset = offset_class[1];
var period = $('#period').val();
show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name);
return false;
});
}
function datetime_picker_callback() {
$("#text-time_from, #text-time_to").timepicker({
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
timeText: '<?php echo __('Time'); ?>',
hourText: '<?php echo __('Hour'); ?>',
minuteText: '<?php echo __('Minute'); ?>',
secondText: '<?php echo __('Second'); ?>',
currentText: '<?php echo __('Now'); ?>',
closeText: '<?php echo __('Close'); ?>'});
$("#text-date_from, #text-date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
}
datetime_picker_callback();
</script>

View File

@ -210,6 +210,7 @@ $agent_status_arr[AGENT_STATUS_WARNING] = __('Warning');
$agent_status_arr[AGENT_STATUS_CRITICAL] = __('Critical');
$agent_status_arr[AGENT_STATUS_UNKNOWN] = __('Unknown');
$agent_status_arr[AGENT_STATUS_NOT_INIT] = __('Not init');
$agent_status_arr[AGENT_STATUS_ALERT_FIRED] = __('Fired alerts');
$table->data['group_row'][] = html_print_label_input_block(
__('Search group'),
@ -271,7 +272,7 @@ $table->data['agent_row'][] = html_print_label_input_block(
0,
true,
false,
true,
false,
'',
false,
'width:100%'
@ -300,6 +301,7 @@ if (is_metaconsole() === false) {
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
$module_status_arr['fired'] = __('Fired alerts');
$table->data['last_row'][] = html_print_label_input_block(
__('Search module'),
@ -322,7 +324,7 @@ if (is_metaconsole() === false) {
0,
true,
false,
true,
false,
'',
false,
'width:100%'
@ -380,7 +382,7 @@ html_print_div(
]
);
$infoHeadTitle = 'Sombra oscura';
$infoHeadTitle = '';
?>
<?php if (is_metaconsole() === false) { ?>

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.770
%define release 230404
%define release 230417
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.770
%define release 230404
%define release 230417
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.770
%define release 230404
%define release 230417
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -2185,6 +2185,12 @@ CREATE TABLE IF NOT EXISTS `tnetflow_filter` (
`advanced_filter` TEXT,
`filter_args` TEXT,
`aggregate` VARCHAR(60),
`netflow_monitoring` TINYINT UNSIGNED NOT NULL default 0,
`traffic_max` INTEGER NOT NULL default 0,
`traffic_critical` FLOAT(20,2) NOT NULL default 0,
`traffic_warning` FLOAT(20,2) NOT NULL default 0,
`netflow_monitoring_interval` INT UNSIGNED NOT NULL DEFAULT 300,
`utimestamp` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id_sg`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;

View File

@ -120,42 +120,17 @@ if (empty($wizard->errMessages) === false) {
}
}
$buttons_input = '';
if (empty($form) === false) {
// Print form (prepared in ClusterWizard).
$submit = $form['submit-external-input'];
unset($form['submit-external-input']);
HTML::printForm($form, false, ($wizard->page < 6));
$buttons_input .= HTML::printInput($submit);
}
// Print always go back button.
HTML::printForm($wizard->getGoBackForm(), false);
$buttons_input .= HTML::printForm($wizard->getGoBackForm(), true);
html_print_action_buttons(
'',
[]
);
?>
<script type="text/javascript">
$(document).ready(function() {
var buttonnext = $('#button-next').parent().html();
$('#button-next').hide();
var buttonnext = buttonnext.replace('button-next','button-next_copy');
var buttonback = $('#button-submit').parent().html();
$('#button-submit').hide();
var buttonback = buttonback.replace('button-submit','button-submit_copy');
var buttonalert = $('#button-add').parent().html();
var buttonalert = buttonalert.replace('button-add','button-add_copy');
$('.action_buttons_right_content').parent().html(buttonnext+buttonback+buttonalert);
var style = $('#principal_action_buttons').attr('style');
$('#principal_action_buttons').attr('style',style+' justify-content: unset;');
// Button next/finish on action buttons.
$('#button-next_copy').click(function(){
$('#button-next').trigger('click');
});
// Button back on action buttons.
$('#button-submit_copy').click(function(){
$('#button-submit').trigger('click');
});
});
</script>
html_print_action_buttons($buttons_input);

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.770-230404
Version: 7.0NG.770-230417
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -764,3 +764,10 @@ tentacle_service_watchdog 1
# Enable (1) or disable (0) the parameter of mysql ssl certification (mysql_ssl_verify_server_cert) (enabled by default).
verify_mysql_ssl_cert 1
# Enable (1) or disable (0) the Pandora FMS Netflow Server (PANDORA FMS ENTERPRISE ONLY).
netflowserver 0
# Number of threads for the Pandora FMS Netflow Server (PANDORA FMS ENTERPRISE ONLY).
netflowserver_threads 1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.770";
my $pandora_build = "230404";
my $pandora_build = "230417";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -559,6 +559,8 @@ sub pandora_load_config {
$pa_config->{"unknown_block_size"} = 1000; # 7.0.769
$pa_config->{"netflowserver"} = 0; # 7.0.770
$pa_config->{"netflowserver_threads"} = 1; # 7.0.770
$pa_config->{"ha_mode"} = "pacemaker"; # 7.0.770
$pa_config->{"ha_file"} = undef; # 7.0.770
$pa_config->{"ha_hosts_file"} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'; # 7.0.770
@ -1365,6 +1367,12 @@ sub pandora_load_config {
elsif ($parametro =~ m/^dataserver_smart_queue\s([0-1])/i) {
$pa_config->{'dataserver_smart_queue'} = clean_blank($1);
}
elsif ($parametro =~ m/^netflowserver\s([0-1])/i) {
$pa_config->{'netflowserver'} = clean_blank($1);
}
elsif ($parametro =~ m/^netflowserver_threads\s+([0-9]*)/i) {
$pa_config->{'netflowserver_threads'}= clean_blank($1);
}
elsif ($parametro =~ m/^ha_connect_retries\s+([0-9]*)/i) {
$pa_config->{'ha_connect_retries'} = clean_blank($1);
}

View File

@ -296,7 +296,7 @@ our @ServerTypes = qw (
dataserver
networkserver
snmpconsole
reconserver
discoveryserver
pluginserver
predictionserver
wmiserver
@ -307,6 +307,7 @@ our @ServerTypes = qw (
icmpserver
snmpserver
satelliteserver
transactionalserver
mfserver
syncserver
wuxserver
@ -315,6 +316,8 @@ our @ServerTypes = qw (
migrationserver
alertserver
correlationserver
ncmserver
netflowserver
);
our @AlertStatus = ('Execute the alert', 'Do not execute the alert', 'Do not execute the alert, but increment its internal counter', 'Cease the alert', 'Recover the alert', 'Reset internal counter');

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.770";
my $pandora_build = "230404";
my $pandora_build = "230417";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -78,6 +78,7 @@ our @EXPORT = qw(
PROVISIONINGSERVER
MIGRATIONSERVER
NCMSERVER
NETFLOWSERVER
METACONSOLE_LICENSE
OFFLINE_LICENSE
DISCOVERY_HOSTDEVICES
@ -202,6 +203,7 @@ use constant MIGRATIONSERVER => 20;
use constant ALERTSERVER => 21;
use constant CORRELATIONSERVER => 22;
use constant NCMSERVER => 23;
use constant NETFLOWSERVER => 24;
# Module status
use constant MODULE_NORMAL => 0;
@ -2844,6 +2846,8 @@ sub get_server_name {
return "MIGRATIONSERVER" if ($server_type eq MIGRATIONSERVER);
return "ALERTSERVER" if ($server_type eq ALERTSERVER);
return "CORRELATIONSERVER" if ($server_type eq CORRELATIONSERVER);
return "NCMSERVER" if ($server_type eq NCMSERVER);
return "NETFLOWSERVER" if ($server_type eq NETFLOWSERVER);
return "UNKNOWN";
}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230404
%define release 230417
Summary: Pandora FMS Server
Name: %{name}
@ -49,6 +49,7 @@ rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pandora/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pandora/conf.d
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tentacle/
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/conf
@ -60,6 +61,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/trans
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/pandora/data_in/commands
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/pandora/
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf.d/
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/
@ -89,6 +91,7 @@ if [ ! -f $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server ] ; then
install -m 0644 util/pandora_server_logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pandora_server
fi
install -m 0640 conf/pandora_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/pandora/pandora_server.conf.new
install -m 0640 conf/pandora_server_sec.conf.template $RPM_BUILD_ROOT%{_sysconfdir}/pandora/conf.d/pandora_server_sec.conf.template
install -m 0640 conf/tentacle_server.conf.new $RPM_BUILD_ROOT%{_sysconfdir}/tentacle/tentacle_server.conf.new
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
@ -228,6 +231,9 @@ exit 0
%defattr(600,root,root)
/etc/pandora/pandora_server.conf.new
%defattr(600,root,root)
/etc/pandora/conf.d/pandora_server_sec.conf.template
%defattr(664,root,root)
/etc/tentacle/tentacle_server.conf.new

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230404
%define release 230417
Summary: Pandora FMS Server
Name: %{name}
@ -67,6 +67,7 @@ mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/trans
mkdir -p $RPM_BUILD_ROOT/var/spool/pandora/data_in/commands
mkdir -p $RPM_BUILD_ROOT/var/log/pandora/
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
mkdir -p $RPM_BUILD_ROOT%{prefix}/pandora_server/conf.d/
mkdir -p $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
mkdir -p $RPM_BUILD_ROOT/usr/lib/perl5/
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1/
@ -78,6 +79,7 @@ cp -aRf bin/tentacle_server $RPM_BUILD_ROOT/usr/bin/
cp -aRf conf/pandora_* $RPM_BUILD_ROOT%{prefix}/pandora_server/conf/
cp -aRf conf/pandora_server.conf.new $RPM_BUILD_ROOT/etc/pandora/
cp -aRf conf/pandora_server_sec.conf.template $RPM_BUILD_ROOT/etc/pandora/conf.d/pandora_server_sec.conf.template
cp -aRf conf/tentacle_* $RPM_BUILD_ROOT%{prefix}/tentacle/conf/
cp -aRf conf/tentacle_server.conf.new $RPM_BUILD_ROOT/etc/tentacle/
cp -aRf util $RPM_BUILD_ROOT%{prefix}/pandora_server/
@ -202,6 +204,7 @@ rm -Rf %{prefix}pandora_server
rm -Rf /var/log/pandora
rm -Rf /usr/lib/perl5/PandoraFMS/
rm -Rf /etc/pandora/pandora_server.conf*
rm -Rf /etc/pandora/conf.d/*
rm -Rf /etc/tentacle/tentacle_server.conf*
rm -Rf /var/spool/pandora
rm -Rf /etc/init.d/pandora_server /etc/init.d/tentacle_serverd

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