Merge branch 'develop' into ent-9771-discovery-2-0-sistema-de-extensiones-disco-para-el-discovery

This commit is contained in:
Daniel Cebrian 2023-04-17 15:48:23 +02:00
commit 8183f7aa5d
61 changed files with 1502 additions and 996 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

@ -19,7 +19,7 @@ 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

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-230412
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-230412"
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 => '230412';
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 230412
%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 230412
%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="230412"
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
{230412}
{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 230412")
#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 230412))"
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-230412
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-230412"
pandora_version="7.0NG.770-230417"
package_pear=0
package_pandora=1

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

@ -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,

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;
@ -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

@ -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

@ -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

@ -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

@ -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

@ -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 = 'PC230412';
$build_version = 'PC230417';
$pandora_version = 'v7.0NG.770';
// Do not overwrite default timezone set if defined.

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

@ -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;
}
}
}

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
@ -5988,7 +6000,7 @@ function reporting_get_events($data, $links=false)
$tooltip = ui_print_help_tip(
__(
"Event count corresponds to events within the last hour"
'Event count corresponds to events within the last hour'
),
true
);

View File

@ -712,7 +712,14 @@ 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';

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

@ -1381,7 +1381,6 @@ var TreeController = {
.removeClass("leaf-closed")
.removeClass("leaf-error")
.addClass("leaf-loading");
$.ajax({
url: controller.ajaxURL,
type: "POST",
@ -1413,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) {
@ -1513,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

@ -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

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

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

@ -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

@ -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 230412
%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 230412
%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 230412
%define release 230417
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.770-230412
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-230412"
pandora_version="7.0NG.770-230417"
package_cpan=0
package_pandora=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 = "230412";
my $pandora_build = "230417";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

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 = "230412";
my $pandora_build = "230417";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230412
%define release 230417
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.770
%define release 230412
%define release 230417
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.770"
PI_BUILD="230412"
PI_BUILD="230417"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.770 Build 230412";
my $version = "7.0NG.770 Build 230417";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.770 Build 230412";
my $version = "7.0NG.770 Build 230417";
# save program name for logging
my $progname = basename($0);