Merge remote-tracking branch 'origin/develop' into ent-9884-Carga-restauracion-de-filtros-en-la-vista-de-monitores
This commit is contained in:
commit
e4f5a9a61a
extras
build_src.sh
deploy-scripts
pandora_agent_deploy.shpandora_deploy_community.shpandora_deploy_community_el8.shpandora_deploy_community_ubuntu_2204.sh
docker/centos8/base
fedora_official_specs
pandora_agents
pc
shellscript
aix
bsd-ipso
hp-ux
linux
mac_osx
openWRT
solaris
unix
AIX
DEBIAN
Darwin
dmg
pandora_agent.confFreeBSD
HP-UX
Linux
NT4
NetBSD
OpenWRT
SunOS
pandora_agentpandora_agent.redhat.specpandora_agent.specpandora_agent_installerwin32
pandora_console
DEBIAN
attachment/downloads
composer.jsoncomposer.lockextensions
extras
fonts
godmode
agentes
agent_template.phpconfigurar_agente.phpinventory_manager.phpmodule_manager.phpmodule_manager_editor_network.phpmodule_manager_editor_plugin.phpmodule_manager_editor_web.phpmodule_manager_editor_wmi.phpplanned_downtime.editor.phpplanned_downtime.list.php
alerts
events
groups
massive
menu.phpmodules
reporting
setup
snmpconsole
users
wizards
images
include
|
@ -24,7 +24,7 @@ cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_server-$LOCAL_VERSION.tar.g
|
|||
cd $CODEHOME/pandora_agents/shellscript && tar zcvf $RPMHOME/SOURCES/pandorafms_agent-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn --exclude nohup linux || exit 1
|
||||
|
||||
# Unix agent
|
||||
cd $CODEHOME/pandora_agents && tar zvcf $RPMHOME/SOURCES/pandorafms_agent_unix-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn --exclude nohup --exclude NT4 --exclude Darwin/dmg unix || exit 1
|
||||
cd $CODEHOME/pandora_agents && tar zvcf $RPMHOME/SOURCES/pandorafms_agent_linux-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn --exclude nohup --exclude NT4 --exclude Darwin/dmg unix || exit 1
|
||||
|
||||
# Enterprise console
|
||||
cd $PANDHOME_ENT/pandora_console && tar zcvf $RPMHOME/SOURCES/pandorafms_console_enterprise-$LOCAL_VERSION.tar.gz --exclude \.exe --exclude \.svn enterprise/* || exit 1
|
||||
|
@ -37,7 +37,7 @@ if [ "$1" == "nightly" ]; then
|
|||
ln -s $RPMHOME/SOURCES/pandorafms_console-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_console-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_server-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_server-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_agent-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_agent-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_agent_unix-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_agent_unix-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_agent_linux-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_agent_linux-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_console_enterprise-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_console_enterprise-$VERSION.tar.gz || exit 1
|
||||
ln -s $RPMHOME/SOURCES/pandorafms_server_enterprise-$LOCAL_VERSION.tar.gz $RPMHOME/SOURCES/pandorafms_server_enterprise-$VERSION.tar.gz || exit 1
|
||||
fi
|
||||
|
|
|
@ -142,7 +142,7 @@ 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.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm &>> $LOGFILE
|
||||
$package_manager_cmd install -y http://firefly.artica.es/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'
|
||||
|
||||
|
@ -151,8 +151,8 @@ fi
|
|||
if [[ $OS_RELEASE == 'debian' ]]; then
|
||||
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.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_unix_7.0NG.deb' 'Downloading Pandora FMS agent dependencies'
|
||||
execute_cmd 'apt install -y ./pandorafms.agent_unix_7.0NG.deb' 'Installing Pandora FMS agent'
|
||||
execute_cmd 'wget http://firefly.artica.es/pandorafms/latest/Debian_Ubuntu/pandorafms.agent_linux_7.0NG.deb' 'Downloading Pandora FMS agent dependencies'
|
||||
execute_cmd 'apt install -y ./pandorafms.agent_linux_7.0NG.deb' 'Installing Pandora FMS agent'
|
||||
fi
|
||||
|
||||
# Configuring Agente
|
||||
|
|
|
@ -258,6 +258,7 @@ console_dependencies=" \
|
|||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
chromium \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
|
@ -284,11 +285,16 @@ server_dependencies=" \
|
|||
java \
|
||||
bind-utils \
|
||||
whois \
|
||||
cpanminus \
|
||||
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.artica.es/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
|
||||
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
# install cpan dependencies
|
||||
execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore"
|
||||
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
|
||||
|
@ -409,17 +415,17 @@ execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
|||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
execute_cmd "curl -LSs --output pandorafms_server-7.0NG.noarch.rpm ${PANDORA_SERVER_PACKAGE}" "Downloading Pandora FMS Server community"
|
||||
execute_cmd "curl -LSs --output pandorafms_console-7.0NG.noarch.rpm ${PANDORA_CONSOLE_PACKAGE}" "Downloading Pandora FMS Console community"
|
||||
execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA_AGENT_PACKAGE}" "Downloading Pandora FMS Agent community"
|
||||
execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDORA_AGENT_PACKAGE}" "Downloading Pandora FMS Agent community"
|
||||
|
||||
# Install Pandora
|
||||
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#######################################################
|
||||
## Tested versions ##
|
||||
# Centos 8.4, 8.5
|
||||
# Rocky 8.4, 8.5
|
||||
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||
# Almalinuz 8.4, 8.5
|
||||
# RedHat 8.5
|
||||
|
||||
|
@ -14,24 +14,25 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='202209231'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$DBROOTUSER" ] || DBROOTUSER=root
|
||||
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
|
||||
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
|
||||
# Ansi color code variables
|
||||
|
@ -41,7 +42,6 @@ cyan="\e[0;36m"
|
|||
reset="\e[0m"
|
||||
|
||||
# Functions
|
||||
|
||||
execute_cmd () {
|
||||
local cmd="$1"
|
||||
local msg="$2"
|
||||
|
@ -76,7 +76,7 @@ check_cmd_status () {
|
|||
check_pre_pandora () {
|
||||
|
||||
echo -en "${cyan}Checking environment ... ${reset}"
|
||||
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
rpm -qa | grep -v "pandorawmic" | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
[ -d "$PANDORA_CONSOLE" ] && local fail=true
|
||||
[ -f /usr/bin/pandora_server ] && local fail=true
|
||||
|
||||
|
@ -137,7 +137,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -312,6 +315,7 @@ console_dependencies=" \
|
|||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
chromium \
|
||||
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
|
@ -466,6 +470,8 @@ query_cache_size = 64M
|
|||
query_cache_min_res_unit = 2k
|
||||
query_cache_limit = 256K
|
||||
|
||||
#skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
[mysqld_safe]
|
||||
|
@ -476,6 +482,7 @@ EO_CONFIG_F
|
|||
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
||||
fi
|
||||
|
||||
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||
|
@ -484,20 +491,27 @@ fi
|
|||
export MYSQL_PWD=$DBPASS
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
fi
|
||||
|
||||
# if beta is enable
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
execute_cmd "curl -LSs --output pandorafms_server-7.0NG.noarch.rpm ${PANDORA_SERVER_PACKAGE}" "Downloading Pandora FMS Server community"
|
||||
execute_cmd "curl -LSs --output pandorafms_console-7.0NG.noarch.rpm ${PANDORA_CONSOLE_PACKAGE}" "Downloading Pandora FMS Console community"
|
||||
execute_cmd "curl -LSs --output pandorafms_agent_unix-7.0NG.noarch.rpm ${PANDORA_AGENT_PACKAGE}" "Downloading Pandora FMS Agent community"
|
||||
execute_cmd "curl -LSs --output pandorafms_agent_linux-7.0NG.noarch.rpm ${PANDORA_AGENT_PACKAGE}" "Downloading Pandora FMS Agent community"
|
||||
|
||||
# Install Pandora
|
||||
execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages"
|
||||
|
|
|
@ -16,8 +16,9 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||
WORKDIR=/opt/pandora/deploy
|
||||
|
||||
|
||||
S_VERSION='2022052501'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||
|
||||
# define default variables
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
|
@ -33,6 +34,8 @@ LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
|||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
|
||||
|
||||
# Ansi color code variables
|
||||
red="\e[0;91m"
|
||||
|
@ -133,7 +136,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -271,10 +277,19 @@ echo -en "${cyan}Installing phantomjs...${reset}"
|
|||
/usr/bin/phantomjs --version &>> "$LOGFILE"
|
||||
check_cmd_status "Error Installing phanromjs"
|
||||
|
||||
# create symlink for fping
|
||||
rm -f /usr/sbin/fping &>> "$LOGFILE"
|
||||
ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
|
||||
|
||||
# Chrome
|
||||
rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
|
||||
execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome"
|
||||
execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome"
|
||||
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
lib32z1 \
|
||||
vmware_dependencies="\
|
||||
lib32z1 \
|
||||
lib32z1 \
|
||||
build-essential \
|
||||
uuid uuid-dev \
|
||||
|
@ -345,16 +360,22 @@ systemctl stop apparmor &>> "$LOGFILE"
|
|||
systemctl disable apparmor &>> "$LOGFILE"
|
||||
|
||||
#install mysql
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password password $DBROOTPASS") &>> "$LOGFILE"
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password_again password $DBROOTPASS") &>> "$LOGFILE"
|
||||
echo -en "${cyan}Installing MySql Server...${reset}"
|
||||
env DEBIAN_FRONTEND=noninteractive apt install -y mysql-server &>> "$LOGFILE"
|
||||
execute_cmd "curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb" "Downloading Percona repository for MySQL8"
|
||||
execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_all.deb" "Installing Percona repository for MySQL8"
|
||||
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
|
||||
|
||||
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
|
||||
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
|
||||
check_cmd_status "Error Installing MySql Server"
|
||||
|
||||
|
||||
#Configuring Database
|
||||
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||
execute_cmd "systemctl start mysql" "Starting database engine"
|
||||
|
||||
echo """
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DBROOTPASS';
|
||||
""" | mysql -uroot &>> "$LOGFILE"
|
||||
|
||||
export MYSQL_PWD=$DBROOTPASS
|
||||
echo -en "${cyan}Creating Pandora FMS database...${reset}"
|
||||
|
@ -394,11 +415,12 @@ max_connections = 100
|
|||
|
||||
key_buffer_size=4M
|
||||
read_buffer_size=128K
|
||||
|
||||
read_rnd_buffer_size=128K
|
||||
sort_buffer_size=128K
|
||||
join_buffer_size=4M
|
||||
|
||||
skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
log-error=/var/log/mysql/error.log
|
||||
|
@ -412,14 +434,20 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin
|
|||
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_unix-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
fi
|
||||
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_unix-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
|
@ -427,7 +455,7 @@ cd $WORKDIR &>> "$LOGFILE"
|
|||
|
||||
curl -LSs --output pandorafms_console-7.0NG.tar.gz "${PANDORA_CONSOLE_PACKAGE}" &>> "$LOGFILE"
|
||||
curl -LSs --output pandorafms_server-7.0NG.tar.gz "${PANDORA_SERVER_PACKAGE}" &>> "$LOGFILE"
|
||||
curl -LSs --output pandorafms_agent_unix-7.0NG.tar.gz "${PANDORA_AGENT_PACKAGE}" &>> "$LOGFILE"
|
||||
curl -LSs --output pandorafms_agent_linux-7.0NG.tar.gz "${PANDORA_AGENT_PACKAGE}" &>> "$LOGFILE"
|
||||
|
||||
# Install PandoraFMS Console
|
||||
echo -en "${cyan}Installing PandoraFMS Console...${reset}"
|
||||
|
@ -444,7 +472,7 @@ check_cmd_status "Error installing PandoraFMS Server"
|
|||
#Install agent:
|
||||
execute_cmd "apt install -y libyaml-tiny-perl perl coreutils wget curl unzip procps python3 python3-pip" "Installing PandoraFMS Agent Dependencies"
|
||||
echo -en "${cyan}Installing PandoraFMS Agent...${reset}"
|
||||
tar xvzf $WORKDIR/pandorafms_agent_unix-7.0NG.tar.gz &>> "$LOGFILE" && cd unix && ./pandora_agent_installer --install &>> $LOGFILE && cp -a tentacle_client /usr/local/bin/ &>> $LOGFILE && cd $WORKDIR
|
||||
tar xvzf $WORKDIR/pandorafms_agent_linux-7.0NG.tar.gz &>> "$LOGFILE" && cd unix && ./pandora_agent_installer --install &>> $LOGFILE && cp -a tentacle_client /usr/local/bin/ &>> $LOGFILE && cd $WORKDIR
|
||||
check_cmd_status "Error installing PandoraFMS Agent"
|
||||
|
||||
# Copy gotty utility
|
||||
|
|
|
@ -262,13 +262,11 @@ RUN dnf install -y --setopt=tsflags=nodocs \
|
|||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm
|
||||
|
||||
# Install utils
|
||||
RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
|
||||
RUN dnf install -y supervisor chromium crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
|
||||
# SDK VMware perl dependencies
|
||||
RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm
|
||||
# Instant client Oracle
|
||||
RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
|
||||
# Install Phantom
|
||||
RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
|
||||
|
||||
|
||||
EXPOSE 80 443 41121 162/udp
|
||||
|
|
|
@ -4,9 +4,9 @@ Release: 140223.sp3%{?dist}
|
|||
Summary: Host/service/network agent for Pandora FMS monitoring system
|
||||
License: GPLv2
|
||||
Vendor: Artica <http://www.artica.es>
|
||||
Source: http://code.pandorafms.com/static_download/pandorafms_agent_unix-5.0SP3.tar.gz
|
||||
Source: http://code.pandorafms.com/static_download/pandorafms_agent_linux-5.0SP3.tar.gz
|
||||
#Source: %{name}-%{version}.tar.gz
|
||||
#Source0: http://code.pandorafms.com/static_download/pandorafms_agent_unix-5.0SP3.tar.gz
|
||||
#Source0: http://code.pandorafms.com/static_download/pandorafms_agent_linux-5.0SP3.tar.gz
|
||||
URL: http://pandorafms.com
|
||||
Group: Applications/System
|
||||
#Prefix: /usr/share
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, AIX version
|
||||
# Version 7.0NG.768, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -114,7 +114,7 @@ echo "END"
|
|||
|
||||
echo "Make the package \"Pandorafms console\"."
|
||||
dpkg-deb --build temp_package
|
||||
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
|
||||
mv temp_package.deb pandorafms.agent_linux_$pandora_version.deb
|
||||
|
||||
echo "Delete the \"temp_package\" temp dir for job."
|
||||
rm -rf temp_package
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, FreeBSD Version
|
||||
# Version 7.0NG.768, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -207,6 +207,6 @@ module_end
|
|||
|
||||
module_plugin grep_log /var/log/auth.log Syslog sshd
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, HP-UX Version
|
||||
# Version 7.0NG.768, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, GNU/Linux
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -269,7 +269,7 @@ module_plugin grep_log /var/log/syslog Syslog ssh
|
|||
#module_description Used memory in KB postprocessed to be in MB
|
||||
#module_end
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users process ip route
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, GNU/Linux
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -31,14 +31,14 @@ Install procedure
|
|||
|
||||
Step 1 - Get the latest package and copy to /tmp, you can get the latest package at:
|
||||
|
||||
http://sourceforge.net/projects/pandora/files/Pandora%20FMS%203.2/Stable%20release/Unix%20%28Tarball%29/pandorafms_agent_unix-3.2.tar.gz/download
|
||||
http://sourceforge.net/projects/pandora/files/Pandora%20FMS%203.2/Stable%20release/Unix%20%28Tarball%29/pandorafms_agent_linux-3.2.tar.gz/download
|
||||
|
||||
Note: You will get a special version of the launcher, you can get it from our SVN repository and replace the perl daemon launcher with this special version for OpenWRT. Just replace it after do the package install for the Unix/Perl generic agent.
|
||||
|
||||
Step 2 - Install it
|
||||
|
||||
cd /tmp
|
||||
tar xvzf pandorafms_agent_unix-3.2.tar.gz
|
||||
tar xvzf pandorafms_agent_linux-3.2.tar.gz
|
||||
cd unix
|
||||
./pandora_agent --install
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, Solaris Version
|
||||
# Version 7.0NG.768, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.767
|
||||
# Version 7.0NG.768
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 4.0
|
||||
%define release 1
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 4.0.1
|
||||
%define release 1
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.767, AIX version
|
||||
# Version 7.0NG.768, 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.767
|
||||
# Version 7.0NG.768
|
||||
# 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.767, HPUX Version
|
||||
# Version 7.0NG.768, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767
|
||||
# Version 7.0NG.768
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -164,5 +164,5 @@ module_end
|
|||
|
||||
module_plugin grep_log /var/log/syslog Syslog ssh
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767
|
||||
# Version 7.0NG.768
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -379,6 +379,6 @@ module_end
|
|||
|
||||
#module_plugin grep_log /var/log/syslog Syslog ssh
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767
|
||||
# Version 7.0NG.768
|
||||
# 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.767, Solaris version
|
||||
# Version 7.0NG.768, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, AIX version
|
||||
# Version 7.0NG.768, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.767-221221
|
||||
Version: 7.0NG.768-230201
|
||||
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.767-221221"
|
||||
pandora_version="7.0NG.768-230201"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -61,7 +61,7 @@ chmod 755 -R temp_package/DEBIAN
|
|||
#cp -aRf * temp_package/usr/share/pandora_agent/
|
||||
#but don't copy recursive the temp_package into temp_package
|
||||
|
||||
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_unix | grep -v temp_package`
|
||||
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_linux | grep -v temp_package`
|
||||
do
|
||||
#if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ]
|
||||
#then
|
||||
|
@ -137,7 +137,7 @@ if [ "$USE_DOCKER_APP" == "1" ]; then
|
|||
else
|
||||
dpkg-deb --root-owner-group --build temp_package
|
||||
fi
|
||||
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb
|
||||
mv temp_package.deb pandorafms.agent_linux_$pandora_version.deb
|
||||
|
||||
echo "Delete the \"temp_package\" temp dir for job."
|
||||
rm -rf temp_package
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.767"
|
||||
VERSION="7.0NG.768"
|
||||
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.767" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.768" 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.767" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.768" 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.767</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.767 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.767</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.768</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.768 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.768</string>
|
||||
|
||||
<key>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.767, GNU/Linux
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, FreeBSD Version
|
||||
# Version 7.0NG.768, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -272,7 +272,7 @@ module_plugin pandora_df_free
|
|||
|
||||
module_plugin grep_log /var/log/auth.log Syslog sshd
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
|
||||
|
||||
# Log collection modules. Only for enterprise version, this will collect log files for forensic analysis.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, HP-UX Version
|
||||
# Version 7.0NG.768, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, GNU/Linux
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -269,7 +269,7 @@ module_plugin pandora_netusage
|
|||
# Service autodiscovery plugin
|
||||
module_plugin autodiscover --default
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
#module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
|
||||
|
||||
# Log collection modules. Only for enterprise version, this will collect log files for forensic analysis.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, GNU/Linux
|
||||
# Version 7.0NG.768, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, NetBSD Version
|
||||
# Version 7.0NG.768, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -232,6 +232,6 @@ module_end
|
|||
|
||||
module_plugin grep_log /var/log/auth.log Syslog sshd
|
||||
|
||||
# Plugin for inventory on the agent (Only Enterprise)
|
||||
# Plugin for inventory on the agent.
|
||||
|
||||
# module_plugin inventory 1 cpu ram video nic hd cdrom software
|
||||
|
|
|
@ -31,14 +31,14 @@ Install procedure
|
|||
|
||||
Step 1 - Get the latest package and copy to /tmp, you can get the latest package at:
|
||||
|
||||
http://sourceforge.net/projects/pandora/files/Pandora%20FMS%203.2/Stable%20release/Unix%20%28Tarball%29/pandorafms_agent_unix-3.2.tar.gz/download
|
||||
http://sourceforge.net/projects/pandora/files/Pandora%20FMS%203.2/Stable%20release/Unix%20%28Tarball%29/pandorafms_agent_linux-3.2.tar.gz/download
|
||||
|
||||
Note: You will get a special version of the launcher, you can get it from our SVN repository and replace the perl daemon launcher with this special version for OpenWRT. Just replace it after do the package install for the Unix/Perl generic agent.
|
||||
|
||||
Step 2 - Install it
|
||||
|
||||
cd /tmp
|
||||
tar xvzf pandorafms_agent_unix-3.2.tar.gz
|
||||
tar xvzf pandorafms_agent_linux-3.2.tar.gz
|
||||
cd unix
|
||||
./pandora_agent --install
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.767, Solaris Version
|
||||
# Version 7.0NG.768, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.767';
|
||||
use constant AGENT_BUILD => '221221';
|
||||
use constant AGENT_VERSION => '7.0NG.768';
|
||||
use constant AGENT_BUILD => '230201';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.767
|
||||
%define release 221221
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230201
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.767
|
||||
%define release 221221
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230201
|
||||
|
||||
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.767"
|
||||
PI_BUILD="221221"
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230201"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.767
|
||||
# Version 7.0NG.768
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.767}
|
||||
{Pandora FMS Windows Agent v7.0NG.768}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{221221}
|
||||
{230201}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.767 Build 221221")
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230201")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.767(Build 221221))"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230201))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.767-221221
|
||||
Version: 7.0NG.768-230201
|
||||
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.767-221221"
|
||||
pandora_version="7.0NG.768-230201"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -9,13 +9,24 @@
|
|||
],
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.2.0"
|
||||
"php": "8.0.0"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"mpdf/mpdf": "^8.0.15",
|
||||
"swiftmailer/swiftmailer": "^6.0",
|
||||
"amphp/parallel-functions": "^1.0"
|
||||
"amphp/parallel-functions": "^1.0",
|
||||
"chrome-php/chrome": "^1.7.1",
|
||||
"artica/phpchartjs": "^1.0"
|
||||
},
|
||||
"repositories": {
|
||||
"phpchartjs": {
|
||||
"type": "path",
|
||||
"url": "../../../phpchartjs",
|
||||
"options": {
|
||||
"symlink": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "643ac0dc8a8e1f129104399054f8dd0c",
|
||||
"content-hash": "be2ad3d9d4df55d7ccb87981e82c4932",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
|
@ -549,6 +549,205 @@
|
|||
],
|
||||
"time": "2021-10-25T18:29:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "artica/phpchartjs",
|
||||
"version": "v1.0.2",
|
||||
"dist": {
|
||||
"type": "path",
|
||||
"url": "../../../phpchartjs",
|
||||
"reference": "4957e7cd699e50cee8e0ba7304e1423aafb2cad2"
|
||||
},
|
||||
"require": {
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"halfpastfouram/collection": "1.0.0",
|
||||
"laminas/laminas-json": ">3.1.2",
|
||||
"php": ">=7.2",
|
||||
"symfony/var-dumper": "^3.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "*",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"sensiolabs/security-checker": "^5.0",
|
||||
"squizlabs/php_codesniffer": "3.5.3"
|
||||
},
|
||||
"type": "package",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Artica\\PHPChartJS\\": "src/",
|
||||
"Test\\": "test/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
"./vendor/bin/phpunit"
|
||||
],
|
||||
"cs-check": [
|
||||
"./vendor/bin/phpcs"
|
||||
],
|
||||
"cs-fix": [
|
||||
"./vendor/bin/phpcbf"
|
||||
]
|
||||
},
|
||||
"license": [
|
||||
"AGPL-3.0-or-later"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bob Kruithof"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Barbero"
|
||||
}
|
||||
],
|
||||
"description": "PHP library for ChartJS",
|
||||
"homepage": "https://artica.es/",
|
||||
"keywords": [
|
||||
"chartjs",
|
||||
"graph",
|
||||
"php"
|
||||
],
|
||||
"transport-options": {
|
||||
"symlink": false,
|
||||
"relative": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chrome-php/chrome",
|
||||
"version": "v1.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chrome-php/chrome.git",
|
||||
"reference": "5783c749b2ee385d1c481b0906f1b8acef0296e4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/chrome-php/chrome/zipball/5783c749b2ee385d1c481b0906f1b8acef0296e4",
|
||||
"reference": "5783c749b2ee385d1c481b0906f1b8acef0296e4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"chrome-php/wrench": "^1.3",
|
||||
"evenement/evenement": "^3.0.1",
|
||||
"monolog/monolog": "^1.27.1 || ^2.8 || ^3.2",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0",
|
||||
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0",
|
||||
"symfony/polyfill-mbstring": "^1.26",
|
||||
"symfony/process": "^4.4 || ^5.0 || ^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||
"phpunit/phpunit": "^9.5.23",
|
||||
"symfony/var-dumper": "^4.4 || ^5.0 || ^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"HeadlessChromium\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Enrico Dias",
|
||||
"email": "enrico@enricodias.com",
|
||||
"homepage": "https://github.com/enricodias"
|
||||
}
|
||||
],
|
||||
"description": "Instrument headless chrome/chromium instances from PHP",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"chrome",
|
||||
"chromium",
|
||||
"crawl",
|
||||
"headless",
|
||||
"pdf",
|
||||
"puppeteer",
|
||||
"screenshot"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/chrome-php/chrome/issues",
|
||||
"source": "https://github.com/chrome-php/chrome/tree/v1.7.1"
|
||||
},
|
||||
"time": "2022-09-04T21:11:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "chrome-php/wrench",
|
||||
"version": "v1.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chrome-php/wrench.git",
|
||||
"reference": "68b8282d5d0d54a519c3212ee3e4c35bef40b7d9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/chrome-php/wrench/zipball/68b8282d5d0d54a519c3212ee3e4c35bef40b7d9",
|
||||
"reference": "68b8282d5d0d54a519c3212ee3e4c35bef40b7d9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-sockets": "*",
|
||||
"php": "^7.3 || ^8.0",
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0",
|
||||
"symfony/polyfill-php80": "^1.26"
|
||||
},
|
||||
"conflict": {
|
||||
"wrench/wrench": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.1",
|
||||
"phpunit/phpunit": "^9.5.23"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Wrench\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
}
|
||||
],
|
||||
"description": "A simple PHP WebSocket implementation",
|
||||
"keywords": [
|
||||
"WebSockets",
|
||||
"hybi",
|
||||
"websocket"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/chrome-php/wrench/issues",
|
||||
"source": "https://github.com/chrome-php/wrench/tree/v1.3.0"
|
||||
},
|
||||
"time": "2022-08-28T11:42:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
"version": "1.2.2",
|
||||
|
@ -693,6 +892,265 @@
|
|||
],
|
||||
"time": "2021-10-11T09:18:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "evenement/evenement",
|
||||
"version": "v3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/igorw/evenement.git",
|
||||
"reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7",
|
||||
"reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Evenement": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Igor Wiedler",
|
||||
"email": "igor@wiedler.ch"
|
||||
}
|
||||
],
|
||||
"description": "Événement is a very simple event dispatching library for PHP",
|
||||
"keywords": [
|
||||
"event-dispatcher",
|
||||
"event-emitter"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/igorw/evenement/issues",
|
||||
"source": "https://github.com/igorw/evenement/tree/master"
|
||||
},
|
||||
"time": "2017-07-23T21:35:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "halfpastfouram/collection",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/halfpastfouram/collection.git",
|
||||
"reference": "0862d0b431fef9dc2245518dc06b86ff00dcd102"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/halfpastfouram/collection/zipball/0862d0b431fef9dc2245518dc06b86ff00dcd102",
|
||||
"reference": "0862d0b431fef9dc2245518dc06b86ff00dcd102",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeclimate/php-test-reporter": "dev-master",
|
||||
"phpunit/phpunit": "5.2.*"
|
||||
},
|
||||
"type": "package",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Test\\": "test/",
|
||||
"Halfpastfour\\Collection\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"AGPL 3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bob Kruithof"
|
||||
}
|
||||
],
|
||||
"description": "A flexible PHP Collection complete with custom Iterator.",
|
||||
"homepage": "http://github.com/halfpastfouram/collection",
|
||||
"keywords": [
|
||||
"collection",
|
||||
"php"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/halfpastfouram/collection/issues",
|
||||
"source": "https://github.com/halfpastfouram/collection/tree/master"
|
||||
},
|
||||
"time": "2016-12-18T13:04:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-json",
|
||||
"version": "3.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laminas/laminas-json.git",
|
||||
"reference": "7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-json/zipball/7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec",
|
||||
"reference": "7a8a1d7bf2d05dd6c1fbd7c0868d3848cf2b57ec",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~8.0.0 || ~8.1.0 || ~8.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"zendframework/zend-json": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"laminas/laminas-coding-standard": "~2.4.0",
|
||||
"laminas/laminas-stdlib": "^2.7.7 || ^3.1",
|
||||
"phpunit/phpunit": "^9.5.25"
|
||||
},
|
||||
"suggest": {
|
||||
"laminas/laminas-json-server": "For implementing JSON-RPC servers",
|
||||
"laminas/laminas-xml2json": "For converting XML documents to JSON"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laminas\\Json\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP",
|
||||
"homepage": "https://laminas.dev",
|
||||
"keywords": [
|
||||
"json",
|
||||
"laminas"
|
||||
],
|
||||
"support": {
|
||||
"chat": "https://laminas.dev/chat",
|
||||
"docs": "https://docs.laminas.dev/laminas-json/",
|
||||
"forum": "https://discourse.laminas.dev",
|
||||
"issues": "https://github.com/laminas/laminas-json/issues",
|
||||
"rss": "https://github.com/laminas/laminas-json/releases.atom",
|
||||
"source": "https://github.com/laminas/laminas-json"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://funding.communitybridge.org/projects/laminas-project",
|
||||
"type": "community_bridge"
|
||||
}
|
||||
],
|
||||
"time": "2022-10-17T04:06:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "2.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "720488632c590286b88b80e62aa3d3d551ad4a50"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/720488632c590286b88b80e62aa3d3d551ad4a50",
|
||||
"reference": "720488632c590286b88b80e62aa3d3d551ad4a50",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"psr/log": "^1.0.1 || ^2.0 || ^3.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
|
||||
"doctrine/couchdb": "~1.0@dev",
|
||||
"elasticsearch/elasticsearch": "^7 || ^8",
|
||||
"ext-json": "*",
|
||||
"graylog2/gelf-php": "^1.4.2",
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"guzzlehttp/psr7": "^2.2",
|
||||
"mongodb/mongodb": "^1.8",
|
||||
"php-amqplib/php-amqplib": "~2.4 || ^3",
|
||||
"phpspec/prophecy": "^1.15",
|
||||
"phpstan/phpstan": "^0.12.91",
|
||||
"phpunit/phpunit": "^8.5.14",
|
||||
"predis/predis": "^1.1 || ^2.0",
|
||||
"rollbar/rollbar": "^1.3 || ^2 || ^3",
|
||||
"ruflin/elastica": "^7",
|
||||
"swiftmailer/swiftmailer": "^5.3|^6.0",
|
||||
"symfony/mailer": "^5.4 || ^6",
|
||||
"symfony/mime": "^5.4 || ^6"
|
||||
},
|
||||
"suggest": {
|
||||
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
|
||||
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
|
||||
"elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
|
||||
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
|
||||
"ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler",
|
||||
"ext-mbstring": "Allow to work properly with unicode symbols",
|
||||
"ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
|
||||
"ext-openssl": "Required to send log messages using SSL",
|
||||
"ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)",
|
||||
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
|
||||
"mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
|
||||
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
|
||||
"rollbar/rollbar": "Allow sending log messages to Rollbar",
|
||||
"ruflin/elastica": "Allow sending log messages to an Elastic Search server"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Monolog\\": "src/Monolog"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "https://seld.be"
|
||||
}
|
||||
],
|
||||
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
|
||||
"homepage": "https://github.com/Seldaek/monolog",
|
||||
"keywords": [
|
||||
"log",
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/Seldaek/monolog/issues",
|
||||
"source": "https://github.com/Seldaek/monolog/tree/2.8.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/Seldaek",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-07-24T11:55:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mpdf/mpdf",
|
||||
"version": "v8.0.15",
|
||||
|
@ -940,30 +1398,30 @@
|
|||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.4",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
"reference": "ef29f6d262798707a9edd554e2b82517ef3a9376"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376",
|
||||
"reference": "ef29f6d262798707a9edd554e2b82517ef3a9376",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
"Psr\\Log\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
|
@ -984,9 +1442,9 @@
|
|||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.4"
|
||||
"source": "https://github.com/php-fig/log/tree/2.0.0"
|
||||
},
|
||||
"time": "2021-05-03T11:20:27+00:00"
|
||||
"time": "2021-07-14T16:41:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "setasign/fpdi",
|
||||
|
@ -1136,6 +1594,152 @@
|
|||
"abandoned": "symfony/mailer",
|
||||
"time": "2021-10-18T15:26:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v5.4.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "ac09569844a9109a5966b9438fc29113ce77cf51"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51",
|
||||
"reference": "ac09569844a9109a5966b9438fc29113ce77cf51",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-mbstring": "~1.8",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Filesystem\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Provides basic utilities for the filesystem",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/filesystem/tree/v5.4.13"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-09-21T19:53:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"provide": {
|
||||
"ext-ctype": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Ctype\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"ctype",
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-iconv",
|
||||
"version": "v1.24.0",
|
||||
|
@ -1392,16 +1996,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.24.0",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
|
||||
"reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1416,7 +2020,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.23-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
|
@ -1424,12 +2028,12 @@
|
|||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
|
@ -1455,7 +2059,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -1471,7 +2075,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-30T18:21:41+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php72",
|
||||
|
@ -1548,6 +2152,232 @@
|
|||
}
|
||||
],
|
||||
"time": "2021-05-27T09:17:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.27.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php80\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v5.4.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/6e75fe6874cbc7e4773d049616ab450eff537bf1",
|
||||
"reference": "6e75fe6874cbc7e4773d049616ab450eff537bf1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Process\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v5.4.11"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-27T16:58:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v3.4.47",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/0719f6cf4633a38b2c1585140998579ce23b4b7d",
|
||||
"reference": "0719f6cf4633a38b2c1585140998579ce23b4b7d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-iconv": "*",
|
||||
"twig/twig": "~1.34|~2.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"ext-symfony_debug": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"Resources/functions/dump.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\VarDumper\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony mechanism for exploring and dumping PHP variables",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-dumper/tree/v3.4.47"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-10-24T10:57:07+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
@ -1559,7 +2389,7 @@
|
|||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"platform-overrides": {
|
||||
"php": "7.2.0"
|
||||
"php": "8.0.0"
|
||||
},
|
||||
"plugin-api-version": "2.3.0"
|
||||
}
|
||||
|
|
|
@ -1,67 +1,144 @@
|
|||
<?php
|
||||
/**
|
||||
* Pandora FMS API Checker Extension.
|
||||
*
|
||||
* @category API
|
||||
* @package Pandora FMS
|
||||
* @subpackage Extensions
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
function api_execute($url, $ip, $pandora_url, $apipass, $user, $password, $op, $op2, $id, $id2, $return_type, $other, $other_mode)
|
||||
{
|
||||
if (empty($url)) {
|
||||
$url = 'http://'.$ip.$pandora_url.'/include/api.php';
|
||||
// Begin.
|
||||
|
||||
$url .= '?';
|
||||
$url .= 'apipass='.$apipass;
|
||||
$url .= '&user='.$user;
|
||||
$url .= '&pass='.$password;
|
||||
$url .= '&op='.$op;
|
||||
$url .= '&op2='.$op2;
|
||||
if ($id !== '') {
|
||||
$url .= '&id='.$id;
|
||||
|
||||
/**
|
||||
* Api Execution.
|
||||
*
|
||||
* @param string $url Url.
|
||||
* @param string $ip Ip.
|
||||
* @param string $pandora_url Pandora_url.
|
||||
* @param string $apipass Apipass.
|
||||
* @param string $user User.
|
||||
* @param string $password Password.
|
||||
* @param string $op Op.
|
||||
* @param string $op2 Op2.
|
||||
* @param string $id Id.
|
||||
* @param string $id2 Id2.
|
||||
* @param string $return_type Return_type.
|
||||
* @param string $other Other.
|
||||
* @param string $other_mode Other_mode.
|
||||
* @param string $token Token.
|
||||
*
|
||||
* @return array.
|
||||
*/
|
||||
function api_execute(
|
||||
string $url,
|
||||
string $ip,
|
||||
string $pandora_url,
|
||||
string $apipass,
|
||||
string $user,
|
||||
string $password,
|
||||
string $op,
|
||||
string $op2,
|
||||
string $id='',
|
||||
string $id2='',
|
||||
string $return_type='',
|
||||
string $other='',
|
||||
string $other_mode='',
|
||||
string $token=''
|
||||
) {
|
||||
$data = [];
|
||||
|
||||
if (empty($url) === true) {
|
||||
$url = 'http://'.$ip.$pandora_url.'/include/api.php?';
|
||||
|
||||
if (empty($op) === false) {
|
||||
$data['op'] = $op;
|
||||
}
|
||||
|
||||
if ($id2 !== '') {
|
||||
$url .= '&id2='.$id2;
|
||||
if (empty($op2) === false) {
|
||||
$data['op2'] = $op2;
|
||||
}
|
||||
|
||||
if ($return_type !== '') {
|
||||
$url .= '&return_type='.$return_type;
|
||||
if (empty($id) === false) {
|
||||
$data['id'] = $id;
|
||||
}
|
||||
|
||||
if ($other !== '') {
|
||||
$url .= '&other_mode='.$other_mode;
|
||||
$url .= '&other='.$other;
|
||||
if (empty($id2) === false) {
|
||||
$data['id2'] = $id2;
|
||||
}
|
||||
|
||||
if (empty($return_type) === false) {
|
||||
$data['return_type'] = $return_type;
|
||||
}
|
||||
|
||||
if (empty($other) === false) {
|
||||
$data['other_mode'] = $other_mode;
|
||||
$data['other'] = $other;
|
||||
}
|
||||
|
||||
// If token is not reported,use old method.
|
||||
if (empty($token) === true) {
|
||||
$data['apipass'] = $apipass;
|
||||
$data['user'] = $user;
|
||||
$data['password'] = $password;
|
||||
}
|
||||
}
|
||||
|
||||
$curlObj = curl_init();
|
||||
$curlObj = curl_init($url);
|
||||
if (empty($data) === false) {
|
||||
$url .= http_build_query($data);
|
||||
}
|
||||
|
||||
// set the content type json
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Bearer '.$token,
|
||||
];
|
||||
|
||||
curl_setopt($curlObj, CURLOPT_URL, $url);
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curlObj, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, true);
|
||||
$result = curl_exec($curlObj);
|
||||
curl_close($curlObj);
|
||||
|
||||
$return = [
|
||||
return [
|
||||
'url' => $url,
|
||||
'result' => $result,
|
||||
];
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Perform API Checker
|
||||
*
|
||||
* @return void.
|
||||
*/
|
||||
function extension_api_checker()
|
||||
{
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Profile Management'
|
||||
|
@ -85,11 +162,12 @@ function extension_api_checker()
|
|||
$return_type = io_safe_output(get_parameter('return_type', ''));
|
||||
$other = io_safe_output(get_parameter('other', ''));
|
||||
$other_mode = io_safe_output(get_parameter('other_mode', 'url_encode_separator_|'));
|
||||
$token = get_parameter('token');
|
||||
|
||||
$api_execute = get_parameter('api_execute', 0);
|
||||
$api_execute = (bool) get_parameter('api_execute', false);
|
||||
|
||||
$return_call_api = '';
|
||||
if ($api_execute) {
|
||||
if ($api_execute === true) {
|
||||
$return_call_api = api_execute(
|
||||
$url,
|
||||
$ip,
|
||||
|
@ -103,7 +181,8 @@ function extension_api_checker()
|
|||
urlencode($id2),
|
||||
$return_type,
|
||||
urlencode($other),
|
||||
$other_mode
|
||||
$other_mode,
|
||||
$token
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -129,6 +208,11 @@ function extension_api_checker()
|
|||
$row[] = html_print_input_text('pandora_url', $pandora_url, '', 50, 255, true);
|
||||
$table->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
$row[] = __('API Token').ui_print_help_tip(__('Use API Token instead API Pass, User and Password.'), true);
|
||||
$row[] = html_print_input_text('token', $token, '', 50, 255, true);
|
||||
$table->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
$row[] = __('API Pass');
|
||||
$row[] = html_print_input_password('apipass', $apipass, '', 50, 255, true);
|
||||
|
@ -214,7 +298,7 @@ function extension_api_checker()
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
if ($api_execute) {
|
||||
if ($api_execute === true) {
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Result').'</legend>';
|
||||
echo __('URL').'<br />';
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
require_once __DIR__.'/../include/config.php';
|
||||
require_once __DIR__.'/../include/auth/mysql.php';
|
||||
require_once __DIR__.'/../include/functions.php';
|
||||
require_once __DIR__.'/../include/functions_db.php';
|
||||
/*
|
||||
* Review if sample agent is active and deploys configuration for
|
||||
* visual consoles if necessary
|
||||
*/
|
||||
global $config;
|
||||
|
||||
// Deployment of sample agent for visual consoles.
|
||||
if ($config['sample_agent'] == 1 && !isset($config['sample_agent_deployed'])) {
|
||||
$id_agente = db_get_sql('SELECT id_agente FROM tagente WHERE nombre = "Sample_Agent";');
|
||||
$modules = db_get_all_rows_filter('tagente_modulo', ['id_agente' => $id_agente], 'id_agente_modulo');
|
||||
$count_modules = count($modules);
|
||||
|
||||
// Update of layout 1 (Rack sample).
|
||||
$images_rack_server = [
|
||||
'rack_server_rack',
|
||||
'rack_server',
|
||||
'rack_switch',
|
||||
'rack_firewall',
|
||||
'rack_double_server',
|
||||
'rack_frame',
|
||||
'rack_pdu',
|
||||
];
|
||||
$query = 'UPDATE `tlayout_data` SET `id_agent` = '.$id_agente.', `id_agente_modulo` = CASE ';
|
||||
for ($i = 0; $i < $count_modules; $i++) {
|
||||
$query .= 'WHEN `image` = "'.$images_rack_server[$i].'" THEN '.$modules[$i]['id_agente_modulo'].' ';
|
||||
}
|
||||
|
||||
$query .= 'END WHERE `id_layout` = 1 AND `image` IN ("'.implode('","', $images_rack_server).'");';
|
||||
|
||||
db_process_sql($query);
|
||||
// Update of layout 2 (Dashboard).
|
||||
$query = 'UPDATE `tlayout_data` SET `id_agent`= '.$id_agente.', `id_agente_modulo` = CASE ';
|
||||
$query .= 'WHEN `id` = 107 THEN '.$modules[0]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 108 THEN '.$modules[1]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 109 THEN '.$modules[2]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 110 THEN '.$modules[2]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 111 THEN '.$modules[3]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 112 THEN '.$modules[4]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 113 THEN '.$modules[5]['id_agente_modulo'].' ';
|
||||
$query .= 'WHEN `id` = 114 THEN '.$modules[6]['id_agente_modulo'].' ';
|
||||
$query .= 'END WHERE `id_layout` = 2 AND `id` IN (107,108,109,110,111,112,113,114);';
|
||||
|
||||
db_process_sql($query);
|
||||
|
||||
// This setting will avoid regenerate all the times the visual consoles.
|
||||
config_update_value('sample_agent_deployed', 1);
|
||||
}
|
||||
|
||||
extensions_add_main_function('sample_agent_deployment');
|
|
@ -1685,3 +1685,10 @@ enterprise/operation/agentes/manage_transmap.php
|
|||
enterprise/operation/agentes/manage_transmap_creation.php
|
||||
enterprise/operation/agentes/manage_transmap_creation_phases_data.php
|
||||
enterprise/operation/agentes/transactional_map.php
|
||||
enterprise/godmode/agentes/inventory_manager.php
|
||||
enterprise/operation/agentes/agent_inventory.php
|
||||
enterprise/godmode/modules/manage_inventory_modules.php
|
||||
enterprise/godmode/modules/manage_inventory_modules_form.php
|
||||
enterprise/operation/inventory/inventory.php
|
||||
include/test.js
|
||||
include/web2image.js
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,25 @@
|
|||
START TRANSACTION;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_name` TEXT NULL,
|
||||
`text` TEXT NULL,
|
||||
`period` TEXT NULL,
|
||||
`ip` TEXT NULL,
|
||||
`type` TEXT NULL,
|
||||
`user` TEXT NULL,
|
||||
PRIMARY KEY (`id_filter`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE INDEX `tusuario_perfil_user` ON `tusuario_perfil` (`id_usuario`);
|
||||
CREATE INDEX `tusuario_perfil_group` ON `tusuario_perfil` (`id_grupo`);
|
||||
CREATE INDEX `tusuario_perfil_profile` ON `tusuario_perfil` (`id_perfil`);
|
||||
CREATE INDEX `tlayout_data_layout` ON `tlayout_data` (`id_layout`);
|
||||
CREATE INDEX `taddress_agent_agent` ON `taddress_agent` (`id_agent`);
|
||||
CREATE INDEX `ttag_name` ON `ttag` (name(15));
|
||||
CREATE INDEX `tservice_element_service` ON `tservice_element` (`id_service`);
|
||||
CREATE INDEX `tservice_element_agent` ON `tservice_element` (`id_agent`);
|
||||
CREATE INDEX `tservice_element_am` ON `tservice_element` (`id_agente_modulo`);
|
||||
CREATE INDEX `tagent_module_log_agent` ON `tagent_module_log` (`id_agent`);
|
||||
|
||||
COMMIT;
|
Binary file not shown.
Binary file not shown.
|
@ -224,6 +224,7 @@ if ($result === false) {
|
|||
$result = [];
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
|
|
|
@ -459,7 +459,20 @@ if ($id_agente) {
|
|||
|
||||
|
||||
// Inventory.
|
||||
$inventorytab = enterprise_hook('inventory_tab');
|
||||
$inventorytab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/page_white_text.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Inventory'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
if ($tab == 'inventory') {
|
||||
$inventorytab['active'] = true;
|
||||
} else {
|
||||
$inventorytab['active'] = false;
|
||||
}
|
||||
|
||||
if ($inventorytab == -1) {
|
||||
$inventorytab = '';
|
||||
|
@ -2118,6 +2131,9 @@ if ($delete_module) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Before delete the main module, check and delete the childrens from the original module.
|
||||
module_check_childrens_and_delete($id_borrar_modulo);
|
||||
|
||||
// Also call base function to delete modules.
|
||||
modules_delete_agent_module($id_borrar_modulo);
|
||||
|
||||
|
@ -2381,6 +2397,10 @@ switch ($tab) {
|
|||
include 'agent_wizard.php';
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
include 'inventory_manager.php';
|
||||
break;
|
||||
|
||||
default:
|
||||
if (enterprise_hook('switch_agent_tab', [$tab])) {
|
||||
// This will make sure that blank pages will have at least some
|
||||
|
@ -2473,6 +2493,11 @@ switch ($tab) {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Change description when edit port
|
||||
$( "#text-tcp_port" ).change(function() {
|
||||
$( "#textarea_description" ).text(`Checks port ${$( "#text-tcp_port" ).val()} is opened`);
|
||||
});
|
||||
|
||||
// Set the position and width of the subtab
|
||||
/*
|
||||
|
|
|
@ -0,0 +1,263 @@
|
|||
<?php
|
||||
// ______ __ _______ _______ _______
|
||||
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
|
||||
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
// You cannnot redistribute it without written permission of copyright holder.
|
||||
// ============================================================================
|
||||
// Load global variables
|
||||
global $config;
|
||||
|
||||
// Check user credentials
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access agent manager'
|
||||
);
|
||||
include $config['homedir'].'/general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
global $direccion_agente, $id_agente, $id_os;
|
||||
|
||||
// include_once ($config['homedir'].'/'.ENTERPRISE_DIR.'/include/functions_policies.php');
|
||||
require_once $config['homedir'].'/include/functions_ui.php';
|
||||
|
||||
// Initialize data
|
||||
$add_inventory_module = (boolean) get_parameter('add_inventory_module');
|
||||
$update_inventory_module = (boolean) get_parameter('update_inventory_module');
|
||||
$delete_inventory_module = (int) get_parameter('delete_inventory_module');
|
||||
$load_inventory_module = (int) get_parameter('load_inventory_module');
|
||||
$force_inventory_module = (int) get_parameter('force_inventory_module');
|
||||
$id_agent_module_inventory = (int) get_parameter('id_agent_module_inventory');
|
||||
$id_module_inventory = (int) get_parameter('id_module_inventory');
|
||||
$target = (string) get_parameter('target', '');
|
||||
$username = (string) get_parameter('username');
|
||||
$password = io_input_password((string) get_parameter('password'));
|
||||
$interval = (int) get_parameter('interval');
|
||||
|
||||
$custom_fields = array_map(
|
||||
function ($field) {
|
||||
$field['secure'] = (bool) $field['secure'];
|
||||
if ($field['secure']) {
|
||||
$field['value'] = io_input_password($field['value']);
|
||||
}
|
||||
|
||||
return $field;
|
||||
},
|
||||
get_parameter('custom_fields', [])
|
||||
);
|
||||
|
||||
$custom_fields_enabled = (bool) get_parameter('custom_fields_enabled');
|
||||
|
||||
// Add inventory module to agent
|
||||
if ($add_inventory_module) {
|
||||
$if_exists = db_get_value_filter(
|
||||
'id_agent_module_inventory',
|
||||
'tagent_module_inventory',
|
||||
[
|
||||
'id_agente' => $id_agente,
|
||||
'id_module_inventory' => $id_module_inventory,
|
||||
]
|
||||
);
|
||||
|
||||
if (!$if_exists) {
|
||||
$values = [
|
||||
'id_agente' => $id_agente,
|
||||
'id_module_inventory' => $id_module_inventory,
|
||||
'target' => $target,
|
||||
'interval' => $interval,
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode($custom_fields)) : '',
|
||||
];
|
||||
|
||||
$result = db_process_sql_insert('tagent_module_inventory', $values);
|
||||
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Successfully added inventory module'));
|
||||
} else {
|
||||
ui_print_error_message(__('Error adding inventory module'));
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('The inventory of the module already exists'));
|
||||
}
|
||||
|
||||
// Remove inventory module from agent
|
||||
} else if ($delete_inventory_module) {
|
||||
$result = db_process_sql_delete(
|
||||
'tagent_module_inventory',
|
||||
['id_agent_module_inventory' => $delete_inventory_module]
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Successfully deleted inventory module'));
|
||||
} else {
|
||||
ui_print_error_message(__('Error deleting inventory module'));
|
||||
}
|
||||
|
||||
// Update inventory module
|
||||
} else if ($force_inventory_module) {
|
||||
$result = db_process_sql_update('tagent_module_inventory', ['flag' => 1], ['id_agent_module_inventory' => $force_inventory_module]);
|
||||
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Successfully forced inventory module'));
|
||||
} else {
|
||||
ui_print_error_message(__('Error forcing inventory module'));
|
||||
}
|
||||
|
||||
// Update inventory module
|
||||
} else if ($update_inventory_module) {
|
||||
$values = [
|
||||
'target' => $target,
|
||||
'interval' => $interval,
|
||||
'username' => $username,
|
||||
'password' => $password,
|
||||
'custom_fields' => $custom_fields_enabled && !empty($custom_fields) ? base64_encode(json_encode($custom_fields)) : '',
|
||||
];
|
||||
|
||||
$result = db_process_sql_update('tagent_module_inventory', $values, ['id_agent_module_inventory' => $id_agent_module_inventory, 'id_agente' => $id_agente]);
|
||||
|
||||
if ($result) {
|
||||
ui_print_success_message(__('Successfully updated inventory module'));
|
||||
} else {
|
||||
ui_print_error_message(__('Error updating inventory module'));
|
||||
}
|
||||
}
|
||||
|
||||
// Load inventory module data for updating
|
||||
if ($load_inventory_module) {
|
||||
$sql = 'SELECT * FROM tagent_module_inventory WHERE id_module_inventory = '.$load_inventory_module;
|
||||
$row = db_get_row_sql($sql);
|
||||
|
||||
if (!empty($row)) {
|
||||
$id_agent_module_inventory = $row['id_agent_module_inventory'];
|
||||
$id_module_inventory = $row['id_module_inventory'];
|
||||
$target = $row['target'];
|
||||
$interval = $row['interval'];
|
||||
$username = $row['username'];
|
||||
$password = io_output_password($row['password']);
|
||||
$custom_fields = [];
|
||||
|
||||
if (!empty($row['custom_fields'])) {
|
||||
try {
|
||||
$custom_fields = array_map(
|
||||
function ($field) {
|
||||
if ($field['secure']) {
|
||||
$field['value'] = io_output_password($field['value']);
|
||||
}
|
||||
|
||||
return $field;
|
||||
},
|
||||
json_decode(base64_decode($row['custom_fields']), true)
|
||||
);
|
||||
$custom_fields_enabled = true;
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Inventory module error'));
|
||||
include 'general/footer.php';
|
||||
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$target = $direccion_agente;
|
||||
$interval = (string) SECONDS_1HOUR;
|
||||
$username = '';
|
||||
$password = '';
|
||||
$custom_fields_enabled = false;
|
||||
$custom_fields = [];
|
||||
}
|
||||
|
||||
// Inventory module configuration
|
||||
$form_buttons = '';
|
||||
if ($load_inventory_module) {
|
||||
$form_buttons .= html_print_input_hidden('id_agent_module_inventory', $id_agent_module_inventory, true);
|
||||
$form_buttons .= html_print_submit_button(__('Update'), 'update_inventory_module', false, 'class="sub next"', true);
|
||||
} else {
|
||||
$form_buttons .= html_print_submit_button(__('Add'), 'add_inventory_module', false, 'class="sub next"', true);
|
||||
}
|
||||
|
||||
echo ui_get_inventory_module_add_form(
|
||||
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente,
|
||||
$form_buttons,
|
||||
$load_inventory_module,
|
||||
$id_os,
|
||||
$target,
|
||||
$interval,
|
||||
$username,
|
||||
$password,
|
||||
$custom_fields_enabled,
|
||||
$custom_fields
|
||||
);
|
||||
|
||||
// Inventory module list
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tmodule_inventory, tagent_module_inventory
|
||||
WHERE tagent_module_inventory.id_agente = %d
|
||||
AND tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory
|
||||
ORDER BY name',
|
||||
$id_agente
|
||||
);
|
||||
$result = db_process_sql($sql);
|
||||
if (db_get_num_rows($sql) == 0) {
|
||||
echo ' </td></tr><tr><td>';
|
||||
} else {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->styleTable = 'margin-top: 20px;';
|
||||
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
|
||||
$table->head[1] = __('Name');
|
||||
$table->head[2] = __('Description');
|
||||
$table->head[3] = __('Target');
|
||||
$table->head[4] = __('Interval');
|
||||
$table->head[5] = __('Actions');
|
||||
$table->align = [];
|
||||
$table->align[5] = 'left';
|
||||
|
||||
foreach ($result as $row) {
|
||||
$data = [];
|
||||
|
||||
$sql = sprintf('SELECT id_policy FROM tpolicy_modules_inventory WHERE id = %d', $row['id_policy_module_inventory']);
|
||||
$id_policy = db_get_value_sql($sql);
|
||||
|
||||
if ($id_policy) {
|
||||
$policy = policies_get_policy($id_policy);
|
||||
$data[0] = '<a href="index.php?sec=gmodules&sec2='.ENTERPRISE_DIR.'/godmode/policies/policies&id='.$id_policy.'">';
|
||||
$data[0] .= html_print_image('images/policies_mc.png', true, ['border' => '0', 'title' => $policy['name']]);
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
$data[0] = '';
|
||||
}
|
||||
|
||||
$data[1] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&load_inventory_module='.$row['id_module_inventory'].'">'.$row['name'].'</a>';
|
||||
$data[2] = $row['description'];
|
||||
$data[3] = $row['target'];
|
||||
$data[4] = human_time_description_raw($row['interval']);
|
||||
// Delete module
|
||||
$data[5] = '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&delete_inventory_module='.$row['id_agent_module_inventory'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data[5] .= html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'invert_filter']);
|
||||
$data[5] .= '</b></a> ';
|
||||
// Update module
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&load_inventory_module='.$row['id_module_inventory'].'">';
|
||||
$data[5] .= html_print_image('images/config.png', true, ['border' => '0', 'title' => __('Update'), 'class' => 'invert_filter']);
|
||||
$data[5] .= '</b></a> ';
|
||||
// Force refresh module
|
||||
$data[5] .= '<a href="index.php?sec=estado&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'&force_inventory_module='.$row['id_agent_module_inventory'].'">';
|
||||
$data[5] .= html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force'), 'class' => 'invert_filter']).'</b></a>';
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
}
|
|
@ -52,13 +52,13 @@ if (!isset($policy_page)) {
|
|||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
|
||||
echo '<table width="100%" cellpadding="2" cellspacing="2" class="databox filters" >';
|
||||
echo "<tr><td class='datos bolder w20p'>";
|
||||
echo __('Search').' '.html_print_input_text(
|
||||
echo "<tr><td class='datos bolder w12p'><span class='mrgn_right_7px'>";
|
||||
echo __('Search').'</span>'.html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
15,
|
||||
255,
|
||||
5,
|
||||
5,
|
||||
true
|
||||
);
|
||||
html_print_input_hidden('search', 1);
|
||||
|
@ -73,7 +73,6 @@ echo '</td>';
|
|||
echo "<td class='datos w10p'>";
|
||||
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"');
|
||||
echo '</td>';
|
||||
echo "<td class='datos w10p'></td>";
|
||||
echo '</form>';
|
||||
// Check if there is at least one server of each type available to assign that
|
||||
// kind of modules. If not, do not show server type in combo.
|
||||
|
@ -179,7 +178,7 @@ if (($policy_page) || (isset($agent))) {
|
|||
// Create module/type combo.
|
||||
echo '<form id="create_module_type" method="post" action="'.$url.'">';
|
||||
if (!$policy_page) {
|
||||
echo '<td class="datos w20p bolder">';
|
||||
echo '<td class="datos w15p bolder">';
|
||||
echo __('Show in hierachy mode');
|
||||
if ($checked == 'true') {
|
||||
$checked = true;
|
||||
|
@ -198,8 +197,8 @@ if (($policy_page) || (isset($agent))) {
|
|||
echo '</td>';
|
||||
}
|
||||
|
||||
echo '<td class="datos w20p bolder">';
|
||||
echo __('<p>Type</p>');
|
||||
echo '<td class="datos w20p bolder lign_right"><span class="mrgn_right_7px">';
|
||||
echo __('Type').'</span>';
|
||||
html_print_select(
|
||||
$modules,
|
||||
'moduletype',
|
||||
|
@ -216,7 +215,7 @@ if (($policy_page) || (isset($agent))) {
|
|||
);
|
||||
html_print_input_hidden('edit_module', 1);
|
||||
echo '</td>';
|
||||
echo '<td class="datos w10p">';
|
||||
echo '<td class="datos w5p">';
|
||||
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
@ -247,6 +246,8 @@ if ($module_action === 'delete') {
|
|||
$print_result_msg = true;
|
||||
$count_correct_delete_modules = 0;
|
||||
foreach ($id_agent_modules_delete as $id_agent_module_del) {
|
||||
// Before delete the main module, check and delete the childrens from the original module.
|
||||
module_check_childrens_and_delete($id_agent_module_del);
|
||||
$id_grupo = (int) agents_get_agent_group($id_agente);
|
||||
$all_groups = agents_get_all_groups_agent($id_agente, $id_grupo);
|
||||
|
||||
|
@ -1176,7 +1177,11 @@ foreach ($modules as $module) {
|
|||
$data[6] = ui_print_status_image(
|
||||
$status,
|
||||
htmlspecialchars($title),
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
($module['ip_target']) ? 'IP: '.$module['ip_target'] : false
|
||||
);
|
||||
|
||||
// MAX / MIN values.
|
||||
|
@ -1278,9 +1283,13 @@ foreach ($modules as $module) {
|
|||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
||||
// Check module relatonships to show warning message.
|
||||
$url = htmlentities('index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo']);
|
||||
|
||||
// Delete module.
|
||||
$data[9] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'].'"
|
||||
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[9] = '<a href="#"
|
||||
onClick="get_children_modules(false, \''.$module['id_agente_modulo'].'\', \''.$url.'\')">';
|
||||
|
||||
$data[9] .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
|
@ -1304,8 +1313,7 @@ foreach ($modules as $module) {
|
|||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module"
|
||||
onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module" id="form_multiple_delete">';
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
@ -1339,6 +1347,8 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
@ -1347,7 +1357,18 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("input[name=submit_modules_action]").click(function (event) {
|
||||
event.preventDefault();
|
||||
var module_action = $('#module_action').val();
|
||||
if(module_action !== 'delete') {
|
||||
$("#form_multiple_delete").submit();
|
||||
} else {
|
||||
get_children_modules(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('[id^=checkbox-id_delete]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
|
@ -1389,4 +1410,60 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
window.location = window.location + "&checked=true";
|
||||
}
|
||||
}
|
||||
|
||||
function get_children_modules(multiple, id_module, url) {
|
||||
var selected_modules = [];
|
||||
|
||||
if(typeof(id_module) === 'undefined' && multiple === true) {
|
||||
$("input[id^='checkbox-id_delete']:checked").each(function () {
|
||||
selected_modules.push(this.value);
|
||||
});
|
||||
} else {
|
||||
selected_modules = [id_module];
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: 'include/ajax/module',
|
||||
get_children_modules: true,
|
||||
parent_modulues: JSON.parse(JSON.stringify(selected_modules)),
|
||||
},
|
||||
success: function (data) {
|
||||
delete_module_warning(data, multiple, id_module, url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delete_module_warning(children, multiple, id_module, url) {
|
||||
var message = '<?php echo __('Are you sure?'); ?>';
|
||||
var ret = false;
|
||||
|
||||
if(children != false) {
|
||||
message += '<br><strong>' + '<?php echo __('This module has children modules.The following modules will also be deleted: '); ?>' + '</strong><ul>';
|
||||
$.each(children, function (key, value) {
|
||||
message += '<li>' + value['nombre'] + '</li>';
|
||||
});
|
||||
message += '</ul>';
|
||||
}
|
||||
|
||||
confirmDialog({
|
||||
title: "<?php echo __('Delete module'); ?>",
|
||||
message: message,
|
||||
onAccept: function() {
|
||||
if(multiple === true) {
|
||||
$("#form_multiple_delete").submit();
|
||||
return true;
|
||||
} else {
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -69,7 +69,7 @@ if (strstr($page, 'policy_modules') === false) {
|
|||
|
||||
define('ID_NETWORK_COMPONENT_TYPE', 2);
|
||||
|
||||
if (empty($update_module_id)) {
|
||||
if (empty($edit_module)) {
|
||||
// Function in module_manager_editor_common.php.
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ $data[1] = html_print_input_text(
|
|||
$data[2] = __('Auth password').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||
$data[3] = html_print_input_password(
|
||||
'snmp3_auth_pass',
|
||||
$snmp3_auth_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -415,7 +415,7 @@ $data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_pr
|
|||
$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',
|
||||
$snmp3_privacy_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -711,6 +711,12 @@ $(document).ready (function () {
|
|||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
$('#password-snmp3_auth_pass').val('<?php echo $snmp3_auth_pass; ?>');
|
||||
$('#password-snmp3_privacy_pass').val('<?php echo $snmp3_privacy_pass; ?>');
|
||||
|
||||
observerInputPassword();
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ if (strstr($page, 'policy_modules') === false) {
|
|||
|
||||
define('ID_NETWORK_COMPONENT_TYPE', 4);
|
||||
|
||||
if (empty($update_module_id)) {
|
||||
if (empty($edit_module)) {
|
||||
// Function in module_manager_editor_common.php
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
} else {
|
||||
|
@ -85,6 +85,8 @@ $table_simple->rowstyle['macro_field'] = 'display:none';
|
|||
|
||||
push_table_simple($data, 'macro_field');
|
||||
|
||||
$password_fields = [];
|
||||
|
||||
// If there are $macros, we create the form fields
|
||||
if (!empty($macros)) {
|
||||
$macros = json_decode($macros, true);
|
||||
|
@ -102,7 +104,8 @@ if (!empty($macros)) {
|
|||
}
|
||||
|
||||
if ($m_hide) {
|
||||
$data[1] = html_print_input_password($m['macro'], io_output_password($m['value']), '', 100, 1024, true);
|
||||
$data[1] = html_print_input_password($m['macro'], '', '', 100, 1024, true);
|
||||
array_push($password_fields, $m);
|
||||
} else {
|
||||
$data[1] = html_print_input_text(
|
||||
$m['macro'],
|
||||
|
@ -125,6 +128,17 @@ if (!empty($macros)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
foreach ($password_fields as $k => $p) {
|
||||
echo "
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
$('input[name=\"".$p['macro']."\"]').val('".$p['value']."');
|
||||
});
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function changePluginSelect() {
|
||||
|
@ -140,4 +154,8 @@ if (!empty($macros)) {
|
|||
|
||||
forced_title_callback();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
observerInputPassword();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -82,7 +82,7 @@ if ($plugin_pass == '' && !$id_agent_module) {
|
|||
$plugin_pass = 1;
|
||||
}
|
||||
|
||||
if (empty($update_module_id)) {
|
||||
if (empty($edit_module)) {
|
||||
// Function in module_manager_editor_common.php
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
} else {
|
||||
|
|
|
@ -34,7 +34,7 @@ $extra_title = __('WMI server module');
|
|||
|
||||
define('ID_NETWORK_COMPONENT_TYPE', 6);
|
||||
|
||||
if (empty($update_module_id)) {
|
||||
if (empty($edit_module)) {
|
||||
// Function in module_manager_editor_common.php
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
} else {
|
||||
|
@ -116,7 +116,7 @@ $data[1] = html_print_input_text(
|
|||
$data[2] = __('Password');
|
||||
$data[3] = html_print_input_password(
|
||||
'plugin_pass',
|
||||
$plugin_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -191,6 +191,11 @@ $(document).ready (function () {
|
|||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
$('#password-plugin_pass').val('<?php echo $plugin_pass; ?>');
|
||||
|
||||
observerInputPassword();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1842,6 +1842,10 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
|||
$(document).ready (function () {
|
||||
populate_agents_selector();
|
||||
|
||||
// Add data-pendingdelete attribute to exclude delete_pending modules
|
||||
document.querySelector("#id_agents").dataset.pendingdelete = true
|
||||
document.querySelector("#modules_selection_mode").dataset.pendingdelete = true
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
$("#modules_selection_mode").change(agent_changed_by_multiple_agents);
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ $search_text = (string) get_parameter('search_text');
|
|||
$date_from = (string) get_parameter('date_from');
|
||||
$date_to = (string) get_parameter('date_to');
|
||||
$execution_type = (string) get_parameter('execution_type');
|
||||
$show_archived = (bool) get_parameter('archived');
|
||||
$show_archived = (bool) get_parameter_switch('archived', false);
|
||||
$agent_id = (int) get_parameter('agent_id');
|
||||
$agent_name = (string) ((empty($agent_id) === false) ? get_parameter('agent_name') : '');
|
||||
$module_id = (int) get_parameter('module_name_hidden');
|
||||
|
@ -313,12 +313,20 @@ $table_form = new StdClass();
|
|||
$table_form->class = 'databox filters';
|
||||
$table_form->width = '100%';
|
||||
$table_form->rowstyle = [];
|
||||
$table_form->cellstyle[0] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
|
||||
$table_form->cellstyle[2] = ['width: 100px;'];
|
||||
$table_form->cellstyle[3] = ['text-align: right;'];
|
||||
$table_form->colspan[3][0] = 3;
|
||||
$table_form->data = [];
|
||||
|
||||
$row = [];
|
||||
|
||||
// Search text.
|
||||
$row[] = __('Search').' '.html_print_input_text(
|
||||
$row[] = __('Search');
|
||||
|
||||
$row[] = html_print_input_text(
|
||||
'search_text',
|
||||
$search_text,
|
||||
'',
|
||||
|
@ -356,7 +364,8 @@ $execution_type_fields = [
|
|||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron'),
|
||||
];
|
||||
$row[] = __('Execution type').' '.html_print_select(
|
||||
$row[] = __('Execution type');
|
||||
$row[] = html_print_select(
|
||||
$execution_type_fields,
|
||||
'execution_type',
|
||||
$execution_type,
|
||||
|
@ -368,11 +377,11 @@ $row[] = __('Execution type').' '.html_print_select(
|
|||
false
|
||||
);
|
||||
// Show past downtimes.
|
||||
$row[] = __('Show past downtimes').' '.html_print_checkbox(
|
||||
'archived',
|
||||
1,
|
||||
$show_archived,
|
||||
true
|
||||
$row[] = __('Show past downtimes').' '.html_print_switch(
|
||||
[
|
||||
'name' => 'archived',
|
||||
'value' => $show_archived,
|
||||
]
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
@ -388,8 +397,8 @@ $params['return'] = true;
|
|||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
$agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params);
|
||||
$row[] = $agent_input;
|
||||
$row[] = __('Agent');
|
||||
$row[] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
// Module.
|
||||
$row[] = __('Module').' '.html_print_autocomplete_modules(
|
||||
|
@ -402,6 +411,10 @@ $row[] = __('Module').' '.html_print_autocomplete_modules(
|
|||
true
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
$row[] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'search',
|
||||
|
|
|
@ -40,6 +40,7 @@ $update_command = (bool) get_parameter('update_command');
|
|||
$create_command = (bool) get_parameter('create_command');
|
||||
$delete_command = (bool) get_parameter('delete_command');
|
||||
$copy_command = (bool) get_parameter('copy_command');
|
||||
$content_type = (string) get_parameter('content_type', 'text/plain');
|
||||
|
||||
$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands';
|
||||
|
||||
|
@ -226,7 +227,7 @@ if (is_ajax()) {
|
|||
'field'.$i.'_value',
|
||||
'text/plain',
|
||||
'',
|
||||
'',
|
||||
$content_type == 'text/plain',
|
||||
$is_management_allowed,
|
||||
'',
|
||||
'',
|
||||
|
@ -238,7 +239,7 @@ if (is_ajax()) {
|
|||
'field'.$i.'_value',
|
||||
'text/html',
|
||||
'',
|
||||
'text/html',
|
||||
$content_type == 'text/html',
|
||||
$is_management_allowed,
|
||||
'',
|
||||
'',
|
||||
|
|
|
@ -353,9 +353,18 @@ if ($delete_action) {
|
|||
if ($enable_alert) {
|
||||
$searchFlag = true;
|
||||
$id_alert = (int) get_parameter('id_alert');
|
||||
$id_agente = ($id_agente !== 0) ? $id_agente : alerts_get_agent_by_alert($id_alert);
|
||||
|
||||
$result = alerts_agent_module_disable($id_alert, false);
|
||||
|
||||
if ($id_agente) {
|
||||
db_process_sql(
|
||||
'UPDATE tagente
|
||||
SET update_alert_count = 1
|
||||
WHERE id_agente = '.$id_agente
|
||||
);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ALERT_MANAGEMENT,
|
||||
|
@ -380,9 +389,18 @@ if ($enable_alert) {
|
|||
if ($disable_alert) {
|
||||
$searchFlag = true;
|
||||
$id_alert = (int) get_parameter('id_alert');
|
||||
$id_agente = ($id_agente !== 0) ? $id_agente : alerts_get_agent_by_alert($id_alert);
|
||||
|
||||
$result = alerts_agent_module_disable($id_alert, true);
|
||||
|
||||
if ($id_agente) {
|
||||
db_process_sql(
|
||||
'UPDATE tagente
|
||||
SET update_alert_count = 1
|
||||
WHERE id_agente = '.$id_agente
|
||||
);
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ALERT_MANAGEMENT,
|
||||
|
|
|
@ -109,6 +109,8 @@ if ($id) {
|
|||
$text_agent = '';
|
||||
}
|
||||
}
|
||||
|
||||
$server_id = ($filter['server_id'] ?? '');
|
||||
} else {
|
||||
$id_group = '';
|
||||
$id_group_filter = '';
|
||||
|
@ -134,6 +136,7 @@ if ($id) {
|
|||
$filter_only_alert = '';
|
||||
$search_secondary_groups = 0;
|
||||
$search_recursive_groups = 0;
|
||||
$server_id = '';
|
||||
}
|
||||
|
||||
if ($update || $create) {
|
||||
|
@ -183,6 +186,12 @@ if ($update || $create) {
|
|||
$custom_data = get_parameter('custom_data', '');
|
||||
$custom_data_filter_type = get_parameter('custom_data_filter_type', '');
|
||||
|
||||
$server_id = '';
|
||||
if (is_metaconsole() === true) {
|
||||
$servers_array = get_parameter('server_id', []);
|
||||
$server_id = implode(',', $servers_array);
|
||||
}
|
||||
|
||||
$values = [
|
||||
'id_name' => $id_name,
|
||||
'id_group_filter' => $id_group_filter,
|
||||
|
@ -212,6 +221,7 @@ if ($update || $create) {
|
|||
'search_recursive_groups' => $search_recursive_groups,
|
||||
'custom_data' => $custom_data,
|
||||
'custom_data_filter_type' => $custom_data_filter_type,
|
||||
'server_id' => $server_id,
|
||||
];
|
||||
|
||||
$severity = explode(',', $severity);
|
||||
|
@ -708,6 +718,55 @@ if (is_metaconsole()) {
|
|||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$servers = metaconsole_get_servers();
|
||||
if (is_array($servers) === true) {
|
||||
$servers = array_reduce(
|
||||
$servers,
|
||||
function ($carry, $item) {
|
||||
$carry[$item['id']] = $item['server_name'];
|
||||
return $carry;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
$servers = [];
|
||||
}
|
||||
|
||||
$servers[0] = __('Metaconsola');
|
||||
|
||||
if ($server_id === '') {
|
||||
$server_id = array_keys($servers);
|
||||
} else {
|
||||
if (is_array($server_id) === false) {
|
||||
if (is_numeric($server_id) === true) {
|
||||
if ($server_id !== 0) {
|
||||
$server_id = [$server_id];
|
||||
} else {
|
||||
$server_id = array_keys($servers);
|
||||
}
|
||||
} else {
|
||||
$server_id = explode(',', $server_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[29][0] = '<b>'.__('Server').'</b>';
|
||||
$table->data[29][1] = html_print_select(
|
||||
$servers,
|
||||
'server_id[]',
|
||||
$server_id,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'height: 60px;'
|
||||
);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=edit_filter&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ if (is_ajax() === true) {
|
|||
if ($get_group_agents === true) {
|
||||
ob_clean();
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$id_os = (int) get_parameter('id_os', 0);
|
||||
$disabled = (int) get_parameter('disabled', 0);
|
||||
$search = (string) get_parameter('search', '');
|
||||
$recursion = (int) get_parameter('recursion', 0);
|
||||
|
@ -151,6 +152,10 @@ if (is_ajax() === true) {
|
|||
$filter['status'] = $status_agents;
|
||||
}
|
||||
|
||||
if ($id_os !== 0) {
|
||||
$filter['id_os'] = $id_os;
|
||||
}
|
||||
|
||||
$_sql_post = ' 1=1 ';
|
||||
if ($show_void_agents == 0) {
|
||||
$_sql_post .= ' AND id_agente IN (SELECT a.id_agente FROM tagente a, tagente_modulo b WHERE a.id_agente=b.id_agente AND b.delete_pending=0) AND \'1\'';
|
||||
|
@ -782,18 +787,18 @@ if ($tab == 'tree') {
|
|||
|
||||
$form = "<form method='post' action=''>";
|
||||
$form .= "<table class='databox filters bolder' width='100%'>";
|
||||
$form .= '<tr><td>'.__('Search').' ';
|
||||
$form .= '<tr><td>'.__('Search').' ';
|
||||
$form .= html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
100,
|
||||
100,
|
||||
30,
|
||||
30,
|
||||
true
|
||||
);
|
||||
$form .= '</td><td>';
|
||||
$form .= '</td><td style="text-align: right">';
|
||||
$form .= "<input name='find' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
$form .= '<td></tr>';
|
||||
$form .= '</tr>';
|
||||
$form .= '</table>';
|
||||
$form .= '</form>';
|
||||
|
||||
|
|
|
@ -550,7 +550,22 @@ $table->data['form_agents_3'][3] = html_print_select(
|
|||
|
||||
|
||||
$table->data['edit0'][0] = __('Dynamic Interval');
|
||||
$table->data['edit0'][1] = html_print_extended_select_for_time('dynamic_interval', '', '', 'None', '0', 10, true, 'width:150px', false);
|
||||
$table->data['edit0'][1] = html_print_extended_select_for_time(
|
||||
'dynamic_interval',
|
||||
-2,
|
||||
'',
|
||||
'None',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:150px',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['edit0'][2] = '<table width="100%"><tr><td><em>'.__('Dynamic Min.').'</em></td>';
|
||||
$table->data['edit0'][2] .= '<td align="right">'.html_print_input_text('dynamic_min', '', '', 10, 255, true).'</td></tr>';
|
||||
$table->data['edit0'][2] .= '<tr><td><em>'.__('Dynamic Max.').'</em></td>';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Godmode menu.
|
||||
*
|
||||
|
@ -180,7 +181,9 @@ if ($access_console_node === true) {
|
|||
$sub2['godmode/modules/manage_network_components']['id'] = 'Network components';
|
||||
$sub['templates']['sub2'] = $sub2;
|
||||
|
||||
enterprise_hook('inventory_submenu');
|
||||
$sub['godmode/modules/manage_inventory_modules']['text'] = __('Inventory modules');
|
||||
$sub['godmode/modules/manage_inventory_modules']['id'] = 'Inventory modules';
|
||||
|
||||
enterprise_hook('autoconfiguration_menu');
|
||||
enterprise_hook('agent_repository_menu');
|
||||
}
|
||||
|
@ -422,10 +425,10 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($
|
|||
if (is_user_admin($config['id_user']) === true) {
|
||||
$sub['extensions/db_status']['text'] = __('DB Schema Check');
|
||||
$sub['extensions/db_status']['id'] = 'DB Schema Check';
|
||||
$sub['extensions/db_status']['sec'] = 'gbman';
|
||||
$sub['extensions/db_status']['sec'] = 'gextensions';
|
||||
$sub['extensions/dbmanager']['text'] = __('DB Interface');
|
||||
$sub['extensions/dbmanager']['id'] = 'DB Interface';
|
||||
$sub['extensions/dbmanager']['sec'] = 'gbman';
|
||||
$sub['extensions/dbmanager']['sec'] = 'gextensions';
|
||||
enterprise_hook('dbBackupManager');
|
||||
enterprise_hook('elasticsearch_interface_menu');
|
||||
}
|
||||
|
@ -578,6 +581,14 @@ if ($access_console_node === true) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($access_console_node === true) {
|
||||
// About.
|
||||
$menu_godmode['about']['text'] = __('About');
|
||||
$menu_godmode['about']['id'] = 'about';
|
||||
}
|
||||
|
||||
if ((bool) $config['pure'] === false) {
|
||||
menu_print_menu($menu_godmode);
|
||||
}
|
||||
|
||||
echo '<div id="about-div"></div>';
|
||||
|
|
|
@ -0,0 +1,393 @@
|
|||
<?php
|
||||
// ______ __ _______ _______ _______
|
||||
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
|
||||
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
// You cannnot redistribute it without written permission of copyright holder.
|
||||
// ============================================================================
|
||||
// Load global variables
|
||||
global $config;
|
||||
|
||||
// Check user credentials.
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Inventory Module Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
require_once $config['homedir'].'/include/functions_inventory.php';
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
|
||||
$management_allowed = is_management_allowed();
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
$sec = 'advanced';
|
||||
enterprise_include_once('meta/include/functions_components_meta.php');
|
||||
enterprise_hook('open_meta_frame');
|
||||
components_meta_print_header();
|
||||
|
||||
if ($management_allowed === false) {
|
||||
ui_print_warning_message(__('To manage inventory plugin you must activate centralized management'));
|
||||
}
|
||||
} else {
|
||||
$sec = 'gmodules';
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Inventory modules'),
|
||||
'images/page_white_text.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if ($management_allowed === false) {
|
||||
if (is_metaconsole() === false) {
|
||||
$url = '<a target="_blank" href="'.ui_get_meta_url(
|
||||
'index.php?sec=advanced&sec2=godmode/modules/manage_inventory_modules'
|
||||
).'">'.__('metaconsole').'</a>';
|
||||
} else {
|
||||
$url = __('any node');
|
||||
}
|
||||
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'This console is not manager of this environment, please manage this feature from centralized manager console. Go to %s to manage it.',
|
||||
$url
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
||||
if ($is_windows) {
|
||||
ui_print_error_message(__('Not supported in Windows systems'));
|
||||
}
|
||||
|
||||
// Initialize variables.
|
||||
$offset = (int) get_parameter('offset');
|
||||
$create_module_inventory = (bool) get_parameter('create_module_inventory');
|
||||
$update_module_inventory = (bool) get_parameter('update_module_inventory');
|
||||
$delete_inventory_module = (int) get_parameter('delete_inventory_module');
|
||||
$multiple_delete = (bool) get_parameter('multiple_delete', 0);
|
||||
$id_module_inventory = (int) get_parameter('id_module_inventory');
|
||||
$name = (string) get_parameter('name');
|
||||
$description = (string) get_parameter('description');
|
||||
$id_os = (int) get_parameter('id_os');
|
||||
if ($id_os == 0) {
|
||||
$id_os = 'NULL';
|
||||
}
|
||||
|
||||
$interpreter = (string) get_parameter('interpreter');
|
||||
$script_mode = (string) get_parameter('script_mode');
|
||||
$code = (string) get_parameter('code');
|
||||
$code = base64_encode(str_replace("\r", '', html_entity_decode($code, ENT_QUOTES)));
|
||||
$format = (string) get_parameter('format');
|
||||
$block_mode = (int) get_parameter('block_mode', 0);
|
||||
$script_path = (string) get_parameter('script_path');
|
||||
|
||||
// Create inventory module.
|
||||
if ($create_module_inventory === true) {
|
||||
$values = [
|
||||
'name' => $name,
|
||||
'description' => $description,
|
||||
'id_os' => $id_os,
|
||||
'interpreter' => $interpreter,
|
||||
'code' => $code,
|
||||
'data_format' => $format,
|
||||
'block_mode' => $block_mode,
|
||||
'script_mode' => $script_mode,
|
||||
'script_path' => $script_path,
|
||||
];
|
||||
|
||||
$result = (bool) inventory_create_inventory_module($values);
|
||||
|
||||
$auditMessage = ((bool) $result === true) ? sprintf('Create inventory module #%s', $result) : 'Fail try to create inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
$auditMessage
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
(bool) $result,
|
||||
__('Successfully created inventory module'),
|
||||
__('Error creating inventory module')
|
||||
);
|
||||
|
||||
// Update inventory module.
|
||||
} else if ($update_module_inventory === true) {
|
||||
$values = [
|
||||
'name' => $name,
|
||||
'description' => $description,
|
||||
'id_os' => $id_os,
|
||||
'interpreter' => $interpreter,
|
||||
'code' => $code,
|
||||
'data_format' => $format,
|
||||
'block_mode' => $block_mode,
|
||||
'script_mode' => $script_mode,
|
||||
'script_path' => $script_path,
|
||||
];
|
||||
|
||||
$result = inventory_update_inventory_module($id_module_inventory, $values);
|
||||
|
||||
$auditMessage = ((bool) $result === true) ? 'Update inventory module' : 'Fail try to update inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
sprintf('%s #%s', $auditMessage, $id_module_inventory)
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
(bool) $result,
|
||||
__('Successfully updated inventory module'),
|
||||
__('Error updating inventory module')
|
||||
);
|
||||
|
||||
// Delete inventory module.
|
||||
} else if ((bool) $delete_inventory_module === true) {
|
||||
$result = db_process_sql_delete(
|
||||
'tmodule_inventory',
|
||||
['id_module_inventory' => $delete_inventory_module]
|
||||
);
|
||||
|
||||
$auditMessage = ((bool) $result === true) ? 'Delete inventory module' : 'Fail try to delete inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
sprintf('%s #%s', $auditMessage, $id_module_inventory)
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
(bool) $result,
|
||||
__('Successfully deleted inventory module'),
|
||||
__('Error deleting inventory module')
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$setups = db_get_all_rows_in_table('tmetaconsole_setup');
|
||||
foreach ($setups as $key => $setup) {
|
||||
if (metaconsole_connect($setup) == NOERR) {
|
||||
$result = db_process_sql_delete(
|
||||
'tmodule_inventory',
|
||||
['id_module_inventory' => $delete_inventory_module]
|
||||
);
|
||||
|
||||
$auditMessage = ((bool) $result === true) ? 'Delete inventory module' : 'Fail try to delete inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
sprintf('%s #%s', $auditMessage, $id_module_inventory)
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
(bool) $result,
|
||||
$setup['server_name'].': '.__('Successfully deleted inventory module'),
|
||||
$setup['server_name'].': '.__('Error deleting inventory module')
|
||||
);
|
||||
}
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
} else if ($multiple_delete) {
|
||||
$ids = (array) get_parameter('delete_multiple', []);
|
||||
|
||||
foreach ($ids as $id) {
|
||||
$result = db_process_sql_delete('tmodule_inventory', ['id_module_inventory' => $id]);
|
||||
|
||||
if ($result === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
$result = true;
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$str_ids = implode(',', $ids);
|
||||
$auditMessage = ($result === true) ? 'Multiple delete inventory module' : 'Fail try to delete inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
sprintf('%s :%s', $auditMessage, $str_ids)
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully multiple deleted'),
|
||||
__('Not deleted. Error deleting multiple data')
|
||||
);
|
||||
|
||||
$id = 0;
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$setups = db_get_all_rows_in_table('tmetaconsole_setup');
|
||||
foreach ($setups as $key => $setup) {
|
||||
if (metaconsole_connect($setup) == NOERR) {
|
||||
foreach ($ids as $id) {
|
||||
$result_node = db_process_sql_delete('tmodule_inventory', ['id_module_inventory' => $id]);
|
||||
|
||||
if ($result_node === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result_node !== false) {
|
||||
$result_node = true;
|
||||
} else {
|
||||
$result_node = false;
|
||||
}
|
||||
|
||||
$str_ids = implode(',', $ids);
|
||||
$auditMessage = ($result_node === true) ? 'Multiple delete inventory module' : 'Fail try to delete inventory module';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
sprintf('%s :%s', $auditMessage, $str_ids)
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
$result_node,
|
||||
$setup['server_name'].': '.__('Successfully multiple deleted'),
|
||||
$setup['server_name'].': '.__('Not deleted. Error deleting multiple data')
|
||||
);
|
||||
}
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$total_modules = db_get_sql('SELECT COUNT(*) FROM tmodule_inventory');
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->size = [];
|
||||
$table->size[0] = '140px';
|
||||
$table->align = [];
|
||||
$table->align[2] = 'left';
|
||||
$table->align[4] = 'left';
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->head[0] = __('Name');
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('OS');
|
||||
$table->head[3] = __('Interpreter');
|
||||
|
||||
if ($management_allowed === true) {
|
||||
$table->head[4] = __('Action').html_print_checkbox('all_delete', 0, false, true, false);
|
||||
}
|
||||
|
||||
$result = inventory_get_modules_list($offset);
|
||||
|
||||
if ($result === false) {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No inventory modules defined') ]);
|
||||
} else {
|
||||
$status = '';
|
||||
$begin = true;
|
||||
while ($row = array_shift($result)) {
|
||||
$data = [];
|
||||
$begin = false;
|
||||
if ($management_allowed === true) {
|
||||
$data[0] = '<strong><a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form&id_module_inventory='.$row['id_module_inventory'].'">'.$row['name'].'</a></strong>';
|
||||
} else {
|
||||
$data[0] = '<strong>'.$row['name'].'</strong>';
|
||||
}
|
||||
|
||||
$data[1] = $row['description'];
|
||||
if ($row['os_name'] == null) {
|
||||
$data[2] = html_print_image('images/agent.png', true, ['border' => '0', 'alt' => __('Agent'), 'title' => __('Agent'), 'height' => '18', 'class' => 'invert_filter']);
|
||||
} else {
|
||||
$data[2] = ui_print_os_icon($row['id_os'], false, true);
|
||||
}
|
||||
|
||||
if ($row['interpreter'] == '') {
|
||||
$data[3] = __('Local module');
|
||||
} else {
|
||||
$data[3] = __('Remote/Local');
|
||||
}
|
||||
|
||||
if ($management_allowed === true) {
|
||||
// Update module.
|
||||
$data[4] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form&id_module_inventory='.$row['id_module_inventory'].'">';
|
||||
$data[4] .= html_print_image('images/config.png', true, ['border' => '0', 'title' => __('Update'), 'class' => 'invert_filter']).'</b></a>';
|
||||
|
||||
// Delete module.
|
||||
$data[4] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules&delete_inventory_module='.$row['id_module_inventory'].'" onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= html_print_image('images/cross.png', true, ['border' => '0', 'title' => __('Delete'), 'class' => 'invert_filter']);
|
||||
$data[4] .= '</b></a> ';
|
||||
$data[4] .= html_print_checkbox_extended('delete_multiple[]', $row['id_module_inventory'], false, false, '', 'class="check_delete"', true);
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_inventory_modules'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset);
|
||||
html_print_table($table);
|
||||
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div class='pdd_l_5px float-right'>";
|
||||
if ($management_allowed === true) {
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
if ($management_allowed === true) {
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
|
||||
echo '<div class="float-right mrgn_btn_15px">';
|
||||
html_print_input_hidden('create_module_inventory', 1);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
enterprise_hook('close_meta_frame');
|
||||
echo '<div id="deploy_messages" class="invisible">';
|
||||
echo '<span>'.__(
|
||||
'The configurations of inventory modules from the nodes have been unified.
|
||||
From this point on, changes to the inventory scripts must be made through this screen.'
|
||||
).'</br></br>'.__('You can find more information at:')."<a href='https://pandorafms.com/manual'>https://pandorafms.com/manual</a>".'</span>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function() {
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
}
|
||||
else {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,206 @@
|
|||
<?php
|
||||
// ______ __ _______ _______ _______
|
||||
// | __ \.---.-.-----.--| |.-----.----.---.-. | ___| | | __|
|
||||
// | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
// |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright (c) 2007-2021 Artica Soluciones Tecnologicas, http://www.artica.es
|
||||
// This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
// You cannnot redistribute it without written permission of copyright holder.
|
||||
// ============================================================================
|
||||
// Load global variables
|
||||
global $config;
|
||||
|
||||
// Check user credentials
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Inventory Module Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
enterprise_include_once('meta/include/functions_components_meta.php');
|
||||
enterprise_hook('open_meta_frame');
|
||||
components_meta_print_header();
|
||||
} else {
|
||||
$sec = 'gmodules';
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Inventory modules'),
|
||||
'images/op_inventory.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// Header
|
||||
$is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';
|
||||
if ($is_windows) {
|
||||
ui_print_error_message(__('Not supported in Windows systems'));
|
||||
}
|
||||
|
||||
// Initialize variables
|
||||
$id_module_inventory = (int) get_parameter('id_module_inventory');
|
||||
|
||||
$script_mode = 1;
|
||||
|
||||
// Updating
|
||||
if ($id_module_inventory) {
|
||||
$row = db_get_row(
|
||||
'tmodule_inventory',
|
||||
'id_module_inventory',
|
||||
$id_module_inventory
|
||||
);
|
||||
|
||||
if (!empty($row)) {
|
||||
$name = $row['name'];
|
||||
$description = $row['description'];
|
||||
$id_os = $row['id_os'];
|
||||
$interpreter = $row['interpreter'];
|
||||
$code = $row['code'];
|
||||
$data_format = $row['data_format'];
|
||||
$block_mode = $row['block_mode'];
|
||||
$script_path = $row['script_path'];
|
||||
$script_mode = $row['script_mode'];
|
||||
} else {
|
||||
ui_print_error_message(__('Inventory module error'));
|
||||
include 'general/footer.php';
|
||||
return;
|
||||
}
|
||||
|
||||
// New module
|
||||
} else {
|
||||
$name = '';
|
||||
$description = '';
|
||||
$id_os = 1;
|
||||
$interpreter = '';
|
||||
$code = '';
|
||||
$data_format = '';
|
||||
$block_mode = 0;
|
||||
}
|
||||
|
||||
if ($id_os == null) {
|
||||
$disabled = true;
|
||||
} else {
|
||||
$disabled = false;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = '<strong>'.__('Name').'</strong>';
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 45, 100, true, $disabled);
|
||||
$table->data[1][0] = '<strong>'.__('Description').'</strong>';
|
||||
$table->data[1][1] = html_print_input_text('description', $description, '', 60, 500, true);
|
||||
$table->data[2][0] = '<strong>'.__('OS').'</strong>';
|
||||
$table->data[2][1] = html_print_select_from_sql(
|
||||
'SELECT id_os, name FROM tconfig_os ORDER BY name',
|
||||
'id_os',
|
||||
$id_os,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
$return = true
|
||||
);
|
||||
|
||||
$table->data[3][0] = '<strong>'.__('Interpreter').'</strong>';
|
||||
$table->data[3][1] = html_print_input_text('interpreter', $interpreter, '', 25, 100, true);
|
||||
$table->data[3][1] .= ui_print_help_tip(__('Left blank for the LOCAL inventory modules'), true);
|
||||
|
||||
$table->data['block_mode'][0] = '<strong>'.__('Block Mode').'</strong>';
|
||||
$table->data['block_mode'][1] = html_print_checkbox('block_mode', 1, $block_mode, true);
|
||||
|
||||
$table->data[4][0] = '<strong>'.__('Format').'</strong>';
|
||||
$table->data[4][0] .= ui_print_help_tip(__('separate fields with ').SEPARATOR_COLUMN, true);
|
||||
$table->data[4][1] = html_print_input_text('format', $data_format, '', 50, 100, true);
|
||||
|
||||
$table->data[5][0] = '<strong>'.__('Script mode').'</strong>';
|
||||
$table->data[5][0] .= ui_print_help_tip(__(''), true);
|
||||
$table->data[5][1] = __('Use script');
|
||||
$table->data[5][1] .= html_print_radio_button(
|
||||
'script_mode',
|
||||
1,
|
||||
'',
|
||||
$script_mode,
|
||||
true
|
||||
).' ';
|
||||
$table->data[5][1] .= '    '.__('Use inline code');
|
||||
$table->data[5][1] .= html_print_radio_button(
|
||||
'script_mode',
|
||||
2,
|
||||
'',
|
||||
$script_mode,
|
||||
true
|
||||
).' ';
|
||||
|
||||
$table->data[6][0] = '<strong>'.__('Script path').'</strong>';
|
||||
$table->data[6][1] = html_print_input_text('script_path', $script_path, '', 50, 1000, true);
|
||||
|
||||
$table->data[7][0] = '<strong>'.__('Code').'</strong>';
|
||||
$table->data[7][0] .= ui_print_help_tip(__("Here is placed the script for the REMOTE inventory modules Local inventory modules don't use this field").SEPARATOR_COLUMN, true);
|
||||
|
||||
$table->data[7][1] = html_print_textarea('code', 25, 80, base64_decode($code), '', true);
|
||||
|
||||
echo '<form name="inventorymodule" id="inventorymodule_form" method="post"
|
||||
action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules">';
|
||||
|
||||
html_print_table($table);
|
||||
if ($id_module_inventory) {
|
||||
html_print_input_hidden('update_module_inventory', 1);
|
||||
html_print_input_hidden('id_module_inventory', $id_module_inventory);
|
||||
} else {
|
||||
html_print_input_hidden('create_module_inventory', 1);
|
||||
}
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
if ($id_module_inventory) {
|
||||
html_print_submit_button(__('Update'), 'submit', false, 'class="sub next"');
|
||||
} else {
|
||||
html_print_submit_button(__('Create'), 'submit', false, 'class="sub upd"');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
enterprise_hook('close_meta_frame');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
var mode = <?php echo $script_mode; ?>;
|
||||
|
||||
if (mode == 1) {
|
||||
$('#table1-6').show();
|
||||
$('#table1-7').hide();
|
||||
} else {
|
||||
$('#table1-7').show();
|
||||
$('#table1-6').hide();
|
||||
}
|
||||
|
||||
$('input[type=radio][name=script_mode]').change(function() {
|
||||
if (this.value == 1) {
|
||||
$('#table1-6').show();
|
||||
$('#table1-7').hide();
|
||||
}
|
||||
else if (this.value == 2) {
|
||||
$('#table1-7').show();
|
||||
$('#table1-6').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -177,7 +177,7 @@ switch ($activeTab) {
|
|||
$background_color = (string) get_parameter('background_color');
|
||||
$width = (int) get_parameter('width');
|
||||
$height = (int) get_parameter('height');
|
||||
$visualConsoleName = (string) get_parameter('name');
|
||||
$visualConsoleName = io_safe_input((string) get_parameter('name'));
|
||||
$is_favourite = (int) get_parameter('is_favourite_sent');
|
||||
$auto_adjust = (int) get_parameter('auto_adjust_sent');
|
||||
|
||||
|
|
|
@ -684,23 +684,6 @@ $table_other->data[$i++][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table_other->data[$i][0] = __('PhantomJS cache cleanup ').$tip;
|
||||
$table_other->data[$i++][1] = html_print_input(
|
||||
[
|
||||
'type' => 'select',
|
||||
'name' => 'phantomjs_cache_interval',
|
||||
'return' => true,
|
||||
'fields' => [
|
||||
PHANTOM_CACHE_CLEANUP_ONCE => __('No scheduled'),
|
||||
PHANTOM_CACHE_CLEANUP_WEEKLY => __('Each week'),
|
||||
PHANTOM_CACHE_CLEANUP_DAILY => __('Each day'),
|
||||
],
|
||||
'selected' => ($config['phantomjs_cache_interval'] ?? PHANTOM_CACHE_CLEANUP_ONCE),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Agent Wizard defaults.
|
||||
$defaultAgentWizardOptions = json_decode(io_safe_output($config['agent_wizard_defaults']));
|
||||
$tableSnmpWizard = new stdClass();
|
||||
|
|
|
@ -95,11 +95,11 @@ $table->data[$i++][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Phantomjs bin directory');
|
||||
$table->data[$i][0] = __('Chromium path');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'phantomjs_bin',
|
||||
'chromium_path',
|
||||
io_safe_output(
|
||||
$config['phantomjs_bin']
|
||||
$config['chromium_path']
|
||||
),
|
||||
'',
|
||||
30,
|
||||
|
@ -350,6 +350,87 @@ $table->data[$i++][1] = html_print_textarea(
|
|||
true
|
||||
);
|
||||
|
||||
// Inventory changes blacklist.
|
||||
$table->data[$i][0] = __('Inventory changes blacklist');
|
||||
|
||||
$inventory_changes_blacklist_id = get_parameter(
|
||||
'inventory_changes_blacklist',
|
||||
$config['inventory_changes_blacklist']
|
||||
);
|
||||
|
||||
if (!is_array($inventory_changes_blacklist_id)) {
|
||||
$inventory_changes_blacklist_id = explode(
|
||||
',',
|
||||
$inventory_changes_blacklist_id
|
||||
);
|
||||
}
|
||||
|
||||
$inventory_modules = db_get_all_rows_sql(
|
||||
'SELECT mi.id_module_inventory, mi.name module_inventory_name, os.name os_name
|
||||
FROM tmodule_inventory mi, tconfig_os os
|
||||
WHERE os.id_os = mi.id_os'
|
||||
);
|
||||
|
||||
$inventory_changes_blacklist = [];
|
||||
$inventory_changes_blacklist_out = [];
|
||||
|
||||
foreach ($inventory_modules as $inventory_module) {
|
||||
if (in_array($inventory_module['id_module_inventory'], $inventory_changes_blacklist_id)) {
|
||||
$inventory_changes_blacklist[$inventory_module['id_module_inventory']] = $inventory_module['module_inventory_name'].' ('.$inventory_module['os_name'].')';
|
||||
} else {
|
||||
$inventory_changes_blacklist_out[$inventory_module['id_module_inventory']] = $inventory_module['module_inventory_name'].' ('.$inventory_module['os_name'].')';
|
||||
}
|
||||
}
|
||||
|
||||
$select_out = html_print_select(
|
||||
$inventory_changes_blacklist_out,
|
||||
'inventory_changes_blacklist_out[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:200px'
|
||||
);
|
||||
$arrows = ' ';
|
||||
$select_in = html_print_select(
|
||||
$inventory_changes_blacklist,
|
||||
'inventory_changes_blacklist[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:200px'
|
||||
);
|
||||
|
||||
$table_ichanges = '<table>
|
||||
<tr>
|
||||
<td>'.__('Out of black list').'</td>
|
||||
<td></td>
|
||||
<td>'.__('In black list').'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.$select_out.'</td>
|
||||
<td>
|
||||
<a href="javascript:">'.html_print_image('images/darrowright.png', true, ['id' => 'right_iblacklist', 'alt' => __('Push selected modules into blacklist'), 'title' => __('Push selected modules into blacklist'), 'class' => 'invert_filter']).'</a>
|
||||
<br><br>
|
||||
<a href="javascript:">'.html_print_image('images/darrowleft.png', true, ['id' => 'left_iblacklist', 'alt' => __('Pop selected modules out of blacklist'), 'title' => __('Pop selected modules out of blacklist'), 'class' => 'invert_filter']).'</a>
|
||||
</td>
|
||||
<td>'.$select_in.'</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
$table->data[$i++][1] = $table_ichanges;
|
||||
|
||||
$table->data[$i][0] = __('Referer security');
|
||||
$table->data[$i++][1] = html_print_checkbox_switch(
|
||||
'referer_security',
|
||||
|
@ -815,5 +896,64 @@ $(document).ready (function () {
|
|||
})
|
||||
|
||||
$('input#button-email_test').click(perform_email_test);
|
||||
|
||||
$("#right_iblacklist").click (function () {
|
||||
jQuery.each($("select[name='inventory_changes_blacklist_out[]'] option:selected"), function (key, value) {
|
||||
imodule_name = $(value).html();
|
||||
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
|
||||
id_imodule = $(value).attr('value');
|
||||
$("select[name='inventory_changes_blacklist[]']")
|
||||
.append(
|
||||
$("<option></option>")
|
||||
.val(id_imodule)
|
||||
.html('<i>' + imodule_name + '</i>')
|
||||
);
|
||||
$("#inventory_changes_blacklist_out")
|
||||
.find("option[value='" + id_imodule + "']").remove();
|
||||
$("#inventory_changes_blacklist")
|
||||
.find("option[value='']").remove();
|
||||
if($("#inventory_changes_blacklist_out option").length == 0) {
|
||||
$("select[name='inventory_changes_blacklist_out[]']")
|
||||
.append(
|
||||
$("<option></option>")
|
||||
.val('')
|
||||
.html('<i><?php echo __('None'); ?></i>')
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#left_iblacklist").click (function () {
|
||||
jQuery.each($("select[name='inventory_changes_blacklist[]'] option:selected"), function (key, value) {
|
||||
imodule_name = $(value).html();
|
||||
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
|
||||
id_imodule = $(value).attr('value');
|
||||
$("select[name='inventory_changes_blacklist_out[]']")
|
||||
.append(
|
||||
$("<option></option>")
|
||||
.val(id_imodule)
|
||||
.html('<i>' + imodule_name + '</i>')
|
||||
);
|
||||
$("#inventory_changes_blacklist")
|
||||
.find("option[value='" + id_imodule + "']").remove();
|
||||
$("#inventory_changes_blacklist_out")
|
||||
.find("option[value='']").remove();
|
||||
if($("#inventory_changes_blacklist option").length == 0) {
|
||||
$("select[name='inventory_changes_blacklist[]']")
|
||||
.append(
|
||||
$("<option></option>")
|
||||
.val('')
|
||||
.html('<i><?php echo __('None'); ?></i>')
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit-update_button").click(function () {
|
||||
$('#inventory_changes_blacklist option').map(function(){
|
||||
$(this).prop('selected', true);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1314,7 +1314,7 @@ $row++;
|
|||
|
||||
$decimal_separators = [
|
||||
',' => ',',
|
||||
'.' => '.'
|
||||
'.' => '.',
|
||||
];
|
||||
|
||||
$table_other->data[$row][0] = __('Decimal separator');
|
||||
|
|
|
@ -1599,6 +1599,10 @@ $(document).ready (function () {
|
|||
name: "get_recovery_fields",
|
||||
value: "0"
|
||||
});
|
||||
values.push({
|
||||
name: "content_type",
|
||||
value: "<?php echo $al_field4; ?>"
|
||||
})
|
||||
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
||||
values,
|
||||
function (data, status) {
|
||||
|
@ -1624,8 +1628,9 @@ $(document).ready (function () {
|
|||
// The row provided has a predefined class. We delete it.
|
||||
$('#table_macros-field' + i)
|
||||
.removeAttr('class');
|
||||
|
||||
$("[name=field" + i + "_value]").val(old_value).trigger('change');
|
||||
if(old_value && i != 4){
|
||||
$("[name=field" + i + "_value]").val(old_value).trigger('change');
|
||||
}
|
||||
$('#table_macros-field').show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -404,6 +404,7 @@ if ($id_profile || $new_profile) {
|
|||
html_print_input_hidden('create_profile', 1);
|
||||
} else {
|
||||
html_print_input_hidden('id', $id_profile);
|
||||
html_print_input_hidden('old_name_profile', $name);
|
||||
html_print_input_hidden('update_profile', 1);
|
||||
html_print_submit_button(__('Update'), 'upd', false, 'class="sub upd"');
|
||||
}
|
||||
|
@ -415,15 +416,53 @@ enterprise_hook('close_meta_frame');
|
|||
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready (function () {
|
||||
var disable_option = '<?php echo $disable_option; ?>';
|
||||
|
||||
if (disable_option != '') {
|
||||
var ids = ['#checkbox-db_management', '#checkbox-user_management', '#checkbox-pandora_management'];
|
||||
if (disable_option != '') {
|
||||
var ids = ['#checkbox-db_management', '#checkbox-user_management', '#checkbox-pandora_management'];
|
||||
ids.forEach(id => {
|
||||
$(id).css({'cursor':'not-allowed', 'opacity':'0.5'});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Not enable enter for prevent submits
|
||||
$(window).keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#text-name').on('blur',function(){
|
||||
/* Check if the name is already on use for new profiles or check if the
|
||||
name is already on use for update checking if the name is distinct of the original*/
|
||||
if($('#hidden-create_profile').val()==1 || ($('#hidden-update_profile').val()==1 && $('#hidden-old_name_profile').val()!=$('#text-name').val())){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
dataType: "html",
|
||||
data: {
|
||||
page: 'include/ajax/profile',
|
||||
search_profile_nanme: true,
|
||||
profile_name: $('#text-name').val().trim(),
|
||||
},
|
||||
success: function (data) {
|
||||
if(data === 'true'){
|
||||
alert( <?php echo "'".__('Profile name already on use, please, change the name before save')."'"; ?> );
|
||||
if($('#hidden-old_name_profile').val()){
|
||||
$('#text-name').val($('#hidden-old_name_profile').val());
|
||||
}else{
|
||||
$('#text-name').val("");
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.error("Fatal error in AJAX call to interpreter order", data)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -42,10 +42,7 @@ require_once $config['homedir'].'/include/functions_visual_map.php';
|
|||
require_once $config['homedir'].'/include/functions_custom_fields.php';
|
||||
enterprise_include_once('include/functions_profile.php');
|
||||
|
||||
$meta = false;
|
||||
if (enterprise_installed() && defined('METACONSOLE')) {
|
||||
$meta = true;
|
||||
}
|
||||
$meta = is_metaconsole();
|
||||
|
||||
$isFunctionSkins = enterprise_include_once('include/functions_skins.php');
|
||||
|
||||
|
@ -55,12 +52,11 @@ if (ENTERPRISE_NOT_HOOK !== enterprise_include('include/functions_policies.php')
|
|||
$enterprise_include = true;
|
||||
}
|
||||
|
||||
if ($enterprise_include) {
|
||||
if ($enterprise_include === true) {
|
||||
enterprise_include_once('meta/include/functions_users_meta.php');
|
||||
}
|
||||
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
date_default_timezone_set('UTC');
|
||||
include 'include/javascript/timezonepicker/includes/parser.inc';
|
||||
|
||||
|
@ -110,13 +106,13 @@ if (!is_metaconsole()) {
|
|||
// This defines the working user. Beware with this, old code get confusses
|
||||
// and operates with current logged user (dangerous).
|
||||
$id = get_parameter('id', get_parameter('id_user', ''));
|
||||
// ID given as parameter
|
||||
// ID given as parameter.
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$user_info = get_user_info($id);
|
||||
$is_err = false;
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'UM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access User Management'
|
||||
|
@ -126,11 +122,11 @@ if (! check_acl($config['id_user'], 0, 'UM')) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (is_ajax()) {
|
||||
if (is_ajax() === true) {
|
||||
$delete_profile = (bool) get_parameter('delete_profile');
|
||||
$get_user_profile = (bool) get_parameter('get_user_profile');
|
||||
|
||||
if ($delete_profile) {
|
||||
if ($delete_profile === true) {
|
||||
$id2 = (string) get_parameter('id_user');
|
||||
$id_up = (int) get_parameter('id_user_profile');
|
||||
|
||||
|
@ -160,7 +156,7 @@ if (is_ajax()) {
|
|||
if ($has_profile === false && $user_is_global_admin === false) {
|
||||
$result = delete_user($id2);
|
||||
|
||||
if ($result) {
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
|
@ -173,30 +169,34 @@ if (is_ajax()) {
|
|||
__('There was a problem deleting the user')
|
||||
);
|
||||
|
||||
// Delete the user in all the consoles
|
||||
if (defined('METACONSOLE')) {
|
||||
// Delete the user in all the consoles.
|
||||
if (is_metaconsole() === true) {
|
||||
$servers = metaconsole_get_servers();
|
||||
foreach ($servers as $server) {
|
||||
// Connect to the remote console
|
||||
// Connect to the remote console.
|
||||
metaconsole_connect($server);
|
||||
|
||||
// Delete the user
|
||||
// Delete the user.
|
||||
$result = delete_user($id_user);
|
||||
if ($result) {
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s from metaconsole', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
|
||||
// Restore the db connection
|
||||
// Restore the db connection.
|
||||
metaconsole_restore_db();
|
||||
|
||||
// Log to the metaconsole too
|
||||
if ($result) {
|
||||
// Log to the metaconsole too.
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s from %s', io_safe_input($id_user), io_safe_input($server['server_name']))
|
||||
__(
|
||||
'Deleted user %s from %s',
|
||||
io_safe_input($id_user),
|
||||
io_safe_input($server['server_name'])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -272,14 +272,8 @@ enterprise_hook('open_meta_frame');
|
|||
|
||||
$tab = get_parameter('tab', 'user');
|
||||
|
||||
if ($id) {
|
||||
$header_title = ' » '.__('Update user');
|
||||
} else {
|
||||
$header_title = ' » '.__('Create user');
|
||||
}
|
||||
|
||||
// Header
|
||||
if ($meta) {
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
|
@ -310,19 +304,34 @@ if ($meta) {
|
|||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_page_header(
|
||||
__('User detail editor').$header_title,
|
||||
ui_print_standard_header(
|
||||
(empty($id) === false) ? __('Update user') : __('Create user'),
|
||||
'images/gm_users.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Profiles'),
|
||||
],
|
||||
[
|
||||
'link' => ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list'),
|
||||
'label' => __('Manage users'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('User Detail Editor'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$sec = 'gusuarios';
|
||||
}
|
||||
|
||||
|
||||
if ($config['user_can_update_info']) {
|
||||
if ((bool) $config['user_can_update_info'] === true) {
|
||||
$view_mode = false;
|
||||
} else {
|
||||
$view_mode = true;
|
||||
|
@ -332,17 +341,18 @@ $new_user = (bool) get_parameter('new_user');
|
|||
$create_user = (bool) get_parameter('create_user');
|
||||
$add_profile = (bool) get_parameter('add_profile');
|
||||
$update_user = (bool) get_parameter('update_user');
|
||||
$renewAPIToken = (bool) get_parameter('renewAPIToken');
|
||||
$status = get_parameter('status', -1);
|
||||
$json_profile = get_parameter('json_profile', '');
|
||||
|
||||
// Reset status var if current action is not update_user
|
||||
if ($new_user || $create_user || $add_profile
|
||||
|| $delete_profile || $update_user
|
||||
// Reset status var if current action is not update_user.
|
||||
if ($new_user === true || $create_user === true || $add_profile === true
|
||||
|| $delete_profile === true || $update_user === true
|
||||
) {
|
||||
$status = -1;
|
||||
}
|
||||
|
||||
if ($new_user && $config['admin_can_add_user']) {
|
||||
if ($new_user === true && (bool) $config['admin_can_add_user'] === true) {
|
||||
$user_info = [];
|
||||
$id = '';
|
||||
$user_info['fullname'] = '';
|
||||
|
@ -366,28 +376,30 @@ if ($new_user && $config['admin_can_add_user']) {
|
|||
|
||||
$user_info['section'] = '';
|
||||
$user_info['data_section'] = '';
|
||||
// This attributes are inherited from global configuration
|
||||
// This attributes are inherited from global configuration.
|
||||
$user_info['block_size'] = $config['block_size'];
|
||||
|
||||
if (enterprise_installed() && is_metaconsole() === true) {
|
||||
if (enterprise_installed() === true && is_metaconsole() === true) {
|
||||
$user_info['metaconsole_agents_manager'] = 0;
|
||||
$user_info['metaconsole_access_node'] = 0;
|
||||
}
|
||||
|
||||
if ($config['ehorus_user_level_conf']) {
|
||||
if ((bool) $config['ehorus_user_level_conf'] === true) {
|
||||
$user_info['ehorus_user_level_user'] = '';
|
||||
$user_info['ehorus_user_level_pass'] = '';
|
||||
$user_info['ehorus_user_level_enabled'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($create_user) {
|
||||
if (! $config['admin_can_add_user']) {
|
||||
ui_print_error_message(__('The current authentication scheme doesn\'t support creating users on %s', get_product_name()));
|
||||
if ($create_user === true) {
|
||||
if ((bool) $config['admin_can_add_user'] === false) {
|
||||
ui_print_error_message(
|
||||
__('The current authentication scheme doesn\'t support creating users on %s', get_product_name())
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (html_print_csrf_error()) {
|
||||
if (html_print_csrf_error() === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -468,6 +480,8 @@ if ($create_user) {
|
|||
}
|
||||
}
|
||||
|
||||
// Generate new API token.
|
||||
$values['api_token'] = api_token_generate();
|
||||
|
||||
if (empty($id) === true) {
|
||||
ui_print_error_message(__('User ID cannot be empty'));
|
||||
|
@ -659,7 +673,7 @@ if ($create_user) {
|
|||
}
|
||||
|
||||
if ($update_user) {
|
||||
if (html_print_csrf_error()) {
|
||||
if (html_print_csrf_error() === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -678,6 +692,9 @@ if ($update_user) {
|
|||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
$values['default_event_filter'] = (int) get_parameter('default_event_filter');
|
||||
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
|
||||
// API Token information.
|
||||
$apiTokenRenewed = (bool) get_parameter('renewAPIToken');
|
||||
$values['api_token'] = ($apiTokenRenewed === true) ? api_token_generate() : users_get_API_token($values['id_user']);
|
||||
|
||||
if (users_is_admin() === false && (bool) $values['is_admin'] !== false) {
|
||||
db_pandora_audit(
|
||||
|
@ -689,7 +706,7 @@ if ($update_user) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// eHorus user level conf.
|
||||
// Ehorus user level conf.
|
||||
$values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false);
|
||||
$values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user');
|
||||
$values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass');
|
||||
|
@ -868,7 +885,7 @@ if ($update_user) {
|
|||
|
||||
ui_print_result_message(
|
||||
$res1,
|
||||
__('User info successfully updated'),
|
||||
($apiTokenRenewed === true) ? __('You have generated a new API Token.') : __('User info successfully updated'),
|
||||
__('Error updating user info (no change?)')
|
||||
);
|
||||
}
|
||||
|
@ -904,7 +921,7 @@ if ($update_user) {
|
|||
$user_info = $values;
|
||||
}
|
||||
|
||||
if ($status != -1) {
|
||||
if ((int) $status !== -1) {
|
||||
ui_print_result_message(
|
||||
$status,
|
||||
__('User info successfully updated'),
|
||||
|
@ -1029,6 +1046,48 @@ if (!$new_user) {
|
|||
$user_id .= '<span>'.$id.'</span>';
|
||||
$user_id .= html_print_input_hidden('id_user', $id, true);
|
||||
$user_id .= '</div>';
|
||||
$user_id .= '<div class="label_select_simple"><p class="edit_user_labels">'.__('API Token').'</p>';
|
||||
$user_id .= html_print_anchor(
|
||||
[
|
||||
'onClick' => sprintf(
|
||||
'javascript:renewAPIToken(\'%s\', \'%s\', \'%s\')',
|
||||
__('Warning'),
|
||||
__('The API token will be renewed. After this action, the last token you were using will not work. Are you sure?'),
|
||||
'user_profile_form',
|
||||
),
|
||||
'content' => html_print_image(
|
||||
'images/icono-refrescar.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'renew_api_token_image clickable',
|
||||
'title' => __('Renew API Token'),
|
||||
]
|
||||
),
|
||||
'class' => 'renew_api_token_link',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$user_id .= html_print_anchor(
|
||||
[
|
||||
'onClick' => sprintf(
|
||||
'javascript:showAPIToken(\'%s\', \'%s\')',
|
||||
__('API Token'),
|
||||
base64_encode(__('Your API Token is:').' <br><span class="font_12pt bolder">'.users_get_API_token($id).'</span><br> '.__('Please, avoid share this string with others.')),
|
||||
),
|
||||
'content' => html_print_image(
|
||||
'images/eye_show.png',
|
||||
true,
|
||||
[
|
||||
'class' => 'renew_api_token_image clickable',
|
||||
'title' => __('Show API Token'),
|
||||
]
|
||||
),
|
||||
'class' => 'renew_api_token_link',
|
||||
],
|
||||
true
|
||||
);
|
||||
$user_id .= '</div>';
|
||||
} else {
|
||||
$user_id = '<div class="label_select_simple">'.html_print_input_text_extended(
|
||||
'id_user',
|
||||
|
@ -1047,7 +1106,7 @@ if (!$new_user) {
|
|||
).'</div>';
|
||||
}
|
||||
|
||||
if (is_user_admin($id)) {
|
||||
if (is_user_admin($id) === true) {
|
||||
$avatar = html_print_image(
|
||||
'images/people_1.png',
|
||||
true,
|
||||
|
@ -1294,11 +1353,8 @@ $values = [
|
|||
'Alert detail' => __('Alert detail'),
|
||||
'External link' => __('External link'),
|
||||
'Other' => __('Other'),
|
||||
'Dashboard' => __('Dashboard'),
|
||||
];
|
||||
if (!is_metaconsole()) {
|
||||
$values['Dashboard'] = __('Dashboard');
|
||||
}
|
||||
|
||||
|
||||
$home_screen .= html_print_select(
|
||||
$values,
|
||||
|
@ -1313,7 +1369,14 @@ $home_screen .= html_print_select(
|
|||
).'</div>';
|
||||
|
||||
|
||||
$dashboards = Manager::getDashboards(-1, -1);
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
|
@ -1444,7 +1507,6 @@ $session_time .= html_print_input_text(
|
|||
'class="input_line_small"'
|
||||
).'</div>';
|
||||
|
||||
|
||||
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
|
||||
|
||||
if (empty($user_groups) === false) {
|
||||
|
@ -1573,7 +1635,7 @@ if (!$id) {
|
|||
$user_id_create = $user_id;
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
if (is_metaconsole() === true) {
|
||||
$access_or_pagination = $meta_access;
|
||||
} else {
|
||||
$access_or_pagination = $size_pagination;
|
||||
|
@ -1589,14 +1651,14 @@ if ($id != '' && !$is_err) {
|
|||
|
||||
echo '<div id="user_form">
|
||||
<div class="user_edit_first_row">
|
||||
<div class="edit_user_info white_box">'.$div_user_info.'</div>
|
||||
<div class="edit_user_info white_box">'.$div_user_info.'</div>
|
||||
<div class="edit_user_autorefresh white_box"><p class="bolder">Extra info</p>'.$email.$phone.$not_login.$local_user.$session_time.'</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="user_edit_second_row white_box">
|
||||
<div class="edit_user_options">'.$language.$access_or_pagination.$skin.$home_screen.$default_event_filter.$double_authentication.'</div>
|
||||
|
||||
<div class="edit_user_timezone">'.$timezone;
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
echo '<div id="timezone-picker">
|
||||
<img id="timezone-image" src="'.$local_file.'" width="'.$map_width.'" height="'.$map_height.'" usemap="#timezone-map" />
|
||||
<img class="timezone-pin" src="include/javascript/timezonepicker/images/pin.png" class="pdd_t_4px" />
|
||||
|
@ -1643,13 +1705,18 @@ if ($config['admin_can_add_user']) {
|
|||
}
|
||||
|
||||
echo '</div>';
|
||||
if ($new_user === true) {
|
||||
html_print_input_hidden('json_profile', $json_profile);
|
||||
}
|
||||
|
||||
html_print_input_hidden('json_profile', $json_profile);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
|
||||
profile_print_profile_table($id, io_safe_output($json_profile));
|
||||
if ($is_err === true && $new_user === true) {
|
||||
profile_print_profile_table($id, io_safe_output($json_profile), false, true);
|
||||
} else {
|
||||
profile_print_profile_table($id, io_safe_output($json_profile));
|
||||
}
|
||||
|
||||
echo '<br />';
|
||||
|
||||
|
@ -1869,6 +1936,8 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
$('input:image[name="del"]').click(function (e) {
|
||||
if($(json_profile).length > 0) return;
|
||||
if (!confirm ('Are you sure?')) return;
|
||||
e.preventDefault();
|
||||
var rows = $("#table_profiles tr").length;
|
||||
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||
|
|
|
@ -333,6 +333,7 @@ if ($delete_user === true) {
|
|||
$result = delete_user($id_user);
|
||||
|
||||
if ($result) {
|
||||
delete_session_user($id_user);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
|
|
|
@ -1288,6 +1288,37 @@ class HostDevices extends Wizard
|
|||
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '<b>'.__('Security level').'</b>',
|
||||
'arguments' => [
|
||||
'name' => 'snmp_security_level',
|
||||
'type' => 'select',
|
||||
'fields' => [
|
||||
'noAuthNoPriv' => __('Not auth and not privacy method'),
|
||||
'authNoPriv' => __('Auth and not privacy method'),
|
||||
'authPriv' => __('Auth and privacy method'),
|
||||
],
|
||||
'selected' => $this->task['snmp_security_level'],
|
||||
'size' => 15,
|
||||
'return' => true,
|
||||
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '<b>'.__('Auth method').'</b>',
|
||||
'arguments' => [
|
||||
'name' => 'snmp_auth_method',
|
||||
'type' => 'select',
|
||||
'fields' => [
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
],
|
||||
'selected' => $this->task['snmp_auth_method'],
|
||||
'size' => 15,
|
||||
'return' => true,
|
||||
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '<b>'.__('Auth password').'</b>'.ui_print_help_tip(
|
||||
__(
|
||||
|
@ -1335,38 +1366,6 @@ class HostDevices extends Wizard
|
|||
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '<b>'.__('Auth method').'</b>',
|
||||
'arguments' => [
|
||||
'name' => 'snmp_auth_method',
|
||||
'type' => 'select',
|
||||
'fields' => [
|
||||
'MD5' => __('MD5'),
|
||||
'SHA' => __('SHA'),
|
||||
],
|
||||
'selected' => $this->task['snmp_auth_method'],
|
||||
'size' => 15,
|
||||
'return' => true,
|
||||
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '<b>'.__('Security level').'</b>',
|
||||
'arguments' => [
|
||||
'name' => 'snmp_security_level',
|
||||
'type' => 'select',
|
||||
'fields' => [
|
||||
'noAuthNoPriv' => __('Not auth and not privacy method'),
|
||||
'authNoPriv' => __('Auth and not privacy method'),
|
||||
'authPriv' => __('Auth and privacy method'),
|
||||
],
|
||||
'selected' => $this->task['snmp_security_level'],
|
||||
'size' => 15,
|
||||
'return' => true,
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
];
|
||||
|
||||
|
|
Binary file not shown.
After ![]() (image error) Size: 3.5 KiB |
Binary file not shown.
After ![]() (image error) Size: 100 KiB |
Binary file not shown.
After ![]() (image error) Size: 668 KiB |
Binary file not shown.
After ![]() (image error) Size: 759 B |
Binary file not shown.
After ![]() (image error) Size: 563 B |
|
@ -721,7 +721,7 @@ if ($get_agent_alerts_datatable === true) {
|
|||
}
|
||||
break;
|
||||
|
||||
case 'lastFired':
|
||||
case 'last_fired':
|
||||
switch ($sort) {
|
||||
case 'asc':
|
||||
$selectLastFiredasc = $selected;
|
||||
|
@ -850,7 +850,7 @@ if ($get_agent_alerts_datatable === true) {
|
|||
} else {
|
||||
$options_simple = [
|
||||
'order' => $order,
|
||||
'limit' => $length,
|
||||
'limit' => ($length > 0) ? $length : 1844674407370955161,
|
||||
'offset' => $start,
|
||||
];
|
||||
}
|
||||
|
@ -884,9 +884,9 @@ if ($get_agent_alerts_datatable === true) {
|
|||
users_get_groups($config['id_user'], $access, false)
|
||||
);
|
||||
|
||||
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
|
||||
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter, false);
|
||||
|
||||
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
|
||||
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -915,7 +915,6 @@ if ($get_agent_alerts_datatable === true) {
|
|||
$data[] = ui_format_alert_row($alert, true, $url, 'font-size: 7pt;');
|
||||
}
|
||||
|
||||
|
||||
$data = array_reduce(
|
||||
$data,
|
||||
function ($carry, $row) {
|
||||
|
@ -923,17 +922,29 @@ if ($get_agent_alerts_datatable === true) {
|
|||
// of objects, making a post-process of certain fields.
|
||||
$tmp = new stdClass();
|
||||
|
||||
// Standby.
|
||||
$tmp->policy = $row[0];
|
||||
$tmp->standby = $row[1];
|
||||
$tmp->force = $row[2];
|
||||
$tmp->agent_name = $row[3];
|
||||
$tmp->agent_module_name = $row[4];
|
||||
$tmp->template_name = $row[5];
|
||||
$tmp->action = $row[6];
|
||||
$tmp->last_fired = $row[7];
|
||||
$tmp->status = $row[8];
|
||||
$tmp->validate = $row[9];
|
||||
if (enterprise_installed() === true) {
|
||||
$tmp->policy = $row[0];
|
||||
$tmp->standby = $row[1];
|
||||
$tmp->force = $row[2];
|
||||
$tmp->agent_name = $row[3];
|
||||
$tmp->agent_module_name = $row[4];
|
||||
$tmp->template_name = $row[5];
|
||||
$tmp->action = $row[6];
|
||||
$tmp->last_fired = $row[7];
|
||||
$tmp->status = $row[8];
|
||||
$tmp->validate = $row[9];
|
||||
} else {
|
||||
// Open.
|
||||
$tmp->standby = $row[0];
|
||||
$tmp->force = $row[1];
|
||||
$tmp->agent_name = $row[2];
|
||||
$tmp->agent_module_name = $row[3];
|
||||
$tmp->template_name = $row[4];
|
||||
$tmp->action = $row[5];
|
||||
$tmp->last_fired = $row[6];
|
||||
$tmp->status = $row[7];
|
||||
$tmp->validate = $row[8];
|
||||
}
|
||||
|
||||
$carry[] = $tmp;
|
||||
return $carry;
|
||||
|
|
|
@ -0,0 +1,457 @@
|
|||
<?php
|
||||
/**
|
||||
* Manage AJAX response for event pages.
|
||||
*
|
||||
* @category Ajax
|
||||
* @package Pandora FMS
|
||||
* @subpackage Events
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
enterprise_include_once('include/functions_audit.php');
|
||||
|
||||
// Check access.
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'ER')
|
||||
&& ! check_acl($config['id_user'], 0, 'EW')
|
||||
&& ! check_acl($config['id_user'], 0, 'EM')
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access event viewer'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$save_filter_modal = get_parameter('save_filter_modal', 0);
|
||||
$load_filter_modal = get_parameter('load_filter_modal', 0);
|
||||
$get_filter_values = get_parameter('get_filter_values', 0);
|
||||
$update_log_filter = get_parameter('update_log_filter', 0);
|
||||
$save_log_filter = get_parameter('save_log_filter', 0);
|
||||
$recover_aduit_log_select = get_parameter('recover_aduit_log_select', 0);
|
||||
|
||||
|
||||
// Saves an event filter.
|
||||
if ($save_log_filter) {
|
||||
$values = [];
|
||||
$values['id_name'] = get_parameter('id_name');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
|
||||
$exists = (bool) db_get_value_filter(
|
||||
'id_filter',
|
||||
'tsesion_filter',
|
||||
['id_name' => $values['id_name']]
|
||||
);
|
||||
|
||||
if ($exists) {
|
||||
echo 'duplicate';
|
||||
} else {
|
||||
$result = db_process_sql_insert('tsesion_filter', $values);
|
||||
|
||||
if ($result === false) {
|
||||
echo 'error';
|
||||
} else {
|
||||
echo $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($recover_aduit_log_select) {
|
||||
echo json_encode(audit_get_audit_filter_select());
|
||||
}
|
||||
|
||||
if ($update_log_filter) {
|
||||
$values = [];
|
||||
$id = get_parameter('id');
|
||||
$values['text'] = get_parameter('text', '');
|
||||
$values['period'] = get_parameter('period', '');
|
||||
$values['ip'] = get_parameter('ip', '');
|
||||
$values['type'] = get_parameter('type', -1);
|
||||
$values['user'] = get_parameter('user', -1);
|
||||
|
||||
$result = db_process_sql_update(
|
||||
'tsesion_filter',
|
||||
$values,
|
||||
['id_filter' => $id]
|
||||
);
|
||||
|
||||
if ($result === false) {
|
||||
echo 'error';
|
||||
} else {
|
||||
echo 'ok';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($get_filter_values) {
|
||||
$id_filter = get_parameter('id');
|
||||
|
||||
$event_filter = audit_get_audit_log_filter($id_filter);
|
||||
echo json_encode($event_filter);
|
||||
}
|
||||
|
||||
|
||||
if ($load_filter_modal) {
|
||||
$filters = audit_get_audit_filter_select();
|
||||
$user_groups_array = users_get_groups_for_select(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
true,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
echo '<div id="load-filter-select" class="load-filter-modal">';
|
||||
|
||||
$table = new StdClass;
|
||||
$table->id = 'load_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
if (is_metaconsole()) {
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
$table->class = 'databox filters';
|
||||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
||||
$filter_id_width = '200px';
|
||||
if (is_metaconsole()) {
|
||||
$filter_id_width = '150px';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Load filter').$jump;
|
||||
$data[0] .= html_print_select(
|
||||
$filters,
|
||||
'filter_id',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'margin-left:5px; width:'.$filter_id_width.';'
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Load filter'),
|
||||
'load_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="load_filter_values()"',
|
||||
true
|
||||
);
|
||||
$data[1] .= html_print_input_hidden('load_filter', 1, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
html_print_table($table);
|
||||
echo '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function show_filter() {
|
||||
$("#load-filter-select").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true,
|
||||
width: 450
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function load_filter_values() {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '<?php echo ui_get_full_url('ajax.php'); ?>',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
page: 'include/ajax/audit_log',
|
||||
get_filter_values: 1,
|
||||
"id" : $('#filter_id :selected').val()
|
||||
},
|
||||
success: function(data) {
|
||||
var options = "";
|
||||
$.each(data,function(i,value){
|
||||
if (i == 'text'){
|
||||
$("#text-filter_text").val(value);
|
||||
}
|
||||
if (i == 'period'){
|
||||
$("#text-filter_period").val(value);
|
||||
}
|
||||
if (i == 'ip'){
|
||||
$("#text-filter_ip").val(value);
|
||||
}
|
||||
if (i == 'type'){
|
||||
$("#filter_type").val(value).change();
|
||||
}
|
||||
if (i == 'user'){
|
||||
$("#filter_user").val(value).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Close dialog.
|
||||
$("#load-filter-select").dialog('close');
|
||||
}
|
||||
|
||||
$(document).ready (function() {
|
||||
show_filter();
|
||||
})
|
||||
|
||||
</script>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($save_filter_modal) {
|
||||
echo '<div id="save-filter-select" style="width:350px;">';
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) {
|
||||
echo '<div id="info_box"></div>';
|
||||
$table = new StdClass;
|
||||
$table->id = 'save_filter_form';
|
||||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
if (is_metaconsole()) {
|
||||
$table->class = 'databox filters';
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; text-align:left;';
|
||||
if (!is_metaconsole()) {
|
||||
$table->style[0] = 'width: 50%; width:50%;';
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$table->rowid[0] = 'update_save_selector';
|
||||
$data[0] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'new',
|
||||
__('New filter'),
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
$data[1] = html_print_radio_button(
|
||||
'filter_mode',
|
||||
'update',
|
||||
__('Update filter'),
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[1] = 'save_filter_row1';
|
||||
$data[0] = __('Filter name').$jump;
|
||||
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
|
||||
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Save filter'),
|
||||
'save_filter',
|
||||
false,
|
||||
'class="sub wand" onclick="save_new_filter();"',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[2] = 'save_filter_row2';
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
$data[0] = __('Overwrite filter').$jump;
|
||||
|
||||
$_filters_update = audit_get_audit_filter_select();
|
||||
|
||||
$data[0] .= html_print_select(
|
||||
$_filters_update,
|
||||
'overwrite_filter',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Update filter'),
|
||||
'update_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="save_update_filter();"',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
html_print_table($table);
|
||||
} else {
|
||||
include 'general/noaccess.php';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function show_save_filter() {
|
||||
$('#save_filter_row1').show();
|
||||
$('#save_filter_row2').show();
|
||||
$('#update_filter_row1').hide();
|
||||
// Filter save mode selector
|
||||
$("[name='filter_mode']").click(function() {
|
||||
if ($(this).val() == 'new') {
|
||||
$('#save_filter_row1').show();
|
||||
$('#save_filter_row2').show();
|
||||
$('#submit-save_filter').show();
|
||||
$('#update_filter_row1').hide();
|
||||
}
|
||||
else {
|
||||
$('#save_filter_row1').hide();
|
||||
$('#save_filter_row2').hide();
|
||||
$('#update_filter_row1').show();
|
||||
$('#submit-save_filter').hide();
|
||||
}
|
||||
});
|
||||
$("#save-filter-select").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true
|
||||
});
|
||||
}
|
||||
|
||||
function save_new_filter() {
|
||||
|
||||
// If the filter name is blank show error
|
||||
if ($('#text-id_name').val() == '') {
|
||||
$('#info_box').html("<h3 class='error'><?php echo __('Filter name cannot be left blank'); ?></h3>");
|
||||
return false;
|
||||
}
|
||||
|
||||
var id_filter_save;
|
||||
|
||||
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
{
|
||||
"page" : "include/ajax/audit_log",
|
||||
"save_log_filter" : 1,
|
||||
"id_name" : $("#text-id_name").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#text-filter_period").val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
},
|
||||
function (data) {
|
||||
$("#info_box").hide();
|
||||
if (data == 'error') {
|
||||
$("#info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "error_create_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
} else if (data == 'duplicate') {
|
||||
$('#info_box').html("<h3 class='error'><?php echo __('Filter name already on use'); ?></h3>");
|
||||
$('#info_box').show();
|
||||
} else {
|
||||
// Close dialog.
|
||||
$("#save-filter-select").dialog('close');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// This updates an event filter
|
||||
function save_update_filter() {
|
||||
var id_filter_update = $("#overwrite_filter").val();
|
||||
var name_filter_update = $("#overwrite_filter option[value='"+id_filter_update+"']").text();
|
||||
|
||||
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
{"page" : "include/ajax/audit_log",
|
||||
"update_log_filter" : 1,
|
||||
"id" : $("#overwrite_filter :selected").val(),
|
||||
"text" : $("#text-filter_text").val(),
|
||||
"period" : $("#text-filter_period").val(),
|
||||
"ip" : $('#text-filter_ip').val(),
|
||||
"type" : $('#filter_type :selected').val(),
|
||||
"user" : $('#filter_user :selected').val(),
|
||||
},
|
||||
function (data) {
|
||||
$(".info_box").hide();
|
||||
if (data == 'ok') {
|
||||
$(".info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "success_update_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
}
|
||||
else {
|
||||
$(".info_box").filter(function(i, item) {
|
||||
if ($(item).data('type_info_box') == "error_create_filter") {
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
|
||||
// Close dialog
|
||||
$('.ui-dialog-titlebar-close').trigger('click');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function (){
|
||||
show_save_filter();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
return;
|
||||
}
|
|
@ -59,6 +59,7 @@ $drawConsoleSound = (bool) get_parameter('drawConsoleSound', false);
|
|||
$process_buffers = (bool) get_parameter('process_buffers', false);
|
||||
$get_extended_event = (bool) get_parameter('get_extended_event');
|
||||
$change_status = (bool) get_parameter('change_status');
|
||||
$get_Acknowledged = (bool) get_parameter('get_Acknowledged');
|
||||
$change_owner = (bool) get_parameter('change_owner');
|
||||
$add_comment = (bool) get_parameter('add_comment');
|
||||
$dialogue_event_response = (bool) get_parameter('dialogue_event_response');
|
||||
|
@ -1513,6 +1514,40 @@ if ($change_status === true) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($get_Acknowledged === true) {
|
||||
$event_id = (int) get_parameter('event_id', 0);
|
||||
$server_id = (int) get_parameter('server_id', 0);
|
||||
|
||||
$return = '';
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
echo events_page_general_acknowledged($event_id);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$return = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ($change_owner === true) {
|
||||
$new_owner = get_parameter('new_owner', '');
|
||||
$event_id = (int) get_parameter('event_id', 0);
|
||||
|
@ -2031,8 +2066,10 @@ if ($total_event_graph) {
|
|||
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
$prueba = grafico_eventos_total('', 280, 150, false, true);
|
||||
echo $prueba;
|
||||
$out = '<div style="flex: 0 0 300px; width:99%; height:100%;">';
|
||||
$out .= grafico_eventos_total('', 0, 0, false, true);
|
||||
$out .= '<div>';
|
||||
echo $out;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2041,8 +2078,10 @@ if ($graphic_event_group) {
|
|||
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
$prueba = grafico_eventos_grupo(280, 150, '', false, true);
|
||||
echo $prueba;
|
||||
$out = '<div style="flex: 0 0 300px; width:99%; height:100%;">';
|
||||
$out .= grafico_eventos_grupo(0, 0, '', false, true);
|
||||
$out .= '<div>';
|
||||
echo $out;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -340,7 +340,7 @@ if (is_ajax() === true) {
|
|||
|
||||
// Group.
|
||||
$secondary_groups = '';
|
||||
$secondary = agents_get_secondary_groups($data['id_agente']);
|
||||
$secondary = enterprise_hook('agents_get_secondary_groups', [$data['id_agente']]);
|
||||
if (isset($secondary['for_select']) === true && empty($secondary['for_select']) === false) {
|
||||
$secondary_groups = implode(', ', $secondary['for_select']);
|
||||
$secondary_groups = ', '.$secondary_groups;
|
||||
|
@ -353,19 +353,26 @@ if (is_ajax() === true) {
|
|||
|
||||
|
||||
// Events.
|
||||
echo '<div class="div-dialog">';
|
||||
echo graph_graphic_agentevents(
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1
|
||||
$result_graph_event = enterprise_hook(
|
||||
'graph_graphic_agentevents',
|
||||
[
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1,
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
if ($result_graph_event !== -1) {
|
||||
echo '<div class="div-dialog">';
|
||||
echo $result_graph_event;
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ if (check_login()) {
|
|||
0
|
||||
);
|
||||
|
||||
$get_children_modules = (bool) get_parameter('get_children_modules', false);
|
||||
|
||||
$get_data_dataMatrix = (bool) get_parameter(
|
||||
'get_data_dataMatrix',
|
||||
0
|
||||
|
@ -1182,8 +1184,8 @@ if (check_login()) {
|
|||
$status,
|
||||
$title
|
||||
);
|
||||
|
||||
$last_status_change_text = 'Time elapsed since last status change: ';
|
||||
$last_status_change_text = ($module['ip_target']) ? 'IP: '.$module['ip_target'].'<br />' : '';
|
||||
$last_status_change_text .= 'Time elapsed since last status change: ';
|
||||
$last_status_change_text .= !empty($module['last_status_change']) ? human_time_comparation($module['last_status_change']) : __('N/A');
|
||||
|
||||
$data[5] = ui_print_status_image($status, htmlspecialchars($title), true, false, false, false, $last_status_change_text);
|
||||
|
@ -1636,6 +1638,39 @@ if (check_login()) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($get_children_modules === true) {
|
||||
$parent_modules = get_parameter('parent_modulues', false);
|
||||
$children_selected = [];
|
||||
|
||||
if ($parent_modules === false) {
|
||||
$children_selected = false;
|
||||
} else {
|
||||
foreach ($parent_modules as $parent) {
|
||||
$child_modules = get_children_module($parent_modules, ['nombre', 'id_agente_modulo'], true);
|
||||
if ((bool) $child_modules === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($child_modules as $child) {
|
||||
$module_exist = in_array($child['id_agente_modulo'], $parent_modules);
|
||||
$child_exist = in_array($child, $children_selected);
|
||||
|
||||
if ($module_exist === false && $child_exist === false) {
|
||||
array_push($children_selected, $child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($children_selected) === true) {
|
||||
$children_selected = false;
|
||||
}
|
||||
|
||||
echo json_encode($children_selected);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Saves an event filter.
|
||||
if ($save_monitor_filter) {
|
||||
$values = [];
|
||||
|
@ -2154,7 +2189,6 @@ if (check_login()) {
|
|||
$('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
show_save_filter();
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS- http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_profile.php';
|
||||
|
||||
// Clean the possible blanks introduced by the included files.
|
||||
ob_clean();
|
||||
|
||||
$search_profile_name = (bool) get_parameter('search_profile_nanme');
|
||||
|
||||
if ($search_profile_name) {
|
||||
$profile_name = (string) get_parameter('profile_name');
|
||||
|
||||
echo json_encode(profile_exist($profile_name));
|
||||
|
||||
return;
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -69,9 +69,6 @@ $id2 = get_parameter('id2');
|
|||
$otherSerialize = get_parameter('other');
|
||||
$otherMode = get_parameter('other_mode', 'url_encode');
|
||||
$returnType = get_parameter('return_type', 'string');
|
||||
$api_password = get_parameter('apipass', '');
|
||||
$password = get_parameter('pass', '');
|
||||
$user = get_parameter('user', '');
|
||||
$info = get_parameter('info', '');
|
||||
$raw_decode = (bool) get_parameter('raw_decode', false);
|
||||
|
||||
|
@ -84,6 +81,21 @@ $apiPassword = io_output_password(
|
|||
)
|
||||
);
|
||||
|
||||
$apiTokenValid = false;
|
||||
// Try getting bearer token from header.
|
||||
// TODO. Getting token from url will be removed.
|
||||
$apiToken = (string) getBearerToken();
|
||||
if (empty($apiToken) === true) {
|
||||
// Legacy user/pass token.
|
||||
// TODO. Revome in future.
|
||||
$api_password = get_parameter('apipass', '');
|
||||
$user = get_parameter('user', '');
|
||||
$password = get_parameter('pass', '');
|
||||
} else {
|
||||
$apiTokenValid = (bool) api_token_check($apiToken);
|
||||
}
|
||||
|
||||
|
||||
$correctLogin = false;
|
||||
$no_login_msg = '';
|
||||
|
||||
|
@ -94,8 +106,8 @@ ob_clean();
|
|||
// Special call without checks to retrieve version and build of the Pandora FMS
|
||||
// This info is avalable from the web console without login
|
||||
// Don't change the format, it is parsed by applications.
|
||||
if ($info == 'version') {
|
||||
if (!$config['MR']) {
|
||||
if ($info === 'version') {
|
||||
if ((bool) $config['MR'] === false) {
|
||||
$config['MR'] = 0;
|
||||
}
|
||||
|
||||
|
@ -105,6 +117,7 @@ if ($info == 'version') {
|
|||
|
||||
if (empty($apiPassword) === true
|
||||
|| (empty($apiPassword) === false && $api_password === $apiPassword)
|
||||
|| $apiTokenValid === true
|
||||
) {
|
||||
if (enterprise_hook('metaconsole_validate_origin', [get_parameter('server_auth')]) === true
|
||||
|| enterprise_hook('console_validate_origin', [get_parameter('server_auth')]) === true
|
||||
|
@ -118,7 +131,14 @@ if (empty($apiPassword) === true
|
|||
$correctLogin = true;
|
||||
} else if ((bool) isInACL($ipOrigin) === true) {
|
||||
// External access.
|
||||
$user_in_db = process_user_login($user, $password, true);
|
||||
// Token is valid. Bypass the credentials.
|
||||
if ($apiTokenValid === true) {
|
||||
$credentials = db_get_row('tusuario', 'api_token', $apiToken);
|
||||
$user = $credentials['id_user'];
|
||||
$password = $credentials['password'];
|
||||
}
|
||||
|
||||
$user_in_db = process_user_login($user, $password, true, $apiTokenValid);
|
||||
if ($user_in_db !== false) {
|
||||
$config['id_usuario'] = $user_in_db;
|
||||
// Compat.
|
||||
|
@ -144,19 +164,19 @@ if (empty($apiPassword) === true
|
|||
$no_login_msg = 'Incorrect given API password';
|
||||
}
|
||||
|
||||
if ($correctLogin) {
|
||||
if ($correctLogin === true) {
|
||||
if (($op !== 'get') && ($op !== 'set') && ($op !== 'help')) {
|
||||
returnError('no_set_no_get_no_help', $returnType);
|
||||
} else {
|
||||
$function_name = '';
|
||||
|
||||
// Check if is an extension function and get the function name.
|
||||
if ($op2 == 'extension') {
|
||||
if ($op2 === 'extension') {
|
||||
$extension_api_url = $config['homedir'].'/'.EXTENSIONS_DIR.'/'.$ext_name.'/'.$ext_name.'.api.php';
|
||||
// The extension API file must exist and the extension must be
|
||||
// enabled.
|
||||
if (file_exists($extension_api_url)
|
||||
&& !in_array($ext_name, extensions_get_disabled_extensions())
|
||||
if (file_exists($extension_api_url) === true
|
||||
&& in_array($ext_name, extensions_get_disabled_extensions()) === false
|
||||
) {
|
||||
include_once $extension_api_url;
|
||||
$function_name = 'apiextension_'.$op.'_'.$ext_function;
|
||||
|
@ -164,7 +184,7 @@ if ($correctLogin) {
|
|||
} else {
|
||||
$function_name = 'api_'.$op.'_'.$op2;
|
||||
|
||||
if ($op == 'set' && $id) {
|
||||
if ($op === 'set' && $id) {
|
||||
switch ($op2) {
|
||||
case 'update_agent':
|
||||
case 'add_module_in_conf':
|
||||
|
@ -173,7 +193,7 @@ if ($correctLogin) {
|
|||
$agent = agents_locate_agent($id);
|
||||
if ($agent !== false) {
|
||||
$id_os = $agent['id_os'];
|
||||
if ($id_os == 100) {
|
||||
if ((int) $id_os === 100) {
|
||||
returnError(
|
||||
'not_allowed_operation_cluster',
|
||||
$returnType
|
||||
|
|
|
@ -94,7 +94,7 @@ $config['admin_can_make_admin'] = true;
|
|||
* @return mixed False in case of error or invalid credentials, the username in
|
||||
* case it's correct.
|
||||
*/
|
||||
function process_user_login($login, $pass, $api=false)
|
||||
function process_user_login($login, $pass, $api=false, $passAlreadyEncrypted=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -130,10 +130,10 @@ function process_user_login($login, $pass, $api=false)
|
|||
if ($config['fallback_local_auth']
|
||||
|| is_user_admin($login)
|
||||
|| $local_user === true
|
||||
|| strtolower($config['auth']) == 'mysql'
|
||||
|| strtolower($config['auth']) === 'mysql'
|
||||
|| (bool) $user_not_login === true
|
||||
) {
|
||||
return process_user_login_local($login, $pass, $api);
|
||||
return process_user_login_local($login, $pass, $api, $passAlreadyEncrypted);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
@ -144,96 +144,66 @@ function process_user_login($login, $pass, $api=false)
|
|||
}
|
||||
|
||||
|
||||
function process_user_login_local($login, $pass, $api=false)
|
||||
function process_user_login_local($login, $pass, $api=false, $passAlreadyEncrypted=false)
|
||||
{
|
||||
global $config, $mysql_cache;
|
||||
|
||||
// Connect to Database
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
if (!$api) {
|
||||
$sql = sprintf(
|
||||
"SELECT `id_user`, `password`
|
||||
FROM `tusuario`
|
||||
WHERE `id_user` = '%s' AND `not_login` = 0
|
||||
AND `disabled` = 0",
|
||||
$login
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
"SELECT `id_user`, `password`
|
||||
FROM `tusuario`
|
||||
WHERE `id_user` = '%s'
|
||||
AND `disabled` = 0",
|
||||
$login
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
if (!$api) {
|
||||
$sql = sprintf(
|
||||
'SELECT "id_user", "password"
|
||||
FROM "tusuario"
|
||||
WHERE "id_user" = \'%s\' AND "not_login" = 0
|
||||
AND "disabled" = 0',
|
||||
$login
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
'SELECT "id_user", "password"
|
||||
FROM "tusuario"
|
||||
WHERE "id_user" = \'%s\'
|
||||
AND "disabled" = 0',
|
||||
$login
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
if (!$api) {
|
||||
$sql = sprintf(
|
||||
'SELECT id_user, password
|
||||
FROM tusuario
|
||||
WHERE id_user = \'%s\' AND not_login = 0
|
||||
AND disabled = 0',
|
||||
$login
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
'SELECT id_user, password
|
||||
FROM tusuario
|
||||
WHERE id_user = \'%s\'
|
||||
AND disabled = 0',
|
||||
$login
|
||||
);
|
||||
}
|
||||
break;
|
||||
if ((bool) $api === false) {
|
||||
$sql = sprintf(
|
||||
"SELECT `id_user`, `password`
|
||||
FROM `tusuario`
|
||||
WHERE `id_user` = '%s' AND `not_login` = 0
|
||||
AND `disabled` = 0",
|
||||
$login
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
"SELECT `id_user`, `password`
|
||||
FROM `tusuario`
|
||||
WHERE `id_user` = '%s'
|
||||
AND `disabled` = 0",
|
||||
$login
|
||||
);
|
||||
}
|
||||
|
||||
$row = db_get_row_sql($sql);
|
||||
|
||||
// Check that row exists, that password is not empty and that password is the same hash
|
||||
if ($row !== false && $row['password'] !== md5('')
|
||||
&& $row['password'] == md5($pass)
|
||||
) {
|
||||
if ($passAlreadyEncrypted) {
|
||||
$credentials_check = $pass === $row['password'];
|
||||
} else {
|
||||
// Perform password check whether it is MD5-hashed (old hashing) or Bcrypt-hashed.
|
||||
if (strlen($row['password']) === 32) {
|
||||
// MD5.
|
||||
$credentials_check = $row !== false && $row['password'] !== md5('') && $row['password'] == md5($pass);
|
||||
} else {
|
||||
// Bcrypt.
|
||||
$credentials_check = password_verify($pass, $row['password']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($credentials_check === true) {
|
||||
// Login OK
|
||||
// Nick could be uppercase or lowercase (select in MySQL
|
||||
// is not case sensitive)
|
||||
// We get DB nick to put in PHP Session variable,
|
||||
// to avoid problems with case-sensitive usernames.
|
||||
// Thanks to David Muñiz for Bug discovery :)
|
||||
// Thanks to David Muñiz for Bug discovery :).
|
||||
$filter = ['id_usuario' => $login];
|
||||
$user_profile = db_get_row_filter('tusuario_perfil', $filter);
|
||||
if (!users_is_admin($login) && !$user_profile) {
|
||||
if ((bool) users_is_admin($login) === false && (bool) $user_profile === false) {
|
||||
$mysql_cache['auth_error'] = 'User does not have any profile';
|
||||
$config['auth_error'] = 'User does not have any profile';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Override password to use Bcrypt encryption.
|
||||
if (strlen($row['password']) === 32) {
|
||||
update_user_password($login, $pass);
|
||||
}
|
||||
|
||||
return $row['id_user'];
|
||||
} else {
|
||||
if (!user_can_login($login)) {
|
||||
if (user_can_login($login) === false) {
|
||||
$mysql_cache['auth_error'] = 'User only can use the API.';
|
||||
$config['auth_error'] = 'User only can use the API.';
|
||||
} else {
|
||||
|
@ -655,8 +625,16 @@ function process_user_contact(string $id_user)
|
|||
function create_user($id_user, $password, $user_info)
|
||||
{
|
||||
$values = $user_info;
|
||||
|
||||
$column_type = db_get_column_type('tusuario', 'password');
|
||||
if (empty($column_type) === false && isset($column_type[0]['COLUMN_TYPE'])) {
|
||||
$column_type = ($column_type[0]['COLUMN_TYPE'] === 'varchar(60)');
|
||||
} else {
|
||||
$column_type = false;
|
||||
}
|
||||
|
||||
$values['id_user'] = $id_user;
|
||||
$values['password'] = md5($password);
|
||||
$values['password'] = ($column_type === false) ? md5($password) : password_hash($password, PASSWORD_BCRYPT);
|
||||
$values['last_connect'] = 0;
|
||||
$values['registered'] = get_system_time();
|
||||
|
||||
|
@ -747,7 +725,7 @@ function delete_user(string $id_user)
|
|||
|
||||
|
||||
/**
|
||||
* Update the password in MD5 for user pass as id_user with
|
||||
* Update the password using BCRYPT algorithm for specific id_user passing
|
||||
* password in plain text.
|
||||
*
|
||||
* @param string $user User ID.
|
||||
|
@ -764,9 +742,19 @@ function update_user_password(string $user, string $password_new)
|
|||
return false;
|
||||
}
|
||||
|
||||
$column_type = db_get_column_type('tusuario', 'password');
|
||||
if (empty($column_type) === false && isset($column_type[0]['COLUMN_TYPE'])) {
|
||||
$column_type = ($column_type[0]['COLUMN_TYPE'] === 'varchar(60)');
|
||||
} else {
|
||||
$column_type = false;
|
||||
}
|
||||
|
||||
if (isset($config['auth']) === true && $config['auth'] === 'pandora') {
|
||||
$sql = sprintf(
|
||||
"UPDATE tusuario SET password = '".md5($password_new)."', last_pass_change = '".date('Y-m-d H:i:s', get_system_time())."' WHERE id_user = '".$user."'"
|
||||
"UPDATE tusuario SET password = '%s', last_pass_change = '%s' WHERE id_user = '%s'",
|
||||
($column_type === false) ? md5($password_new) : password_hash($password_new, PASSWORD_BCRYPT),
|
||||
date('Y-m-d H:i:s', get_system_time()),
|
||||
$user
|
||||
);
|
||||
|
||||
$connection = mysql_connect_db(
|
||||
|
@ -786,7 +774,7 @@ function update_user_password(string $user, string $password_new)
|
|||
return db_process_sql_update(
|
||||
'tusuario',
|
||||
[
|
||||
'password' => md5($password_new),
|
||||
'password' => ($column_type === false) ? md5($password_new) : password_hash($password_new, PASSWORD_BCRYPT),
|
||||
'last_pass_change' => date('Y/m/d H:i:s', get_system_time()),
|
||||
],
|
||||
['id_user' => $user]
|
||||
|
@ -1050,7 +1038,14 @@ function create_user_and_permisions_ldap(
|
|||
$values['id_user'] = $id_user;
|
||||
|
||||
if ($config['ldap_save_password'] || $config['ad_save_password']) {
|
||||
$values['password'] = md5($password);
|
||||
$column_type = db_get_column_type('tusuario', 'password');
|
||||
if (empty($column_type) === false && isset($column_type[0]['COLUMN_TYPE'])) {
|
||||
$column_type = ($column_type[0]['COLUMN_TYPE'] === 'varchar(60)');
|
||||
} else {
|
||||
$column_type = false;
|
||||
}
|
||||
|
||||
$values['password'] = ($column_type === false) ? md5($password) : password_hash($password, PASSWORD_BCRYPT);
|
||||
}
|
||||
|
||||
$values['last_connect'] = 0;
|
||||
|
@ -1482,11 +1477,26 @@ function change_local_user_pass_ldap($id_user, $password)
|
|||
$local_user_pass = db_get_value_filter('password', 'tusuario', ['id_user' => $id_user]);
|
||||
|
||||
$return = false;
|
||||
if (md5($password) !== $local_user_pass) {
|
||||
$values_update = [];
|
||||
$values_update['password'] = md5($password);
|
||||
|
||||
$return = db_process_sql_update('tusuario', $values_update, ['id_user' => $id_user]);
|
||||
$column_type = db_get_column_type('tusuario', 'password');
|
||||
if (empty($column_type) === false && isset($column_type[0]['COLUMN_TYPE'])) {
|
||||
$column_type = ($column_type[0]['COLUMN_TYPE'] === 'varchar(60)');
|
||||
} else {
|
||||
$column_type = false;
|
||||
}
|
||||
|
||||
$values_update = [];
|
||||
|
||||
if ($column_type === false) {
|
||||
if (md5($password) !== $local_user_pass) {
|
||||
$values_update['password'] = md5($password);
|
||||
$return = db_process_sql_update('tusuario', $values_update, ['id_user' => $id_user]);
|
||||
}
|
||||
} else {
|
||||
if (password_hash($password, PASSWORD_BCRYPT) !== $local_user_pass) {
|
||||
$values_update['password'] = password_hash($password, PASSWORD_BCRYPT);
|
||||
$return = db_process_sql_update('tusuario', $values_update, ['id_user' => $id_user]);
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
|
|
@ -42,40 +42,23 @@ require_once $config['homedir'].'/include/functions_agents.php';
|
|||
require_once $config['homedir'].'/include/functions_tags.php';
|
||||
|
||||
$data_raw = get_parameter('data');
|
||||
$data_decoded = json_decode(base64_decode($data_raw), true);
|
||||
$data_decoded = json_decode(io_safe_output($data_raw), true);
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
$data = urldecode($data_decoded['data']);
|
||||
$session_id = urldecode($data_decoded['session_id']);
|
||||
$data_combined = urldecode($data_decoded['data_combined']);
|
||||
$data_module_list = urldecode($data_decoded['data_module_list']);
|
||||
$type_graph_pdf = urldecode($data_decoded['type_graph_pdf']);
|
||||
$viewport_width = urldecode($data_decoded['viewport_width']);
|
||||
$data = $data_decoded['data'];
|
||||
$session_id = $data_decoded['session_id'];
|
||||
$type_graph_pdf = $data_decoded['type_graph_pdf'];
|
||||
|
||||
$data_combined = [];
|
||||
if (isset($data_decoded['data_combined']) === true) {
|
||||
$data_combined = $data_decoded['data_combined'];
|
||||
}
|
||||
|
||||
$data_module_list = [];
|
||||
if (isset($data_decoded['data_module_list']) === true) {
|
||||
$data_module_list = $data_decoded['data_module_list'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Echo to stdout a PhantomJS callback call.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function echoPhantomCallback()
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$('document').ready(function () {
|
||||
setTimeout(function () {
|
||||
try {
|
||||
var status = window.callPhantom({ status: "loaded" });
|
||||
} catch (error) {
|
||||
console.log("CALLBACK ERROR", error.message)
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
// Initialize session.
|
||||
global $config;
|
||||
|
||||
|
@ -99,7 +82,6 @@ if (check_login(false) === false) {
|
|||
</head>
|
||||
<body>
|
||||
<h1>Access is not granted</h1>
|
||||
<?php echoPhantomCallback(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -108,10 +90,16 @@ if (check_login(false) === false) {
|
|||
}
|
||||
|
||||
// Access granted.
|
||||
$params = json_decode($data, true);
|
||||
$params = $data;
|
||||
if (isset($params['backgroundColor']) === false) {
|
||||
$params['backgroundColor'] = 'inherit';
|
||||
}
|
||||
|
||||
// Metaconsole connection to the node.
|
||||
$server_id = $params['server_id'];
|
||||
$server_id = 0;
|
||||
if (isset($params['server_id']) === true) {
|
||||
$server_id = $params['server_id'];
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
|
@ -124,7 +112,6 @@ if (is_metaconsole() === true && empty($server_id) === false) {
|
|||
ui_print_error_message(
|
||||
__('There was a problem connecting with the node')
|
||||
);
|
||||
echoPhantomCallback();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -133,7 +120,6 @@ if (is_metaconsole() === true && empty($server_id) === false) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$user_language = get_user_language($config['id_user']);
|
||||
if (file_exists('languages/'.$user_language.'.mo') === true) {
|
||||
$cfr = new CachedFileReader('languages/'.$user_language.'.mo');
|
||||
|
@ -146,16 +132,16 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Pandora FMS Graph (<?php echo agents_get_alias($agent_id).' - '.$interface_name; ?>)</title>
|
||||
<title>Pandora FMS Graph</title>
|
||||
<link rel="stylesheet" href="styles/pandora.css" type="text/css" />
|
||||
<link rel="stylesheet" href="styles/pandora_minimal.css" type="text/css" />
|
||||
<link rel="stylesheet" href="styles/js/jquery-ui.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery-ui.min.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.time.js"></script>
|
||||
|
@ -170,48 +156,46 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.exportdata.pandora.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.axislabels.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/pandora.flot.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/chartjs/chart.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/chartjs/chartjs-plugin-datalabels.min.js"></script>
|
||||
</head>
|
||||
<body style='background-color: <?php echo $params['backgroundColor']; ?>;'>
|
||||
<body style='width:794px; margin: 0px; background-color: <?php echo $params['backgroundColor']; ?>;'>
|
||||
<?php
|
||||
$params['only_image'] = false;
|
||||
$params['menu'] = false;
|
||||
|
||||
$params['disable_black'] = true;
|
||||
$params_combined = json_decode($data_combined, true);
|
||||
$module_list = json_decode($data_module_list, true);
|
||||
$params_combined = $data_combined;
|
||||
$module_list = $data_module_list;
|
||||
|
||||
if (isset($params['vconsole']) === false || $params['vconsole'] === false) {
|
||||
if ((int) $viewport_width > 0) {
|
||||
$params['width'] = (int) $viewport_width;
|
||||
$viewport = [
|
||||
'width' => 0,
|
||||
'height' => 0,
|
||||
];
|
||||
|
||||
$style = 'width:100%;';
|
||||
if (isset($params['options']['viewport']) === true) {
|
||||
$viewport = $params['options']['viewport'];
|
||||
if (empty($viewport['width']) === false) {
|
||||
$style .= 'width:'.$viewport['width'].'px;';
|
||||
}
|
||||
|
||||
if ((isset($params['width']) === false
|
||||
|| ($params['width'] <= 0))
|
||||
) {
|
||||
if ((int) $params['width'] <= 0) {
|
||||
$params['width'] = 650;
|
||||
}
|
||||
|
||||
if ((int) $params['landscape'] === 1) {
|
||||
$params['width'] = 850;
|
||||
}
|
||||
|
||||
if ($type_graph_pdf === 'slicebar') {
|
||||
$params['width'] = 100;
|
||||
$params['height'] = 70;
|
||||
}
|
||||
if (empty($viewport['height']) === false) {
|
||||
$style .= 'height:'.$viewport['height'].'px;';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<div>';
|
||||
echo '<div id="container-chart-generator-item" style="'.$style.' margin:0px;">';
|
||||
switch ($type_graph_pdf) {
|
||||
case 'combined':
|
||||
$params['pdf'] = true;
|
||||
echo graphic_combined_module(
|
||||
$result = graphic_combined_module(
|
||||
$module_list,
|
||||
$params,
|
||||
$params_combined
|
||||
);
|
||||
|
||||
echo $result;
|
||||
break;
|
||||
|
||||
case 'sparse':
|
||||
|
@ -219,67 +203,40 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
echo grafico_modulo_sparse($params);
|
||||
break;
|
||||
|
||||
case 'pie_chart':
|
||||
case 'pie_graph':
|
||||
$params['pdf'] = true;
|
||||
echo flot_pie_chart(
|
||||
$params['values'],
|
||||
$params['keys'],
|
||||
$params['width'],
|
||||
$params['height'],
|
||||
$params['water_mark_url'],
|
||||
$params['font'],
|
||||
$config['font_size'],
|
||||
$params['legend_position'],
|
||||
$params['colors'],
|
||||
$params['hide_labels']
|
||||
$chart = get_build_setup_charts(
|
||||
'PIE',
|
||||
$params['options'],
|
||||
$params['chart_data']
|
||||
);
|
||||
|
||||
echo $chart->render(true);
|
||||
break;
|
||||
|
||||
case 'vbar':
|
||||
case 'vbar_graph':
|
||||
$params['pdf'] = true;
|
||||
echo flot_vcolumn_chart($params);
|
||||
break;
|
||||
|
||||
case 'hbar':
|
||||
$params['pdf'] = true;
|
||||
echo flot_hcolumn_chart(
|
||||
$params['chart_data'],
|
||||
$params['width'],
|
||||
$params['height'],
|
||||
$params['water_mark_url'],
|
||||
$params['font'],
|
||||
$config['font_size'],
|
||||
$params['backgroundColor'],
|
||||
$params['tick_color'],
|
||||
$params['val_min'],
|
||||
$params['val_max'],
|
||||
$params['pdf']
|
||||
$chart = get_build_setup_charts(
|
||||
'BAR',
|
||||
$params['options'],
|
||||
$params['chart_data']
|
||||
);
|
||||
|
||||
echo $chart->render(true);
|
||||
break;
|
||||
|
||||
case 'ring_graph':
|
||||
$params['pdf'] = true;
|
||||
echo flot_custom_pie_chart(
|
||||
$params['chart_data'],
|
||||
$params['width'],
|
||||
$params['height'],
|
||||
$params['colors'],
|
||||
$params['module_name_list'],
|
||||
$params['long_index'],
|
||||
$params['no_data'],
|
||||
false,
|
||||
'',
|
||||
$params['water_mark'],
|
||||
$params['font'],
|
||||
$config['font_size'],
|
||||
$params['unit'],
|
||||
$params['ttl'],
|
||||
$params['homeurl'],
|
||||
$params['background_color'],
|
||||
$params['legend_position'],
|
||||
$params['background_color'],
|
||||
$params['pdf']
|
||||
$params['options']['width'] = 500;
|
||||
$params['options']['height'] = 500;
|
||||
|
||||
$chart = get_build_setup_charts(
|
||||
'DOUGHNUT',
|
||||
$params['options'],
|
||||
$params['chart_data']
|
||||
);
|
||||
|
||||
echo $chart->render(true);
|
||||
break;
|
||||
|
||||
case 'slicebar':
|
||||
|
@ -313,7 +270,6 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
}
|
||||
|
||||
echo '</div>';
|
||||
echoPhantomCallback();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue