mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch 'develop' into ent-10065-post-filtros-de-eventos-privados
This commit is contained in:
commit
764d5908bb
@ -78,16 +78,16 @@ cd unix && ./pandora_agent_installer --install
|
||||
}
|
||||
|
||||
|
||||
install_autodiscover () {
|
||||
local arch=$1
|
||||
wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
||||
unzip autodiscover-linux.zip
|
||||
chmod +x $arch/autodiscover
|
||||
mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
||||
}
|
||||
# install_autodiscover () {
|
||||
# local arch=$1
|
||||
# wget http://firefly.pandorafms.com/projects/autodiscover-linux.zip
|
||||
# unzip autodiscover-linux.zip
|
||||
# chmod +x $arch/autodiscover
|
||||
# mv -f $arch/autodiscover /etc/pandora/plugins/autodiscover
|
||||
# }
|
||||
|
||||
## Main
|
||||
echo "Starting PandoraFMS Agent deployment ver. $S_VERSION"
|
||||
echo "Starting PandoraFMS Agent binary deployment ver. $S_VERSION"
|
||||
|
||||
execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define env variable PANDORA_SERVER_IP'
|
||||
|
||||
@ -104,8 +104,6 @@ OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release
|
||||
[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS
|
||||
[[ $OS =~ 'fedora' ]] && OS_RELEASE=$OS
|
||||
[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS
|
||||
#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS
|
||||
#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS
|
||||
|
||||
# initialice logfile
|
||||
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
|
||||
@ -126,6 +124,30 @@ check_repo_connection
|
||||
execute_cmd "grep --version" 'Checking needed tools: grep'
|
||||
execute_cmd "sed --version" 'Checking needed tools: sed'
|
||||
|
||||
# Arch check
|
||||
arch=$(uname -m)
|
||||
case $arch in
|
||||
|
||||
x86_64)
|
||||
echo -e "${cyan}Arch: $arch ${reset} "
|
||||
;;
|
||||
|
||||
x86)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo -e "${yellow}Skiping installation arch: $arch not suported by binary agent please consider to install source agent${reset}"
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Creating working directory
|
||||
rm -rf $HOME/pandora_deploy_tmp/ &>> $LOGFILE
|
||||
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
|
||||
@ -148,6 +170,10 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
||||
# Check rh version
|
||||
if [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '8' ] ; then
|
||||
package_manager_cmd=dnf
|
||||
execute_cmd "$package_manager_cmd install -y libnsl" "Installing dependencies"
|
||||
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '9' ] ; then
|
||||
package_manager_cmd=dnf
|
||||
execute_cmd "$package_manager_cmd install -y libnsl libxcrypt-compat" "Installing dependencies"
|
||||
elif [ $(sed -nr 's/VERSION_ID+=\s*"([0-9]).*"$/\1/p' /etc/os-release) -eq '7' ] ; then
|
||||
package_manager_cmd=yum
|
||||
|
||||
@ -158,24 +184,23 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
||||
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
|
||||
|
||||
# Insatall pandora agent
|
||||
$package_manager_cmd install -y http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm &>> $LOGFILE
|
||||
echo -en "${cyan}Installing Pandora FMS agent...${reset}"
|
||||
check_cmd_status 'Error installing Pandora FMS agent'
|
||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm "
|
||||
execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package'
|
||||
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||
|
||||
fi
|
||||
|
||||
if [[ $OS_RELEASE == 'debian' ]]; then
|
||||
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz'
|
||||
execute_cmd "apt update" 'Updating repos'
|
||||
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
||||
execute_cmd 'wget http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz' 'Downloading Pandora FMS agent package'
|
||||
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
||||
execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package'
|
||||
execute_cmd 'install_tarball pandorafms_agent_linux-7.0NG.tar.gz' 'Installing Pandora FMS agent'
|
||||
[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
||||
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd 'apt install -y libio-socket-ssl-perl' "Installing SSL libraries for encrypted connection"
|
||||
cd $HOME/pandora_deploy_tmp
|
||||
fi
|
||||
|
||||
# Configuring Agente
|
||||
|
||||
[[ $PANDORA_SERVER_IP ]] && sed -i "s/^server_ip.*$/server_ip $PANDORA_SERVER_IP/g" $PANDORA_AGENT_CONF
|
||||
[[ $PANDORA_REMOTE_CONFIG ]] && sed -i "s/^remote_config.*$/remote_config $PANDORA_REMOTE_CONFIG/g" $PANDORA_AGENT_CONF
|
||||
[[ $PANDORA_GROUP ]] && sed -i "s/^group.*$/group $PANDORA_GROUP/g" $PANDORA_AGENT_CONF
|
||||
@ -187,27 +212,6 @@ fi
|
||||
[[ $PANDORA_AGENT_SSL ]] && sed -i "s/^#server_ssl.*$/server_ssl $PANDORA_AGENT_SSL/g" $PANDORA_AGENT_CONF
|
||||
|
||||
|
||||
#installing autodiscover
|
||||
|
||||
arch=$(uname -m)
|
||||
case $arch in
|
||||
|
||||
x86_64)
|
||||
execute_cmd 'install_autodiscover x86_64' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
||||
;;
|
||||
|
||||
x86)
|
||||
execute_cmd 'install_autodiscover x84' "installing service autodiscover on $arch" 'Error unable to install autodiscovery'
|
||||
;;
|
||||
|
||||
armv7l)
|
||||
echo -e "${cyan}Skiping autodiscover installation arch $arch not suported${reset}"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo -e "${yellow}Skiping autodiscover installation arch $arch not suported${reset}"
|
||||
;;
|
||||
esac
|
||||
|
||||
#Starting pandora agent daemon.
|
||||
execute_cmd '/etc/init.d/pandora_agent_daemon restart' 'Starting Pandora Agent'
|
||||
|
@ -28,7 +28,7 @@ $PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spe
|
||||
$CODEHOME/pandora_console/pandora_console.redhat.spec \
|
||||
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec\
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
|
||||
$CODEHOME/pandora_server/pandora_server.redhat.spec \
|
||||
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
|
||||
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, FreeBSD Version
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, HP-UX Version
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
@ -166,7 +166,7 @@ module_description User CPU Usage (%)
|
||||
module_min_warning 70
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_max_critical 0
|
||||
module_unit %
|
||||
module_end
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, Solaris Version
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
@ -119,7 +119,7 @@ module_description CPU Load (%)
|
||||
module_min_warning 80
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_max_critical 0
|
||||
module_end
|
||||
|
||||
# Number processes
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, HPUX Version
|
||||
# Version 7.0NG.773.3, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2023 Pandora FMS
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.773, Solaris version
|
||||
# Version 7.0NG.773.3, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, AIX version
|
||||
# Version 7.0NG.773.3, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773-230818
|
||||
Version: 7.0NG.773.3-230911
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773-230818"
|
||||
pandora_version="7.0NG.773.3-230911"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -31,7 +31,7 @@ fi
|
||||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.773"
|
||||
VERSION="7.0NG.773.3"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
@ -19,11 +19,11 @@
|
||||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.3" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.3" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
@ -5,9 +5,9 @@
|
||||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.773.3</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.773.3 Pandora FMS on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.773.3</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
@ -187,7 +187,7 @@ module_description User CPU Usage (%)
|
||||
module_min_warning 70
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_max_critical 0
|
||||
module_end
|
||||
|
||||
#Get load average
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, FreeBSD Version
|
||||
# Version 7.0NG.773.3, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, HP-UX Version
|
||||
# Version 7.0NG.773.3, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2004-2023 Pandora FMS
|
||||
# https://pandorafms.com
|
||||
@ -219,7 +219,7 @@ module_description User CPU Usage (%)
|
||||
module_min_warning 70
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_max_critical 0
|
||||
module_unit %
|
||||
module_group System
|
||||
module_end
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, GNU/Linux
|
||||
# Version 7.0NG.773.3, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, NetBSD Version
|
||||
# Version 7.0NG.773.3, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.773, Solaris Version
|
||||
# Version 7.0NG.773.3, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2023 Pandora FMS
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1030,8 +1030,8 @@ my $Sem = undef;
|
||||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773';
|
||||
use constant AGENT_BUILD => '230818';
|
||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||
use constant AGENT_BUILD => '230911';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773
|
||||
%define release 230818
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230911
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
@ -25,7 +25,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
||||
Requires: coreutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip) perl(File::Copy) perl(Sys::Hostname)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
AutoReq: 0
|
||||
|
@ -4,8 +4,8 @@
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773
|
||||
%define release 230725
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230911
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
@ -26,9 +26,7 @@ Requires(preun): chkconfig /bin/rm /usr/sbin/userdel
|
||||
Requires: coreutils unzip
|
||||
Requires: util-linux procps grep
|
||||
Requires: /sbin/ip /bin/awk
|
||||
Requires: perl(Sys::Syslog) perl(IO::Compress::Zip)
|
||||
# Required by plugins
|
||||
#Requires: sh-utils sed passwd net-tools rpm
|
||||
#Requires: libnsl
|
||||
AutoReq: 0
|
||||
Provides: %{name}-%{version}
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773
|
||||
%define release 230818
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230911
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -9,8 +9,8 @@
|
||||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773"
|
||||
PI_BUILD="230818"
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="230911"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2023 Pandora FMS
|
||||
# Version 7.0NG.773
|
||||
# Version 7.0NG.773.3
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
@ -165,7 +165,7 @@ module_description User CPU Usage (%)
|
||||
module_min_warning 70
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_max_critical 0
|
||||
module_unit %
|
||||
module_group System
|
||||
module_end
|
||||
@ -522,4 +522,11 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
|
||||
#module_type generic_data_string
|
||||
#module_exec echo Bordón
|
||||
#module_native_encoding OEM
|
||||
#module_end
|
||||
#module_end
|
||||
|
||||
# Hardening plugin for security compliance analysis.
|
||||
#module_begin
|
||||
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe"
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
|
3
pandora_agents/win32/bin/util/pandora_sca.exe
Executable file
3
pandora_agents/win32/bin/util/pandora_sca.exe
Executable file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
|
||||
size 5248006
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
||||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.773}
|
||||
{Pandora FMS Windows Agent v7.0NG.773.3}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{230818}
|
||||
{230911}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.773 Build 230818")
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 230911")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.773(Build 230818))"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 230911))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.773-230818
|
||||
Version: 7.0NG.773.3-230911
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773-230818"
|
||||
pandora_version="7.0NG.773.3-230911"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -261,12 +261,27 @@ function agents_modules_load_js()
|
||||
}
|
||||
|
||||
function select_selected () {
|
||||
// $('#id_agents2 option').each(function(){
|
||||
// if($(this).attr('selected') === 'selected'){
|
||||
// $(this).prop('selected', true);
|
||||
// }
|
||||
// });
|
||||
var f = document.forms.filter_form;
|
||||
f.action = "index.php?sec=view&sec2=extensions/agents_modules";
|
||||
$('#filter_form').submit();
|
||||
}
|
||||
/* <![CDATA[ */
|
||||
function export_csv() {
|
||||
let group_id = $('#group_id option:selected').val();
|
||||
let module_group_id = $('#modulegroup option:selected').val();
|
||||
let agent_id = $('#id_agents2 option:selected').map((_, e) => e.value).get();
|
||||
let module_id = $('#module option:selected').map((_, e) => e.value).get();
|
||||
|
||||
let filters_array = {group_id: group_id, module_group_id:module_group_id, agent_id:agent_id, module_id:module_id}
|
||||
let jsonFilters = JSON.stringify(filters_array)
|
||||
let filters = window.btoa(jsonFilters)
|
||||
var f = document.forms.filter_form;
|
||||
|
||||
blockResubmit($(this));
|
||||
f.action = "extensions/agents_modules_csv.php?get_agents_module_csv=1&filters="+filters;
|
||||
$("#filter_form").submit();
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
@ -653,7 +668,7 @@ function mainAgentsModules()
|
||||
}
|
||||
|
||||
if ($config['pure'] != 1) {
|
||||
$show_filters = '<form method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters = '<form id="filter_form" method="post" action="index.php?sec=view&sec2=extensions/agents_modules" class="w100p">';
|
||||
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td width="33%">'.$filter_type.'</td>';
|
||||
@ -679,6 +694,13 @@ function mainAgentsModules()
|
||||
'onclick' => 'select_selected()',
|
||||
],
|
||||
true
|
||||
).html_print_button(
|
||||
__('Export to CSV'),
|
||||
'srcbutton_csv',
|
||||
false,
|
||||
'export_csv()',
|
||||
['class' => 'secondary mini'],
|
||||
true,
|
||||
),
|
||||
],
|
||||
true
|
||||
|
118
pandora_console/extensions/agents_modules_csv.php
Normal file
118
pandora_console/extensions/agents_modules_csv.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* Export data.
|
||||
*
|
||||
* @category Tools
|
||||
* @package Pandora FMS
|
||||
* @subpackage Operation
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
if (true) {
|
||||
include_once '../include/config.php';
|
||||
include_once '../include/functions_agents.php';
|
||||
include_once '../include/functions_reporting.php';
|
||||
include_once '../include/functions_modules.php';
|
||||
include_once '../include/functions_users.php';
|
||||
include_once $config['homedir'].'/include/config.php';
|
||||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
include_once $config['homedir'].'/include/functions_reporting.php';
|
||||
include_once $config['homedir'].'/include/functions_modules.php';
|
||||
include_once $config['homedir'].'/include/functions_users.php';
|
||||
}
|
||||
|
||||
|
||||
check_login();
|
||||
|
||||
// ACL Check.
|
||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Agent view (Grouped)'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$get_agents_module_csv = get_parameter('get_agents_module_csv', 0);
|
||||
|
||||
|
||||
if ($get_agents_module_csv === '1') {
|
||||
// ***************************************************
|
||||
// Header output
|
||||
// ***************************************************
|
||||
$config['ignore_callback'] = true;
|
||||
while (@ob_end_clean()) {
|
||||
}
|
||||
|
||||
$filename = 'agents_module_view_'.date('Ymd').'-'.date('His');
|
||||
|
||||
// Set cookie for download control.
|
||||
setDownloadCookieToken();
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment; filename="'.$filename.'.csv"');
|
||||
// ***************************************************
|
||||
// Data processing
|
||||
// ***************************************************
|
||||
echo pack('C*', 0xEF, 0xBB, 0xBF);
|
||||
|
||||
$json_filters = get_parameter('filters', '');
|
||||
|
||||
$filters = json_decode(
|
||||
base64_decode(
|
||||
get_parameter('filters', '')
|
||||
),
|
||||
true
|
||||
);
|
||||
|
||||
$results = export_agents_module_csv($filters);
|
||||
|
||||
$divider = $config['csv_divider'];
|
||||
$dataend = PHP_EOL;
|
||||
|
||||
$header_fields = [
|
||||
__('Agent'),
|
||||
__('Module'),
|
||||
__('Data'),
|
||||
];
|
||||
|
||||
$out_csv = '';
|
||||
foreach ($header_fields as $key => $value) {
|
||||
$out_csv .= $value.$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
|
||||
foreach ($results as $result) {
|
||||
foreach ($result as $key => $value) {
|
||||
$out_csv .= io_safe_output($value).$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
}
|
||||
|
||||
echo io_safe_output($out_csv);
|
||||
|
||||
exit;
|
||||
}
|
@ -204,51 +204,60 @@ function files_repo_add_file($file_input_name='upfile', $description='', $groups
|
||||
|
||||
if ($upload_result === true) {
|
||||
$filename = $_FILES[$file_input_name]['name'];
|
||||
// Replace conflictive characters
|
||||
$filename = str_replace([' ', '=', '?', '&'], '_', $filename);
|
||||
$filename = filter_var($filename, FILTER_SANITIZE_URL);
|
||||
// The filename should not be larger than 200 characters
|
||||
if (mb_strlen($filename, 'UTF-8') > 200) {
|
||||
$filename = mb_substr($filename, 0, 200, 'UTF-8');
|
||||
}
|
||||
|
||||
$hash = '';
|
||||
if ($public) {
|
||||
$hash = md5(time().$config['dbpass']);
|
||||
$hash = mb_substr($hash, 0, 8, 'UTF-8');
|
||||
}
|
||||
// Invalid extensions.
|
||||
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
$invalid_extensions = '/^(php|php1|php2|php3|php4|php5|php7|php8|phar|phptml|phps)$/i';
|
||||
|
||||
$values = [
|
||||
'name' => $filename,
|
||||
'description' => $description,
|
||||
'hash' => $hash,
|
||||
];
|
||||
$file_id = db_process_sql_insert('tfiles_repo', $values);
|
||||
if (preg_match($invalid_extensions, $extension) === 0) {
|
||||
// Replace conflictive characters
|
||||
$filename = str_replace([' ', '=', '?', '&'], '_', $filename);
|
||||
$filename = filter_var($filename, FILTER_SANITIZE_URL);
|
||||
// The filename should not be larger than 200 characters
|
||||
if (mb_strlen($filename, 'UTF-8') > 200) {
|
||||
$filename = mb_substr($filename, 0, 200, 'UTF-8');
|
||||
}
|
||||
|
||||
if ($file_id) {
|
||||
$file_tmp = $_FILES[$file_input_name]['tmp_name'];
|
||||
$destination = $files_repo_path.'/'.$file_id.'_'.$filename;
|
||||
$hash = '';
|
||||
if ($public) {
|
||||
$hash = md5(time().$config['dbpass']);
|
||||
$hash = mb_substr($hash, 0, 8, 'UTF-8');
|
||||
}
|
||||
|
||||
if (move_uploaded_file($file_tmp, $destination)) {
|
||||
if (is_array($groups) && !empty($groups)) {
|
||||
db_process_sql_delete('tfiles_repo_group', ['id_file' => $file_id]);
|
||||
foreach ($groups as $group) {
|
||||
$values = [
|
||||
'id_file' => $file_id,
|
||||
'id_group' => $group,
|
||||
];
|
||||
db_process_sql_insert('tfiles_repo_group', $values);
|
||||
$values = [
|
||||
'name' => $filename,
|
||||
'description' => $description,
|
||||
'hash' => $hash,
|
||||
];
|
||||
$file_id = db_process_sql_insert('tfiles_repo', $values);
|
||||
|
||||
if ($file_id) {
|
||||
$file_tmp = $_FILES[$file_input_name]['tmp_name'];
|
||||
$destination = $files_repo_path.'/'.$file_id.'_'.$filename;
|
||||
|
||||
if (move_uploaded_file($file_tmp, $destination)) {
|
||||
if (is_array($groups) && !empty($groups)) {
|
||||
db_process_sql_delete('tfiles_repo_group', ['id_file' => $file_id]);
|
||||
foreach ($groups as $group) {
|
||||
$values = [
|
||||
'id_file' => $file_id,
|
||||
'id_group' => $group,
|
||||
];
|
||||
db_process_sql_insert('tfiles_repo_group', $values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result['status'] = true;
|
||||
$result['status'] = true;
|
||||
} else {
|
||||
db_process_sql_delete('tfiles_repo', ['id' => $file_id]);
|
||||
unlink($file_tmp);
|
||||
$result['message'] = __('The file could not be copied');
|
||||
}
|
||||
} else {
|
||||
db_process_sql_delete('tfiles_repo', ['id' => $file_id]);
|
||||
unlink($file_tmp);
|
||||
$result['message'] = __('The file could not be copied');
|
||||
$result['message'] = __('There was an error creating the file');
|
||||
}
|
||||
} else {
|
||||
$result['message'] = __('There was an error creating the file');
|
||||
$result['message'] = __('File has an invalid extension');
|
||||
}
|
||||
} else {
|
||||
$result['message'] = $upload_result;
|
||||
|
@ -1,6 +1,18 @@
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE tevent_filter ADD private_filter_user text NULL;
|
||||
ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
||||
`id` INT NOT NULL auto_increment,
|
||||
`filter_name` VARCHAR(45) NULL,
|
||||
`user_id` VARCHAR(255) NULL,
|
||||
`graph_modules` TEXT NULL,
|
||||
`interval` INT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
UPDATE `twelcome_tip`
|
||||
SET title = 'Scheduled downtimes',
|
||||
@ -11,4 +23,26 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
|
||||
|
||||
ALTER TABLE `tsesion_filter_log_viewer`
|
||||
CHANGE COLUMN `date_range` `custom_date` INT NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `start_date_defined` `date` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `start_date_time` `date_text` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `start_date_date` `date_units` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `start_date_date_range` `date_init` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `start_date_time_range` `time_init` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `end_date_date_range` `date_end` VARCHAR(45) NULL DEFAULT NULL ,
|
||||
CHANGE COLUMN `end_date_time_range` `time_end` VARCHAR(45) NULL DEFAULT NULL ;
|
||||
|
||||
ALTER TABLE `tsesion_filter`
|
||||
CHANGE COLUMN `period` `date_text` VARCHAR(45) NULL DEFAULT NULL AFTER `user`;
|
||||
|
||||
ALTER TABLE `tsesion_filter`
|
||||
ADD COLUMN `custom_date` INT NULL AFTER `user`,
|
||||
ADD COLUMN `date` VARCHAR(45) NULL AFTER `custom_date`,
|
||||
ADD COLUMN `date_units` VARCHAR(45) NULL AFTER `date_text`,
|
||||
ADD COLUMN `date_init` VARCHAR(45) NULL AFTER `date_units`,
|
||||
ADD COLUMN `time_init` VARCHAR(45) NULL AFTER `date_init`,
|
||||
ADD COLUMN `date_end` VARCHAR(45) NULL AFTER `time_init`,
|
||||
ADD COLUMN `time_end` VARCHAR(45) NULL AFTER `date_end`;
|
||||
|
||||
COMMIT;
|
||||
|
@ -241,10 +241,10 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
&& array_search($_GET['sec2'], $autorefresh_list) !== false
|
||||
) {
|
||||
$do_refresh = true;
|
||||
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
|
||||
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
|
||||
$do_refresh = false;
|
||||
}
|
||||
|
||||
// Exception for network maps.
|
||||
if ($_GET['sec2'] === 'operation/agentes/pandora_networkmap') {
|
||||
$do_refresh = false;
|
||||
}
|
||||
|
||||
if ($do_refresh) {
|
||||
@ -366,59 +366,37 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
$header_autorefresh_counter .= '</div>';
|
||||
}
|
||||
|
||||
// Button for feedback pandora.
|
||||
if (enterprise_installed() && $config['activate_feedback']) {
|
||||
$header_feedback = '<div id="feedback-icon-header">';
|
||||
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
|
||||
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
|
||||
$header_feedback .= html_print_image(
|
||||
'images/send_feedback@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Feedback'),
|
||||
'id' => 'feedback-header',
|
||||
'alt' => __('Feedback'),
|
||||
'style' => 'cursor: pointer;',
|
||||
]
|
||||
);
|
||||
$header_feedback .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Support.
|
||||
if (enterprise_installed()) {
|
||||
$header_support_link = $config['custom_support_url'];
|
||||
$modal_box = '<div id="modal_help" class="invisible">
|
||||
<div id="modal-feedback-form" class="invisible"></div>
|
||||
<div id="msg-header" class="invisible"></div>
|
||||
<a href="https://pandorafms.com/manual" target="_blank">'.__('Pandora documentation').'</a>';
|
||||
if (enterprise_installed() === true) {
|
||||
$modal_box .= '<a href="https://support.pandorafms.com/" target="_blank">'.__('Enterprise support ').'</a>';
|
||||
$modal_box .= '<a href="#" id="feedback-header">'.__('Give us feedback').'</a>';
|
||||
} else {
|
||||
$header_support_link = 'https://pandorafms.com/forums/';
|
||||
$modal_box .= '<a href="https://pandorafms.com/community/forums/" target="_blank">'.__('Community Support').'</a>';
|
||||
}
|
||||
|
||||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
|
||||
$header_support .= html_print_image(
|
||||
'images/support@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Go to support'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
$header_support .= '</a></div>';
|
||||
$modal_box .= '<hr class="separator" />';
|
||||
$modal_box .= '<a href="https://github.com/pandorafms/pandorafms/issues" target="_blank">'.__('Open an issue in Github').'</a>';
|
||||
$modal_box .= '<a href="https://discord.com/invite/xVt2ruSxmr" target="_blank">'.__('Join discord community').'</a>';
|
||||
$modal_box .= '</div>';
|
||||
|
||||
// Documentation.
|
||||
$header_docu = '<div id="header_docu">';
|
||||
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
|
||||
$header_docu .= html_print_image(
|
||||
'images/documentation@header.svg',
|
||||
true,
|
||||
$modal_help = html_print_div(
|
||||
[
|
||||
'title' => __('Go to documentation'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
'id' => 'modal-help-content',
|
||||
'content' => html_print_image(
|
||||
'images/help@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Help'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
).$modal_box,
|
||||
],
|
||||
true,
|
||||
);
|
||||
$header_docu .= '</a></div>';
|
||||
|
||||
|
||||
// User.
|
||||
@ -472,11 +450,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
echo '</span>';
|
||||
echo '</div>';
|
||||
echo '<div class="header_center"></div>';
|
||||
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
echo '<div class="header_right">'.$modal_help, $header_user, $header_logout.'</div>';
|
||||
} else {
|
||||
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
|
||||
<div class="header_center">'.$header_searchbar.'</div>
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
|
||||
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $header_welcome, $servers_list, $modal_help, $header_user, $header_logout.'</div>';
|
||||
}
|
||||
?>
|
||||
</div> <!-- Closes #table_header_inner -->
|
||||
@ -554,6 +532,54 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
element.style.display = "none"
|
||||
}
|
||||
|
||||
function notifications_clean_all() {
|
||||
let wrapper_inner = document.getElementById('notification-wrapper-inner');
|
||||
while (wrapper_inner.firstChild) {
|
||||
wrapper_inner.removeChild(wrapper_inner.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
function mark_all_notification_as_read() {
|
||||
jQuery.post ("ajax.php",
|
||||
{
|
||||
"page" : "godmode/setup/setup_notifications",
|
||||
"mark_all_notification_as_read" : 1
|
||||
},
|
||||
function (data, status) {
|
||||
notifications_clean_all();
|
||||
location.reload();
|
||||
},
|
||||
"json"
|
||||
)
|
||||
.fail(function(xhr, textStatus, errorThrown){
|
||||
console.error(
|
||||
"Failed to mark al notification as read. Error: ",
|
||||
xhr.responseText
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function filter_notification() {
|
||||
let notification_type = '';
|
||||
$('.notification-item').hide();
|
||||
$(".checkbox_filter_notifications:checkbox:checked").each(function() {
|
||||
notification_type = $(this).val();
|
||||
console.log(notification_type);
|
||||
$('.notification-item[value='+notification_type+']').show();
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
});
|
||||
|
||||
if (notification_type == 'All'){
|
||||
$('.notification-item').show();
|
||||
}
|
||||
|
||||
if (notification_type == ''){
|
||||
$('.notification-item').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function click_on_notification_toast(event) {
|
||||
var match = /notification-(.*)-id-([0-9]+)/.exec(event.target.id);
|
||||
if (!match) {
|
||||
@ -960,8 +986,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
<?php if (enterprise_installed()) { ?>
|
||||
// Feedback.
|
||||
$("#feedback-header").click(function () {
|
||||
// Clean DOM.
|
||||
$("#feedback-header").empty();
|
||||
// Function charge Modal.
|
||||
show_feedback();
|
||||
});
|
||||
@ -1067,6 +1091,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).click(function(event) {
|
||||
if (!$(event.target).closest('#modal-help-content').length &&
|
||||
$('#modal_help').hasClass('invisible') === false) {
|
||||
$('#modal_help').addClass('invisible');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal-help-content').on('click', (e) => {
|
||||
if($(e.target).prop('tagName') === 'A') {
|
||||
$('#modal_help').addClass('invisible');
|
||||
} else {
|
||||
$('#modal_help').removeClass('invisible');
|
||||
}
|
||||
});
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
|
||||
echo '<style>
|
||||
:root {';
|
||||
if ($config['style'] === 'pandora') {
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
|
||||
echo '--login-background-color: rgba(255, 255, 255, 0.50);';
|
||||
echo '--login-label-color: #545454;';
|
||||
echo '--login-text-color: #000;';
|
||||
$style_theme = 'white-theme';
|
||||
@ -237,16 +237,18 @@ if (is_metaconsole() === true) {
|
||||
);
|
||||
}
|
||||
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'enterprise/images/custom_logo_login/'.$config['custom_logo_login'];
|
||||
if (!isset($config['custom_logo_login'])) {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
} else {
|
||||
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'images/custom_logo_login/'.$config['custom_logo_login'];
|
||||
if (empty($config['custom_logo_login']) === true) {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
} else {
|
||||
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,7 +216,9 @@ if ($create_agent) {
|
||||
$server_name = (string) get_parameter_post('server_name');
|
||||
$id_os = (int) get_parameter_post('id_os');
|
||||
$disabled = (int) get_parameter_post('disabled');
|
||||
$custom_id = (string) get_parameter_post('custom_id', '');
|
||||
$custom_id_safe_output = strip_tags(io_safe_output(get_parameter('custom_id', '')));
|
||||
$custom_id = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $custom_id_safe_output)));
|
||||
// $custom_id = (string) get_parameter_post('custom_id', '');
|
||||
$cascade_protection = (int) get_parameter_post('cascade_protection', 0);
|
||||
$cascade_protection_module = (int) get_parameter_post('cascade_protection_module', 0);
|
||||
$safe_mode = (int) get_parameter_post('safe_mode', 0);
|
||||
@ -999,7 +1001,9 @@ if ($update_agent) {
|
||||
$disabled = (bool) get_parameter_post('disabled');
|
||||
$server_name = (string) get_parameter_post('server_name', '');
|
||||
$id_parent = (int) get_parameter_post('id_agent_parent');
|
||||
$custom_id = (string) get_parameter_post('custom_id', '');
|
||||
$custom_id_safe_output = strip_tags(io_safe_output(get_parameter('custom_id', '')));
|
||||
$custom_id = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $custom_id_safe_output)));
|
||||
// $custom_id = (string) get_parameter_post('custom_id', '');
|
||||
$cascade_protection = (int) get_parameter_post('cascade_protection', 0);
|
||||
$cascade_protection_module = (int) get_parameter('cascade_protection_module', 0);
|
||||
$safe_mode_module = (int) get_parameter('safe_mode_module', 0);
|
||||
@ -1471,13 +1475,13 @@ if ($update_module === true || $create_module === true) {
|
||||
$plugin_pass = io_input_password(
|
||||
(string) get_parameter('snmp3_auth_pass')
|
||||
);
|
||||
$plugin_parameter = (string) get_parameter('snmp3_auth_method');
|
||||
$plugin_parameter = (string) get_parameter('snmp3_auth_method', 'MD5');
|
||||
|
||||
$custom_string_1 = (string) get_parameter('snmp3_privacy_method');
|
||||
$custom_string_1 = (string) get_parameter('snmp3_privacy_method', 'DES');
|
||||
$custom_string_2 = io_input_password(
|
||||
(string) get_parameter('snmp3_privacy_pass')
|
||||
);
|
||||
$custom_string_3 = (string) get_parameter('snmp3_security_level');
|
||||
$custom_string_3 = (string) get_parameter('snmp3_security_level', 'noAuthNoPriv');
|
||||
} else if ($id_module_type >= 34 && $id_module_type <= 37) {
|
||||
$tcp_send = (string) get_parameter('command_text');
|
||||
$custom_string_1 = (string) get_parameter(
|
||||
|
@ -459,10 +459,10 @@ if ($id_agent_module) {
|
||||
$snmp_version = 1;
|
||||
$snmp3_auth_user = '';
|
||||
$snmp3_auth_pass = '';
|
||||
$snmp3_auth_method = '';
|
||||
$snmp3_privacy_method = '';
|
||||
$snmp3_auth_method = 'MD5';
|
||||
$snmp3_privacy_method = 'DES';
|
||||
$snmp3_privacy_pass = '';
|
||||
$snmp3_security_level = '';
|
||||
$snmp3_security_level = 'noAuthNoPriv';
|
||||
|
||||
// For Remote CMD.
|
||||
$command_text = '';
|
||||
|
@ -405,7 +405,22 @@ push_table_simple($data, 'field_snmpv3_row1');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Privacy method');
|
||||
$data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true, false, false, '', $disabledBecauseInPolicy);
|
||||
$data[1] = html_print_select(
|
||||
[
|
||||
'DES' => __('DES'),
|
||||
'AES' => __('AES'),
|
||||
],
|
||||
'snmp3_privacy_method',
|
||||
$snmp3_privacy_method,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||
$data[3] = html_print_input_password(
|
||||
'snmp3_privacy_pass',
|
||||
|
@ -1558,7 +1558,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
$all_modules = true;
|
||||
}
|
||||
|
||||
if ($all_common_modules === true) {
|
||||
if ($all_common_modules === true || $all_modules === true) {
|
||||
$module_names = explode(',', get_parameter('all_common_modules'));
|
||||
}
|
||||
|
||||
@ -1602,7 +1602,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
foreach ($agents as $agent_id) {
|
||||
$agent_id = (int) $agent_id;
|
||||
// Check module belongs to the agent.
|
||||
if ($modules_selection_mode == 'all' && $all_modules === false) {
|
||||
if ($modules_selection_mode == 'all' && ($all_modules === false || $all_modules === true)) {
|
||||
$check = false;
|
||||
foreach ($module_names as $module_name) {
|
||||
$check_module = modules_get_agentmodule_id(
|
||||
@ -1666,7 +1666,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
||||
);
|
||||
}
|
||||
|
||||
if ($result !== false && (bool) $all_modules === false) {
|
||||
if ($result !== false && ((bool) $all_modules === false || (bool) $all_modules === true)) {
|
||||
foreach ($module_names as $module_name) {
|
||||
$module = modules_get_agentmodule_id(
|
||||
$module_name,
|
||||
|
@ -89,7 +89,7 @@ if (is_ajax() === true) {
|
||||
[
|
||||
'id' => 'agent_modules_affected_planned_downtime',
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'style' => 'width: 99%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'godmode/agentes/planned_downtime.list',
|
||||
@ -730,7 +730,7 @@ if ($downtimes === false && $filter_performed === false) {
|
||||
$table->cellstyle = [];
|
||||
|
||||
$table->head = [];
|
||||
$table->head['name'] = __('Name #Ag.');
|
||||
$table->head['name'] = __('Name (Ag.)');
|
||||
$table->head['description'] = __('Description');
|
||||
$table->head['group'] = __('Group');
|
||||
$table->head['type'] = __('Type');
|
||||
|
@ -97,7 +97,7 @@ if (is_ajax()) {
|
||||
|
||||
if (!empty($field_description)) {
|
||||
// If the value is 5, this because severity in snmp alerts is not permit to show.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
if (($i > 5) && ($command['id'] === 3)) {
|
||||
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
|
||||
__('Field %s'),
|
||||
($i - 1)
|
||||
@ -118,7 +118,7 @@ if (is_ajax()) {
|
||||
}
|
||||
} else {
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it.
|
||||
if (($i > 5) && ($command['id'] == 3)) {
|
||||
if (($i > 5) && ($command['id'] === 3)) {
|
||||
if (substr_count($command['command'], '_field'.($i - 1).'_') > 0) {
|
||||
$fdesc = sprintf(__('Field %s'), ($i - 1));
|
||||
} else {
|
||||
|
284
pandora_console/godmode/massive/massive_add_policies_alerts.php
Normal file
284
pandora_console/godmode/massive/massive_add_policies_alerts.php
Normal file
@ -0,0 +1,284 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access massive alert deletion'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
if (is_ajax() === true) {
|
||||
$load_policies = get_parameter('load_policies', 0);
|
||||
$load_alerts_policies = get_parameter('load_alerts_policies', 0);
|
||||
|
||||
if ($load_policies) {
|
||||
$id_group = get_parameter('id_group', 0);
|
||||
if ($id_group !== '0') {
|
||||
$filter['force_id_group'] = $id_group;
|
||||
$arr_policies = policies_get_policies($filter);
|
||||
} else {
|
||||
$arr_policies = policies_get_policies();
|
||||
}
|
||||
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
echo json_encode($policies, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_alerts_policies) {
|
||||
$ids_policies = get_parameter('policies', []);
|
||||
|
||||
$alerts = [];
|
||||
foreach ($ids_policies as $policie) {
|
||||
foreach (policies_get_alerts($policie, ['id_policy_module' => '<>0']) as $row) {
|
||||
$alerts[$row['id']] = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.policies_get_module_name($row['id_policy_module']));
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($alerts, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$add = (bool) get_parameter_post('add');
|
||||
|
||||
if ($add) {
|
||||
$array_alerts = (array) get_parameter('id_alerts');
|
||||
$array_actions = (array) get_parameter('action');
|
||||
$fires_min = (int) get_parameter('fires_min', 0);
|
||||
$fires_max = (int) get_parameter('fires_max', 0);
|
||||
|
||||
if (empty($array_alerts) === false) {
|
||||
foreach ($array_alerts as $id_alert) {
|
||||
foreach ($array_actions as $action) {
|
||||
$id_policy_alert = db_get_value('id_policy_alert', 'tpolicy_alerts_actions', 'id', $action);
|
||||
$result = policies_add_action_alert($id_alert, $action, $fires_min, $fires_max);
|
||||
}
|
||||
}
|
||||
|
||||
ui_print_result_message($result, __('Add action successfully'), __('Could not be added'), '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_table';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; vertical-align:top';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align:top';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'id_group',
|
||||
0,
|
||||
'',
|
||||
'All',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('recursion', 1, $recursion, true, false, '', true)
|
||||
);
|
||||
|
||||
$arr_policies = policies_get_policies();
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Policies'),
|
||||
html_print_select(
|
||||
$policies,
|
||||
'id_policies[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_alerts[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
$actions = alerts_get_alert_actions();
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Action'),
|
||||
html_print_select(
|
||||
$actions,
|
||||
'action[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Number of matching alerts'),
|
||||
'<div>'.html_print_input_text('fires_min', 0, '', false, 10, true, false, false, '', 'w30p').'<span class="margin-lr-10">'.__('to').'</span>'.html_print_input_text('fires_max', 0, '', false, 10, true, false, false, '', 'w30p').'</div>'
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('add', 'add', $table->width, false, $SelectAction);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
$('#id_group').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_add_policies_alerts',
|
||||
load_policies: 1,
|
||||
id_group: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_policies').html(options);
|
||||
} else {
|
||||
$('#id_policies').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
$('#id_policies').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#id_policies').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_add_policies_alerts',
|
||||
load_alerts_policies: 1,
|
||||
policies: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_alerts').html(options);
|
||||
} else {
|
||||
$('#id_alerts').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$("form").submit(function(e){
|
||||
var id_policies = $('#id_policies :selected').val();
|
||||
var id_alerts = $('#id_alerts :selected').val();
|
||||
var action = $('#action :selected').val();
|
||||
|
||||
if ($.isEmptyObject(id_policies) || $.isEmptyObject(id_alerts) || $.isEmptyObject(action) || id_policies === '0' || id_alerts === '0'){
|
||||
e.preventDefault();
|
||||
alert('<?php echo __('Policies, Alerts and Action must to be selected'); ?>');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
@ -0,0 +1,288 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access massive alert deletion'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
if (is_ajax() === true) {
|
||||
$load_policies = get_parameter('load_policies', 0);
|
||||
$load_alerts_policies = get_parameter('load_alerts_policies', 0);
|
||||
|
||||
if ($load_policies) {
|
||||
$id_group = get_parameter('id_group', 0);
|
||||
if ($id_group !== '0') {
|
||||
$filter['force_id_group'] = $id_group;
|
||||
$arr_policies = policies_get_policies($filter);
|
||||
} else {
|
||||
$arr_policies = policies_get_policies();
|
||||
}
|
||||
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
echo json_encode($policies, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_alerts_policies) {
|
||||
$ids_policies = get_parameter('policies', []);
|
||||
|
||||
$alerts = [];
|
||||
foreach ($ids_policies as $policie) {
|
||||
$array_alerts = policies_get_alerts(
|
||||
$policie,
|
||||
['id_policy_module' => '0']
|
||||
);
|
||||
foreach ($array_alerts as $row) {
|
||||
$alerts[$row['id']] = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.$row['name_extern_module']);
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($alerts, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$add = (bool) get_parameter_post('add');
|
||||
|
||||
if ($add) {
|
||||
$array_alerts = (array) get_parameter('id_alerts');
|
||||
$array_actions = (array) get_parameter('action');
|
||||
$fires_min = (int) get_parameter('fires_min', 0);
|
||||
$fires_max = (int) get_parameter('fires_max', 0);
|
||||
|
||||
if (empty($array_alerts) === false) {
|
||||
foreach ($array_alerts as $id_alert) {
|
||||
foreach ($array_actions as $action) {
|
||||
$id_policy_alert = db_get_value('id_policy_alert', 'tpolicy_alerts_actions', 'id', $action);
|
||||
$result = policies_add_action_alert($id_alert, $action, $fires_min, $fires_max);
|
||||
}
|
||||
}
|
||||
|
||||
ui_print_result_message($result, __('Add action successfully'), __('Could not be added'), '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_table';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; vertical-align:top';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align:top';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'id_group',
|
||||
0,
|
||||
'',
|
||||
'All',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:180px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('recursion', 1, $recursion, true, false, '', true)
|
||||
);
|
||||
|
||||
$arr_policies = policies_get_policies();
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Policies'),
|
||||
html_print_select(
|
||||
$policies,
|
||||
'id_policies[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_alerts[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
$actions = alerts_get_alert_actions();
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Action'),
|
||||
html_print_select(
|
||||
$actions,
|
||||
'action[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Number of matching alerts'),
|
||||
'<div>'.html_print_input_text('fires_min', 0, '', false, 10, true, false, false, '', 'w30p').'<span class="margin-lr-10">'.__('to').'</span>'.html_print_input_text('fires_max', 0, '', false, 10, true, false, false, '', 'w30p').'</div>'
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('add', 'add', $table->width, false, $SelectAction);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
$('#id_group').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_add_policies_alerts_action_external',
|
||||
load_policies: 1,
|
||||
id_group: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_policies').html(options);
|
||||
} else {
|
||||
$('#id_policies').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
$('#id_policies').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#id_policies').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_add_policies_alerts_action_external',
|
||||
load_alerts_policies: 1,
|
||||
policies: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_alerts').html(options);
|
||||
} else {
|
||||
$('#id_alerts').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$("form").submit(function(e){
|
||||
var id_policies = $('#id_policies :selected').val();
|
||||
var id_alerts = $('#id_alerts :selected').val();
|
||||
var action = $('#action :selected').val();
|
||||
|
||||
if ($.isEmptyObject(id_policies) || $.isEmptyObject(id_alerts) || $.isEmptyObject(action) || id_policies === '0' || id_alerts === '0'){
|
||||
e.preventDefault();
|
||||
alert('<?php echo __('Policies, Alerts and Action must to be selected'); ?>');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access massive alert deletion'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
if (is_ajax() === true) {
|
||||
$load_policies = get_parameter('load_policies', 0);
|
||||
$load_alerts_policies = get_parameter('load_alerts_policies', 0);
|
||||
$load_actions_alerts = get_parameter('load_actions_alerts', 0);
|
||||
|
||||
if ($load_policies) {
|
||||
$id_group = get_parameter('id_group', 0);
|
||||
if ($id_group !== '0') {
|
||||
$filter['force_id_group'] = $id_group;
|
||||
$arr_policies = policies_get_policies($filter);
|
||||
} else {
|
||||
$arr_policies = policies_get_policies();
|
||||
}
|
||||
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
echo json_encode($policies, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_alerts_policies) {
|
||||
$ids_policies = get_parameter('policies', []);
|
||||
|
||||
$alerts = [];
|
||||
foreach ($ids_policies as $policie) {
|
||||
foreach (policies_get_alerts($policie, ['id_policy_module' => '<>0']) as $row) {
|
||||
$name = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.policies_get_module_name($row['id_policy_module']));
|
||||
$alerts[$row['id'].'__'.policies_get_name($policie).' - '.$name] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($alerts, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_actions_alerts) {
|
||||
$array_alerts = get_parameter('id_alerts', []);
|
||||
|
||||
$actions = [];
|
||||
foreach ($array_alerts as $alert) {
|
||||
$alert_policie = explode('__', $alert);
|
||||
$alert_id = $alert_policie[0];
|
||||
$alert_name = $alert_policie[1];
|
||||
$array_actions = db_get_all_rows_filter(
|
||||
'tpolicy_alerts_actions',
|
||||
['id_policy_alert' => $alert]
|
||||
);
|
||||
foreach ($array_actions as $row) {
|
||||
$action = db_get_row_filter(
|
||||
'talert_actions',
|
||||
['id' => $row['id_alert_action']]
|
||||
);
|
||||
$actions[$row['id']] = $alert_name.' - '.$action['name'];
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($actions, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$delete = (bool) get_parameter_post('delete');
|
||||
|
||||
if ($delete) {
|
||||
$array_actions = get_parameter('id_actions');
|
||||
foreach ($array_actions as $id_action) {
|
||||
$result = policies_delete_action_alert($id_action);
|
||||
}
|
||||
|
||||
ui_print_result_message($result, __('Deleted action successfully'), __('Could not be deleted'), '');
|
||||
}
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_table';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; vertical-align:top';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align:top';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'id_group',
|
||||
0,
|
||||
'',
|
||||
'All',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:180px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('recursion', 1, $recursion, true, false, '', true)
|
||||
);
|
||||
|
||||
$arr_policies = policies_get_policies();
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Policies'),
|
||||
html_print_select(
|
||||
$policies,
|
||||
'id_policies[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_alerts[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Actions'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_actions[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
$('#id_group').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts',
|
||||
load_policies: 1,
|
||||
id_group: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_policies').html(options);
|
||||
} else {
|
||||
$('#id_policies').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
$('#id_policies').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#id_policies').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts',
|
||||
load_alerts_policies: 1,
|
||||
policies: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_alerts').html(options);
|
||||
} else {
|
||||
$('#id_alerts').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#id_alerts').change(function(){
|
||||
var data = $(this).val();
|
||||
if (data !== 0){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts',
|
||||
load_actions_alerts: 1,
|
||||
id_alerts: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_actions').html(options);
|
||||
} else {
|
||||
$('#id_actions').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$("form").submit(function(e){
|
||||
var id_policies = $('#id_policies :selected').val();
|
||||
var id_alerts = $('#id_alerts :selected').val();
|
||||
var id_actions = $('#id_actions :selected').val();
|
||||
|
||||
if ($.isEmptyObject(id_policies) || $.isEmptyObject(id_alerts) || $.isEmptyObject(id_actions) || id_policies === '0' || id_alerts === '0'){
|
||||
e.preventDefault();
|
||||
alert('<?php echo __('Policies, Alerts and Action must to be selected'); ?>');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Extensions
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access massive alert deletion'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
|
||||
if (is_ajax() === true) {
|
||||
$load_policies = get_parameter('load_policies', 0);
|
||||
$load_alerts_policies = get_parameter('load_alerts_policies', 0);
|
||||
$load_actions_alerts = get_parameter('load_actions_alerts', 0);
|
||||
|
||||
if ($load_policies) {
|
||||
$id_group = get_parameter('id_group', 0);
|
||||
if ($id_group !== '0') {
|
||||
$filter['force_id_group'] = $id_group;
|
||||
$arr_policies = policies_get_policies($filter);
|
||||
} else {
|
||||
$arr_policies = policies_get_policies();
|
||||
}
|
||||
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
echo json_encode($policies, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_alerts_policies) {
|
||||
$ids_policies = get_parameter('policies', []);
|
||||
|
||||
$alerts = [];
|
||||
foreach ($ids_policies as $policie) {
|
||||
foreach (policies_get_alerts($policie, ['id_policy_module' => '0']) as $row) {
|
||||
$name = io_safe_output(alerts_get_alert_template_name($row['id_alert_template']).' - '.$row['name_extern_module']);
|
||||
$alerts[$row['id'].'__'.policies_get_name($policie).' - '.$name] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($alerts, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_actions_alerts) {
|
||||
$array_alerts = get_parameter('id_alerts', []);
|
||||
|
||||
$actions = [];
|
||||
foreach ($array_alerts as $alert) {
|
||||
$alert_policie = explode('__', $alert);
|
||||
$alert_id = $alert_policie[0];
|
||||
$alert_name = $alert_policie[1];
|
||||
$array_actions = db_get_all_rows_filter(
|
||||
'tpolicy_alerts_actions',
|
||||
['id_policy_alert' => $alert]
|
||||
);
|
||||
foreach ($array_actions as $row) {
|
||||
$action = db_get_row_filter(
|
||||
'talert_actions',
|
||||
['id' => $row['id_alert_action']]
|
||||
);
|
||||
$actions[$row['id']] = $alert_name.' - '.$action['name'];
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($actions, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$delete = (bool) get_parameter_post('delete');
|
||||
|
||||
if ($delete) {
|
||||
$array_actions = get_parameter('id_actions');
|
||||
foreach ($array_actions as $id_action) {
|
||||
$result = policies_delete_action_alert($id_action);
|
||||
}
|
||||
|
||||
ui_print_result_message($result, __('Deleted action successfully'), __('Could not be deleted'), '');
|
||||
}
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_table';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; vertical-align:top';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align:top';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AW',
|
||||
true,
|
||||
'id_group',
|
||||
0,
|
||||
'',
|
||||
'All',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:180px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group recursion'),
|
||||
html_print_checkbox('recursion', 1, $recursion, true, false, '', true)
|
||||
);
|
||||
|
||||
$arr_policies = policies_get_policies();
|
||||
$policies = [];
|
||||
foreach ($arr_policies as $row) {
|
||||
$policies[$row['id']] = $row['name'];
|
||||
}
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Policies'),
|
||||
html_print_select(
|
||||
$policies,
|
||||
'id_policies[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Alerts'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_alerts[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->colspan[2][0] = 2;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Actions'),
|
||||
html_print_select(
|
||||
[],
|
||||
'id_actions[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%;'
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
|
||||
html_print_table($table);
|
||||
|
||||
attachActionButton('delete', 'delete', $table->width, false, $SelectAction);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
$('#id_group').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts_action_external',
|
||||
load_policies: 1,
|
||||
id_group: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_policies').html(options);
|
||||
} else {
|
||||
$('#id_policies').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
$('#id_policies').trigger('change');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#id_policies').change(function(){
|
||||
var data = $(this).val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts_action_external',
|
||||
load_alerts_policies: 1,
|
||||
policies: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_alerts').html(options);
|
||||
} else {
|
||||
$('#id_alerts').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#id_alerts').change(function(){
|
||||
var data = $(this).val();
|
||||
if (data !== 0){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: 'godmode/massive/massive_delete_policies_alerts_action_external',
|
||||
load_actions_alerts: 1,
|
||||
id_alerts: data,
|
||||
},
|
||||
success: function(data) {
|
||||
var data = $.parseJSON(data);
|
||||
var options = '';
|
||||
$.each( data, function( id, name ) {
|
||||
options += '<option value="'+id+'">'+name+'</option>';
|
||||
});
|
||||
if (options!== ''){
|
||||
$('#id_actions').html(options);
|
||||
} else {
|
||||
$('#id_actions').html('<option value="0"><?php echo __('None'); ?></option>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
$("form").submit(function(e){
|
||||
var id_policies = $('#id_policies :selected').val();
|
||||
var id_alerts = $('#id_alerts :selected').val();
|
||||
var id_actions = $('#id_actions :selected').val();
|
||||
|
||||
if ($.isEmptyObject(id_policies) || $.isEmptyObject(id_alerts) || $.isEmptyObject(id_actions) || id_policies === '0' || id_alerts === '0'){
|
||||
e.preventDefault();
|
||||
alert('<?php echo __('Policies, Alerts and Action must to be selected'); ?>');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
</script>
|
@ -371,7 +371,6 @@ $autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail';
|
||||
$autorefresh_list_out['enterprise/operation/services/services'] = 'Services';
|
||||
$autorefresh_list_out['operation/dashboard/dashboard'] = 'Dashboard';
|
||||
|
||||
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map';
|
||||
$autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console';
|
||||
$autorefresh_list_out['operation/events/events'] = 'Events';
|
||||
|
||||
|
@ -64,6 +64,16 @@ $options_alerts = [
|
||||
'standby_alerts' => __('Bulk alert setting standby'),
|
||||
];
|
||||
|
||||
$options_alerts_policies = [
|
||||
'add_policies_alerts' => __('Bulk policies alert action add'),
|
||||
'delete_policies_alerts' => __('Bulk policies alert action delete'),
|
||||
];
|
||||
|
||||
$options_policies_alerts_externals = [
|
||||
'add_policies_alerts_action_external' => __('Bulk policies external alert action add'),
|
||||
'delete_policies_alerts_action_external' => __('Bulk policies external alert action delete'),
|
||||
];
|
||||
|
||||
$options_agents = [
|
||||
'edit_agents' => __('Bulk agent edit'),
|
||||
'delete_agents' => __('Bulk agent delete'),
|
||||
@ -119,6 +129,10 @@ if ($satellite_options != ENTERPRISE_NOT_HOOK) {
|
||||
|
||||
if (in_array($option, array_keys($options_alerts)) === true) {
|
||||
$tab = 'massive_alerts';
|
||||
} else if (in_array($option, array_keys($options_alerts_policies)) === true) {
|
||||
$tab = 'massive_policies_alerts';
|
||||
} else if (in_array($option, array_keys($options_policies_alerts_externals)) === true) {
|
||||
$tab = 'massive_policies_alerts_external';
|
||||
} else if (in_array($option, array_keys($options_agents)) === true) {
|
||||
$tab = 'massive_agents';
|
||||
} else if (in_array($option, array_keys($options_users)) === true) {
|
||||
@ -173,6 +187,14 @@ switch ($tab) {
|
||||
$options = $options_alerts;
|
||||
break;
|
||||
|
||||
case 'massive_policies_alerts':
|
||||
$options = $options_alerts_policies;
|
||||
break;
|
||||
|
||||
case 'massive_policies_alerts_external':
|
||||
$options = $options_policies_alerts_externals;
|
||||
break;
|
||||
|
||||
case 'massive_agents':
|
||||
$options = $options_agents;
|
||||
break;
|
||||
@ -223,6 +245,30 @@ $alertstab = [
|
||||
'active' => $tab == 'massive_alerts',
|
||||
];
|
||||
|
||||
$policiesalertstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_policies_alerts">'.html_print_image(
|
||||
'images/policies_mc.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Policies alerts'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_policies_alerts',
|
||||
];
|
||||
|
||||
$policiesalertsexternaltab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_policies_alerts_external">'.html_print_image(
|
||||
'images/alerts_extern.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Policies external alerts'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $tab == 'massive_policies_alerts_external',
|
||||
];
|
||||
|
||||
$userstab = [
|
||||
'text' => '<a href="'.$url.'&tab=massive_users">'.html_print_image(
|
||||
'images/user.svg',
|
||||
@ -298,6 +344,8 @@ if (check_acl($config['id_user'], 0, 'UM')) {
|
||||
}
|
||||
|
||||
$onheader['massive_alerts'] = $alertstab;
|
||||
$onheader['massive_policies_alerts'] = $policiesalertstab;
|
||||
$onheader['massive_policies_alerts_external'] = $policiesalertsexternaltab;
|
||||
$onheader['policies'] = $policiestab;
|
||||
$onheader['snmp'] = $snmptab;
|
||||
$onheader['satellite'] = $satellitetab;
|
||||
@ -318,6 +366,8 @@ if (is_metaconsole() === false) {
|
||||
$pluginstab,
|
||||
$userstab,
|
||||
$alertstab,
|
||||
$policiesalertstab,
|
||||
$policiesalertsexternaltab,
|
||||
$policiestab,
|
||||
$snmptab,
|
||||
$satellitetab,
|
||||
@ -490,6 +540,22 @@ switch ($option) {
|
||||
include_once $config['homedir'].'/godmode/massive/massive_standby_alerts.php';
|
||||
break;
|
||||
|
||||
case 'add_policies_alerts':
|
||||
include_once $config['homedir'].'/godmode/massive/massive_add_policies_alerts.php';
|
||||
break;
|
||||
|
||||
case 'delete_policies_alerts':
|
||||
include_once $config['homedir'].'/godmode/massive/massive_delete_policies_alerts.php';
|
||||
break;
|
||||
|
||||
case 'add_policies_alerts_action_external':
|
||||
include_once $config['homedir'].'/godmode/massive/massive_add_policies_alerts_action_external.php';
|
||||
break;
|
||||
|
||||
case 'delete_policies_alerts_action_external':
|
||||
include_once $config['homedir'].'/godmode/massive/massive_delete_policies_alerts_action_external.php';
|
||||
break;
|
||||
|
||||
case 'add_profiles':
|
||||
include_once $config['homedir'].'/godmode/massive/massive_add_profiles.php';
|
||||
break;
|
||||
|
@ -309,6 +309,8 @@ if ($access_console_node === true) {
|
||||
}
|
||||
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_alerts']['text'] = __('Alerts operations');
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_policies_alerts']['text'] = __('Policies alerts');
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_policies_alerts_external']['text'] = __('Policies External alerts');
|
||||
enterprise_hook('massivepolicies_submenu');
|
||||
enterprise_hook('massivesnmp_submenu');
|
||||
enterprise_hook('massivesatellite_submenu');
|
||||
|
@ -190,14 +190,21 @@ $output .= html_print_label_input_block(
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
'w100p',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
)
|
||||
);
|
||||
$output .= "</td><td class='datos2' width='50%'>";
|
||||
|
@ -1272,36 +1272,58 @@ $class = 'databox filters';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (is_metaconsole() === true) {
|
||||
?>
|
||||
<tr id="row_servers_all" class="datos">
|
||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
if ($meta) {
|
||||
?>
|
||||
html_print_select(
|
||||
$servers,
|
||||
'combo_server_all',
|
||||
$server_name,
|
||||
'',
|
||||
__('All nodes'),
|
||||
'all'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($meta) {
|
||||
?>
|
||||
<tr id="row_multiple_servers" class="datos">
|
||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
$server_ids = [];
|
||||
$server_ids[0] = __('Local metaconsole');
|
||||
$get_servers = metaconsole_get_servers();
|
||||
foreach ($get_servers as $key => $server) {
|
||||
$server_ids[$server['id']] = $server['server_name'];
|
||||
}
|
||||
<?php
|
||||
$server_ids = [];
|
||||
$server_ids[0] = __('Local metaconsole');
|
||||
$get_servers = metaconsole_get_servers();
|
||||
foreach ($get_servers as $key => $server) {
|
||||
$server_ids[$server['id']] = $server['server_name'];
|
||||
}
|
||||
|
||||
html_print_select(
|
||||
$server_ids,
|
||||
'server_multiple[]',
|
||||
$server_multiple,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
html_print_select(
|
||||
$server_ids,
|
||||
'server_multiple[]',
|
||||
$server_multiple,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="row_label" class="datos">
|
||||
<td class="bolder">
|
||||
@ -1421,10 +1443,21 @@ $class = 'databox filters';
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
10
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -1444,10 +1477,21 @@ $class = 'databox filters';
|
||||
html_print_extended_select_for_time(
|
||||
'period_range',
|
||||
$period_range,
|
||||
'',
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
10
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period_range\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -1487,10 +1531,21 @@ $class = 'databox filters';
|
||||
html_print_extended_select_for_time(
|
||||
'period1',
|
||||
$period_pg,
|
||||
'',
|
||||
'check_period_warning(this)',
|
||||
'',
|
||||
'0',
|
||||
10
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -1506,10 +1561,21 @@ $class = 'databox filters';
|
||||
html_print_extended_select_for_time(
|
||||
'period2',
|
||||
$projection_period,
|
||||
'',
|
||||
'check_period_warning(this)',
|
||||
'',
|
||||
'0',
|
||||
10
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -3440,7 +3506,7 @@ $class = 'databox filters';
|
||||
html_print_extended_select_for_time(
|
||||
'lapse',
|
||||
$lapse,
|
||||
'',
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
__('None'),
|
||||
'0',
|
||||
10,
|
||||
@ -3448,7 +3514,13 @@ $class = 'databox filters';
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
!$lapse_calc
|
||||
!$lapse_calc,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'lapse\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -6495,6 +6567,7 @@ function chooseType() {
|
||||
$("#row_alert_actions").hide();
|
||||
$("#row_servers").hide();
|
||||
$("#row_servers_all_opt").hide();
|
||||
$("#row_servers_all").hide();
|
||||
$("#row_multiple_servers").hide();
|
||||
$("#row_sort").hide();
|
||||
$("#row_date").hide();
|
||||
@ -7059,7 +7132,7 @@ function chooseType() {
|
||||
|
||||
case 'group_report':
|
||||
$("#row_group").show();
|
||||
$("#row_servers_all_opt").show();
|
||||
$("#row_servers_all").show();
|
||||
$("#row_description").show();
|
||||
$("#row_historical_db_check").hide();
|
||||
break;
|
||||
|
@ -1986,7 +1986,7 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'group_report':
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
$values['server_name'] = get_parameter('combo_server_all');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
@ -2862,7 +2862,7 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'group_report':
|
||||
$values['server_name'] = get_parameter('combo_server');
|
||||
$values['server_name'] = get_parameter('combo_server_all');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
|
@ -555,6 +555,7 @@ switch ($activeTab) {
|
||||
$type = (int) get_parameter('type', STATIC_GRAPH);
|
||||
$image = get_parameter('image');
|
||||
$range = (int) get_parameter('range', 50);
|
||||
$range_vertical = (int) get_parameter('range_vertical', 50);
|
||||
$width = (int) get_parameter('width', 0);
|
||||
$height = (int) get_parameter('height', 0);
|
||||
$period = (int) get_parameter('period', 0);
|
||||
@ -567,6 +568,9 @@ switch ($activeTab) {
|
||||
$label_type = get_parameter('label_type', 'agent_module');
|
||||
$enable_link = get_parameter('enable_link', 'enable_link');
|
||||
$show_on_top = get_parameter('show_on_top', 0);
|
||||
$pos_x = get_parameter('pos_x', 0);
|
||||
$pos_y = get_parameter('pos_y', 0);
|
||||
$max_elements_row = (int) get_parameter('max_elements_row', 0);
|
||||
|
||||
// This var switch between creation of items, item_per_agent = 0 => item per module; item_per_agent <> 0 => item per agent
|
||||
$item_per_agent = get_parameter('item_per_agent', 0);
|
||||
@ -611,6 +615,7 @@ switch ($activeTab) {
|
||||
$image,
|
||||
$idVisualConsole,
|
||||
$range,
|
||||
$range_vertical,
|
||||
$width,
|
||||
$height,
|
||||
$period,
|
||||
@ -626,7 +631,10 @@ switch ($activeTab) {
|
||||
$kind_relationship,
|
||||
$item_in_the_map,
|
||||
$fontf,
|
||||
$fonts
|
||||
$fonts,
|
||||
$pos_x,
|
||||
$pos_y,
|
||||
$max_elements_row
|
||||
);
|
||||
|
||||
$statusProcessInDB = [
|
||||
@ -668,6 +676,7 @@ switch ($activeTab) {
|
||||
$image,
|
||||
$idVisualConsole,
|
||||
$range,
|
||||
$range_vertical,
|
||||
$width,
|
||||
$height,
|
||||
$period,
|
||||
@ -683,7 +692,10 @@ switch ($activeTab) {
|
||||
$kind_relationship,
|
||||
$item_in_the_map,
|
||||
$fontf,
|
||||
$fonts
|
||||
$fonts,
|
||||
$pos_x,
|
||||
$pos_y,
|
||||
$max_elements_row
|
||||
);
|
||||
} else {
|
||||
$id_modules = [];
|
||||
@ -722,6 +734,7 @@ switch ($activeTab) {
|
||||
$image,
|
||||
$idVisualConsole,
|
||||
$range,
|
||||
$range_vertical,
|
||||
$width,
|
||||
$height,
|
||||
$period,
|
||||
@ -737,7 +750,10 @@ switch ($activeTab) {
|
||||
$kind_relationship,
|
||||
$item_in_the_map,
|
||||
$fontf,
|
||||
$fonts
|
||||
$fonts,
|
||||
$pos_x,
|
||||
$pos_y,
|
||||
$max_elements_row
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -144,22 +144,28 @@ $table->data['all_0'][0] = html_print_label_input_block(
|
||||
|
||||
|
||||
$table->rowstyle['staticgraph'] = 'display: none;';
|
||||
$table->colspan['staticgraph'][0] = 2;
|
||||
$table->data['staticgraph'][0] = html_print_label_input_block(
|
||||
__('Image'),
|
||||
html_print_select(
|
||||
'<div class="flex">'.html_print_select(
|
||||
$images_list,
|
||||
'image',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 49%'
|
||||
).'<span id="image_prev" class="mrgn_lft_10px mrgn_top-10px"><img src="'.$config['homeurl'].'/images/console/icons/appliance_ok.png"></span></div>'
|
||||
);
|
||||
|
||||
$table->rowstyle['all_1'] = 'display: none;';
|
||||
$table->data['all_1'][0] = html_print_label_input_block(
|
||||
__('Range between elements (px)'),
|
||||
__('Horizontal range between elements (px)'),
|
||||
html_print_input_text(
|
||||
'range',
|
||||
50,
|
||||
@ -170,6 +176,18 @@ $table->data['all_1'][0] = html_print_label_input_block(
|
||||
)
|
||||
);
|
||||
|
||||
$table->data['all_1'][1] = html_print_label_input_block(
|
||||
__('Vertical range between elements (px)'),
|
||||
html_print_input_text(
|
||||
'range_vertical',
|
||||
50,
|
||||
'',
|
||||
5,
|
||||
5,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$input_size = __('Width').': ';
|
||||
$input_size .= html_print_input_text('width', 0, '', 5, 5, true);
|
||||
$input_size .= __('Height').': ';
|
||||
@ -425,6 +443,16 @@ if (is_metaconsole() === false) {
|
||||
);
|
||||
}
|
||||
|
||||
$table->data['all_4_01'][0] = html_print_label_input_block(
|
||||
__('Filter agents'),
|
||||
html_print_input_text('filter_agents', '', '', false, 255, true)
|
||||
);
|
||||
|
||||
$table->data['all_4_01'][1] = html_print_label_input_block(
|
||||
__('Filter modules'),
|
||||
html_print_input_text('filter_modules', '', '', false, 255, true)
|
||||
);
|
||||
|
||||
$table->rowstyle['all_4'] = 'display: none;';
|
||||
$table->data['all_4'][0] = html_print_label_input_block(
|
||||
__('Agents').ui_print_help_tip(
|
||||
@ -549,6 +577,16 @@ $table->data['all_8'][1] = html_print_label_input_block(
|
||||
).'</span>'
|
||||
);
|
||||
|
||||
$table->data['all_10'][0] = html_print_label_input_block(
|
||||
__('Max. elements for row'),
|
||||
html_print_input_text('max_elements_row', 0, '', false, 255, true)
|
||||
);
|
||||
|
||||
$table->data['all_10'][1] = html_print_label_input_block(
|
||||
__('Position'),
|
||||
'<div class="flex_center"><span class="mrgn_right_10px">X</span>'.html_print_input_text('pos_x', 0, '', false, 255, true, false, false, '', 'w50p').'<span class="margin-lr-10">Y</span>'.html_print_input_text('pos_y', 0, '', false, 255, true, false, false, '', 'w50p').'</div>'
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
@ -831,6 +869,44 @@ function item_per_agent_change(itemPerAgent) {
|
||||
function metaconsole_init() {
|
||||
$("#groups").change();
|
||||
}
|
||||
|
||||
$('#text-filter_agents').on('keyup',function(){
|
||||
if ($(this).val() !== ''){
|
||||
findInSelect('id_agents',$(this).val());
|
||||
} else {
|
||||
$('#id_agents option').each(function(){
|
||||
$(this).removeClass('invisible');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#text-filter_modules').on('keyup',function(){
|
||||
if ($(this).val() !== ''){
|
||||
findInSelect('module',$(this).val());
|
||||
} else {
|
||||
$('#module option').each(function(){
|
||||
$(this).removeClass('invisible');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function findInSelect(selectid, find){
|
||||
var select = $('#'+selectid+' option');
|
||||
select.each(function(){
|
||||
var regex = new RegExp(find, "gi");
|
||||
if ($(this).html().match(regex) === null) {
|
||||
$(this).addClass('invisible');
|
||||
} else {
|
||||
$(this).removeClass('invisible');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$('#image').on('change', function(){
|
||||
var img = $(this).val();
|
||||
$('#image_prev').html('<img src="<?php echo $config['homeurl']; ?>/images/console/icons/'+img+'.png">');
|
||||
})
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
select[name='kind_relationship'] option[disabled='disabled'] {
|
||||
|
@ -24,6 +24,14 @@ if (! check_acl($config['id_user'], 0, 'AR')
|
||||
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('pandora_fullcalendar');
|
||||
|
||||
|
||||
/**
|
||||
* Mask class names.
|
||||
@ -204,3 +212,115 @@ if ($classname_selected === null) {
|
||||
|
||||
Wizard::printBigButtonsList($wiz_data);
|
||||
}
|
||||
|
||||
$is_management_allowed = is_management_allowed();
|
||||
$task_id = get_parameter('task', '');
|
||||
if ($task_id !== '') {
|
||||
$task = db_get_row_filter(
|
||||
'tuser_task_scheduled',
|
||||
['id' => $task_id]
|
||||
);
|
||||
$args = unserialize($task['args']);
|
||||
$event_calendar = io_safe_output($args['weekly_schedule']);
|
||||
} else {
|
||||
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#table-new-job-3").hide();
|
||||
var edit = '<?php echo $task_id; ?>';
|
||||
if (edit != '') {
|
||||
exec_calendar();
|
||||
}
|
||||
|
||||
$("#scheduled").change(exec_calendar);
|
||||
|
||||
function exec_calendar() {
|
||||
if ($("#scheduled").val() == "weekly") {
|
||||
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
|
||||
var eventsBBDD = '<?php echo $event_calendar; ?>';
|
||||
var events = loadEventBBDD(eventsBBDD);
|
||||
var calendarEl = document.getElementById('calendar_map');
|
||||
|
||||
var options = {
|
||||
contentHeight: "auto",
|
||||
headerToolbar: {
|
||||
left: "",
|
||||
center: "",
|
||||
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
|
||||
},
|
||||
buttonText: {
|
||||
dayGridWeek: '<?php echo __('Simple'); ?>',
|
||||
timeGridWeek: '<?php echo __('Detailed'); ?>'
|
||||
},
|
||||
dayHeaderFormat: { weekday: "short" },
|
||||
initialView: "dayGridWeek",
|
||||
navLinks: false,
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
slotDuration: "01:00:00",
|
||||
slotLabelInterval: "02:00:00",
|
||||
snapDuration: "01:00:00",
|
||||
slotMinTime: "00:00:00",
|
||||
slotMaxTime: "24:00:00",
|
||||
scrollTime: "01:00:00",
|
||||
locale: "en-GB",
|
||||
firstDay: 1,
|
||||
eventTimeFormat: {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
},
|
||||
eventColor: "#82b92e",
|
||||
editable: is_management_allowed === 0 ? false : true,
|
||||
dayMaxEvents: 3,
|
||||
dayPopoverFormat: { weekday: "long" },
|
||||
defaultAllDay: false,
|
||||
displayEventTime: true,
|
||||
displayEventEnd: true,
|
||||
selectOverlap: false,
|
||||
eventOverlap: false,
|
||||
allDaySlot: true,
|
||||
droppable: false,
|
||||
select: is_management_allowed === 0 ? false : select_alert_template,
|
||||
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
|
||||
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
|
||||
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
|
||||
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
|
||||
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
|
||||
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
|
||||
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
|
||||
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
|
||||
};
|
||||
|
||||
var settings = {
|
||||
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'); ?>',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
removeText: '<?php echo __('Remove'); ?>',
|
||||
userLanguage: '<?php echo get_user_language(); ?>',
|
||||
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
|
||||
tooltipText: '<?php echo __('Drag out to remove'); ?>',
|
||||
alert: '<?php echo __('Alert'); ?>'
|
||||
}
|
||||
|
||||
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
|
||||
calendar.render();
|
||||
|
||||
$("#table-new-job-3").show();
|
||||
$('.fc-event-title').hide();
|
||||
$(".fc-button-active" ).trigger( "click" );
|
||||
} else {
|
||||
$("#calendar_map").html();
|
||||
$("#table-new-job-3").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -187,6 +187,27 @@ if (get_parameter('mark_notification_as_read', 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_parameter('mark_all_notification_as_read', 0)) {
|
||||
$unread_messages = db_get_all_rows_sql('SELECT id_mensaje FROM tnotification_user WHERE utimestamp_read is NULL');
|
||||
|
||||
if ($unread_messages !== false) {
|
||||
foreach ($unread_messages as $messages) {
|
||||
messages_process_read($messages['id_mensaje']);
|
||||
}
|
||||
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
// If there is new messages, get the info.
|
||||
echo json_encode(
|
||||
['result' => $result]
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (get_parameter('get_notifications_dropdown', 0)) {
|
||||
echo notifications_print_dropdown();
|
||||
return;
|
||||
|
@ -759,6 +759,31 @@ if (enterprise_installed() === true) {
|
||||
);
|
||||
}
|
||||
|
||||
$days_week = [
|
||||
0 => __('Sunday'),
|
||||
1 => __('Monday'),
|
||||
2 => __('Tuesday'),
|
||||
3 => __('Wednesday'),
|
||||
4 => __('Thursday'),
|
||||
5 => __('Friday'),
|
||||
6 => __('Saturday'),
|
||||
];
|
||||
|
||||
$table_styles->data[$row][] = html_print_label_input_block(
|
||||
__('Datepicker first day of week'),
|
||||
html_print_select(
|
||||
$days_week,
|
||||
'datepicker_first_day',
|
||||
$config['datepicker_first_day'],
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
// Title Header.
|
||||
|
@ -2312,7 +2312,7 @@ $(document).ready (function () {
|
||||
// The row provided has a predefined class. We delete it.
|
||||
$('#table_macros-field' + i)
|
||||
.removeAttr('class');
|
||||
if(old_value && i != 4){
|
||||
if(old_value){
|
||||
$("[name=field" + i + "_value]").val(old_value).trigger('change');
|
||||
}
|
||||
$('#table_macros-field').show();
|
||||
|
@ -1628,7 +1628,6 @@ $autorefresh_list_out['operation/agentes/status_monitor'] = 'Monitor detail';
|
||||
$autorefresh_list_out['enterprise/operation/services/services'] = 'Services';
|
||||
$autorefresh_list_out['operation/dashboard/dashboard'] = 'Dashboard';
|
||||
|
||||
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map';
|
||||
$autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console';
|
||||
$autorefresh_list_out['operation/events/events'] = 'Events';
|
||||
|
||||
@ -1643,6 +1642,10 @@ if (isset($autorefresh_list) === false || empty($autorefresh_list) === true || e
|
||||
$aux = [];
|
||||
$count_autorefresh_list = count($autorefresh_list);
|
||||
for ($i = 0; $i < $count_autorefresh_list; $i++) {
|
||||
if ($autorefresh_list[$i] === 'operation/agentes/pandora_networkmap') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$aux[$autorefresh_list[$i]] = $autorefresh_list_out[$autorefresh_list[$i]];
|
||||
unset($autorefresh_list_out[$autorefresh_list[$i]]);
|
||||
$autorefresh_list[$i] = $aux;
|
||||
|
@ -592,6 +592,9 @@ $userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
|
||||
true
|
||||
);
|
||||
|
||||
// Hidden hint to change theme.
|
||||
$hin_change_theme = ui_print_help_tip(__('When changing the theme, the login screen logo will be restricted to the default for that color scheme, if you have a custom logo, adjust it after changing the theme.'), true, '', '', 'display: none;');
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (users_is_admin() === true) {
|
||||
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
|
||||
@ -599,7 +602,7 @@ if (is_metaconsole() === true) {
|
||||
}
|
||||
} else {
|
||||
if (function_exists('skins_print_select')) {
|
||||
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
|
||||
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme').$hin_change_theme;
|
||||
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
||||
}
|
||||
}
|
||||
@ -817,5 +820,10 @@ $(document).ready(function () {
|
||||
128,
|
||||
128
|
||||
);
|
||||
|
||||
//Hint to change theme.
|
||||
$('#skin1').on("change", () => {
|
||||
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
|
||||
})
|
||||
});
|
||||
</script>
|
@ -912,7 +912,7 @@ class DiscoveryTaskList extends HTML
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).' ';
|
||||
$data[6] .= __('Discovery.NetScan (legacy)');
|
||||
$data[6] .= __('Discovery.NetScan');
|
||||
} else {
|
||||
// APP or external script recon task.
|
||||
$data[6] = html_print_image(
|
||||
@ -920,7 +920,7 @@ class DiscoveryTaskList extends HTML
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).' ';
|
||||
$data[6] .= $recon_script_name.' (legacy)';
|
||||
$data[6] .= $recon_script_name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 12 KiB |
10
pandora_console/images/draggable.svg
Normal file
10
pandora_console/images/draggable.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 22 KiB |
8
pandora_console/images/help@header.svg
Normal file
8
pandora_console/images/help@header.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>help_pandora</title>
|
||||
<g id="help_pandora" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,0 C15.4050388,0 20,1.5951272 20,5.39448104 L20,14.605519 C20,18.4048728 15.4050388,20 10,20 C4.59496118,20 0,18.4048728 0,14.605519 L0,5.39448104 C0,1.5951272 4.59496118,0 10,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Mask" fill="#3F3F3F"></path>
|
||||
<g id="?" transform="translate(6, 4)"></g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
BIN
pandora_console/images/widgets/groups_status_map.png
Normal file
BIN
pandora_console/images/widgets/groups_status_map.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
BIN
pandora_console/images/widgets/inventory.png
Normal file
BIN
pandora_console/images/widgets/inventory.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -58,7 +58,14 @@ if ($save_log_filter) {
|
||||
$values = [];
|
||||
$values['id_name'] = get_parameter('id_name');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['custom_date'] = get_parameter('custom_date');
|
||||
$values['date'] = get_parameter('date');
|
||||
$values['date_text'] = get_parameter('date_text');
|
||||
$values['date_units'] = get_parameter('date_units');
|
||||
$values['date_init'] = get_parameter('date_init');
|
||||
$values['time_init'] = get_parameter('time_init');
|
||||
$values['date_end'] = get_parameter('date_end');
|
||||
$values['time_end'] = get_parameter('time_end');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
@ -91,7 +98,14 @@ if ($update_log_filter) {
|
||||
$values = [];
|
||||
$id = get_parameter('id');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['custom_date'] = get_parameter('custom_date');
|
||||
$values['date'] = get_parameter('date');
|
||||
$values['date_text'] = get_parameter('date_text');
|
||||
$values['date_units'] = get_parameter('date_units');
|
||||
$values['date_init'] = get_parameter('date_init');
|
||||
$values['time_init'] = get_parameter('time_init');
|
||||
$values['date_end'] = get_parameter('date_end');
|
||||
$values['time_end'] = get_parameter('time_end');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
@ -211,18 +225,42 @@ function load_filter_values() {
|
||||
$.each(data,function(i,value){
|
||||
if (i == 'text'){
|
||||
$("#text-filter_text").val(value);
|
||||
}
|
||||
if (i == 'period'){
|
||||
$("#filter_period").val(value).change();
|
||||
}
|
||||
if (i == 'ip'){
|
||||
} else if (i == 'ip'){
|
||||
$("#text-filter_ip").val(value);
|
||||
}
|
||||
if (i == 'type'){
|
||||
} else if (i == 'type'){
|
||||
$("#filter_type").val(value).change();
|
||||
}
|
||||
if (i == 'user'){
|
||||
} else if (i == 'user'){
|
||||
$("#filter_user").val(value).change();
|
||||
} else if (i == 'custom_date'){
|
||||
$('#hidden-custom_date').val(value).change();
|
||||
if ($('#hidden-custom_date').val()==='0'){
|
||||
$('#date_default').show();
|
||||
$('#date_range').hide();
|
||||
$('#date_extend').hide();
|
||||
$('#date').val('".SECONDS_1DAY."').trigger('change');
|
||||
} else if ($('#hidden-custom_date').val()==='1'){
|
||||
$('#date_range').show();
|
||||
$('#date_default').hide();
|
||||
$('#date_extend').hide();
|
||||
} else {
|
||||
$('#date_range').hide();
|
||||
$('#date_default').hide();
|
||||
$('#date_extend').show();
|
||||
}
|
||||
} else if (i == 'date'){
|
||||
$('#date').val(value).change();
|
||||
} else if (i == 'date_end'){
|
||||
$('#text-date_end').val(value);
|
||||
} else if (i == 'date_init'){
|
||||
$('#text-date_init').val(value);
|
||||
} else if (i == 'date_text'){
|
||||
$('#text-date_text').val(value);
|
||||
} else if (i == 'date_units'){
|
||||
$('#date_units').val(value).change();
|
||||
} else if (i == 'time_end'){
|
||||
$('#text-time_end').val(value);
|
||||
} else if (i == 'time_init'){
|
||||
$('#text-time_init').val(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -408,7 +446,14 @@ function save_new_filter() {
|
||||
"save_log_filter" : 1,
|
||||
"id_name" : $("#text-id_name").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#filter_period :selected").val(),
|
||||
"custom_date": $('#hidden-custom_date').val(),
|
||||
"date": $('#date option:selected').val(),
|
||||
"date_text": $('#text-date_text').val(),
|
||||
"date_units": $('#date_units option:selected').val(),
|
||||
"date_init": $('#text-date_init').val(),
|
||||
"time_init": $('#text-time_init').val(),
|
||||
"date_end": $('#text-date_end').val(),
|
||||
"time_end": $('#text-time_end').val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
@ -444,7 +489,14 @@ function save_update_filter() {
|
||||
"update_log_filter" : 1,
|
||||
"id" : $("#overwrite_filter :selected").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#filter_period :selected").val(),
|
||||
"custom_date": $('#hidden-custom_date').val(),
|
||||
"date": $('#date option:selected').val(),
|
||||
"date_text": $('#text-date_text').val(),
|
||||
"date_units": $('#date_units option:selected').val(),
|
||||
"date_init": $('#text-date_init').val(),
|
||||
"time_init": $('#text-time_init').val(),
|
||||
"date_end": $('#text-date_end').val(),
|
||||
"time_end": $('#text-time_end').val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
|
@ -1503,6 +1503,7 @@ if ($add_comment === true) {
|
||||
if ($change_status === true) {
|
||||
$event_ids = get_parameter('event_ids');
|
||||
$new_status = get_parameter('new_status');
|
||||
$group_rep = (int) get_parameter('group_rep', 0);
|
||||
$server_id = 0;
|
||||
if (is_metaconsole() === true) {
|
||||
$server_id = (int) get_parameter('server_id');
|
||||
@ -1516,10 +1517,19 @@ if ($change_status === true) {
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$return = events_change_status(
|
||||
explode(',', $event_ids),
|
||||
$new_status
|
||||
);
|
||||
if ($group_rep !== 3) {
|
||||
$return = events_change_status(
|
||||
explode(',', $event_ids),
|
||||
$new_status
|
||||
);
|
||||
} else {
|
||||
// Update all elements with same extraid.
|
||||
$return = events_update_status(
|
||||
$event_ids,
|
||||
(int) $new_status,
|
||||
['group_rep' => $group_rep]
|
||||
);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
|
@ -1486,27 +1486,53 @@ if (check_login()) {
|
||||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
if ($params['histogram'] === true) {
|
||||
$params['id_agent_module'] = $params['agent_module_id'];
|
||||
$params['dinamic_proc'] = 1;
|
||||
if ($params['enable_projected_period'] === '1') {
|
||||
$params_graphic = [
|
||||
'period' => $params['period'],
|
||||
'date' => strtotime(date('Y-m-d H:i:s')),
|
||||
'only_image' => false,
|
||||
'homeurl' => ui_get_full_url(false, false, false, false).'/',
|
||||
'ttl' => false,
|
||||
'height' => $config['graph_image_height'],
|
||||
'landscape' => $content['landscape'],
|
||||
'return_img_base_64' => true,
|
||||
];
|
||||
|
||||
$params_combined = [
|
||||
'projection' => $params['period_projected'],
|
||||
];
|
||||
|
||||
$return['chart'] = graphic_combined_module(
|
||||
[$params['agent_module_id']],
|
||||
$params_graphic,
|
||||
$params_combined
|
||||
);
|
||||
$output .= '<div class="stat_win_histogram">';
|
||||
if ($params['compare'] === 'separated') {
|
||||
$output .= $return['chart'];
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
if ($params['histogram'] === true) {
|
||||
$params['id_agent_module'] = $params['agent_module_id'];
|
||||
$params['dinamic_proc'] = 1;
|
||||
|
||||
$output .= '<div class="stat_win_histogram">';
|
||||
if ($params['compare'] === 'separated') {
|
||||
$graph = \reporting_module_histogram_graph(
|
||||
['datetime' => ($params['begin_date'] - $params['period'])],
|
||||
$params
|
||||
);
|
||||
$output .= $graph['chart'];
|
||||
}
|
||||
|
||||
$graph = \reporting_module_histogram_graph(
|
||||
['datetime' => ($params['begin_date'] - $params['period'])],
|
||||
['datetime' => $params['begin_date']],
|
||||
$params
|
||||
);
|
||||
$output .= $graph['chart'];
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= grafico_modulo_sparse($params);
|
||||
}
|
||||
|
||||
$graph = \reporting_module_histogram_graph(
|
||||
['datetime' => $params['begin_date']],
|
||||
$params
|
||||
);
|
||||
$output .= $graph['chart'];
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= grafico_modulo_sparse($params);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
||||
|
57
pandora_console/include/ajax/notifications.ajax.php
Normal file
57
pandora_console/include/ajax/notifications.ajax.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
*
|
||||
* @category Users
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
// Includes.
|
||||
require_once $config['homedir'].'/include/functions_notifications.php';
|
||||
|
||||
$change_label = get_parameter('change_label', 0);
|
||||
if ($change_label === '1') {
|
||||
$label = get_parameter('label', '');
|
||||
$source = get_parameter('source', 0);
|
||||
$user = get_parameter('user', '');
|
||||
$value = get_parameter('value', 0) ? 1 : 0;
|
||||
|
||||
// Update the label value.
|
||||
ob_clean();
|
||||
$json = json_encode(
|
||||
[
|
||||
'result' => notifications_set_user_label_status(
|
||||
$source,
|
||||
$user,
|
||||
$label,
|
||||
$value
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
echo $json;
|
||||
return;
|
||||
}
|
@ -201,23 +201,8 @@ class AuditLog extends HTML
|
||||
'name' => 'filter_text',
|
||||
],
|
||||
[
|
||||
'label' => __('Max. hours old'),
|
||||
'type' => 'select',
|
||||
'class' => 'w20px',
|
||||
'select2_enable' => true,
|
||||
'sort' => false,
|
||||
'selected' => 168,
|
||||
'fields' => [
|
||||
24 => __('1 day'),
|
||||
168 => __('7 days'),
|
||||
360 => __('15 days'),
|
||||
744 => __('1 month'),
|
||||
2160 => __('3 months'),
|
||||
4320 => __('6 months'),
|
||||
8760 => __('1 Year'),
|
||||
],
|
||||
'id' => 'filter_period',
|
||||
'name' => 'filter_period',
|
||||
'label' => __('Date'),
|
||||
'type' => 'date_range',
|
||||
],
|
||||
[
|
||||
'label' => __('IP'),
|
||||
@ -312,10 +297,35 @@ class AuditLog extends HTML
|
||||
$filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $this->filterIp);
|
||||
}
|
||||
|
||||
if (empty($this->filterPeriod) === false) {
|
||||
$filter .= sprintf(' AND fecha >= DATE_ADD(NOW(), INTERVAL -%d HOUR)', $this->filterPeriod);
|
||||
// Calculate range dates.
|
||||
$custom_date = $filters['custom_date'];
|
||||
if ($custom_date === '1') {
|
||||
$date_from = ($filters['date_init'].' '.$filters['time_init']);
|
||||
$date_to = ($filters['date_end'].' '.$filters['time_end']);
|
||||
} else if ($custom_date === '2') {
|
||||
$period = ($filters['date_text'] * $filters['date_units']);
|
||||
$date_to = date('Y-m-d H:i:s');
|
||||
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $period));
|
||||
} else if (in_array($filters['date'], ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||
if ($filters['date'] === 'this_week') {
|
||||
$date_from = date('Y-m-d 00:00:00', strtotime('last monday'));
|
||||
$date_to = date('Y-m-d 23:59:59', strtotime($date_from.' +6 days'));
|
||||
} else if ($filters['date'] === 'this_month') {
|
||||
$date_from = date('Y-m-d 23:59:59', strtotime('first day of this month'));
|
||||
$date_to = date('Y-m-d 00:00:00', strtotime('last day of this month'));
|
||||
} else if ($filters['date'] === 'past_month') {
|
||||
$date_from = date('Y-m-d 00:00:00', strtotime('first day of previous month'));
|
||||
$date_to = date('Y-m-d 23:59:59', strtotime('last day of previous month'));
|
||||
} else if ($filters['date'] === 'past_week') {
|
||||
$date_from = date('Y-m-d 00:00:00', strtotime('monday', strtotime('last week')));
|
||||
$date_to = date('Y-m-d 23:59:59', strtotime('sunday', strtotime('last week')));
|
||||
}
|
||||
} else {
|
||||
$date_to = date('Y-m-d H:i:s');
|
||||
$date_from = date('Y-m-d H:i:s', (strtotime($date_to) - $filters['date']));
|
||||
}
|
||||
|
||||
$filter .= sprintf(' AND fecha BETWEEN "%s" AND "%s"', $date_from, $date_to);
|
||||
$count = (int) db_get_value_sql(sprintf('SELECT COUNT(*) as "total" FROM tsesion WHERE %s', $filter));
|
||||
|
||||
if ($length !== '-1') {
|
||||
|
@ -169,6 +169,7 @@ class ConsoleSupervisor
|
||||
* NOTIF.PHP.DISABLE_FUNCTIONS
|
||||
* NOTIF.PHP.CHROMIUM
|
||||
* NOTIF.PHP.VERSION
|
||||
* NOTIF.PHP.VERSION.SUPPORT
|
||||
*/
|
||||
|
||||
$this->checkPHPSettings();
|
||||
@ -210,6 +211,12 @@ class ConsoleSupervisor
|
||||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if there're new messages in UM.
|
||||
* NOTIF.UPDATEMANAGER.MESSAGES
|
||||
@ -377,6 +384,7 @@ class ConsoleSupervisor
|
||||
* NOTIF.PHP.DISABLE_FUNCTIONS
|
||||
* NOTIF.PHP.CHROMIUM
|
||||
* NOTIF.PHP.VERSION
|
||||
* NOTIF.PHP.VERSION.SUPPORT
|
||||
*/
|
||||
|
||||
$this->checkPHPSettings();
|
||||
@ -434,6 +442,12 @@ class ConsoleSupervisor
|
||||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if event storm protection is activated.
|
||||
* NOTIF.MISC.EVENTSTORMPROTECTION
|
||||
@ -498,6 +512,12 @@ class ConsoleSupervisor
|
||||
|
||||
$this->checkUpdateManagerRegistration();
|
||||
|
||||
/*
|
||||
* Check if has API access.
|
||||
* NOTIF.API.ACCESS
|
||||
*/
|
||||
$this->checkApiAccess();
|
||||
|
||||
/*
|
||||
* Check if there're new messages in UM.
|
||||
* NOTIF.UPDATEMANAGER.MESSAGES
|
||||
@ -683,7 +703,7 @@ class ConsoleSupervisor
|
||||
$total_agents = db_get_value('count(*)', 'tagente');
|
||||
|
||||
if ($total_agents >= 200) {
|
||||
if ($config['agentaccess'] !== 0) {
|
||||
if ((int) $config['agentaccess'] !== 0) {
|
||||
db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']);
|
||||
$this->notify(
|
||||
[
|
||||
@ -856,6 +876,7 @@ class ConsoleSupervisor
|
||||
case 'NOTIF.PHP.DISABLE_FUNCTIONS':
|
||||
case 'NOTIF.PHP.CHROMIUM':
|
||||
case 'NOTIF.PHP.VERSION':
|
||||
case 'NOTIF.PHP.VERSION.SUPPORT':
|
||||
case 'NOTIF.HISTORYDB':
|
||||
case 'NOTIF.PANDORADB':
|
||||
case 'NOTIF.PANDORADB.HISTORICAL':
|
||||
@ -864,6 +885,7 @@ class ConsoleSupervisor
|
||||
case 'NOTIF.METACONSOLE.DB_CONNECTION':
|
||||
case 'NOTIF.DOWNTIME':
|
||||
case 'NOTIF.UPDATEMANAGER.REGISTRATION':
|
||||
case 'NOTIF.API.ACCESS':
|
||||
case 'NOTIF.MISC.EVENTSTORMPROTECTION':
|
||||
case 'NOTIF.MISC.DEVELOPBYPASS':
|
||||
case 'NOTIF.MISC.FONTPATH':
|
||||
@ -1811,14 +1833,14 @@ class ConsoleSupervisor
|
||||
$url = 'https://www.php.net/supported-versions.php';
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.PHP.VERSION',
|
||||
'type' => 'NOTIF.PHP.VERSION.SUPPORT',
|
||||
'title' => __('PHP UPDATE REQUIRED'),
|
||||
'message' => __('You should update your PHP version because it will be out of official support').'<br>'.__('Current PHP version: ').PHP_VERSION,
|
||||
'url' => $url,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.PHP.VERSION');
|
||||
$this->cleanNotifications('NOTIF.PHP.VERSION.SUPPORT');
|
||||
}
|
||||
}
|
||||
|
||||
@ -2366,6 +2388,30 @@ class ConsoleSupervisor
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if has access to the API
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function checkApiAccess()
|
||||
{
|
||||
global $config;
|
||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
if (update_manager_verify_api() === false) {
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.API.ACCESS',
|
||||
'title' => __('Cannot access the Pandora FMS API '),
|
||||
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.API.ACCESS');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if user 'admin' is enabled and using default password.
|
||||
*
|
||||
|
@ -542,13 +542,21 @@ class CustomNetScan extends Wizard
|
||||
'extra' => '<span id="interval_manual_container">'.html_print_extended_select_for_time(
|
||||
'interval',
|
||||
$this->task['interval_sweep'],
|
||||
'',
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'interval\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
).'</span>',
|
||||
];
|
||||
|
||||
|
@ -283,7 +283,8 @@ class ExtensionsDiscovery extends Wizard
|
||||
ui_require_javascript_file('extensions_discovery');
|
||||
$_iniFile = $this->loadIni();
|
||||
if ($_iniFile === false) {
|
||||
include 'general/noaccess.php';
|
||||
// No file .disco.
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No .disco file found') ]);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -549,6 +549,11 @@ class SnmpConsole extends HTML
|
||||
$order = get_datatable_order(true);
|
||||
$filters = get_parameter('filter', []);
|
||||
|
||||
// Build ranges.
|
||||
$now_timestamp = time();
|
||||
$interval_seconds = ($filters['filter_hours_ago'] * 3600);
|
||||
$ago_timestamp = ($now_timestamp - $interval_seconds);
|
||||
|
||||
// Build ranges.
|
||||
$now = new DateTime();
|
||||
$ago = new DateTime();
|
||||
@ -688,7 +693,7 @@ class SnmpConsole extends HTML
|
||||
if ($date_from_trap != '') {
|
||||
if ($time_from_trap != '') {
|
||||
$whereSubquery .= '
|
||||
AND (UNIX_TIMESTAMP(timestamp) > UNIX_TIMESTAMP("'.$date_from_trap.' '.$time_from_trap.'"))
|
||||
AND (utimestamp > '.$ago_timestamp.')
|
||||
';
|
||||
} else {
|
||||
$whereSubquery .= '
|
||||
@ -700,7 +705,7 @@ class SnmpConsole extends HTML
|
||||
if ($date_to_trap != '') {
|
||||
if ($time_to_trap) {
|
||||
$whereSubquery .= '
|
||||
AND (UNIX_TIMESTAMP(timestamp) < UNIX_TIMESTAMP("'.$date_to_trap.' '.$time_to_trap.'"))
|
||||
AND (utimestamp < '.$now_timestamp.')
|
||||
';
|
||||
} else {
|
||||
$whereSubquery .= '
|
||||
|
@ -122,10 +122,11 @@ class Tree
|
||||
public function setFilter($filter)
|
||||
{
|
||||
// There is not module filter in metaconsole.
|
||||
if (is_metaconsole()) {
|
||||
/*
|
||||
if (is_metaconsole()) {
|
||||
$filter['searchModule'] = '';
|
||||
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->filter = $filter;
|
||||
}
|
||||
|
@ -20,8 +20,8 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230818';
|
||||
$pandora_version = 'v7.0NG.773';
|
||||
$build_version = 'PC230911';
|
||||
$pandora_version = 'v7.0NG.773.3';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
@ -807,6 +807,7 @@ define('AUDIT_LOG_FILE_MANAGER', 'File manager');
|
||||
define('AUDIT_LOG_ALERT_MANAGEMENT', 'Alert management');
|
||||
define('AUDIT_LOG_ALERT_CORRELATION_MANAGEMENT', 'Alert correlation management');
|
||||
define('AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT', 'Visual Console Management');
|
||||
define('AUDIT_LOG_GRAPH_ANALYTICS_PUBLIC', 'Graph Analytics Public');
|
||||
define('AUDIT_LOG_TAG_MANAGEMENT', 'Tag management');
|
||||
define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management');
|
||||
define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
|
||||
|
@ -270,7 +270,8 @@ function format_for_graph(
|
||||
$dec_point='.',
|
||||
$thousands_sep=',',
|
||||
$divider=1000,
|
||||
$sufix=''
|
||||
$sufix='',
|
||||
$two_lines=false
|
||||
) {
|
||||
// Exception to exclude modules whose unit is already formatted as KB (satellite modules)
|
||||
if (!empty($sufix) && $sufix == 'KB') {
|
||||
@ -297,6 +298,10 @@ function format_for_graph(
|
||||
}
|
||||
|
||||
// This will actually do the rounding and the decimals.
|
||||
if ($two_lines === true) {
|
||||
return remove_right_zeros(format_numeric($number, $decimals)).'<br>'.$shorts[$pos].$sufix;
|
||||
}
|
||||
|
||||
return remove_right_zeros(format_numeric($number, $decimals)).$shorts[$pos].$sufix;
|
||||
}
|
||||
|
||||
@ -4046,25 +4051,49 @@ function series_type_graph_array($data, $show_elements_graph)
|
||||
}
|
||||
} else {
|
||||
$name_legend = '';
|
||||
if (isset($show_elements_graph['fullscale']) === true
|
||||
&& (int) $show_elements_graph['fullscale'] === 1
|
||||
) {
|
||||
$name_legend .= 'Tip: ';
|
||||
} else {
|
||||
$name_legend .= 'Avg: ';
|
||||
}
|
||||
|
||||
if ($value['unit']) {
|
||||
$name_legend .= $value['agent_alias'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= $value['module_name'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= __('Unit ').' ';
|
||||
$name_legend .= $value['unit'].': ';
|
||||
if ($show_elements_graph['graph_analytics'] === true) {
|
||||
$name_legend .= '<div class="graph-analytics-legend-main">';
|
||||
$name_legend .= '<div class="graph-analytics-legend-square" style="background-color: '.$color_series[$i]['color'].';">';
|
||||
$name_legend .= '<span class="square-value">';
|
||||
$name_legend .= format_for_graph(
|
||||
end(end($value['data'])),
|
||||
1,
|
||||
$config['decimal_separator'],
|
||||
$config['thousand_separator'],
|
||||
1000,
|
||||
'',
|
||||
true
|
||||
);
|
||||
$name_legend .= '</span>';
|
||||
$name_legend .= '<span class="square-unit" title="'.$value['unit'].'">'.$value['unit'].'</span>';
|
||||
$name_legend .= '</div>';
|
||||
$name_legend .= '<div class="graph-analytics-legend">';
|
||||
$name_legend .= '<span>'.$value['agent_alias'].'</span>';
|
||||
$name_legend .= '<span title="'.$value['module_name'].'">'.$value['module_name'].'</span>';
|
||||
$name_legend .= '</div>';
|
||||
$name_legend .= '</div>';
|
||||
} else {
|
||||
$name_legend .= $value['agent_alias'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= $value['module_name'].': ';
|
||||
if (isset($show_elements_graph['fullscale']) === true
|
||||
&& (int) $show_elements_graph['fullscale'] === 1
|
||||
) {
|
||||
$name_legend .= 'Tip: ';
|
||||
} else {
|
||||
$name_legend .= 'Avg: ';
|
||||
}
|
||||
|
||||
if ($value['unit']) {
|
||||
$name_legend .= $value['agent_alias'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= $value['module_name'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= __('Unit ').' ';
|
||||
$name_legend .= $value['unit'].': ';
|
||||
} else {
|
||||
$name_legend .= $value['agent_alias'];
|
||||
$name_legend .= ' / ';
|
||||
$name_legend .= $value['module_name'].': ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4085,28 +4114,30 @@ function series_type_graph_array($data, $show_elements_graph)
|
||||
$value['max'] = 0;
|
||||
}
|
||||
|
||||
$data_return['legend'][$key] .= '<span class="legend-font-small">'.__('Min').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['min'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'.__('Max').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['max'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'._('Avg.').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['avg'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> '.$str;
|
||||
if (isset($show_elements_graph['graph_analytics']) === false) {
|
||||
$data_return['legend'][$key] .= '<span class="legend-font-small">'.__('Min').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['min'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'.__('Max').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['max'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> <span class="legend-font-small">'._('Avg.').' </span><span class="bolder">'.remove_right_zeros(
|
||||
number_format(
|
||||
$value['avg'],
|
||||
$config['graph_precision'],
|
||||
$config['csv_decimal_separator'],
|
||||
$config['csv_decimal_separator'] == ',' ? '.' : ','
|
||||
)
|
||||
).' '.$value['unit'].'</span> '.$str;
|
||||
}
|
||||
|
||||
if ($show_elements_graph['compare'] == 'overlapped'
|
||||
&& $key == 'sum2'
|
||||
|
@ -2760,69 +2760,6 @@ function agents_delete_agent($id_agents, $disableACL=false)
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
enterprise_hook('agent_delete_from_cache', [$id_agent]);
|
||||
|
||||
// Delete agent from visual console.
|
||||
db_process_sql_delete(
|
||||
'tlayout_data',
|
||||
['id_agent' => $id_agent]
|
||||
);
|
||||
|
||||
// Delete agent from visual dashboards.
|
||||
db_process_sql(
|
||||
'UPDATE twidget_dashboard
|
||||
SET options = NULL
|
||||
WHERE options LIKE ("%\"agentid\":\"'.$id_agent.'\"%")'
|
||||
);
|
||||
|
||||
// Delete agent from treport.
|
||||
db_process_sql_delete(
|
||||
'treport_content',
|
||||
['id_agent' => $id_agent]
|
||||
);
|
||||
|
||||
// Delete rules from tevent alerts (correlative alerts)
|
||||
db_process_sql_delete(
|
||||
'tevent_rule',
|
||||
[
|
||||
'agent' => $id_agent,
|
||||
'operator_agent' => '==',
|
||||
]
|
||||
);
|
||||
|
||||
db_process_sql_delete(
|
||||
'tevent_rule',
|
||||
[
|
||||
'log_agent' => $id_agent,
|
||||
'operator_log_agent' => '==',
|
||||
]
|
||||
);
|
||||
|
||||
// Delete from gis maps history
|
||||
db_process_sql_delete(
|
||||
'tgis_data_history',
|
||||
['tagente_id_agente' => $id_agent]
|
||||
);
|
||||
|
||||
// Delete from policies.
|
||||
db_process_sql_delete(
|
||||
'tpolicy_agents',
|
||||
['id_agent' => $id_agent]
|
||||
);
|
||||
|
||||
// Delete from tnetwork maps
|
||||
db_process_sql_delete(
|
||||
'titem',
|
||||
['source_data' => $id_agent]
|
||||
);
|
||||
|
||||
db_process_sql_delete(
|
||||
'trel_item',
|
||||
[
|
||||
'id_parent_source_data' => $id_agent,
|
||||
'id_child_source_data' => $id_agent,
|
||||
],
|
||||
'OR'
|
||||
);
|
||||
|
||||
// Delete agent from fav menu.
|
||||
db_process_sql_delete(
|
||||
'tfavmenu_user',
|
||||
|
@ -1168,6 +1168,10 @@ function config_update_config()
|
||||
$error_update[] = __('Custom title header');
|
||||
}
|
||||
|
||||
if (config_update_value('datepicker_first_day', (string) get_parameter('datepicker_first_day'), true) === false) {
|
||||
$error_update[] = __('Datepicker first day');
|
||||
}
|
||||
|
||||
if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) {
|
||||
$error_update[] = __('Custom subtitle header');
|
||||
}
|
||||
@ -2751,6 +2755,10 @@ function config_process_config()
|
||||
config_update_value('custom_title_header', __('Pandora FMS'));
|
||||
}
|
||||
|
||||
if (!isset($config['datepicker_first_day'])) {
|
||||
config_update_value('datepicker_first_day', '0');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_subtitle_header'])) {
|
||||
config_update_value('custom_subtitle_header', __('the Flexible Monitoring System'));
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ function events_update_status($id_evento, $status, $filter=null)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (!$status) {
|
||||
if (!$status && $status !== 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1762,11 +1762,9 @@ function events_get_all(
|
||||
}
|
||||
}
|
||||
|
||||
$string_metaconsole_connections = implode(',', $metaconsole_connections);
|
||||
$explode_metaconsole_connections = explode(',', $string_metaconsole_connections);
|
||||
$result_meta = Promise\wait(
|
||||
parallelMap(
|
||||
$explode_metaconsole_connections,
|
||||
$metaconsole_connections,
|
||||
function ($node_int) use ($sql, $history) {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
@ -3553,11 +3551,15 @@ function events_page_responses($event)
|
||||
);
|
||||
|
||||
if ($status_blocked === false) {
|
||||
if (isset($event['server_id']) === false) {
|
||||
$event['server_id'] = '0';
|
||||
}
|
||||
|
||||
$data[2] = html_print_button(
|
||||
__('Update'),
|
||||
'status_button',
|
||||
false,
|
||||
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].');',
|
||||
'event_change_status("'.$event['similar_ids'].'",'.$event['server_id'].', '.$event['group_rep'].');',
|
||||
[
|
||||
'icon' => 'next',
|
||||
'mode' => 'link',
|
||||
|
@ -125,9 +125,22 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
||||
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$real_directory = filemanager_safe_directory($destination_directory);
|
||||
$umask = io_safe_output((string) get_parameter('umask'));
|
||||
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
$umask = io_safe_output((string) get_parameter('umask'));
|
||||
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
||||
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
||||
$check_extension = true;
|
||||
if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') {
|
||||
if ((strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')) {
|
||||
$check_extension = false;
|
||||
} else {
|
||||
$check_extension = true;
|
||||
}
|
||||
}
|
||||
|
||||
// (strtolower($extension) !== 'mib' && strtolower($extension) !== 'zip')
|
||||
if (strpos($real_directory, $default_real_directory) !== 0 || $check_extension === false) {
|
||||
// Perform security check to determine whether received upload
|
||||
// directory is part of the default path for caller uploader and
|
||||
// user is not trying to access an external path (avoid
|
||||
@ -177,14 +190,31 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
||||
|
||||
// Upload zip.
|
||||
if ($upload_zip === true) {
|
||||
$parse_all_queries = explode('&', parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY));
|
||||
$parse_sec2_query = explode('=', $parse_all_queries[1]);
|
||||
if (isset($_FILES['file']) === true
|
||||
&& empty($_FILES['file']['name']) === false
|
||||
) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$filepath = $_FILES['file']['tmp_name'];
|
||||
$real_directory = filemanager_safe_directory($destination_directory);
|
||||
$secure = true;
|
||||
if ($parse_sec2_query[1] === 'operation/snmpconsole/snmp_mib_uploader') {
|
||||
// Security control structure.
|
||||
$zip = new \ZipArchive;
|
||||
if ($zip->open($filepath) === true) {
|
||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||
$unzip_filename = $zip->getNameIndex($i);
|
||||
$extension = pathinfo($unzip_filename, PATHINFO_EXTENSION);
|
||||
if (strtolower($extension) !== 'mib') {
|
||||
$secure = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
if (strpos($real_directory, $default_real_directory) !== 0 || $secure === false) {
|
||||
// Perform security check to determine whether received upload
|
||||
// directory is part of the default path for caller uploader
|
||||
// and user is not trying to access an external path (avoid
|
||||
|
@ -1577,10 +1577,16 @@ function graphic_combined_module(
|
||||
$server_name = metaconsole_get_server_by_id($modules[0]['server']);
|
||||
}
|
||||
|
||||
if (isset($params_combined['custom_period']) !== false && $params_combined['custom_period'] !== false) {
|
||||
$period = $params_combined['custom_period'];
|
||||
} else {
|
||||
$period = $params['period'];
|
||||
}
|
||||
|
||||
if ($params_combined['projection']) {
|
||||
$output_projection = forecast_projection_graph(
|
||||
$module_list[0],
|
||||
$params['period'],
|
||||
$period,
|
||||
$params_combined['projection'],
|
||||
false,
|
||||
false,
|
||||
@ -5540,3 +5546,23 @@ function graph_events_agent_by_group($id_group, $width=300, $height=200, $noWate
|
||||
$options
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function graph_analytics_filter_select()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$result = [];
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'RW') === 1 || check_acl($config['id_user'], 0, 'RM') === 1) {
|
||||
$filters = db_get_all_rows_sql('SELECT id, filter_name FROM tgraph_analytics_filter WHERE user_id = "'.$config['id_user'].'"');
|
||||
|
||||
if ($filters !== false) {
|
||||
foreach ($filters as $filter) {
|
||||
$result[$filter['id']] = $filter['filter_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -2648,14 +2648,16 @@ function groups_get_heat_map_agents(array $id_group, float $width=0, float $heig
|
||||
*
|
||||
* @return string Html
|
||||
*/
|
||||
function tactical_groups_get_agents_and_monitoring($id_groups)
|
||||
function tactical_groups_get_agents_and_monitoring($id_groups, $data='')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$data = [
|
||||
'total_agents' => groups_agents_total_counters($id_groups, false)['total'],
|
||||
'monitor_total' => groups_get_total_monitors($id_groups, [], [], false, false, false, false),
|
||||
];
|
||||
if ($data === '') {
|
||||
$data = [
|
||||
'total_agents' => groups_agents_total_counters($id_groups, false)['total'],
|
||||
'monitor_total' => groups_get_total_monitors($id_groups, [], [], false, false, false, false),
|
||||
];
|
||||
}
|
||||
|
||||
// Link URLS
|
||||
$urls = [];
|
||||
@ -2703,16 +2705,18 @@ function tactical_groups_get_agents_and_monitoring($id_groups)
|
||||
* @param [type] $id_groups
|
||||
* @return string Html.
|
||||
*/
|
||||
function tactical_groups_get_stats_alerts($id_groups)
|
||||
function tactical_groups_get_stats_alerts($id_groups, $data='')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$alerts = groups_monitor_alerts_total_counters($id_groups, false);
|
||||
$data = [
|
||||
'monitor_alerts' => $alerts['total'],
|
||||
'monitor_alerts_fired' => $alerts['fired'],
|
||||
if ($data === '') {
|
||||
$alerts = groups_monitor_alerts_total_counters($id_groups, false);
|
||||
$data = [
|
||||
'monitor_alerts' => $alerts['total'],
|
||||
'monitor_alerts_fired' => $alerts['fired'],
|
||||
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
$urls = [];
|
||||
$urls['monitor_alerts'] = $config['homeurl'].'index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=60&ag_group='.$id_groups[0];
|
||||
@ -2780,17 +2784,19 @@ function tactical_groups_get_stats_alerts($id_groups)
|
||||
* @param boolean $data_agents
|
||||
* @return void
|
||||
*/
|
||||
function groups_get_stats_modules_status($id_groups, $graph_width=250, $graph_height=150, $links=false, $data_agents=false)
|
||||
function groups_get_stats_modules_status($id_groups, $graph_width=250, $graph_height=150, $links=false, $data_agents=false, $data='')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$data = [
|
||||
'monitor_critical' => groups_get_critical_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_warning' => groups_get_warning_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_ok' => groups_get_normal_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_unknown' => groups_get_unknown_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_not_init' => groups_get_not_init_monitors($id_groups, [], [], false, false, false, false),
|
||||
];
|
||||
if ($data === '') {
|
||||
$data = [
|
||||
'monitor_critical' => groups_get_critical_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_warning' => groups_get_warning_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_ok' => groups_get_normal_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_unknown' => groups_get_unknown_monitors($id_groups, [], [], false, false, false, false),
|
||||
'monitor_not_init' => groups_get_not_init_monitors($id_groups, [], [], false, false, false, false),
|
||||
];
|
||||
}
|
||||
|
||||
// Link URLS.
|
||||
if ($links === false) {
|
||||
|
@ -1744,8 +1744,8 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
||||
[
|
||||
'label' => __('Agents'),
|
||||
'label_class' => 'font-title-font',
|
||||
'type' => 'select',
|
||||
'fields' => $agents,
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
|
||||
'name' => 'filtered-module-agents-'.$uniqId,
|
||||
'selected' => explode(',', $data['mAgents']),
|
||||
'return' => true,
|
||||
@ -1925,8 +1925,7 @@ function html_print_extended_select_for_unit(
|
||||
$select_style=false,
|
||||
$unique_name=true,
|
||||
$disabled=false,
|
||||
$no_change=0,
|
||||
$class='w100p'
|
||||
$no_change=0
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -1958,7 +1957,7 @@ function html_print_extended_select_for_unit(
|
||||
|
||||
ob_start();
|
||||
|
||||
echo '<div id="'.$uniq_name.'_default" class="'.$class.' inline_line">';
|
||||
echo '<div id="'.$uniq_name.'_default" class="w100p inline_line">';
|
||||
html_print_select(
|
||||
$fields,
|
||||
$uniq_name.'_select',
|
||||
@ -2167,7 +2166,8 @@ function html_print_extended_select_for_time(
|
||||
$style_icon='',
|
||||
$no_change=false,
|
||||
$allow_zero=0,
|
||||
$units=null
|
||||
$units=null,
|
||||
$script_input=''
|
||||
) {
|
||||
global $config;
|
||||
$admin = is_user_admin($config['id_user']);
|
||||
@ -2257,7 +2257,7 @@ function html_print_extended_select_for_time(
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_flex">';
|
||||
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class);
|
||||
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input);
|
||||
|
||||
html_print_input_hidden($name, $selected, false, $uniq_name);
|
||||
html_print_select(
|
||||
@ -2905,6 +2905,8 @@ function html_print_anchor(
|
||||
|
||||
$output .= '>';
|
||||
|
||||
$output .= (isset($options['text']) === true) ? $options['text'] : '';
|
||||
|
||||
$output .= (isset($options['content']) === true) ? io_safe_input_html($options['content']) : '';
|
||||
|
||||
$output .= '</a>';
|
||||
@ -3964,14 +3966,6 @@ function html_print_table(&$table, $return=false)
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($table->tdid)) {
|
||||
foreach ($table->tdid as $keyrow => $tid) {
|
||||
foreach ($tid as $key => $id) {
|
||||
$tdid[$keyrow][$key] = $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($table->cellstyle)) {
|
||||
foreach ($table->cellstyle as $keyrow => $cstyle) {
|
||||
foreach ($cstyle as $key => $cst) {
|
||||
@ -4155,10 +4149,6 @@ function html_print_table(&$table, $return=false)
|
||||
$colspan[$keyrow][$key] = '';
|
||||
}
|
||||
|
||||
if (!isset($tdid[$keyrow][$key])) {
|
||||
$tdid[$keyrow][$key] = '';
|
||||
}
|
||||
|
||||
if (!isset($rowspan[$keyrow][$key])) {
|
||||
$rowspan[$keyrow][$key] = '';
|
||||
}
|
||||
@ -4179,16 +4169,10 @@ function html_print_table(&$table, $return=false)
|
||||
$style[$key] = '';
|
||||
}
|
||||
|
||||
if ($tdid[$keyrow][$key] !== '') {
|
||||
$tid = $tdid[$keyrow][$key];
|
||||
} else {
|
||||
$tid = $tableid.'-'.$keyrow.'-'.$key;
|
||||
}
|
||||
|
||||
if ($class === 'datos5' && $key === 1) {
|
||||
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
|
||||
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
|
||||
} else {
|
||||
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
|
||||
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -5790,7 +5774,11 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
||||
((isset($data['class']) === true) ? $data['class'] : ''),
|
||||
((isset($data['readonly']) === true) ? $data['readonly'] : false),
|
||||
((isset($data['custom_fields']) === true) ? $data['custom_fields'] : false),
|
||||
((isset($data['style_icon']) === true) ? $data['style_icon'] : '')
|
||||
((isset($data['style_icon']) === true) ? $data['style_icon'] : ''),
|
||||
((isset($data['no_change']) === true) ? $data['no_change'] : ''),
|
||||
((isset($data['allow_zero']) === true) ? $data['allow_zero'] : ''),
|
||||
((isset($data['units']) === true) ? $data['units'] : null),
|
||||
((isset($data['script_input']) === true) ? $data['script_input'] : '')
|
||||
);
|
||||
break;
|
||||
|
||||
@ -7137,6 +7125,7 @@ function html_print_menu_button(array $options, bool $return=false)
|
||||
'class' => ($options['class'] ?? ''),
|
||||
'style' => ($options['style'] ?? ''),
|
||||
'onClick' => ($options['onClick'] ?? ''),
|
||||
'text' => ($options['text'] ?? ''),
|
||||
'content' => $content,
|
||||
],
|
||||
$return
|
||||
@ -7239,6 +7228,300 @@ function html_print_code_picker(
|
||||
}
|
||||
|
||||
|
||||
function html_print_select_date_range(
|
||||
$name,
|
||||
$return,
|
||||
$selected=SECONDS_1DAY,
|
||||
$date_init='',
|
||||
$time_init='',
|
||||
$date_end='',
|
||||
$time_end='',
|
||||
$date_text=SECONDS_1DAY,
|
||||
$class='w100p'
|
||||
) {
|
||||
global $config;
|
||||
|
||||
if ($selected === 'custom') {
|
||||
$display_extend = '';
|
||||
$display_range = 'style="display:none"';
|
||||
$display_default = 'style="display:none"';
|
||||
$custom_date = 2;
|
||||
} else if ($selected === 'chose_range') {
|
||||
$display_range = '';
|
||||
$display_default = 'style="display:none"';
|
||||
$display_extend = 'style="display:none"';
|
||||
$custom_date = 1;
|
||||
} else {
|
||||
$display_default = '';
|
||||
$display_range = 'style="display:none"';
|
||||
$display_extend = 'style="display:none"';
|
||||
$custom_date = 0;
|
||||
}
|
||||
|
||||
if ($date_end === '') {
|
||||
$date_end = date('Y/m/d');
|
||||
}
|
||||
|
||||
if ($date_init === '') {
|
||||
$date_init = date('Y/m/d', strtotime($date_end.' -1 days'));
|
||||
}
|
||||
|
||||
$date_init = date('Y/m/d', strtotime($date_init));
|
||||
|
||||
if ($time_init === '') {
|
||||
$time_init = date('H:i:s');
|
||||
}
|
||||
|
||||
if ($time_end === '') {
|
||||
$time_end = date('H:i:s');
|
||||
}
|
||||
|
||||
$fields[SECONDS_1DAY] = __('Last 24hr');
|
||||
$fields['this_week'] = __('This week');
|
||||
$fields['this_month'] = __('This month');
|
||||
$fields['past_week'] = __('Past week');
|
||||
$fields['past_month'] = __('Past month');
|
||||
$fields[SECONDS_1WEEK] = __('Last 7 days');
|
||||
$fields[SECONDS_15DAYS] = __('Last 15 days');
|
||||
$fields[SECONDS_1MONTH] = __('Last 30 days');
|
||||
$fields['custom'] = __('Custom');
|
||||
$fields['chose_range'] = __('Chose start/end date period');
|
||||
|
||||
$output = html_print_input_hidden('custom_date', $custom_date, true);
|
||||
$output .= '<div id="'.$name.'_default" class="wauto inline_flex" '.$display_default.'>';
|
||||
$output .= html_print_select(
|
||||
$fields,
|
||||
$name,
|
||||
$selected,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
$class
|
||||
);
|
||||
$output .= '</div>';
|
||||
$output .= '<div id="'.$name.'_range" class="inline_flex" '.$display_range.'>';
|
||||
$table = new stdClass();
|
||||
$table->class = 'table-adv-filter';
|
||||
$table->data[0][0] .= '<div><div><div><span class="font-title-font">'.__('From').':</span></div>';
|
||||
$table->data[0][0] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
|
||||
$table->data[0][0] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
|
||||
$table->data[0][0] .= '</div>';
|
||||
$table->data[0][0] .= '<div><div><span class="font-title-font">'.__('to').':</span></div>';
|
||||
$table->data[0][0] .= html_print_input_text('date_end', $date_end, '', 12, 10, true).' ';
|
||||
$table->data[0][0] .= '<div id="'.$name.'_manual" class="w100p inline_line">';
|
||||
$table->data[0][0] .= html_print_input_text('time_end', $time_end, '', 10, 7, true).' ';
|
||||
$table->data[0][0] .= ' <a href="javascript:">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'back_default',
|
||||
'class' => ' main_menu_icon invert_filter',
|
||||
'alt' => __('List'),
|
||||
'title' => __('List'),
|
||||
'style' => 'width: 18px;',
|
||||
]
|
||||
).'</a>';
|
||||
$table->data[0][0] .= '</div></div>';
|
||||
$output .= html_print_table($table, true);
|
||||
$output .= '</div>';
|
||||
|
||||
$units = [
|
||||
1 => __('seconds'),
|
||||
SECONDS_1MINUTE => __('minutes'),
|
||||
SECONDS_1HOUR => __('hours'),
|
||||
SECONDS_1DAY => __('days'),
|
||||
SECONDS_1WEEK => __('weeks'),
|
||||
SECONDS_1MONTH => __('months'),
|
||||
SECONDS_1YEAR => __('years'),
|
||||
];
|
||||
$output .= '<div id="'.$name.'_extend" class="w100p inline_flex" '.$display_extend.'>';
|
||||
$output .= html_print_input_text($name.'_text', $date_text, '', false, 255, true);
|
||||
$output .= html_print_select(
|
||||
$units,
|
||||
$name.'_units',
|
||||
'1',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
' margin-left: 5px; width: 140px;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$output .= ' <a href="javascript:">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'back_default_extend',
|
||||
'class' => $name.'_toggler main_menu_icon invert_filter',
|
||||
'alt' => __('List'),
|
||||
'title' => __('List'),
|
||||
'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;',
|
||||
]
|
||||
).'</a>';
|
||||
$output .= '</div>';
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
$output .= "<script type='text/javascript'>
|
||||
$(document).ready (function () {
|
||||
$('#".$name."').change(function(){
|
||||
if ($(this).val() === 'chose_range') {
|
||||
$('#".$name."_range').show();
|
||||
$('#".$name."_default').hide();
|
||||
$('#".$name."_extend').hide();
|
||||
$('#hidden-custom_date').val('1');
|
||||
} else if ($(this).val() === 'custom') {
|
||||
$('#".$name."_range').hide();
|
||||
$('#".$name."_default').hide();
|
||||
$('#".$name."_extend').show();
|
||||
$('#hidden-custom_date').val('2');
|
||||
}
|
||||
});
|
||||
|
||||
$('#back_default, #back_default_extend').click(function(){
|
||||
display_default();
|
||||
});
|
||||
|
||||
// To get position must to be showed, hide elements return 0 on offset function.
|
||||
$('#".$name."_range').show();
|
||||
$('#".$name."_default').hide();
|
||||
$('#".$name."_extend').hide();
|
||||
position_top_init = $('#text-date_init').offset().top + $('#text-date_init').outerHeight();
|
||||
position_top_end = $('#text-date_end').offset().top + $('#text-date_end').outerHeight();
|
||||
$('#".$name."_range').hide();
|
||||
$('#".$name."_extend').hide();
|
||||
$('#".$name."_default').show();
|
||||
});
|
||||
|
||||
var position_top_init = 0;
|
||||
var position_top_end = 0;
|
||||
|
||||
function display_default(){
|
||||
$('#".$name."_default').show();
|
||||
$('#".$name."_range').hide();
|
||||
$('#".$name."_extend').hide();
|
||||
$('#".$name."').val('".SECONDS_1DAY."').trigger('change');
|
||||
$('#hidden-custom_date').val('0');
|
||||
}
|
||||
|
||||
$('#text-date').datepicker({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown'
|
||||
});
|
||||
|
||||
$('[id^=text-time_init]').timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '".TIME_FORMAT_JS."',
|
||||
timeOnlyTitle: '".__('Choose time')."',
|
||||
timeText: '".__('Time')."',
|
||||
hourText: '".__('Hour')."',
|
||||
minuteText: '".__('Minute')."',
|
||||
secondText: '".__('Second')."',
|
||||
currentText: '".__('Now')."',
|
||||
closeText: '".__('Close')."'
|
||||
});
|
||||
|
||||
$('[id^=text-date_init]').datepicker ({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown',
|
||||
firstDay: ".$config['datepicker_first_day'].",
|
||||
beforeShowDay: function (date) {
|
||||
show_datepicker = 'date_init';
|
||||
var date_now = date.getTime();
|
||||
var date_ini_split = $('[id^=text-date_init]').val().split('/');
|
||||
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
|
||||
var date_end_split = $('[id^=text-date_end]').val().split('/');
|
||||
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
|
||||
if (date_now > date_ini && date_now < date_end) {
|
||||
return [true, 'ui-date-range-in', 'prueba'];
|
||||
} else if (date_now == date_ini || date_now == date_end){
|
||||
return [true, 'ui-datepicker-current-day', ''];
|
||||
}
|
||||
return [true, '', ''];
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=text-date_end]').datepicker ({
|
||||
dateFormat: '".DATE_FORMAT_JS."',
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
showAnim: 'slideDown',
|
||||
firstDay: ".$config['datepicker_first_day'].",
|
||||
beforeShowDay: function (date) {
|
||||
show_datepicker = 'date_end';
|
||||
var date_now = date.getTime();
|
||||
var date_ini_split = $('[id^=text-date_init]').val().split('/');
|
||||
var date_ini = new Date(date_ini_split[1]+'/'+date_ini_split[2]+'/'+date_ini_split[0]).getTime();
|
||||
var date_end_split = $('[id^=text-date_end]').val().split('/');
|
||||
var date_end = new Date(date_end_split[1]+'/'+date_end_split[2]+'/'+date_end_split[0]).getTime();
|
||||
if (date_now > date_ini && date_now < date_end) {
|
||||
return [true, 'ui-date-range-in', 'prueba'];
|
||||
} else if (date_now == date_ini || date_now == date_end){
|
||||
return [true, 'ui-datepicker-current-day', ''];
|
||||
}
|
||||
return [true, '', ''];
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=text-time_end]').timepicker({
|
||||
showSecond: true,
|
||||
timeFormat: '".TIME_FORMAT_JS."',
|
||||
timeOnlyTitle: '".__('Choose time')."',
|
||||
timeText: '".__('Time')."',
|
||||
hourText: '".__('Hour')."',
|
||||
minuteText: '".__('Minute')."',
|
||||
secondText: '".__('Second')."',
|
||||
currentText: '".__('Now')."',
|
||||
closeText: '".__('Close')."'
|
||||
});
|
||||
|
||||
$(window).scroll(function(e){
|
||||
if ($('#date option:selected').val() == 'chose_range'){
|
||||
if ($('#ui-datepicker-div').html() !== '') {
|
||||
if ($(this).scrollTop() > 0){
|
||||
var css_datepicker = $('#ui-datepicker-div').attr('style').replace('absolute','fixed');
|
||||
if (!css_datepicker.includes('px !important')) {
|
||||
if (show_datepicker == 'date_end'){
|
||||
css_datepicker += '; top: '+position_top_end+'px !important';
|
||||
} else {
|
||||
css_datepicker += '; top: '+position_top_init+'px !important';
|
||||
}
|
||||
}
|
||||
$('#ui-datepicker-div').attr('style', css_datepicker);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>";
|
||||
|
||||
if ($return === true) {
|
||||
return $output;
|
||||
} else {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function html_print_wizard_diagnosis(
|
||||
$title,
|
||||
$id_button,
|
||||
@ -7277,4 +7560,5 @@ function html_print_wizard_diagnosis(
|
||||
} else {
|
||||
echo $output;
|
||||
}
|
||||
|
||||
}
|
@ -31,6 +31,7 @@ function inventory_get_data(
|
||||
$agents_ids,
|
||||
$inventory_module_name,
|
||||
$utimestamp,
|
||||
$period,
|
||||
$inventory_search_string='',
|
||||
$export_csv=false,
|
||||
$return_mode=false,
|
||||
@ -97,7 +98,7 @@ function inventory_get_data(
|
||||
|
||||
// Prepare pagination.
|
||||
$url = sprintf(
|
||||
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&order_by_agent=%s&submit_filter=%d',
|
||||
'?sec=estado&sec2=operation/inventory/inventory&agent_id=%s&agent=%s&id_group=%s&export=%s&module_inventory_general_view=%s&search_string=%s&utimestamp=%s&period=%s&order_by_agent=%s&submit_filter=%d',
|
||||
$pagination_url_parameters['inventory_id_agent'],
|
||||
$pagination_url_parameters['inventory_agent'],
|
||||
$pagination_url_parameters['inventory_id_group'],
|
||||
@ -105,6 +106,7 @@ function inventory_get_data(
|
||||
$inventory_module_name,
|
||||
$inventory_search_string,
|
||||
$utimestamp,
|
||||
$period,
|
||||
$order_by_agent,
|
||||
1
|
||||
);
|
||||
@ -328,7 +330,7 @@ function inventory_get_data(
|
||||
$timestamp = db_get_value_sql(
|
||||
"SELECT timestamp
|
||||
FROM tagente_datos_inventory
|
||||
WHERE utimestamp = $utimestamp"
|
||||
WHERE utimestamp BETWEEN '".($utimestamp - $period)."' AND '".$utimestamp."'"
|
||||
);
|
||||
} else {
|
||||
$timestamp = db_get_value_sql(
|
||||
@ -892,6 +894,14 @@ function get_data_basic_info_sql($params, $count=false)
|
||||
);
|
||||
}
|
||||
|
||||
if ($params['utimestamp'] > 0 && $count === false) {
|
||||
$where .= sprintf(
|
||||
' AND utimestamp BETWEEN %d AND %d',
|
||||
($params['utimestamp'] - $params['period']),
|
||||
$params['utimestamp']
|
||||
);
|
||||
}
|
||||
|
||||
if ($params['order'] > 0) {
|
||||
$str_split = explode(' ', $params['order']);
|
||||
switch ($str_split[0]) {
|
||||
|
@ -143,6 +143,10 @@ function menu_print_menu(&$menu)
|
||||
if (empty($new_msg) === false) {
|
||||
$sec2 = 'operation/messages/message_edit&new_msg='.$new_msg;
|
||||
}
|
||||
} else if ($sec2 === 'enterprise/godmode/servers/credential_boxes_satellite'
|
||||
|| $sec2 === 'enterprise/godmode/servers/manage_credential_boxes'
|
||||
) {
|
||||
$sec2 = 'enterprise/godmode/servers/list_satellite';
|
||||
} else {
|
||||
$sec2 = (string) get_parameter('sec2');
|
||||
}
|
||||
@ -950,11 +954,14 @@ if (is_ajax()) {
|
||||
$dialog = '
|
||||
<div id="about-tabs" class="invisible overflow-hidden">
|
||||
<ul>
|
||||
<li><a href="#tab-general-view">'.__('Information').'</a></li>
|
||||
<li><a href="#tab-database">'.__('Database').'</a></li>
|
||||
<li><a href="#tab-system-info">'.__('System Info').'</a></li>
|
||||
<li><a href="#tab-php-system">'.__('PHP System').'</a></li>
|
||||
<li class="ui-tabs-close-button" style="float:right!important;">
|
||||
<li><a href="#tab-general-view">'.__('Information').'</a></li>';
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) {
|
||||
$dialog .= '<li><a href="#tab-database">'.__('Database').'</a></li>
|
||||
<li><a href="#tab-system-info">'.__('System Info').'</a></li>
|
||||
<li><a href="#tab-php-system">'.__('PHP System').'</a></li>';
|
||||
}
|
||||
|
||||
$dialog .= '<li class="ui-tabs-close-button" style="float:right!important;">
|
||||
<img id="about-close" style="cursor: pointer;" src="'.ui_get_full_url('/include/styles/images/dialog-titlebar-close.png', false, false, false).'" alt="'.__('Close').'" title="'.__('Close').'" width="25px">
|
||||
</li>
|
||||
</ul>
|
||||
@ -986,7 +993,7 @@ if (is_ajax()) {
|
||||
$dialog .= '<p><b><a href="https://pandorafms.com/contact/" target="_blank">'.__('Contact Pandora FMS for official support contract.').'</a></b></p>';
|
||||
}
|
||||
|
||||
if (((bool) check_acl($config['id_user'], 0, 'PM') === true) && (is_metaconsole() === false)) {
|
||||
if (((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) && (is_metaconsole() === false)) {
|
||||
$dialogButtons = [];
|
||||
|
||||
$dialogButtons[] = html_print_button(
|
||||
@ -1028,222 +1035,224 @@ if (is_ajax()) {
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="trademark-copyright">Trademark and copyright 2004 - '.date('Y').' <a href="https://pandorafms.com/" target="_blank">Pandora FMS</a>. All rights reserved</p>
|
||||
</div>
|
||||
<div id="tab-database" class="div-scroll">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Database health status').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_health->data->unknownAgents->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_health->data->notInitAgents->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="about-last-tr">
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</div>';
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || $config['is_admin']['admin'] === true) {
|
||||
$dialog .= '<div id="tab-database" class="div-scroll">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Database health status').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_health->data->unknownAgents->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_health->data->unknownAgents->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_health->data->notInitAgents->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_health->data->notInitAgents->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="about-last-tr">
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p"><span>'.$db_health->data->pandoraDbLastRun->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p" style="font-size: 10pt;">'.$db_health->data->pandoraDbLastRun->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Database status info').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="about-last-tr">
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Database status info').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeFirstVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeFirstVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_info->data->dbSchemeBuild->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_info->data->dbSchemeBuild->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="about-last-tr">
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p"><span>'.$db_info->data->dbSize->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p class="about-last-p" style="font-size: 10pt;">'.$db_info->data->dbSize->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p>'.$fragmentation_status.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('Tables fragmentation in the %s database', $product_name).'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationMax->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationMax->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationValue->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p style="font-size: 10pt;">'.$db_fragmentation->data->tablesFragmentationValue->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$db_fragmentation->data->tablesFragmentationStatus->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 50%;">
|
||||
<p>'.$fragmentation_status.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-system-info">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('System Info').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 30%;">
|
||||
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$system_date->data->date->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-php-system">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('PHP system').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-system-info">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('System Info').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 30%;">
|
||||
<p><span>'.$sys_info->data->cpuInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->cpuInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->ramInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->osInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->osInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->hostnameInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->hostnameInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$sys_info->data->ipInfo->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$sys_info->data->ipInfo->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 15%;">
|
||||
<p><span>'.$system_date->data->date->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 85%;">
|
||||
<p style="font-size: 10pt;">'.$system_date->data->date->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-php-system">
|
||||
<table class="table-about">
|
||||
<tbody style="text-align: left;">
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<h2><span> - </span>'.__('PHP system').'</h2>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 50%;">
|
||||
<p><span>'.$php_sys->data->phpVersion->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->phpVersion->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->maxExecutionTime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->maxExecutionTime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->maxInputTime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->maxInputTime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->memoryLimit->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->memoryLimit->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 35%;">
|
||||
<p><span>'.$php_sys->data->sessionLifetime->name.'</span></p>
|
||||
</th>
|
||||
<th style="width: 65%;">
|
||||
<p style="font-size: 10pt;">'.$php_sys->data->sessionLifetime->value.'</p>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
';
|
||||
}
|
||||
|
||||
echo $dialog;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user