Merge remote-tracking branch 'origin/develop' into ent-6924-cambiar-label-event-text-por-event-name

Conflicts:
	pandora_console/extras/mr/46.sql
This commit is contained in:
fbsanchez 2021-04-07 10:23:33 +02:00
commit 1ac6ed35cf
607 changed files with 30069 additions and 12313 deletions

12
.gitignore vendored
View File

@ -1 +1,11 @@
pandora_console/attachment/agents
.vstags
MYMETA.json
MYMETA.yml
.vscode
.vscode*
.vstags
**/blib
**/PandoraFMS-Enterprise/Makefile
**/PandoraFMS-Enterprise/pm_to_blib
**/pandora_console/attachment/cache
**/pandora_console/attachment/agents

View File

@ -0,0 +1,585 @@
#!/bin/bash
# define variables
PANDORA_CONSOLE=/var/www/html/pandora_console
CONSOLE_PATH=/var/www/html/pandora_console
PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
PANDORA_SERVER_BIN=/usr/bin/pandora_server
PANDORA_HA_BIN=/usr/bin/pandora_ha
PANDORA_TABLES_MIN=160
DBHOST=127.0.0.1
DBNAME=pandora
DBUSER=pandora
DBPASS=pandora
DBPORT=3306
S_VERSION='2021012801'
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# Ansi color code variables
red="\e[0;91m"
green="\e[0;92m"
bold="\e[1m"
cyan="\e[0;36m"
reset="\e[0m"
# Functions
execute_cmd () {
local cmd="$1"
local msg="$2"
echo -e "${cyan}$msg...${reset}"
$cmd &>> $LOGFILE
if [ $? -ne 0 ]; then
echo -e "${red}Fail${reset}"
[ "$3" ] && echo "$3"
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp &>> $LOGFILE
exit 1
else
echo -e "\e[1A\e ${cyan}$msg...${reset} ${green}OK${reset}"
return 0
fi
}
check_cmd_status () {
if [ $? -ne 0 ]; then
echo -e "${red}Fail${reset}"
[ "$1" ] && echo "$1"
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
exit 1
else
echo -e "${green}OK${reset}"
return 0
fi
}
check_pre_pandora () {
export MYSQL_PWD=$DBPASS
echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep pandora &>> /dev/null && local fail=true
[ -d "$CONSOLE_PATH" ] && local fail=true
[ -f /usr/bin/pandora_server ] && local fail=true
echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true
[ ! $fail ]
check_cmd_status 'Error there is a current Pandora FMS installation on this node, please remove it to execute a clean install'
}
check_repo_connection () {
execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection"
execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo"
execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo"
}
check_root_permissions () {
echo -en "${cyan}Checking root account... ${reset}"
if [ "$(whoami)" != "root" ]; then
echo -e "${red}Fail${reset}"
echo "Please use a root account or sudo for installing PandoraFMS"
echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE"
exit 1
else
echo -e "${green}OK${reset}"
fi
}
## Main
echo "Starting PandoraFMS Community deployment ver. $S_VERSION"
# Centos Version
if [ ! "$(grep -i centos /etc/redhat-release)" ]; then
printf "${red}Error this is not a Centos Base system, this installer is compatible with Centos systems only${reset}\n"
exit 1
fi
execute_cmd "grep -i centos /etc/redhat-release" "Checking Centos" 'Error This is not a Centos Base system'
echo -en "${cyan}Check Centos Version...${reset}"
[ $(sed -nr 's/VERSION_ID+=\s*"([0-9])"$/\1/p' /etc/os-release) -eq '7' ]
check_cmd_status 'Error OS version, Centos 7 is expected'
# initialice logfile
execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE"
echo "Community installer version: $S_VERSION" >> $LOGFILE
# Pre checks
# Root permisions
check_root_permissions
# Pre installed pandora
check_pre_pandora
# Connectivity
check_repo_connection
# Systemd
execute_cmd "systemctl status" "Cheking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env plese check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8'
# Check memomry greather or equal to 2G
execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)'
# Check disk size at least 10 Gb free space
execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)'
# Execute tools check
execute_cmd "awk --version" 'Checking needed tools: awk'
execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "yum --version" 'Checking needed tools: yum'
# Creating working directory
rm -rf $HOME/pandora_deploy_tmp/*.rpm* &>> $LOGFILE
mkdir $HOME/pandora_deploy_tmp &>> $LOGFILE
execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp"
#Installing wget
execute_cmd "yum install -y wget" "Installing wget"
#Installing extra repositiries
extra_repos=" \
tar \
yum-utils \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
http://rpms.remirepo.net/enterprise/remi-release-7.rpm \
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP"
# Install percona Database
[ -f /etc/resolv.conf ] && rm -rf /etc/my.cnf
execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server"
# Console dependencies
console_dependencies=" \
php \
postfix \
php-mcrypt \
php-cli \
php-gd \
php-curl \
php-session \
php-mysqlnd \
php-ldap \
php-zip \
php-zlib \
php-fileinfo \
php-gettext \
php-snmp \
php-mbstring \
php-pecl-zip \
php-xmlrpc \
libxslt \
wget \
php-xml \
httpd \
mod_php \
atk \
avahi-libs \
cairo \
cups-libs \
fribidi \
gd \
gdk-pixbuf2 \
ghostscript \
graphite2 \
graphviz \
gtk2 \
harfbuzz \
hicolor-icon-theme \
hwdata \
jasper-libs \
lcms2 \
libICE \
libSM \
libXaw \
libXcomposite \
libXcursor \
libXdamage \
libXext \
libXfixes \
libXft \
libXi \
libXinerama \
libXmu \
libXrandr \
libXrender \
libXt \
libXxf86vm \
libcroco \
libdrm \
libfontenc \
libglvnd \
libglvnd-egl \
libglvnd-glx \
libpciaccess \
librsvg2 \
libthai \
libtool-ltdl \
libwayland-client \
libwayland-server \
libxshmfence \
mesa-libEGL \
mesa-libGL \
mesa-libgbm \
mesa-libglapi \
pango \
pixman \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-misc \
poppler-data \
php-yaml \
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"
# Server dependencies
server_dependencies=" \
perl \
vim \
fping \
perl-IO-Compress \
nmap \
sudo \
perl-Time-HiRes \
nfdump \
net-snmp-utils \
http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
# SDK VMware perl dependencies
vmware_dependencies=" \
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
perl-JSON \
perl-Archive-Zip \
openssl-devel \
perl-Crypt-CBC \
perl-Digest-SHA \
http://firefly.artica.es/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm"
execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
# Instant client Oracle
oracle_dependencier=" \
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"
execute_cmd "yum install -y $vmware_dependencies" "Installing Oracle Instant client"
# Disabling SELINUX and firewalld
setenforce 0
sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
systemctl disable firewalld --now &>> $LOGFILE
#Configuring Database
execute_cmd "systemctl start mysqld" "Starting database engine"
export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev)
echo """
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!');
UNINSTALL PLUGIN validate_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora');
""" | mysql --connect-expired-password -uroot
export MYSQL_PWD=$DBPASS
echo -en "${cyan}Creating Pandora FMS database...${reset}"
echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST
check_cmd_status 'Error creating database pandora, is this an empty node? if you have a previus installation please contact with support.'
echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST
#Generating my.cnf
POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
cat > /etc/my.cnf << EO_CONFIG_F
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
character-set-server=utf8
skip-character-set-client-handshake
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Mysql optimizations for Pandora FMS
# Please check the documentation in http://pandorafms.com for better results
max_allowed_packet = 64M
innodb_buffer_pool_size = $POOL_SIZE
innodb_lock_wait_timeout = 90
innodb_file_per_table
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_file_size = 64M
innodb_log_buffer_size = 16M
innodb_io_capacity = 100
thread_cache_size = 8
thread_stack = 256K
max_connections = 100
key_buffer_size=4M
read_buffer_size=128K
read_rnd_buffer_size=128K
sort_buffer_size=128K
join_buffer_size=4M
query_cache_type = 1
query_cache_size = 64M
query_cache_min_res_unit = 2k
query_cache_limit = 256K
sql_mode=""
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
EO_CONFIG_F
execute_cmd "systemctl restart mysqld" "Configuring database engine"
# Downloading Pandora Packages
execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" "Downloading Pandora FMS Server community"
execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" "Downloading Pandora FMS Console community"
execute_cmd "wget http://firefly.artica.es/centos7/pandorafms_agent_unix-7.0NG.751_x86_64.rpm" "Downloading Pandora FMS Agent community"
# Install Pandora
execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages"
# Copy gotty utility
execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util'
tar xvzf gotty_linux_amd64.tar.gz &>> $LOGFILE
execute_cmd "mv gotty /usr/bin/" 'Installing gotty util'
# Enable Services
execute_cmd "systemctl enable mysqld --now" "Enabling Database service"
execute_cmd "systemctl enable httpd --now" "Enabling HTTPD service"
# Populate Database
echo -en "${cyan}Loading pandoradb.sql to $DBNAME database...${reset}"
mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb.sql &>> $LOGFILE
check_cmd_status 'Error Loading database schema'
echo -en "${cyan}Loading pandoradb_data.sql to $DBNAME database...${reset}"
mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sql &>> $LOGFILE
check_cmd_status 'Error Loading database schema data'
# Configure console
cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F
<?php
\$config["dbtype"] = "mysql";
\$config["dbname"]="$DBNAME";
\$config["dbuser"]="$DBUSER";
\$config["dbpass"]="$DBPASS";
\$config["dbhost"]="localhost";
\$config["homedir"]="$PANDORA_CONSOLE";
\$config["homeurl"]="/pandora_console";
error_reporting(0);
\$ownDir = dirname(__FILE__) . '/';
include (\$ownDir . "config_process.php");
EO_CONFIG_F
cat > /etc/httpd/conf.d/pandora.conf << EO_CONFIG_F
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
EO_CONFIG_F
# Add ws proxy options to apache.
cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD'
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
EO_HTTPD_MOD
cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL'
ProxyRequests Off
<Proxy *>
Require all granted
</Proxy>
ProxyPass /ws ws://127.0.0.1:8080
ProxyPassReverse /ws ws://127.0.0.1:8080
EO_HTTPD_WSTUNNEL
# Temporal quitar htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess
# Fixing console permissions
chmod 600 $CONSOLE_PATH/include/config.php
chown apache. $CONSOLE_PATH/include/config.php
mv $CONSOLE_PATH/install.php $CONSOLE_PATH/install.done
# Prepare php.ini
sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
sed -i -e "s/^memory_limit.*/memory_limit = 500M/g" /etc/php.ini
cat > /var/www/html/index.html << EOF_INDEX
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">
EOF_INDEX
execute_cmd "systemctl restart httpd" "Restarting httpd after configuration"
# prepare snmptrapd
cat > /etc/snmp/snmptrapd.conf << EOF
authCommunity log public
disableAuthorization yes
EOF
# Prepare Server conf
sed -i -e "s/^dbhost.*/dbhost $DBHOST/g" $PANDORA_SERVER_CONF
sed -i -e "s/^dbname.*/dbname $DBNAME/g" $PANDORA_SERVER_CONF
sed -i -e "s/^dbuser.*/dbuser $DBUSER/g" $PANDORA_SERVER_CONF
sed -i -e "s|^dbpass.*|dbpass $DBPASS|g" $PANDORA_SERVER_CONF
sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF
# Set Oracle environment for pandora_server
cat > /etc/pandora/pandora_server.env << 'EOF_ENV'
#!/bin/bash
VERSION=19.8
export PATH=$PATH:$HOME/bin:/usr/lib/oracle/$VERSION/client64/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib
export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64
EOF_ENV
# Kernel optimization
cat >> /etc/sysctl.conf <<EO_KO
# Pandora FMS Optimization
# default=5
net.ipv4.tcp_syn_retries = 3
# default=5
net.ipv4.tcp_synack_retries = 3
# default=1024
net.ipv4.tcp_max_syn_backlog = 65536
# default=124928
net.core.wmem_max = 8388608
# default=131071
net.core.rmem_max = 8388608
# default = 128
net.core.somaxconn = 1024
# default = 20480
net.core.optmem_max = 81920
EO_KO
execute_cmd "sysctl --system" "Applying Kernel optimization"
# Fix pandora_server.{log,error} permissions to allow Console check them
chown pandora:apache /var/log/pandora
chmod g+s /var/log/pandora
cat > /etc/logrotate.d/pandora_server <<EO_LR
/var/log/pandora/pandora_server.log
/var/log/pandora/web_socket.log
/var/log/pandora/pandora_server.error {
su root apache
weekly
missingok
size 300000
rotate 3
maxage 90
compress
notifempty
copytruncate
create 660 pandora apache
}
/var/log/pandora/pandora_snmptrap.log {
su root apache
weekly
missingok
size 500000
rotate 1
maxage 30
notifempty
copytruncate
create 660 pandora apache
}
EO_LR
cat > /etc/logrotate.d/pandora_agent <<EO_LRA
/var/log/pandora/pandora_agent.log {
su root apache
weekly
missingok
size 300000
rotate 3
maxage 90
compress
notifempty
copytruncate
}
EO_LRA
chmod 0644 /etc/logrotate.d/pandora_server
chmod 0644 /etc/logrotate.d/pandora_agent
# Add websocket engine start script.
mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/
chmod +x /etc/init.d/pandora_websocket_engine
# Start Websocket engine
/etc/init.d/pandora_websocket_engine start &>> $LOGFILE
# Configure websocket to be started at start.
systemctl enable pandora_websocket_engine &>> $LOGFILE
# Enable pandora ha service
systemctl enable pandora_server --now &>> $LOGFILE
execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server"
# starting tentacle server
systemctl enable tentacle_serverd &>> $LOGFILE
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
# Enabling condole cron
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
## Enabling agent
systemctl enable pandora_agent_daemon &>> $LOGFILE
execute_cmd "systemctl start pandora_agent_daemon" "starting Pandora FMS Agent"
#SSH banner
[ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me)
cat > /etc/issue.net << EOF_banner
Welcome to Pandora FMS appliance on CentOS
------------------------------------------
Go to Public http://$ipplublic/pandora_console$to to login web console
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
You can find more information at http://pandorafms.com
EOF_banner
rm -f /etc/issue
ln -s /etc/issue.net /etc/issue
echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config
# Remove temporary files
execute_cmd "echo done" "Pandora FMS Community installed"
cd
execute_cmd "rm -rf $HOME/pandora_deploy_tmp" "Removing temporary files"
# Print nice finish message
GREEN='\033[01;32m'
NONE='\033[0m'
printf " -> Go to Public ${green}http://"$ipplublic"/pandora_console${reset} to manage this server"
ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v -e "172.1[0-9].0.1" | awk '{print $2}' | awk -v g=$GREEN -v n=$NONE -F '/' '{printf "\n -> Go to Local "g"http://"$1"/pandora_console"n" to manage this server \n -> Use this credentials to login in the console "g"[ User: admin / Password: pandora ]"n" \n"}'

View File

@ -9,7 +9,7 @@ RUN dnf install -y --setopt=tsflags=nodocs \
http://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf module reset -y php && dnf module install -y php:remi-7.3
RUN dnf config-manager --set-enabled PowerTools
RUN dnf config-manager --set-enabled powertools
# Install console
RUN dnf install -y --setopt=tsflags=nodocs \
@ -88,7 +88,7 @@ RUN dnf install -y --setopt=tsflags=nodocs \
xorg-x11-fonts-75dpi \
xorg-x11-fonts-misc \
poppler-data \
php-yaml; yum clean all
php-yaml
RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/
# not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts
@ -242,16 +242,31 @@ RUN dnf install -y --setopt=tsflags=nodocs \
perl-DBD-MySQL \
perl-DBI \
initscripts \
vim \
fping \
perl-IO-Compress \
perl-Time-HiRes \
perl-Math-Complex \
libnsl \
mysql \
java \
net-snmp-utils \
net-tools \
nmap-ncat \
nmap \
net-snmp-utils \
sudo \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm
http://firefly.artica.es/centos8/wmi-1.3.14-4.el7.art.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
# 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
RUN dnf install -y supervisor crontabs mysql http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
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

View File

@ -64,6 +64,7 @@ wget $oconsoleurl
wget $oserverurl
if [ "$BASEBUILD" == 1 ] ; then
docker pull centos:8
# Open Base image
echo "building Base el8 image"
cd $DOCKER_PATH/base
@ -71,9 +72,12 @@ if [ "$BASEBUILD" == 1 ] ; then
echo "Taging Open stack el8 latest image before upload"
docker tag $OBASE_IMAGE:$VERSION $OBASE_IMAGE:latest
echo -e ">>>> \n"
else
docker pull pandorafms/pandorafms-open-base-el8
fi
if [ "$DBBUILD" == 1 ] ; then
docker pull percona:5.7
# Percona image
echo "building Percona image"
cd $OPEN/extras/docker/percona

View File

@ -1,15 +1,15 @@
FROM centos:centos8
MAINTAINER Pandora FMS Team <info@pandorafms.com>
FROM centos:7
LABEL maintainer="Pandora FMS Team <info@pandorafms.com>"
# Add Pandora FMS agent installer
ADD unix /opt/pandora/pandora_agent/unix
RUN export LC_ALL=C
RUN dnf install -y dnf-plugins-core; dnf config-manager --set-enabled PowerTools
RUN yum -y update
# Install dependencies
RUN dnf -y install \
RUN yum -y install \
epel-release \
unzip \
perl \
@ -17,7 +17,7 @@ RUN dnf -y install \
sed \
perl-YAML-Tiny \
"perl(Sys::Syslog)" \
&& dnf clean all
&& yum clean all
# Install Pandora FMS agent

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, AIX version
# Version 7.0NG.753, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, FreeBSD Version
# Version 7.0NG.753, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, HP-UX Version
# Version 7.0NG.753, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, GNU/Linux
# Version 7.0NG.753, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, GNU/Linux
# Version 7.0NG.753, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, Solaris Version
# Version 7.0NG.753, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.751
# Version 7.0NG.753
# 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

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.751, AIX version
# Version 7.0NG.753, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.751
# Version 7.0NG.753
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.751, HPUX Version
# Version 7.0NG.753, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751
# Version 7.0NG.753
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751
# Version 7.0NG.753
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751
# Version 7.0NG.753
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.751, Solaris version
# Version 7.0NG.753, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, AIX version
# Version 7.0NG.753, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.751-210112
Version: 7.0NG.753-210407
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -24,7 +24,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.751"
VERSION="7.0NG.753"
fi
# Path for the generated DMG file

View 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.751" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.753" 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.751" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.753" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -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.751</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.751 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.751</string>
<key>CFBundleVersion</key> <string>7.0NG.753</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.753 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.753</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, GNU/Linux
# Version 7.0NG.753, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, FreeBSD Version
# Version 7.0NG.753, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, HP-UX Version
# Version 7.0NG.753, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, GNU/Linux
# Version 7.0NG.753, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, GNU/Linux
# Version 7.0NG.753, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, NetBSD Version
# Version 7.0NG.753, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.751, Solaris Version
# Version 7.0NG.753, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1015,8 +1015,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.751';
use constant AGENT_BUILD => '210112';
use constant AGENT_VERSION => '7.0NG.753';
use constant AGENT_BUILD => '210407';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -4143,7 +4143,7 @@ while (1) {
@address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`;
}
else {
@address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`;
@address_list = `ifconfig -a 2>$DevNull | grep -i inet | grep -v 'inet6' | grep -v '0.0.0.0' | grep -v '::/0' | awk '{print \$2}' | grep -v '127.0.0.1'`;
}
for (my $i = 0; $i <= $#address_list; $i++) {

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.751
%define release 210112
%define version 7.0NG.753
%define release 210407
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.751
%define release 210112
%define version 7.0NG.753
%define release 210407
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
@ -62,8 +62,9 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUI
rm -Rf $RPM_BUILD_ROOT
%pre
if [ "`id pandora | grep uid | wc -l`" = 0 ]
if [ "`id pandora 2>/dev/null | grep uid | wc -l`" = 0 ]
then
echo "User pandora does not exist. Creating it..."
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
fi
@ -105,10 +106,15 @@ then
echo "Copying new version of pandora_agent_daemon service"
cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/
chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service
# Enable the services on SystemD
systemctl enable pandora_agent_daemon.service
else
chkconfig pandora_agent_daemon on
# Enable the services on SystemD
systemctl enable pandora_agent_daemon.service || chkconfig pandora_agent_daemon on
else
chkconfig pandora_agent_daemon on
fi
if [ "$?" -gt 0 ]
then
echo "There was a problem configuring pandora_agent_daemon service to run on boot. Please enable it manually."
fi
if [ "$1" -gt 1 ]

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.751"
PI_BUILD="210112"
PI_VERSION="7.0NG.753"
PI_BUILD="210407"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.751
# Version 7.0NG.753
# 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

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.751}
{Pandora FMS Windows Agent v7.0NG.753}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{210112}
{210407}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.751(Build 210112)")
#define PANDORA_VERSION ("7.0NG.753(Build 210407)")
string pandora_path;
string pandora_dir;

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.751-210112
Version: 7.0NG.753-210407
Architecture: all
Priority: optional
Section: admin

View File

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

View File

@ -64,6 +64,16 @@ if (isset($config['console_log_enabled']) === true
ini_set('error_log', 0);
}
// Sometimes input is badly retrieved from caller...
if (empty($_REQUEST) === true) {
$data = explode('&', urldecode(file_get_contents('php://input')));
foreach ($data as $d) {
$r = explode('=', $d, 2);
$_POST[$r[0]] = $r[1];
$_GET[$r[0]] = $r[1];
}
}
// Hash login process.
if (isset($_GET['loginhash']) === true) {
$loginhash_data = get_parameter('loginhash_data', '');
@ -80,9 +90,8 @@ if (isset($_GET['loginhash']) === true) {
} else {
include_once 'general/login_page.php';
db_pandora_audit('Logon Failed (loginhash', '', 'system');
while (@ob_end_flush()) {
// Dumping...
continue;
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
@ -149,7 +158,9 @@ if (__PAN_XHPROF__ === 1) {
}
if ($config['force_instant_logout'] === true) {
if (isset($config['force_instant_logout']) === true
&& $config['force_instant_logout'] === true
) {
// Force user logout.
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
@ -169,7 +180,6 @@ if ($config['force_instant_logout'] === true) {
}
while (@ob_end_flush()) {
// Dumping...
continue;
while (ob_get_length() > 0) {
ob_end_flush();
}

View File

@ -360,14 +360,14 @@ function mainAgentsModules()
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else if ($full_modules_selected[0] && $full_agents_id[0]) {
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id));
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'&full_modules_selected='.$full_modules.'
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
@ -437,15 +437,15 @@ function mainAgentsModules()
// Header.
ui_print_page_header(
__('Agents/Modules'),
'images/module_mc.png',
'images/module.png',
false,
'',
false,
$updated_time
);
echo '<table style="width:100%;">';
echo '<table class="w100p">';
echo '<tr>';
echo "<td> <span style='float: right;'>".$fullscreen['text'].'</span> </td>';
echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>';
echo '</tr>';
echo '</table>';
} else {
@ -461,7 +461,7 @@ function mainAgentsModules()
}
// Floating menu - Start.
echo '<div id="vc-controls" style="z-index: 999">';
echo '<div id="vc-controls" class="zindex999">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
@ -469,14 +469,21 @@ function mainAgentsModules()
// Quit fullscreen.
echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo html_print_image(
'images/normal_screen.png',
true,
[
'title' => __('Back to normal mode'),
'class' => 'invert_filter',
]
);
echo '</a>';
echo '</li>';
// Countdown.
echo '<li class="nomn">';
echo '<div class="vc-refr">';
echo '<div class="vc-countdown style="display: inline;"></div>';
echo '<div class="vc-countdown inline_line"></div>';
echo '<div id="vc-refr-form">';
echo __('Refresh').':';
echo html_print_select(
@ -511,8 +518,8 @@ function mainAgentsModules()
}
if ($config['pure'] != 1) {
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" style="width:100%;">';
$show_filters .= '<table class="white_table" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">';
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">';
$show_filters .= '<table class="white_table w100p no-border" cellpadding="0" cellspacing="0" border="0">';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
@ -530,7 +537,7 @@ function mainAgentsModules()
$show_filters .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</span></td>';
$show_filters .= "<td colspan=6 ><span class='right pdd_r_20px'>".$filter_update.'</span></td>';
$show_filters .= '</tr>';
$show_filters .= '</table>';
$show_filters .= '</form>';
@ -675,15 +682,15 @@ function mainAgentsModules()
return;
}
echo '<table cellpadding="4" cellspacing="4" border="0" style="width:100%;" class="agents_modules_table">';
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table w100p">';
echo '<tr>';
echo "<th width='140px' style='text-align: right !important; padding-right:13px;'>".__('Agents').' / '.__('Modules').'</th>';
echo "<th width='140px' class='pdd_r_10px lign_right'>".__('Agents').' / '.__('Modules').'</th>';
if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
echo "<th width='20px' class='vertical_middle center' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_left_green.png',
true,
['title' => __('Previous modules')]
@ -701,15 +708,15 @@ function mainAgentsModules()
$text = ui_print_truncate_text(io_safe_output($module['name']), 'module_small');
echo '<th align="center" width="20px" id="th_module_r_'.$nmodules.'" class="th_class_module_r">
<div style="width: 30px;">
<div id="div_module_r_'.$nmodules.'" style="display: none;padding-left:10px" class="rotate_text_module">'.$text.'</div>
<div class="w30px">
<div id="div_module_r_'.$nmodules.'" class="rotate_text_module invisible padding-lft-10">'.$text.'</div>
</div>
</th>';
}
if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
echo "<th width='20px' class='vertical_middle center' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_right_green.png',
true,
['title' => __('More modules')]
@ -767,7 +774,7 @@ function mainAgentsModules()
break;
}
echo "<tr style='height: 25px;'>";
echo "<tr class='height_25px'>";
echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
@ -787,7 +794,7 @@ function mainAgentsModules()
foreach ($module['id'] as $module_id) {
if (!$match && array_key_exists($module_id, $agent_modules)) {
$status = modules_get_agentmodule_status($module_id);
echo "<td style='text-align: center;'>";
echo "<td class='center'>";
$win_handle = dechex(crc32($module_id.$module['name']));
$graph_type = return_graphtype(modules_get_agentmodule_type($module_id));
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&'.'id='.$module_id.'&'.'refresh='.SECONDS_10MINUTES."', 'day_".$win_handle."', 800, 480)";
@ -844,18 +851,18 @@ function mainAgentsModules()
echo '</table>';
$show_legend = "<div class='legend_white'>";
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></div>".__('Orange cell when the module has fired alerts').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></div>".__('Yellow cell when the module has a warning status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></div>".__('Green cell when the module has a normal status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></div>".__('Grey cell when the module has an unknown status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
$show_legend .= "<div class='center flex'>
<div class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></div>".__("Cell turns blue when the module is in 'not initialize' status").'</div>';
$show_legend .= '</div>';
ui_toggle($show_legend, __('Legend'));

View File

@ -187,7 +187,7 @@ function extension_api_checker()
$row = [];
$row[] = __('Raw URL');
$row[] = html_print_input_text('url', $url, '', 150, 2048, true);
$row[] = html_print_input_text('url', $url, '', 50, 2048, true);
$table3->data[] = $row;
echo "<form method='post'>";
@ -200,9 +200,7 @@ function extension_api_checker()
echo '<legend>'.__('Call parameters').' '.ui_print_help_tip(__('Action: get Operation: module_last_value id: 63'), true).'</legend>';
html_print_table($table2);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo "<div class='right'>";
echo '</div>';
echo '</form>';
@ -212,7 +210,7 @@ function extension_api_checker()
html_print_table($table3);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
echo "<div class='right'>";
html_print_input_hidden('api_execute', 1);
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
echo '</div>';

View File

@ -67,7 +67,7 @@ function extension_db_status()
html_print_table($table);
echo '</fieldset>';
echo "<div style='text-align: right;'>";
echo "<div class='right'>";
html_print_input_hidden('db_status_execute', 1);
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
echo '</div>';

View File

@ -119,7 +119,7 @@ function dbmgr_extension_main()
echo "<form method='post' action=''>";
html_print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES));
echo '<br />';
echo '<div class="action-buttons" style="width: 100%">';
echo '<div class="action-buttons w100p">';
echo '<br />';
html_print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
echo '</div>';
@ -156,7 +156,7 @@ function dbmgr_extension_main()
return;
}
echo "<div style='overflow: auto;'>";
echo "<div class='overflow'>";
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';

View File

@ -25,12 +25,19 @@ function load_matrix_console()
if (! $pure) {
$title_menu = __('Matrix events');
$fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>';
$fullscreen['text'] = '<a href="index.php?extension_in_menu=eventos&sec=extensions&sec2=extensions/matrix_events&pure=1">'.html_print_image(
'images/full_screen.png',
true,
[
'title' => __('Full screen mode'),
'class' => 'invert_filter',
]
).'</a>';
$onheader = ['fullscreen' => $fullscreen];
ui_print_page_header($title_menu, 'images/op_monitoring.png', false, '', false, $onheader);
}
echo '<canvas id="matrix-terminal" style="display:block;"></canvas>';
echo '<canvas id="matrix-terminal" class="visible"></canvas>';
?>
<script language="javascript" type="text/javascript">

View File

@ -84,7 +84,7 @@ function extension_uploader_extensions()
echo "<form method='post' enctype='multipart/form-data'>";
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('upload', 1);
html_print_submit_button(__('Upload'), 'submit', false, 'class="sub add"');
echo '</div>';

View File

@ -111,25 +111,25 @@ function pandora_files_repo_godmode()
return;
}
// Header tabs
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
// Header tabs.
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
$godmode['godmode'] = 1;
$godmode['active'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
$operation['operation'] = 1;
$onheader = [
'godmode' => $godmode,
'operation' => $operation,
];
// Header
// Header.
ui_print_page_header(__('Files repository manager'), 'images/extensions.png', false, '', true, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check
// Directory files_repo check.
if (!files_repo_check_directory(true)) {
return;
}
@ -139,19 +139,19 @@ function pandora_files_repo_godmode()
$server_content_length = $_SERVER['CONTENT_LENGTH'];
}
// Check for an anoying error that causes the $_POST and $_FILES arrays
// were empty if the file is larger than the post_max_size
// Check for an anoying error that causes the $_POST and $_FILES arrays.
// were empty if the file is larger than the post_max_size.
if (intval($server_content_length) > 0 && empty($_POST)) {
ui_print_error_message(__('The file exceeds the maximum size'));
}
// GET and POST parameters
// GET and POST parameters.
$file_id = (int) get_parameter('file_id');
$add_file = (bool) get_parameter('add_file');
$update_file = (bool) get_parameter('update_file');
$delete_file = (bool) get_parameter('delete');
// File add or update
// File add or update.
if ($add_file || ($update_file && $file_id > 0)) {
$groups = get_parameter('groups', []);
$public = (bool) get_parameter('public');
@ -174,7 +174,7 @@ function pandora_files_repo_godmode()
}
}
// File delete
// File delete.
if ($delete_file && $file_id > 0) {
$result = files_repo_delete_file($file_id);
if ($result !== -1) {
@ -184,10 +184,10 @@ function pandora_files_repo_godmode()
$file_id = 0;
}
// FORM
// FORM.
include $full_extensions_dir.'files_repo/files_repo_form.php';
if (!$file_id) {
// LIST
// LIST.
$manage = true;
include $full_extensions_dir.'files_repo/files_repo_list.php';
}
@ -198,13 +198,13 @@ function pandora_files_repo_operation()
{
global $config;
// Header tabs
// Header tabs.
$onheader = [];
if (check_acl($config['id_user'], 0, 'PM')) {
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view')]).'</a>';
$godmode['text'] = '<a href="index.php?sec=godmode/extensions&sec2=extensions/files_repo">'.html_print_image('images/setup.png', true, ['title' => __('Administration view'), 'class' => 'invert_filter']).'</a>';
$godmode['godmode'] = 1;
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/operation.png', true, ['title' => __('Operation view')]).'</a>';
$operation['text'] = '<a href="index.php?sec=extensions&sec2=extensions/files_repo">'.html_print_image('images/eye_show.png', true, ['title' => __('Operation view'), 'class' => 'invert_filter']).'</a>';
$operation['operation'] = 1;
$operation['active'] = 1;
@ -214,18 +214,18 @@ function pandora_files_repo_operation()
];
}
// Header
// Header.
ui_print_page_header(__('Files repository'), 'images/extensions.png', false, '', false, $onheader);
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include_once $full_extensions_dir.'files_repo/functions_files_repo.php';
// Directory files_repo check
// Directory files_repo check.
if (!files_repo_check_directory(true)) {
return;
}
// LIST
// LIST.
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
include $full_extensions_dir.'files_repo/files_repo_list.php';
@ -237,5 +237,4 @@ extensions_add_main_function('pandora_files_repo_operation');
extensions_add_godmode_menu_option(__('Files repository manager'), 'PM', null, null, 'v1r1');
extensions_add_godmode_function('pandora_files_repo_godmode');
// pandora_files_repo_uninstall();
pandora_files_repo_install();

View File

@ -82,7 +82,7 @@ $table->colspan[][1] = 3;
$row = [];
$row[0] = __('Description');
$row[0] .= ui_print_help_tip(__('Only 200 characters are permitted'), true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'style="min-height: 40px; max-height: 40px; width: 98%;"', true);
$row[1] = html_print_textarea('description', 3, 20, $file['description'], 'class="file_repo_description"', true);
$table->data[] = $row;
$table->colspan[][1] = 3;
@ -90,7 +90,7 @@ $table->colspan[][1] = 3;
$row = [];
// Public checkbox
$checkbox = html_print_checkbox('public', 1, (bool) !empty($file['hash']), true);
$style = 'style="padding: 2px 10px; display: inline-block;"';
$style = 'class="inline padding-2-10"';
$row[0] = __('File');
if ($file_id > 0) {

View File

@ -16,6 +16,8 @@ global $config;
$full_extensions_dir = $config['homedir'].'/'.EXTENSIONS_DIR.'/';
require_once $full_extensions_dir.'files_repo/functions_files_repo.php';
$offset = (int) get_parameter('offset');
$filter = [];
$filter['limit'] = $config['block_size'];
@ -61,19 +63,34 @@ if (!empty($files)) {
$data = [];
// Prepare the filename for the get_file.php script
$document_root = str_replace('\\', '/', io_safe_output($_SERVER['DOCUMENT_ROOT']));
$file['location'] = str_replace('\\', '/', io_safe_output($file['location']));
$document_root = str_replace(
'\\',
'/',
io_safe_output($_SERVER['DOCUMENT_ROOT'])
);
$file['location'] = str_replace(
'\\',
'/',
io_safe_output($file['location'])
);
$relative_path = str_replace($document_root, '', $file['location']);
$file_name = explode('/', $file['location']);
$file_decoded = $file_name[(count($file_name) - 1)];
$file_path = base64_encode($file_decoded);
$hash = md5($file_path.$config['dbpass']);
$url = ui_get_full_url('include/get_file.php?file='.urlencode($file_path).'&hash='.$hash);
$url = ui_get_full_url(
'include/get_file.php?file='.urlencode($file_path).'&hash='.$hash
);
$date_format = ($config['date_format']) ? io_safe_output($config['date_format']) : 'F j, Y - H:m';
$data[0] = "<a href=\"$url\" target=\"_blank\">".$file['name'].'</a>';
// Name
$data[1] = ui_print_truncate_text($file['description'], 'description', true, true);
$data[1] = ui_print_truncate_text(
$file['description'],
'description',
true,
true
);
// Description
$data[2] = ui_format_filesize($file['size']);
// Size
@ -83,30 +100,58 @@ if (!empty($files)) {
$data[4] = '';
$table->cellclass[][4] = 'action_buttons';
if (!empty($file['hash'])) {
$public_url = ui_get_full_url(EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']);
$public_url = ui_get_full_url(
EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']
);
$message = __('Copy to clipboard').': Ctrl+C -> Enter';
$action = "window.prompt('$message', '$public_url');";
$data[4] .= "<a href=\"javascript:;\" onclick=\"$action\">";
$data[4] .= html_print_image('images/world.png', true, ['title' => __('Public link')]);
$data[4] .= html_print_image(
'images/world.png',
true,
['title' => __('Public link')]
);
// Public link image
$data[4] .= '</a> ';
}
$data[4] .= "<a href=\"$url\" target=\"_blank\">";
$data[4] .= html_print_image('images/download.png', true, ['title' => __('Download'), 'style' => 'padding:3px' ]);
$data[4] .= html_print_image(
'images/download.png',
true,
[
'title' => __('Download'),
'style' => 'padding:3px',
]
);
// Download image
$data[4] .= '</a>';
if ($manage) {
$config_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id=$file_id");
$data[4] .= " <a href=\"$config_url\">";
$data[4] .= html_print_image('images/config.png', true, ['title' => __('Edit')]);
$config_url = ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id='.$file_id
);
$data[4] .= '<a href=\"$config_url\">';
$data[4] .= html_print_image(
'images/config.png',
true,
['title' => __('Edit')]
);
// Edit image
$data[4] .= '</a>';
$delete_url = ui_get_full_url("index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id=$file_id");
$delete_url = ui_get_full_url(
'index.php?sec=godmode/extensions&sec2=extensions/files_repo&delete=1&file_id='.$file_id
);
$data[4] .= " <a href=\"$delete_url\" onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\">";
$data[4] .= html_print_image('images/cross.png', true, ['title' => __('Delete')]);
$data[4] .= html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
);
// Delete image
$data[4] .= '</a>';
}

View File

@ -137,7 +137,7 @@ function mainInsertData()
}
}
echo '<div class="notify" style="margin-bottom:15px;">';
echo '<div class="notify mrg_btt_15">';
echo sprintf(
__('Please check that the directory "%s" is writeable by the apache user. <br /><br />The CSV file format is date;value&lt;newline&gt;date;value&lt;newline&gt;... The date in CSV is in format Y/m/d H:i:s.'),
$config['remote_config']
@ -200,7 +200,7 @@ function mainInsertData()
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
echo "<div class='right' style='width: ".$table->width."'>";
html_print_input_hidden('save', 1);
html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"');
echo '</div>';

View File

@ -254,7 +254,7 @@ function mainModuleGroups()
''
);
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'>
<tr>";
echo "<form method='post'
action='index.php?sec=view&sec2=extensions/module_groups'>";
@ -336,7 +336,7 @@ function mainModuleGroups()
}
$data[$i][$j] = "<div style='".$cell_style.'background:'.$color.";'>";
$data[$i][$j] .= "<a class='info_cell' rel='$rel' href='$url' style='color:white;font-size: 18px;'>";
$data[$i][$j] .= "<a class='info_cell white font_18px' rel='$rel' href='$url'>";
$data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>';
} else {
@ -349,7 +349,7 @@ function mainModuleGroups()
}
} else {
foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:".$background_color."; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div class='module_gm_groups' style='background:".$background_color."'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
$j++;
@ -365,15 +365,15 @@ function mainModuleGroups()
ui_pagination($counter);
echo "<div style='width:100%; overflow-x:auto;'>";
echo "<div class='w100p' style='overflow-x:auto;'>";
html_print_table($table);
echo '</div>';
ui_pagination($counter);
echo "<div class='legend_basic' style='width: 98.6%'>";
echo "<div class='legend_basic w99p'>";
echo '<table >';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td colspan='2' class='pdd_b_10px'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module group and agent have at least one alarm fired.').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';

View File

@ -1,506 +0,0 @@
<?php
/**
* Net tools utils.
*
* @category Extensions
* @package Pandora FMS
* @subpackage NetTools
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* 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 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;
// Requires.
require_once $config['homedir'].'/include/functions.php';
// This extension is usefull only if the agent has associated IP.
$id_agente = get_parameter('id_agente');
$address = agents_get_address($id_agente);
if (!empty($address) || empty($id_agente)) {
extensions_add_opemode_tab_agent(
'network_tools',
'Network Tools',
'extensions/net_tools/nettool.png',
'main_net_tools',
'v1r1',
'AW'
);
}
/**
* Searchs for command.
*
* @param string $command Command.
*
* @return string Path.
*/
function whereis_the_command($command)
{
global $config;
if (isset($config['network_tools_config'])) {
$network_tools_config = json_decode($config['network_tools_config'], true);
$traceroute_path = $network_tools_config['traceroute_path'];
$ping_path = $network_tools_config['ping_path'];
$nmap_path = $network_tools_config['nmap_path'];
$dig_path = $network_tools_config['dig_path'];
$snmpget_path = $network_tools_config['snmpget_path'];
switch ($command) {
case 'traceroute':
if (!empty($traceroute_path)) {
return $traceroute_path;
}
break;
case 'ping':
if (!empty($ping_path)) {
return $ping_path;
}
break;
case 'nmap':
if (!empty($nmap_path)) {
return $nmap_path;
}
break;
case 'dig':
if (!empty($dig_path)) {
return $dig_path;
}
break;
case 'snmpget':
if (!empty($snmpget_path)) {
return $snmpget_path;
}
break;
default:
return null;
}
}
ob_start();
system('whereis '.$command);
$output = ob_get_clean();
$result = explode(':', $output);
$result = trim($result[1]);
if (empty($result)) {
return null;
}
$result = explode(' ', $result);
$fullpath = trim($result[0]);
if (! file_exists($fullpath)) {
return null;
}
return $fullpath;
}
/**
* Execute net tools action.
*
* @param integer $operation Operation.
* @param string $ip Ip.
* @param string $community Community.
* @param string $snmp_version SNMP version.
*
* @return void
*/
function net_tools_execute($operation, $ip, $community, $snmp_version)
{
if (!validate_address($ip)) {
ui_print_error_message(__('The ip or dns name entered cannot be resolved'));
} else {
switch ($operation) {
case 1:
$traceroute = whereis_the_command('traceroute');
if (empty($traceroute)) {
ui_print_error_message(__('Traceroute executable does not exist.'));
} else {
echo '<h3>'.__('Traceroute to ').$ip.'</h3>';
echo '<pre>';
echo system($traceroute.' '.$ip);
echo '</pre>';
}
break;
case 2:
$ping = whereis_the_command('ping');
if (empty($ping)) {
ui_print_error_message(__('Ping executable does not exist.'));
} else {
echo '<h3>'.__('Ping to %s', $ip).'</h3>';
echo '<pre>';
echo system($ping.' -c 5 '.$ip);
echo '</pre>';
}
break;
case 4:
$nmap = whereis_the_command('nmap');
if (empty($nmap)) {
ui_print_error_message(__('Nmap executable does not exist.'));
} else {
echo '<h3>'.__('Basic TCP Scan on ').$ip.'</h3>';
echo '<pre>';
echo system($nmap.' -F '.$ip);
echo '</pre>';
}
break;
case 5:
echo '<h3>'.__('Domain and IP information for ').$ip.'</h3>';
$dig = whereis_the_command('dig');
if (empty($dig)) {
ui_print_error_message(__('Dig executable does not exist.'));
} else {
echo '<pre>';
echo system('dig '.$ip);
echo '</pre>';
}
$whois = whereis_the_command('whois');
if (empty($whois)) {
ui_print_error_message(__('Whois executable does not exist.'));
} else {
echo '<pre>';
echo system('whois '.$ip);
echo '</pre>';
}
break;
case 3:
$snmp_obj = [
'ip_target' => $ip,
'snmp_version' => $snmp_version,
'snmp_community' => $community,
'format' => '-Oqn',
];
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.3.0';
$result = get_h_snmpwalk($snmp_obj);
echo '<h3>'.__('SNMP information for ').$ip.'</h3>';
echo '<h4>'.__('Uptime').'</h4>';
echo '<pre>';
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo array_pop($result);
}
echo '</pre>';
echo '<h4>'.__('Device info').'</h4>';
echo '<pre>';
$snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.1.0';
$result = get_h_snmpwalk($snmp_obj);
if (empty($result)) {
ui_print_error_message(__('Target unreachable.'));
break;
} else {
echo array_pop($result);
}
echo '</pre>';
echo '<h4>Interface Information</h4>';
$table = new StdClass();
$table->class = 'databox';
$table->head = [];
$table->head[] = __('Interface');
$table->head[] = __('Status');
$i = 0;
$base_oid = '.1.3.6.1.2.1.2.2.1';
$idx_oids = '.1';
$names_oids = '.2';
$status_oids = '.8';
$snmp_obj['base_oid'] = $base_oid.$idx_oids;
$idx = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$names_oids;
$names = get_h_snmpwalk($snmp_obj);
$snmp_obj['base_oid'] = $base_oid.$status_oids;
$statuses = get_h_snmpwalk($snmp_obj);
foreach ($idx as $k => $v) {
$index = str_replace($base_oid.$idx_oids, '', $k);
$name = $names[$base_oid.$names_oids.$index];
$status = $statuses[$base_oid.$status_oids.$index];
$table->data[$i][0] = $name;
$table->data[$i++][1] = $status;
}
html_print_table($table);
break;
default:
// Ignore.
break;
}
}
}
/**
* Main function.
*
* @return void
*/
function main_net_tools()
{
$operation = get_parameter('operation', 0);
$community = get_parameter('community', 'public');
$ip = get_parameter('select_ips');
$snmp_version = get_parameter('select_version');
// Show form.
$id_agente = get_parameter('id_agente', 0);
$principal_ip = db_get_sql(
sprintf(
'SELECT direccion FROM tagente WHERE id_agente = %d',
$id_agente
)
);
$list_address = db_get_all_rows_sql(
sprintf(
'SELECT id_a FROM taddress_agent WHERE id_agent = %d',
$id_agente
)
);
foreach ($list_address as $address) {
$ids[] = join(',', $address);
}
$ips = db_get_all_rows_sql(
sprintf(
'SELECT ip FROM taddress WHERE id_a IN (%s)',
join(',', $ids)
)
);
if ($ips == '') {
echo "<div class='error' style='margin-top:5px'>".__('The agent hasn\'t got IP').'</div>';
return;
}
// Javascript.
?>
<script type='text/javascript'>
$(document).ready(function(){
mostrarColumns($('#operation :selected').val());
});
function mostrarColumns(value) {
if (value == 3) {
$('.snmpcolumn').show();
}
else {
$('.snmpcolumn').hide();
}
}
</script>
<?php
echo '<div>';
echo "<form name='actionbox' method='post'>";
echo "<table class='databox filters' width=100% id=netToolTable>";
echo '<tr><td>';
echo __('Operation');
echo '</td><td>';
html_print_select(
[
1 => __('Traceroute'),
2 => __('Ping host & Latency'),
3 => __('SNMP Interface status'),
4 => __('Basic TCP Port Scan'),
5 => __('DiG/Whois Lookup'),
],
'operation',
$operation,
'mostrarColumns(this.value)',
__('Please select')
);
echo '</td>';
echo '<td>';
echo __('IP address');
echo '</td><td>';
$ips_for_select = array_reduce(
$ips,
function ($carry, $item) {
$carry[$item['ip']] = $item['ip'];
return $carry;
}
);
html_print_select(
$ips_for_select,
'select_ips',
$principal_ip
);
echo '</td>';
echo "<td class='snmpcolumn'>";
echo __('SNMP Version');
html_print_select(
[
'1' => 'v1',
'2c' => 'v2c',
],
'select_version',
$snmp_version
);
echo '</td><td class="snmpcolumn">';
echo __('SNMP Community').'&nbsp;';
html_print_input_text('community', $community);
echo '</td><td>';
echo "<input style='margin:0px;' name=submit type=submit class='sub next' value='".__('Execute')."'>";
echo '</td>';
echo '</tr></table>';
echo '</form>';
if ($operation) {
// Execute form.
net_tools_execute($operation, $ip, $community, $snmp_version);
}
echo '</div>';
}
/**
* Add option.
*
* @return void
*/
function godmode_net_tools()
{
global $config;
check_login();
if (! check_acl($config['id_user'], 0, 'PM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Profile Management'
);
include 'general/noaccess.php';
return;
}
ui_print_page_header(
__('Config Network Tools'),
'',
false,
'network_tools_tab'
);
$update_traceroute = (bool) get_parameter('update_traceroute', 0);
$traceroute_path = (string) get_parameter('traceroute_path', '');
$ping_path = (string) get_parameter('ping_path', '');
$nmap_path = (string) get_parameter('nmap_path', '');
$dig_path = (string) get_parameter('dig_path', '');
$snmpget_path = (string) get_parameter('snmpget_path', '');
if ($update_traceroute) {
$network_tools_config = [];
$network_tools_config['traceroute_path'] = $traceroute_path;
$network_tools_config['ping_path'] = $ping_path;
$network_tools_config['nmap_path'] = $nmap_path;
$network_tools_config['dig_path'] = $dig_path;
$network_tools_config['snmpget_path'] = $snmpget_path;
$result = config_update_value('network_tools_config', json_encode($network_tools_config));
ui_print_result_message(
$result,
__('Set the paths.'),
__('Set the paths.')
);
} else {
if (isset($config['network_tools_config'])) {
$network_tools_config_output = io_safe_output($config['network_tools_config']);
$network_tools_config = json_decode($network_tools_config_output, true);
$traceroute_path = $network_tools_config['traceroute_path'];
$ping_path = $network_tools_config['ping_path'];
$nmap_path = $network_tools_config['nmap_path'];
$dig_path = $network_tools_config['dig_path'];
$snmpget_path = $network_tools_config['snmpget_path'];
}
}
$table = null;
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Traceroute path');
$table->data[0][1] = html_print_input_text('traceroute_path', $traceroute_path, '', 40, 255, true);
$table->data[1][0] = __('Ping path');
$table->data[1][1] = html_print_input_text('ping_path', $ping_path, '', 40, 255, true);
$table->data[2][0] = __('Nmap path');
$table->data[2][1] = html_print_input_text('nmap_path', $nmap_path, '', 40, 255, true);
$table->data[3][0] = __('Dig path');
$table->data[3][1] = html_print_input_text('dig_path', $dig_path, '', 40, 255, true);
$table->data[4][0] = __('Snmpget path');
$table->data[4][1] = html_print_input_text('snmpget_path', $snmpget_path, '', 40, 255, true);
echo '<form id="form_setup" method="post" >';
echo '<fieldset>';
echo '<legend>'.__('Options').'</legend>';
html_print_input_hidden('update_traceroute', 1);
html_print_table($table);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'update_button', false, 'class="sub upd"');
echo '</div>';
echo '</form>';
}
extensions_add_godmode_menu_option(__('Config Network Tools'), 'PM');
extensions_add_godmode_function('godmode_net_tools');

View File

@ -36,14 +36,14 @@ function view_logfile($file_name)
} else if ($file_size > ($config['max_log_size'] * 1000)) {
$data = file_get_contents($file_name, false, null, ($file_size - ($config['max_log_size'] * 1000)));
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "<textarea class='pandora_logs' name='$file_name'>";
echo '... ';
echo $data;
echo '</textarea><br><br>';
} else {
$data = file_get_contents($file_name);
echo "<h2>$file_name (".format_numeric(filesize($file_name) / 1024).' KB) '.ui_print_help_tip(__('The folder /var/log/pandora must have pandora:apache and its content too.'), true).' </h2>';
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "<textarea class='pandora_logs' name='$file_name'>";
echo $data;
echo '</textarea><br><br>';
}

View File

@ -94,12 +94,23 @@ function quickShell()
config_update_value('gotty_ssh_port', 8081);
}
// Context to allow self-signed certs.
$context = stream_context_create(
[
'http' => [ 'method' => 'GET'],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]
);
// Username. Retrieve from form.
if (empty($username) === true) {
// No username provided, ask for it.
$wiz = new Wizard();
$test = file_get_contents($ws_url);
$test = file_get_contents($ws_url, false, $context);
if ($test === false) {
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
$wiz->printForm(
@ -197,8 +208,9 @@ function quickShell()
return;
}
// If rediretion is enabled, we will try to connect to http:// or https:// endpoint.
$test = get_headers($ws_url);
// If rediretion is enabled, we will try to connect using
// http:// or https:// endpoint.
$test = get_headers($ws_url, null, $context);
if ($test === false) {
if (empty($wiz) === true) {
$wiz = new Wizard();

View File

@ -207,7 +207,7 @@ function pandora_realtime_graphs()
'reset',
false,
'javascript:realtimeGraphs.clearGraph();',
'class="sub delete" style="margin-top:0px;"',
'class="sub delete mgn_tp_0" ',
true
);
$table->data[] = $data;
@ -230,7 +230,7 @@ function pandora_realtime_graphs()
'custom_action',
urlencode(
base64_encode(
'&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>'
'&nbsp;<a href="javascript:realtimeGraphs.setOID();"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" class="vertical_middle"></img></a>'
)
),
false

View File

@ -12,4 +12,6 @@
#graph_container {
width: 800px;
margin: 20px auto;
background-color: white;
border-radius: 3px;
}

View File

@ -30,33 +30,56 @@ function users_extension_main_god($god=true)
if ($god) {
$image = 'images/gm_users.png';
} else {
$image = 'images/op_workspace.png';
$image = 'images/user.png';
}
// Header
ui_print_page_header(__('Users connected'), $image, false, '', $god);
// Get user conected last 5 minutes
// Get groups user has permission
$group_um = users_get_groups_UM($config['id_user']);
// Is admin or has group permissions all.
$groups = implode(',', array_keys($group_um, 1));
// Get user conected last 5 minutes.Show only those on which the user has permission.
switch ($config['dbtype']) {
case 'mysql':
$sql = 'SELECT id_user, last_connect
FROM tusuario
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
ORDER BY last_connect DESC';
$sql = sprintf(
'SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
AND tusuario_perfil.id_grupo IN (%s)
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC',
$groups
);
break;
case 'postgresql':
$sql = "SELECT id_user, last_connect
FROM tusuario
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
ORDER BY last_connect DESC';
$sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
AND tusuario_perfil.id_grupo IN (%s)
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC',
$groups
);
break;
case 'oracle':
$sql = "SELECT id_user, last_connect
FROM tusuario
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
ORDER BY last_connect DESC';
$sql = sprintf(
"SELECT tusuario.id_user, tusuario.last_connect
FROM tusuario
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
AND tusuario_perfil.id_grupo IN (%s)
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
GROUP BY tusuario.id_user
ORDER BY last_connect DESC',
$groups
);
break;
}
@ -75,13 +98,45 @@ function users_extension_main_god($god=true)
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Date');
$table->head[1] = __('IP');
$table->head[2] = __('Last login');
$table->head[3] = __('Last contact');
$rowPair = true;
$iterator = 0;
// Get data
foreach ($rows as $row) {
// Get data of user's last login.
switch ($config['dbtype']) {
case 'mysql':
case 'postgresql':
$last_login_data = db_get_row_sql(
sprintf(
"SELECT ip_origen, utimestamp
FROM tsesion
WHERE id_usuario = '%s'
AND descripcion = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
case 'oracle':
$last_login_data = db_get_row_sql(
sprintf(
"SELECT ip_origen, utimestamp
FROM tsesion
WHERE id_usuario = '%s'
AND to_char(descripcion) = '".io_safe_input('Logged in')."'
ORDER BY fecha DESC",
$row['id_user']
)
);
break;
}
if ($rowPair) {
$table->rowclass[$iterator] = 'rowPair';
} else {
@ -93,7 +148,9 @@ function users_extension_main_god($god=true)
$data = [];
$data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>';
$data[1] = date($config['date_format'], $row['last_connect']);
$data[1] = $last_login_data['ip_origin'];
$data[2] = date($config['date_format'], $last_login_data['utimestamp']);
$data[3] = date($config['date_format'], $row['last_connect']);
array_push($table->data, $data);
}
@ -102,7 +159,6 @@ function users_extension_main_god($god=true)
}
extensions_add_godmode_menu_option(__('Users connected'), 'UM', 'gusuarios', 'users/icon.png', 'v1r1');
extensions_add_operation_menu_option(__('Users connected'), 'workspace', 'users/icon.png', 'v1r1', '', 'UM');
extensions_add_godmode_function('users_extension_main_god');

View File

@ -1,5 +1,7 @@
operation/servers/recon_view.php
operation/users/webchat.php
operation/events/event_statistics.php
operation/events/events_marquee.php
include/javascript/webchat.js
attachment/pandora_chat.log.json.txt
attachment/pandora_chat.user_list.json.txt
@ -14,4 +16,65 @@ enterprise/godmode/reporting/cluster_view.php
enterprise/include/ajax/clustermap.php
enterprise/include/functions_clustermap.php
enterprise/include/functions_clusters.php
enterprise/include/javascript/ClusterMapController.js
enterprise/include/javascript/ClusterMapController.js
enterprise/extensions/ipam/ipam_supernet_network.php
enterprise/extensions/ipam/ipam_vlan_wizard.php
enterprise/extensions/ipam/sql
enterprise/extensions/ipam/sql/ipam_mr_1.sql
enterprise/extensions/ipam/sql/ipam_mr_2.sql
enterprise/extensions/ipam/sql/ipam.sql
enterprise/extensions/ipam/css
enterprise/extensions/ipam/css/ipam.css
enterprise/extensions/ipam/ipam_ajax.php
enterprise/extensions/ipam/ipam_vlan_network.php
enterprise/extensions/ipam/ipam_supernet_config.php
enterprise/extensions/ipam/ipam_list.php
enterprise/extensions/ipam/ipam_excel.php
enterprise/extensions/ipam/ipam_massive.php
enterprise/extensions/ipam/ipam_editor.php
enterprise/extensions/ipam/recon_script
enterprise/extensions/ipam/recon_script/readme
enterprise/extensions/ipam/ipam_network.php
enterprise/extensions/ipam/ipam_calculator.php
enterprise/extensions/ipam/ipam_vlan_config.php
enterprise/extensions/ipam/images
enterprise/extensions/ipam/images/red_host_agent.png
enterprise/extensions/ipam/images/lil_green_host_alert.png
enterprise/extensions/ipam/images/lil_red_host_alert.png
enterprise/extensions/ipam/images/lil_red_host_agent.png
enterprise/extensions/ipam/images/green_host_dotted.png
enterprise/extensions/ipam/images/red_host.png
enterprise/extensions/ipam/images/red_host_alert.png
enterprise/extensions/ipam/images/not_host.png
enterprise/extensions/ipam/images/lil_green_host_agent_alert.png
enterprise/extensions/ipam/images/ball_alive.png
enterprise/extensions/ipam/images/lil_green_host_agent.png
enterprise/extensions/ipam/images/ball_notalive.png
enterprise/extensions/ipam/images/green_host_agent_alert.png
enterprise/extensions/ipam/images/green_host_agent.png
enterprise/extensions/ipam/images/lil_red_host.png
enterprise/extensions/ipam/images/green_host_alert.png
enterprise/extensions/ipam/images/lil_not_host.png
enterprise/extensions/ipam/images/green_host.png
enterprise/extensions/ipam/images/lil_green_host.png
enterprise/extensions/ipam/images/lil_red_host_agent_alert.png
enterprise/extensions/ipam/images/lil_green_host_dotted.png
enterprise/extensions/ipam/images/red_host_agent_alert.png
enterprise/extensions/ipam/ipam_supernet_map.php
enterprise/extensions/ipam/include
enterprise/extensions/ipam/include/functions_ipam.php
enterprise/extensions/ipam/include/ajax
enterprise/extensions/ipam/include/ajax/ipam_ajax.php
enterprise/extensions/ipam/include/javascript
enterprise/extensions/ipam/include/javascript/ipam.js
enterprise/extensions/ipam/include/javascript/IpamMapController.js
enterprise/extensions/ipam/ipam_action.php
enterprise/extensions/ipam.php
enterprise/extensions/ipam
enterprise/extensions/disabled/visual_console_manager.php
enterprise/extensions/visual_console_manager.php
pandora_console/extensions/net_tools.php
include/lib/WSManager.php
include/lib/WebSocketServer.php
include/lib/WebSocketUser.php
operation/network/network_explorer.php

View File

@ -1,5 +1,96 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `tipam_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`network` varchar(100) NOT NULL default '',
`name_network` varchar(255) default '',
`description` text NOT NULL,
`location` tinytext NOT NULL,
`id_recon_task` int(10) unsigned NOT NULL,
`scan_interval` tinyint(2) default 1,
`monitoring` tinyint(2) default 0,
`id_group` mediumint(8) unsigned NULL default 0,
`lightweight_mode` tinyint(2) default 0,
`users_operator` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_ip` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_network` bigint(20) unsigned NOT NULL default 0,
`id_agent` int(10) unsigned NOT NULL,
`forced_agent` tinyint(2) NOT NULL default '0',
`ip` varchar(100) NOT NULL default '',
`ip_dec` int(10) unsigned NOT NULL,
`id_os` int(10) unsigned NOT NULL,
`forced_os` tinyint(2) NOT NULL default '0',
`hostname` tinytext NOT NULL,
`forced_hostname` tinyint(2) NOT NULL default '0',
`comments` text NOT NULL,
`alive` tinyint(2) NOT NULL default '0',
`managed` tinyint(2) NOT NULL default '0',
`reserved` tinyint(2) NOT NULL default '0',
`time_last_check` datetime NOT NULL default '1970-01-01 00:00:00',
`time_create` datetime NOT NULL default '1970-01-01 00:00:00',
`users_operator` text,
`time_last_edit` datetime NOT NULL default '1970-01-01 00:00:00',
`enabled` tinyint(2) NOT NULL default '1',
`generate_events` tinyint(2) NOT NULL default '0',
`leased` tinyint(2) DEFAULT '0',
`leased_expiration` bigint(20) DEFAULT '0',
`mac_address` varchar(20) DEFAULT NULL,
`leased_mode` tinyint(2) DEFAULT '0',
PRIMARY KEY (`id`),
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_vlan` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(250) NOT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_vlan_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_vlan` bigint(20) unsigned NOT NULL,
`id_network` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vlan`) REFERENCES tipam_vlan(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_supernet` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(250) NOT NULL,
`description` text default '',
`address` varchar(250) NOT NULL,
`mask` varchar(250) NOT NULL,
`subneting_mask` varchar(250) default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_supernet_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_supernet` bigint(20) unsigned NOT NULL,
`id_network` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_supernet`) REFERENCES tipam_supernet(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET @insert_type = 3;
SET @insert_name = 'IPAM Recon';
SET @insert_description = 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.';
SET @insert_script = '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl';
SET @insert_macros = '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""}}';
INSERT IGNORE INTO trecon_script (`id_recon_script`,`type`, `name`, `description`, `script`, `macros`) SELECT `id_recon_script`,`type`, `name`, `description`, `script`, `macros` FROM (SELECT `id_recon_script`,`type`, `name`, `description`, `script`, `macros` FROM `trecon_script` WHERE `name` = @insert_name UNION SELECT (SELECT max(`id_recon_script`)+1 FROM `trecon_script`) AS `id_recon_script`, @insert_type as `type`, @insert_name as `name`, @insert_description as `description`, @insert_script as `script`, @insert_macros as `macros`) t limit 1;
DELETE FROM `tconfig` WHERE `token` = 'ipam_installed';
DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id';
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event&#x20;text\",\"Event&#x20;type\",\"Source\",\"Agent&#x20;name&#x20;or&#x20;_agent_\",\"Event&#x20;severity\",\"ID&#x20;extra\",\"Tags&#x20;separated&#x20;by&#x20;commas\",\"Comments\",\"\",\"\"]' WHERE `id` = 3;
ALTER TABLE `talert_templates`
@ -14,6 +105,25 @@ ADD COLUMN `field16` TEXT NOT NULL AFTER `field15`
,ADD COLUMN `field19_recovery` TEXT NOT NULL AFTER `field18_recovery`
,ADD COLUMN `field20_recovery` TEXT NOT NULL AFTER `field19_recovery`;
UPDATE `trecon_script` SET `description`='Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0' WHERE `name`='IPMI&#x20;Recon';
ALTER TABLE `trecon_task` MODIFY COLUMN `review_mode` TINYINT(1) UNSIGNED DEFAULT 1;
DELETE FROM `tuser_task` WHERE id = 6;
UPDATE `tuser_task` SET `parameters`='a:4:{i:0;a:6:{s:11:"description";s:28:"Report pending to be created";s:5:"table";s:7:"treport";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:2:{s:11:"description";s:426:"Save to disk in path<a href="javascript:" class="tip" style="" ><img src="http://172.16.0.2/pandora_console/images/tip_help.png" data-title="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" data-use_title_for_force_title="1" class="forced_title" alt="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" /></a>";s:4:"type";s:6:"string";}i:2;a:2:{s:11:"description";s:16:"File nane prefix";s:4:"type";s:6:"string";}i:3;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE `id`=3;
UPDATE `tuser_task_scheduled` SET
`args` = REPLACE (`args`, 'a:3', 'a:5'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:3;s:3:"PDF";s:15:"first_execution"')
WHERE `id_user_task` = 3;
UPDATE `tuser_task_scheduled` SET
`id_user_task` = 3,
`args` = REPLACE (`args`, 'a:3', 'a:5'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:3;s:3:"XML";s:15:"first_execution"')
WHERE `id_user_task` = 6;
ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
COMMIT;

View File

@ -0,0 +1,20 @@
START TRANSACTION;
ALTER TABLE `talert_actions` ADD COLUMN `create_wu_integria` TINYINT(1) default NULL;
ALTER TABLE `treport_content` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `tinventory_alert` ADD COLUMN `alert_groups` TEXT NOT NULL;
UPDATE `tinventory_alert` t1 INNER JOIN `tinventory_alert` t2 ON t1.id = t2.id SET t1.alert_groups = t2.id_group;
ALTER TABLE `tnotification_source` ADD COLUMN `subtype_blacklist` TEXT;
SET @plugin_name = 'Network&#x20;bandwidth&#x20;SNMP';
SET @plugin_description = 'Retrieves&#x20;amount&#x20;of&#x20;digital&#x20;information&#x20;sent&#x20;and&#x20;received&#x20;from&#x20;device&#x20;or&#x20;filtered&#x20;&#x20;interface&#x20;index&#x20;over&#x20;a&#x20;particular&#x20;time&#x20;&#40;agent/module&#x20;interval&#41;.';
SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,300,0,'perl&#x20;/usr/share/pandora_server/util/plugin/pandora_snmp_bandwidth.pl','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"SNMP&#x20;Version&#40;1,2c,3&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Interface&#x20;Index&#x20;&#40;filter&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"securityName\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"context\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"securityLevel\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"authProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"authKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"privProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"privKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"13\":{\"macro\":\"_field13_\",\"desc\":\"UniqId\",\"help\":\"This&#x20;plugin&#x20;needs&#x20;to&#x20;store&#x20;information&#x20;in&#x20;temporary&#x20;directory&#x20;to&#x20;calculate&#x20;bandwidth.&#x20;Set&#x20;here&#x20;an&#x20;unique&#x20;identifier&#x20;with&#x20;no&#x20;spaces&#x20;or&#x20;symbols.\",\"value\":\"\",\"hide\":\"\"},\"14\":{\"macro\":\"_field14_\",\"desc\":\"inUsage\",\"help\":\"Retrieve&#x20;input&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"},\"15\":{\"macro\":\"_field15_\",\"desc\":\"outUsage\",\"help\":\"Retrieve&#x20;output&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"}}','-version&#x20;&#039;_field1_&#039;&#x20;-community&#x20;&#039;_field2_&#039;&#x20;-host&#x20;&#039;_field3_&#039;&#x20;-port&#x20;&#039;_field4_&#039;&#x20;-ifIndex&#x20;&#039;_field5_&#039;&#x20;-securityName&#x20;&#039;_field6_&#039;&#x20;-context&#x20;&#039;_field7_&#039;&#x20;-securityLevel&#x20;&#039;_field8_&#039;&#x20;-authProtocol&#x20;&#039;_field9_&#039;&#x20;-authKey&#x20;&#039;_field10_&#039;&#x20;-privProtocol&#x20;&#039;_field11_&#039;&#x20;-privKey&#x20;&#039;_field12_&#039;&#x20;-uniqid&#x20;&#039;_field13_&#039;&#x20;-inUsage&#x20;&#039;_field14_&#039;&#x20;-outUsage&#x20;&#039;_field15_&#039;');
COMMIT;

View File

@ -1,5 +1,7 @@
START TRANSACTION;
ALTER TABLE `tagent_custom_fields` MODIFY COLUMN `combo_values` TEXT NOT NULL DEFAULT '';
UPDATE `talert_commands` SET `fields_descriptions` = '[\"Event&#x20;name\",\"Event&#x20;type\",\"Source\",\"Agent&#x20;name&#x20;or&#x20;_agent_\",\"Event&#x20;severity\",\"ID&#x20;extra\",\"Tags&#x20;separated&#x20;by&#x20;commas\",\"Comments\",\"\",\"\"]' WHERE `name` = "Monitoring&#x20;Event";
COMMIT;
COMMIT;

View File

@ -363,6 +363,7 @@ CREATE TABLE IF NOT EXISTS `tinventory_alert`(
`last_fired` text NOT NULL default '',
`disable_event` tinyint(1) UNSIGNED default 0,
`enabled` tinyint(1) UNSIGNED default 1,
`alert_groups` text NOT NULL default '',
PRIMARY KEY (`id`),
FOREIGN KEY (`id_module_inventory`) REFERENCES tmodule_inventory(`id_module_inventory`)
ON DELETE CASCADE ON UPDATE CASCADE
@ -864,6 +865,7 @@ ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) D
ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
ALTER TABLE `treport_content_template` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER TABLE `treport_content_template` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
@ -1378,6 +1380,8 @@ ALTER TABLE `talert_actions` MODIFY COLUMN `field11` text NOT NULL,
MODIFY COLUMN `field14` text NOT NULL,
MODIFY COLUMN `field15` text NOT NULL;
ALTER TABLE `talert_actions` ADD COLUMN `create_wu_integria` TINYINT(1) default NULL;
-- ---------------------------------------------------------------------
-- Table `talert_commands`
-- ---------------------------------------------------------------------
@ -1402,6 +1406,7 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
-- Table `ttag`
-- ---------------------------------------------------------------------
ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL;
ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default '';
-- ---------------------------------------------------------------------
-- Table `tconfig`
@ -1409,13 +1414,13 @@ ALTER TABLE `ttag` ADD COLUMN `previous_name` text NULL;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 42);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 44);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', 750);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', 752);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@ -1723,6 +1728,7 @@ ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1
ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
ALTER TABLE `treport_content` ADD COLUMN `summary` tinyint(1) DEFAULT 0;
ALTER table `treport_content` MODIFY COLUMN `name` varchar(300) NULL;
ALTER TABLE `treport_content` ADD COLUMN `uncompressed_module` TINYINT DEFAULT '0';
ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned NOT NULL DEFAULT '0',
@ -2391,6 +2397,7 @@ CREATE TABLE `tnotification_source` (
`enabled` int(1) DEFAULT NULL,
`user_editable` int(1) DEFAULT NULL,
`also_mail` int(1) DEFAULT NULL,
`subtype_blacklist` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -2513,7 +2520,7 @@ INSERT INTO `trecon_script` (`name`,`description`,`script`,`macros`) VALUES ('Di
-- ----------------------------------------------------------------------
-- Add column in table `tagent_custom_fields`
-- ----------------------------------------------------------------------
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` VARCHAR(255) DEFAULT '';
ALTER TABLE tagent_custom_fields ADD COLUMN `combo_values` TEXT NOT NULL DEFAULT '';
-- ----------------------------------------------------------------------
-- Add column in table `tnetflow_filter`
@ -2526,6 +2533,20 @@ ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL;
-- ----------------------------------------------------------------------
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
INSERT IGNORE INTO tuser_task VALUES (8, 'cron_task_generate_csv_log', 'a:1:{i:0;a:2:{s:11:"description";s:14:"Send to e-mail";s:4:"type";s:4:"text";}}', 'Send csv log');
UPDATE `tuser_task` SET `parameters`='a:4:{i:0;a:6:{s:11:"description";s:28:"Report pending to be created";s:5:"table";s:7:"treport";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:2:{s:11:"description";s:426:"Save to disk in path<a href="javascript:" class="tip" style="" ><img src="http://172.16.0.2/pandora_console/images/tip_help.png" data-title="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" data-use_title_for_force_title="1" class="forced_title" alt="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" /></a>";s:4:"type";s:6:"string";}i:2;a:2:{s:11:"description";s:16:"File nane prefix";s:4:"type";s:6:"string";}i:3;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE `id`=3;
DELETE FROM `tuser_task` WHERE id = 6;
-- Migrate old tasks
UPDATE `tuser_task_scheduled` SET
`args` = REPLACE (`args`, 'a:3', 'a:5'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:3;s:3:"PDF";s:15:"first_execution"')
WHERE `id_user_task` = 3;
UPDATE `tuser_task_scheduled` SET
`id_user_task` = 3,
`args` = REPLACE (`args`, 'a:3', 'a:5'),
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:3;s:3:"XML";s:15:"first_execution"')
WHERE `id_user_task` = 6;
-- ----------------------------------------------------------------------
-- ADD message in table 'tnews'
@ -2684,6 +2705,7 @@ CREATE TABLE `tremote_command_target` (
-- Table `trecon_script`
-- ---------------------------------------------------------------------
ALTER TABLE `trecon_script` ADD COLUMN `type` int(11) NOT NULL DEFAULT '0';
UPDATE `trecon_script` SET `description`='Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0' WHERE `name`='IPMI&#x20;Recon';
-- ---------------------------------------------------------------------
-- Table `tusuario_perfil`
@ -2859,6 +2881,12 @@ SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_wmi_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Namespace&#x20;&#40;Optional&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"User\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"WMI&#x20;Class\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Fields&#x20;list\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Query&#x20;filter&#x20;&#40;Optional&#41;\",\"help\":\"Use&#x20;single&#x20;quotes&#x20;for&#x20;query&#x20;conditions\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Operation\",\"help\":\"Aritmetic&#x20;operation&#x20;to&#x20;get&#x20;data.&#x20;Macros&#x20;_fN_&#x20;will&#x20;be&#x20;changed&#x20;by&#x20;fields&#x20;in&#x20;list.&#x20;Example:&#x20;&#40;&#40;_f1_&#x20;-&#x20;_f2_&#41;&#x20;*&#x20;100&#41;&#x20;/&#x20;_f1_\",\"value\":\"\",\"hide\":\"\"}}','-host&#x20;&#039;_field1_&#039;&#x20;-namespace&#x20;&#039;_field2_&#039;&#x20;-user&#x20;&#039;_field3_&#039;&#x20;-pass&#x20;&#039;_field4_&#039;&#x20;-wmiClass&#x20;&#039;_field5_&#039;&#x20;-fieldsList&#x20;&#039;_field6_&#039;&#x20;-queryFilter&#x20;&quot;_field7_&quot;&#x20;-operation&#x20;&#039;_field8_&#039;&#x20;-wmicPath&#x20;/usr/bin/wmic');
SET @plugin_name = 'Network&#x20;bandwidth&#x20;SNMP';
SET @plugin_description = 'Retrieves&#x20;amount&#x20;of&#x20;digital&#x20;information&#x20;sent&#x20;and&#x20;received&#x20;from&#x20;device&#x20;or&#x20;filtered&#x20;&#x20;interface&#x20;index&#x20;over&#x20;a&#x20;particular&#x20;time&#x20;&#40;agent/module&#x20;interval&#41;.';
SET @plugin_id = '';
SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name;
INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,300,0,'perl&#x20;/usr/share/pandora_server/util/plugin/pandora_snmp_bandwidth.pl','','','','',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"SNMP&#x20;Version&#40;1,2c,3&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Interface&#x20;Index&#x20;&#40;filter&#41;\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"securityName\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"context\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"securityLevel\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"authProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"authKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"privProtocol\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"privKey\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"13\":{\"macro\":\"_field13_\",\"desc\":\"UniqId\",\"help\":\"This&#x20;plugin&#x20;needs&#x20;to&#x20;store&#x20;information&#x20;in&#x20;temporary&#x20;directory&#x20;to&#x20;calculate&#x20;bandwidth.&#x20;Set&#x20;here&#x20;an&#x20;unique&#x20;identifier&#x20;with&#x20;no&#x20;spaces&#x20;or&#x20;symbols.\",\"value\":\"\",\"hide\":\"\"},\"14\":{\"macro\":\"_field14_\",\"desc\":\"inUsage\",\"help\":\"Retrieve&#x20;input&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"},\"15\":{\"macro\":\"_field15_\",\"desc\":\"outUsage\",\"help\":\"Retrieve&#x20;output&#x20;usage&#x20;&#40;%&#41;\",\"value\":\"\",\"hide\":\"\"}}','-version&#x20;&#039;_field1_&#039;&#x20;-community&#x20;&#039;_field2_&#039;&#x20;-host&#x20;&#039;_field3_&#039;&#x20;-port&#x20;&#039;_field4_&#039;&#x20;-ifIndex&#x20;&#039;_field5_&#039;&#x20;-securityName&#x20;&#039;_field6_&#039;&#x20;-context&#x20;&#039;_field7_&#039;&#x20;-securityLevel&#x20;&#039;_field8_&#039;&#x20;-authProtocol&#x20;&#039;_field9_&#039;&#x20;-authKey&#x20;&#039;_field10_&#039;&#x20;-privProtocol&#x20;&#039;_field11_&#039;&#x20;-privKey&#x20;&#039;_field12_&#039;&#x20;-uniqid&#x20;&#039;_field13_&#039;&#x20;-inUsage&#x20;&#039;_field14_&#039;&#x20;-outUsage&#x20;&#039;_field15_&#039;');
SET @main_component_group_name = 'Wizard';
SET @component_id = '';
SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name;
@ -3869,3 +3897,104 @@ INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_gro
INSERT IGNORE INTO `tpen` VALUES (171,'dlink','D-Link Systems, Inc.'),(14988,'mikrotik','MikroTik'),(6486,'alcatel','Alcatel-Lucent Enterprise'),(41112,'ubiquiti','Ubiquiti Networks, Inc.'),(207,'telesis','Allied Telesis, Inc.'),(10002,'frogfoot','Frogfoot Networks'),(2,'ibm','IBM'),(4,'unix','Unix'),(63,'apple','Apple Computer, Inc.'),(674,'dell','Dell Inc.'),(111,'oracle','Oracle'),(116,'hitachi','Hitachi, Ltd.'),(173,'netlink','Netlink'),(188,'ascom','Ascom'),(6574,'synology','Synology Inc.'),(3861,'fujitsu','Fujitsu Network Communications, Inc.'),(53526,'dell','Dell ATC'),(52627,'apple','Apple Inc'),(19464,'hitachi','Hitachi Communication Technologies, Ltd.'),(13062,'ascom','Ascom');
CREATE TABLE IF NOT EXISTS `tipam_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`network` varchar(100) NOT NULL default '',
`name_network` varchar(255) default '',
`description` text NOT NULL,
`location` tinytext NOT NULL,
`id_recon_task` int(10) unsigned NOT NULL,
`scan_interval` tinyint(2) default 1,
`monitoring` tinyint(2) default 0,
`id_group` mediumint(8) unsigned NULL default 0,
`lightweight_mode` tinyint(2) default 0,
`users_operator` text,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_ip` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_network` bigint(20) unsigned NOT NULL default 0,
`id_agent` int(10) unsigned NOT NULL,
`forced_agent` tinyint(2) NOT NULL default '0',
`ip` varchar(100) NOT NULL default '',
`ip_dec` int(10) unsigned NOT NULL,
`id_os` int(10) unsigned NOT NULL,
`forced_os` tinyint(2) NOT NULL default '0',
`hostname` tinytext NOT NULL,
`forced_hostname` tinyint(2) NOT NULL default '0',
`comments` text NOT NULL,
`alive` tinyint(2) NOT NULL default '0',
`managed` tinyint(2) NOT NULL default '0',
`reserved` tinyint(2) NOT NULL default '0',
`time_last_check` datetime NOT NULL default '1970-01-01 00:00:00',
`time_create` datetime NOT NULL default '1970-01-01 00:00:00',
`users_operator` text,
`time_last_edit` datetime NOT NULL default '1970-01-01 00:00:00',
`enabled` tinyint(2) NOT NULL default '1',
`generate_events` tinyint(2) NOT NULL default '0',
`leased` tinyint(2) DEFAULT '0',
`leased_expiration` bigint(20) DEFAULT '0',
`mac_address` varchar(20) DEFAULT NULL,
`leased_mode` tinyint(2) DEFAULT '0',
PRIMARY KEY (`id`),
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_vlan` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(250) NOT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_vlan_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_vlan` bigint(20) unsigned NOT NULL,
`id_network` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_vlan`) REFERENCES tipam_vlan(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_supernet` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`name` varchar(250) NOT NULL,
`description` text default '',
`address` varchar(250) NOT NULL,
`mask` varchar(250) NOT NULL,
`subneting_mask` varchar(250) default '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tipam_supernet_network` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`id_supernet` bigint(20) unsigned NOT NULL,
`id_network` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_supernet`) REFERENCES tipam_supernet(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_network`) REFERENCES tipam_network(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET @insert_type = 3;
SET @insert_name = 'IPAM Recon';
SET @insert_description = 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.';
SET @insert_script = '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl';
SET @insert_macros = '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""}}';
INSERT IGNORE INTO trecon_script (`id_recon_script`,`type`, `name`, `description`, `script`, `macros`)
SELECT `id_recon_script`,`type`, `name`, `description`, `script`, `macros` FROM (
SELECT `id_recon_script`,`type`, `name`, `description`, `script`, `macros` FROM `trecon_script` WHERE `name` = @insert_name
UNION
SELECT (SELECT max(`id_recon_script`)+1 FROM `trecon_script`) AS `id_recon_script`,
@insert_type as `type`,
@insert_name as `name`,
@insert_description as `description`,
@insert_script as `script`,
@insert_macros as `macros`
) t limit 1;
DELETE FROM `tconfig` WHERE `token` = 'ipam_installed';
DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id';

View File

@ -29,7 +29,7 @@ if (check_login()) {
}
echo "</span>
<img class='modalclosex cerrar' src='".$config['homeurl']."images/icono_cerrar.png'>
<img class='modalclosex cerrar' src='".$config['homeurl'].'images/icono_cerrar.png'."'>
</div>
<div class='modalcontent'>
@ -105,7 +105,7 @@ if (check_login()) {
echo __(
"This is the online help for %s console. This help is -in best cases- just a brief contextual help, not intented to teach you how to use %s. Official documentation of %s is about 900 pages, and you probably don't need to read it entirely, but sure, you should download it and take a look.<br><br>
<a href='%s' target='_blanck' class='pandora_green_text' style='font-size: 10pt; text-decoration: underline;'>Download the official documentation</a>",
<a href='%s' target='_blanck' class='pandora_green_text font_10 underline'>Download the official documentation</a>",
get_product_name(),
get_product_name(),
get_product_name(),
@ -136,7 +136,7 @@ if (check_login()) {
case 'modulemodal':
echo __(
"The community version doesn't have the ability to define your own library of local modules, or distribute it to remote agents. You need to make those changes individually on each agent which is possible by using external tools and time and effort. Nor can it distribute local plugins, or have access to the library of enterprise plugins to monitor applications such as VMWare, RHEV or Informix between others. The Enterprise version will have all this, plus the ability to distribute and manage your own local modules on your systems, individually or through policies.
<br><br><img style='width:105px' src='".$config['homeurl']."images/logo_oracle.png'><img style='width:105px' src='".$config['homeurl']."images/logo_citrix.png'><img style='width:105px' src='".$config['homeurl']."images/logo_sap.png'><img style='width:105px' src='".$config['homeurl']."images/logo_exchange.png'><br><br><span style='font-style:italic;'>* Todos los logotipos pertenecen a marcas registradas</span>"
<br><br><img class='w105px' src='".$config['homeurl'].'images/logo_oracle.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_citrix.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_sap.png'."'><img class='w105px' src='".$config['homeurl'].'images/logo_exchange.png'."'><br><br><span class='italic'>* Todos los logotipos pertenecen a marcas registradas</span>"
);
break;
@ -192,7 +192,7 @@ if (check_login()) {
echo "
</div>
<div style='float:right;width:100%;height:30px;'>
<div class='right height_30px'>
</div>
<div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span>

View File

@ -53,10 +53,10 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus
<?php
if (check_acl($config['id_user'], 0, 'PM')) {
echo "<div id='create_master_window' style='display:none;'></div>";
echo "<div id='msg' style='display:none;'></div>";
echo "<div id='create_master_window' class='invisible'></div>";
echo "<div id='msg' class='invisible'></div>";
?>
<input style="margin-bottom:20px;" onclick="show_create_ha_cluster();" type="submit" class="button_task" value="<?php echo __('Add new node'); ?>" />
<input onclick="show_create_ha_cluster();" type="submit" class="button_task ui_toggle" value="<?php echo __('Add new node'); ?>" />
<?php
}
?>

View File

@ -24,6 +24,14 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'],
return;
}
\ui_print_page_header(
__('Monitoring').' &raquo; '.__('Clusters'),
'images/chart.png',
false,
'',
false
);
ui_require_css_file('first_task');
?>
<?php
@ -53,7 +61,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no cluster
?>
<form action='index.php?sec=estado&sec2=enterprise/operation/cluster/cluster&op=new' method="post">
<input style="margin-bottom:20px;" type="submit" class="button_task" value="<?php echo __('Create Cluster'); ?>" />
<input type="submit" class="button_task ui_toggle" value="<?php echo __('Create Cluster'); ?>" />
</form>
<?php

View File

@ -21,7 +21,8 @@ ui_require_css_file('order_interpreter');
// Check permissions
// Global errors/warnings checking.
config_check();
config_check();
if ($config['menu_type'] == 'classic') {
@ -76,9 +77,9 @@ if ($config['menu_type'] == 'classic') {
if ($check_minor_release_available) {
if (users_is_admin($config['id_user'])) {
if ($config['language'] == 'es') {
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a id="aviable_updates" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Actualizacion#Versi.C3.B3n_7.0NG_.28_Rolling_Release_.29">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
} else {
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a style="font-size:8pt;font-style:italic;" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a id="aviable_updates" target="blank" href="http://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Anexo_Upgrade#Version_7.0NG_.28_Rolling_Release_.29">'.__('About minor release update').'</a>', 'minor release/s available');
}
}
}
@ -97,8 +98,8 @@ if ($config['menu_type'] == 'classic') {
if ($acl_head_search) {
// Search bar.
$search_bar = '<form autocomplete="off" method="get" style="display: inline;" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" style="display:none;">';
$search_bar = '<form autocomplete="off" method="get" class="display_in" name="quicksearch" action="">';
'<input autocomplete="false" name="hidden" type="text" class="invisible">';
if (!isset($config['search_keywords'])) {
$search_bar .= '<script type="text/javascript"> var fieldKeyWordEmpty = true; </script>';
} else {
@ -256,7 +257,7 @@ if ($config['menu_type'] == 'classic') {
$ignored_params['refr'] = '';
$values = get_refresh_time_array();
$autorefresh_additional = '<span id="combo_refr" style="display: none;">';
$autorefresh_additional = '<span id="combo_refr" class="invisible">';
$autorefresh_additional .= html_print_select(
$values,
'ref',
@ -292,7 +293,15 @@ if ($config['menu_type'] == 'classic') {
$autorefresh_link_close = '</a>';
$display_counter = 'display:block';
} else {
$autorefresh_img = html_print_image('images/header_refresh_disabled_gray.png', true, ['class' => 'bot autorefresh_disabled', 'alt' => 'lightning', 'title' => __('Disabled autorefresh')]);
$autorefresh_img = html_print_image(
'images/header_refresh_disabled_gray.png',
true,
[
'class' => 'bot autorefresh_disabled invert_filter',
'alt' => 'lightning',
'title' => __('Disabled autorefresh'),
]
);
$ignored_params['refr'] = false;
@ -307,7 +316,7 @@ if ($config['menu_type'] == 'classic') {
'images/header_refresh_disabled_gray.png',
true,
[
'class' => 'bot autorefresh_disabled',
'class' => 'bot autorefresh_disabled invert_filter',
'alt' => 'lightning',
'title' => __('Disabled autorefresh'),
]
@ -339,10 +348,10 @@ if ($config['menu_type'] == 'classic') {
// Button for feedback pandora.
if (enterprise_installed()) {
$header_feedback = '<div id="feedback-icon-header">';
$header_feedback .= '<div id="modal-feedback-form" style="display:none;"></div>';
$header_feedback .= '<div id="msg-header" style="display: none"></div>';
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
$header_feedback .= html_print_image(
'/images/feedback-header.png',
'images/feedback-header.png',
true,
[
'title' => __('Feedback'),
@ -364,13 +373,29 @@ if ($config['menu_type'] == 'classic') {
$header_support = '<div id="header_support">';
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
$header_support .= html_print_image('/images/header_support.png', true, ['title' => __('Go to support'), 'class' => 'bot', 'alt' => 'user']);
$header_support .= html_print_image(
'images/header_support.png',
true,
[
'title' => __('Go to support'),
'class' => 'bot invert_filter',
'alt' => 'user',
]
);
$header_support .= '</a></div>';
// Documentation.
$header_docu = '<div id="header_docu">';
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
$header_docu .= html_print_image('/images/header_docu.png', true, ['title' => __('Go to documentation'), 'class' => 'bot', 'alt' => 'user']);
$header_docu .= html_print_image(
'images/header_docu.png',
true,
[
'title' => __('Go to documentation'),
'class' => 'bot invert_filter',
'alt' => 'user',
]
);
$header_docu .= '</a></div>';
@ -397,7 +422,7 @@ if ($config['menu_type'] == 'classic') {
);
}
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span> ('.$config['id_user'].')</span></a></div>';
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span id="user_name_header"> ('.$config['id_user'].')</span></a></div>';
// Logout.
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
@ -406,7 +431,7 @@ if ($config['menu_type'] == 'classic') {
true,
[
'alt' => __('Logout'),
'class' => 'bot',
'class' => 'bot invert_filter',
'title' => __('Logout'),
]
);
@ -421,10 +446,10 @@ if ($config['menu_type'] == 'classic') {
<!-- Notifications content wrapper-->
<div id='notification-content' style='display:none;' /></div>
<div id='notification-content' class='invisible'/></div>
<!-- Old style div wrapper -->
<div id="alert_messages" style="display: none"></div>
<div id="alert_messages" class="invisible"></div>
<script type="text/javascript">
/* <![CDATA[ */
@ -877,7 +902,9 @@ if ($config['menu_type'] == 'classic') {
blinkpubli();
<?php
if ($_GET['refr'] || $do_refresh === true) {
if ($_GET['refr']
|| (isset($do_refresh) === true && $do_refresh === true)
) {
if ($_GET['sec2'] == 'operation/events/events') {
$autorefresh_draw = true;
}
@ -941,7 +968,7 @@ if ($config['menu_type'] == 'classic') {
var newValue = btoa(JSON.stringify(values));
<?php
// Check if the url has the parameter fb64.
if ($_GET['fb64']) {
if (isset($_GET['fb64']) === true) {
$fb64 = $_GET['fb64'];
?>
var fb64 = '<?php echo $fb64; ?>';

View File

@ -18,6 +18,8 @@
global $config;
if (is_ajax()) {
$skip_login_help = get_parameter('skip_login_help', 0);
@ -34,9 +36,9 @@ if (is_ajax()) {
}
// Prints help dialog information
echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name()).'" style="">';
echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name()).'" >';
echo '<div style="font-size: 10pt; margin: 20px;">';
echo '<div id="help_dialog">';
echo __(
"If this is your first time using %s, we suggest a few links that'll help you learn more about the software. Monitoring can be overwhelming, but take your time to learn how to harness the power of %s!",
get_product_name(),
@ -44,11 +46,11 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
);
echo '</div>';
echo '<div style="">';
echo '<table cellspacing=0 cellpadding=0 style="border:1px solid #FFF; width:100%; height: 100%">';
echo '<div>';
echo '<table cellspacing=0 cellpadding=0 class="border_solid_white w100p h100p">';
echo '<tr>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank" class="no_decoration">'.html_print_image(
'images/online_help.png',
true,
[
@ -56,12 +58,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="'.ui_get_full_url(false).'general/pandora_help.php?id=main_help" target="_blank">'.__('Online help').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="http://pandorafms.com/" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="http://pandorafms.com/" target="_blank" class="no_decoration">'.html_print_image(
'images/enterprise_version.png',
true,
[
@ -69,12 +71,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="http://pandorafms.com/" target="_blank">'.__('Enterprise version').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="https://pandorafms.com/forums" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="https://pandorafms.com/forums" target="_blank" class="no_decoration">'.html_print_image(
'images/support.png',
true,
[
@ -82,12 +84,12 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '<br id="br_mb_40" />';
echo '<a class="font_9pt" href="https://pandorafms.com/forums" target="_blank">'.__('Support').' / '.__('Forums').'</a>';
echo '</td>';
echo '<td style="border:1px solid #FFF; text-align:center;">';
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" style="text-decoration:none;">'.html_print_image(
echo '<td class="border_solid_white center">';
echo '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank" class="no_decoration">'.html_print_image(
'images/documentation.png',
true,
[
@ -95,20 +97,20 @@ echo '<div id="login_help_dialog" title="'.__('Welcome to %s', get_product_name(
'border' => 0,
]
).'</a>';
echo '<br style="margin-bottom: 40px;" />';
echo '<a style="font-size: 9pt;"href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
echo '<br id="br_mb_40" />';
echo '<a clas="font_9pt" href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Documentation').'</span></a>';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 240px; right: 10px; border: 1px solid #FFF; width: 570px">';
echo '<div style="float: left; margin-top: 3px; margin-left: 0px; width: 80%; text-align: left;">';
echo '<div class="absolute help_dialog_login" ">';
echo '<div class="skip_help_login">';
html_print_checkbox('skip_login_help', 1, false, false, false, 'cursor: \'pointer\'');
echo '&nbsp;<span style="font-size: 12px;">'.__("Click here to don't show again this message").'</span>';
echo '&nbsp;<span class="font_12pt">'.__("Click here to don't show again this message").'</span>';
echo '</div>';
echo '<div style="float: right; width: 20%;">';
html_print_submit_button('Ok', 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '<div class="float-right w20p">';
html_print_submit_button('Ok', 'hide-login-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok w100p"');
echo '</div>';
echo '</div>';

View File

@ -17,6 +17,10 @@ if (isset($config['homedir'])) {
$homedir = '';
}
global $config;
ui_require_css_file('login', 'include/styles/', true);
require_once __DIR__.'/../include/functions_ui.php';
@ -146,8 +150,8 @@ if (isset($config['custom_support_url'])) {
echo '<li>'.__('Support').'</li>';
}
} else if (!$custom_conf_enabled) {
echo '<li id="li_margin_left"><a href="https://support.artica.es" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li><a href="https://support.artica.es" target="_blank">'.__('Docs').'</li>';
echo '<li id="li_margin_left"><a href="https://support.pandorafms.com" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
echo '<li><a href="https://support.pandorafms.com" target="_blank">'.__('Docs').'</li>';
}
echo '</ul></div>';
@ -197,9 +201,6 @@ if (is_metaconsole() === true) {
} else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
// I comment this in case in the future we put a logo without text.
// echo "<br><span style='font-size:120%;color:white;top:10px;position:relative;'>Community edition</span>";.
}
echo '</a></div>';
@ -214,7 +215,7 @@ switch ($login_screen) {
}
if ($config['auth'] == 'saml') {
echo '<div id="log_nick" class="login_nick" style="display: none;">';
echo '<div id="log_nick" class="login_nick invisible" >';
html_print_input_text_extended(
'nick',
'',
@ -228,7 +229,7 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_pass" class="login_pass" style="display: none;">';
echo '<div id="log_pass" class="login_pass invisible">';
html_print_input_text_extended(
'pass',
'',
@ -244,7 +245,7 @@ switch ($login_screen) {
);
echo '</div>';
echo '<div id="log_button" class="login_button" style="display: none;">';
echo '<div id="log_button" class="login_button invisible">';
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="next_login"');
echo '</div>';

View File

@ -15,9 +15,9 @@
<div class='databox' id='login'>
<div id='login_f' class='databox'>
<h1 id="log_f" style='margin-top: 0px;' class="error"><?php echo __('Authentication error'); ?></h1>
<h1 id="log_f" class="error mgn_tp_0"><?php echo __('Authentication error'); ?></h1>
<div style='width: 350px'>
<div class='w350px'>
<a href="index.php"><img src="images/pandora_logo.png" border="0"></a><br>
<?php echo $pandora_version; ?>
</div>

View File

@ -38,17 +38,17 @@ if (!empty($news)) {
}
// Prints news dialog template
echo '<div id="news_dialog" title="" style="display: none;">';
echo '<div id="news_dialog" class="invisible">';
echo '<div style="position:absolute; top:30px; left: 10px; text-align: left; right:0%; height:70px; min-width:560px; width: 95%; margin: 0 auto; line-height: 19px;">';
echo '<span style="display: block; height: 260px; overflow: auto; text-align: justify; padding: 5px 15px 4px 10px; background: #ECECEC; border-radius: 4px;" id="new_text"></span>';
echo '<span style="font-size: 12px; display: block; margin-top: 20px;" id="new_author"></span>';
echo '<span style="font-size: 12px; display: block; font-style: italic;" id="new_timestamp"></span>';
echo '<div class="parent_new_dialog_tmplt">';
echo '<span id="new_text"></span>';
echo '<span id="new_author"></span>';
echo '<span id="new_timestamp"></span>';
echo '</div>';
echo '<div style="position:absolute; margin: 0 auto; top: 340px; right: 10px; width: 570px">';
echo '<div style="float: right; width: 20%;">';
html_print_submit_button('Ok', 'hide-news-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok" style="width:100px;"');
echo '<div id="div_btn_new_dialog">';
echo '<div class="float-right w20p">';
html_print_submit_button('Ok', 'hide-news-help', false, 'class="ui-button-dialog ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok w100px";"');
echo '</div>';
echo '</div>';

View File

@ -11,6 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
if (file_exists('images/grafico_llave.png')) {
ui_print_page_header(__('You don\'t have access to this page'), '', false, '', true);
} else {
@ -18,17 +19,17 @@ if (file_exists('images/grafico_llave.png')) {
}
?>
<div id="noaccess" style="width: 500px; height:180px;">
<div id="noaccess-title" style=" height: 20px; width: 98%;"><?php echo __('Access to this page is restricted'); ?></div>
<div id="noaccess">
<div id="noaccess-title"><?php echo __('Access to this page is restricted'); ?></div>
<div>
<div id="noaccess-image" style="width: 15%;">
<div id="noaccess-image">
<?php
if (file_exists('images/grafico_llave.png')) {
echo html_print_image('images/grafico_llave.png', true, ['alt' => __('No access')]);
}
?>
</div>
<div id="noaccess-text" style="width: 70%;">
<div id="noaccess-text">
<?php
echo __(
'Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br/> <br/>

View File

@ -18,7 +18,7 @@ require_once '../include/config.php';
require_once '../include/functions.php';
require_once '../include/functions_html.php';
?>
<html style="height:100%; margin-top: 25px; margin-left: 15px; margin-right: 15px; background-color: #333;"><head><title>
<html class="help_pname"><head><title>
<?php
echo __('%s help system', get_product_name());
?>
@ -26,7 +26,7 @@ echo __('%s help system', get_product_name());
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<?php echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">'; ?>
<body style="height: 100%;background-color: #333">
<body class="height_100p bg_333">
<?php
$id = get_parameter('id');
$id_user = get_parameter('id_user');
@ -59,30 +59,30 @@ foreach ($files as $file) {
$logo = ui_get_custom_header_logo(true);
if (! $id || ! file_exists($help_file)) {
echo '<div id="main_help" style="background-color: #fff;text-align:center; padding-top: 15px; padding-bottom: 15px; ">';
echo '<div id="main_help">';
if (!is_metaconsole()) {
echo html_print_image($logo, true, ['border' => '0']);
}
echo '</div>';
echo '<div style="font-family: verdana, arial; font-size: 11px; text-align:left; background-color: #fff;">';
echo '<div style="font-size: 12px; background-color: #fff; ;border:0px;" class="databox">';
echo '<HR style="margin-top: 0px;">';
echo '<h1 style="padding-left: 30px">';
echo '<div id="parent_dic">';
echo '<div class="databox bg-white font_12px no_border">';
echo '<hr class="mgn_tp_0">';
echo '<h1 class="pdd_l_30px">';
echo __('Help system error');
echo '</h1>';
echo "<div style='text-align: center; background-color: #fff'>";
echo "<div class='center bg-white'>";
echo '</div>';
echo '<div class="msg" style="padding-left: 30px;padding-right: 30px;padding-bottom: 15px;">'.__("%s help system has been called with a help reference that currently don't exist. There is no help content to show.", get_product_name()).'</div></div></div>';
echo '<div class="msg msg_pandora_help">'.__("%s help system has been called with a help reference that currently don't exist. There is no help content to show.", get_product_name()).'</div></div></div>';
echo '<br /><br />';
echo '<div style="text-align: center; padding: 5px; font-family: verdana, arial; font-size: 11px;">';
echo '<div id="footer_help">';
include 'footer.php';
return;
}
// Show help
echo '<div id="main_help_new" style="background-color: #fff">';
echo '<div id="main_help_new">';
if (!empty($config['enterprise_installed']) && is_metaconsole()) {
echo '<img src="'.$config['homeurl'].$logo.'">';
} else {
@ -90,7 +90,7 @@ if (!empty($config['enterprise_installed']) && is_metaconsole()) {
}
echo '</div>';
echo '<div id="main_help_new_content" style="height: auto ! important;overfloat: auto;">';
echo '<div id="main_help_new_content">';
ob_start();
require_once $help_file;
$help = ob_get_contents();

View File

@ -25,19 +25,19 @@ if ($config['language'] == 'es') {
}
// Prints help dialog information
echo '<div id="login_help_dialog" title="PHP UPDATE REQUIRED" style="display: none;">';
echo '<div style="width:70%; font-size: 10pt; margin: 20px; float:left">';
echo "<p><b style='font-size: 10pt;'>".__('For a correct operation of PandoraFMS, PHP must be updated to version 7.0 or higher.').'</b></p>';
echo "<p style='font-size: 10pt;'><b>".__('Otherwise, functionalities will be lost.').'</b></p>';
echo '<div id="login_help_dialog" title="PHP UPDATE REQUIRED" class="invisible">';
echo '<div class="login_help_dialog">';
echo "<p><b class='font_10'>".__('For a correct operation of PandoraFMS, PHP must be updated to version 7.0 or higher.').'</b></p>';
echo "<p class='font_10'><b>".__('Otherwise, functionalities will be lost.').'</b></p>';
echo '<ul>';
echo "<li style='padding:5px;'>".__('Report download in PDF format').'</li>';
echo "<li style='padding:5px;'>".__('Emails Sending').'</li>';
echo "<li style='padding:5px;'>".__('Metaconsole Collections').'</li>';
echo "<li style='padding:5px;'>".'...'.'</li>';
echo "<li class='pdd_5px'>".__('Report download in PDF format').'</li>';
echo "<li class='pdd_5px'>".__('Emails Sending').'</li>';
echo "<li class='pdd_5px'>".__('Metaconsole Collections').'</li>';
echo "<li class='pdd_5px'>".'...'.'</li>';
echo '</ul>';
echo '<p><a target="blank" href="'.$url_help.'"><b>'.__('Access Help').'</b></a></p>';
echo '</div>';
echo "<div style='margin-top: 80px;'>";
echo "<div class='mrg_top_80'>";
echo html_print_image('images/icono_warning_mr.png', true, ['alt' => __('Warning php version'), 'border' => 0]);
echo '</div>';
echo '</div>';

View File

@ -188,11 +188,16 @@ try {
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
if (!$double_auth_enabled && $config['2FA_all_users'] != ''
if (isset($config['2FA_all_users']) === false) {
$config['2FA_all_users'] = null;
}
if (!$double_auth_enabled
&& $config['2FA_all_users'] != ''
&& $config['2Fa_auth'] != '1'
&& $config['double_auth_enabled']
) {
echo '<div id="doble_auth_window" style="display: none"; >';
echo '<div id="doble_auth_window" class="invisible"; >';
?>
<script type="text/javascript">
var userID = "<?php echo $config['id_user']; ?>";
@ -234,8 +239,8 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
}
});
$("div#doble_auth_window").dialog({
<?php config_update_value('2Fa_auth', ''); ?>
$("div#doble_auth_window").dialog({
resizable: true,
draggable: true,
modal: true,
@ -247,12 +252,6 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
width: 500,
height: 400,
close: function (event, ui) {
<?php
if (!$double_auth_enabled) {
config_update_value('2Fa_auth', '1');
}
?>
// Abort the ajax request
if (typeof request != 'undefined'){
request.abort();
@ -263,7 +262,11 @@ if (!$double_auth_enabled && $config['2FA_all_users'] != ''
//document.location.reload();
}
})
.show(); </script>
.show();
// Don't allow close the dialog with X button
$('.ui-dialog-titlebar-close').css('display', 'none');
</script>
<?php
echo '</div>';
}

View File

@ -142,7 +142,7 @@ unset($filter['offset']);
if (! is_ajax()) {
echo '<div id="agents_loading" class="loading invisible">';
echo html_print_image('images/spinner.png', true);
echo html_print_image('images/spinner.gif', true);
echo __('Loading').'&hellip;';
echo '</div>';
}

View File

@ -35,8 +35,21 @@ $filter_ip = (string) get_parameter('filter_ip');
$filter_query = '&filter_type='.$filter_type.'&filter_user='.$filter_user.'&filter_text='.$filter_text.'&filter_period='.$filter_period.'&filter_ip='.$filter_ip;
$csv_url = ui_get_full_url(false, false, false, false).'index.php?sec=gextensions&sec2=godmode/audit_log_csv'.$filter_query;
$csv_img = html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV')]);
$csv_url = ui_get_full_url(
false,
false,
false,
false
).'index.php?sec=gextensions&sec2=godmode/audit_log_csv'.$filter_query;
$csv_img = html_print_image(
'images/csv.png',
true,
[
'title' => __(
'Export to CSV'
),'class' => 'invert_filter',
]
);
$header_buttons = [
'csv' => [
'active' => false,

View File

@ -22,7 +22,7 @@ require_once 'include/functions_agents.php';
ui_require_javascript_file('openlayers.pandora');
echo "<div style='margin-bottom: 10px;'></div>";
echo "<div class='margin-bottom-10'></div>";
$agentData = gis_get_data_last_position_agent($id_agente);
$updateGisData = db_get_value('update_gis_data', 'tagente', 'id_agente', $id_agente);
@ -32,7 +32,7 @@ $agent_name = agents_get_name($id_agente);
$agent_name = md5($agent_name);
// Map with the current position
echo '<div id="'.$agent_name.'_agent_map" style="border:1px solid black; width:100%; height: 30em;"></div>';
echo '<div id="'.$agent_name.'_agent_map" class="agent_map"></div>';
if (!gis_get_agent_map($id_agente, '500px', '100%', false)) {
ui_print_error_message(__('There is no default map. Please go to the setup for to set a default map.'));
@ -122,15 +122,15 @@ $table->data[2][1] = html_print_input_text_extended(
);
$table->data[2][2] = __('Ignore new GIS data:');
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'style="margin-right: 40px;"', true);
$table->data[2][3] = __('Yes').' '.html_print_radio_button_extended('update_gis_data', 0, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$table->data[2][3] .= __('No').' '.html_print_radio_button_extended('update_gis_data', 1, '', $updateGisData, false, '', 'class="mrgn_right_40px"', true);
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente;
echo "<form method='post' action='".$url."' onsubmit ='return validateFormFields();'>";
html_print_input_hidden('update_gis', 1);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'; float: left;">';
echo '<div class="action-buttons float-left" style="width: '.$table->width.';">';
html_print_submit_button(__('Update'), '', false, 'class="sub upd"');
echo '</div>';
echo '</form>';

View File

@ -18,6 +18,11 @@ require_once 'include/functions_incidents.php';
check_login();
if (!$config['integria_enabled']) {
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
return;
}
$group = $id_grupo;
if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) {
@ -38,30 +43,25 @@ $groups = users_get_groups($config['id_user'], 'IR');
$filter = ' AND id_agent = '.$id_agent;
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent;
// Select incidencts where the user has access to ($groups from
// get_user_groups), array_keys for the id, implode to pass to SQL
switch ($config['dbtype']) {
case 'mysql':
$sql = 'SELECT * FROM tincidencia WHERE
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.'
ORDER BY actualizacion DESC LIMIT '.$offset.','.$config['block_size'];
break;
$params = [
'',
'-10',
'1',
'-1',
'0',
'',
'',
'',
agents_get_name($id_agent),
];
case 'oracle':
$sql = 'SELECT * FROM tincidencia WHERE
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.'
AND rownum <= '.$offset.','.$config['block_size'].'
ORDER BY actualizacion DESC';
break;
}
$result = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents', $params, false, 'json', ',');
$result = db_get_all_rows_sql($sql);
$result = json_decode($result, true);
$count_sql = 'SELECT count(*) FROM tincidencia WHERE
id_grupo IN ('.implode(',', array_keys($groups)).')'.$filter.'
ORDER BY actualizacion DESC';
$count = count($result);
$count = db_get_value_sql($count_sql);
$result = array_slice($result, $offset, $config['block_size']);
if (empty($result)) {
$result = [];
@ -91,8 +91,6 @@ $table->head[2] = __('Incident');
$table->head[3] = __('Priority');
$table->head[4] = __('Group');
$table->head[5] = __('Updated');
$table->head[6] = __('Source');
$table->head[7] = __('Owner');
$table->size[0] = 43;
$table->size[7] = 50;
@ -115,7 +113,7 @@ foreach ($result as $row) {
$data = [];
$data[0] = '<a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident_detail&amp;id='.$row['id_incidencia'].'">'.$row['id_incidencia'].'</a>';
$data[0] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.$row['id_incidencia'].'</a>';
$attach = incidents_get_attach($row['id_incidencia']);
if (!empty($attach)) {
@ -123,12 +121,10 @@ foreach ($result as $row) {
}
$data[1] = incidents_print_status_img($row['estado'], true);
$data[2] = '<a href="index.php?sec=incidencias&amp;sec2=operation/incidents/incident_detail&amp;id='.$row['id_incidencia'].'">'.substr(io_safe_output($row['titulo']), 0, 45).'</a>';
$data[2] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.substr(io_safe_output($row['titulo']), 0, 45).'</a>';
$data[3] = incidents_print_priority_img($row['prioridad'], true);
$data[4] = ui_print_group_icon($row['id_grupo'], true);
$data[4] = $row['id_grupo'];
$data[5] = ui_print_timestamp($row['actualizacion'], true);
$data[6] = $row['origen'];
$data[7] = ui_print_username($row['id_usuario'], true);
array_push($table->data, $data);
}
@ -139,4 +135,4 @@ echo '</div>';
unset($table);
echo '<br><br>';
echo '<div style="clear:both">&nbsp;</div>';
echo '<div id="both">&nbsp;</div>';

View File

@ -147,6 +147,8 @@ if (is_ajax()) {
return;
}
ui_require_javascript_file('openlayers.pandora');
$new_agent = (empty($id_agente)) ? true : false;
@ -207,11 +209,11 @@ $custom_id_div .= html_print_input_text(
if (!$new_agent && $alias != '') {
$table_agent_name = '<div class="label_select"><p class="input_label">'.__('Agent name').'</p>';
$table_agent_name .= '<div class="label_select_parent">';
$table_agent_name .= '<div class="label_select_child_left" style="width: 60%;">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name" style="width: 70%;">';
$table_agent_name .= '<div class="label_select_child_left w60p">'.html_print_input_text('agente', $nombre_agente, '', 50, 100, true).'</div>';
$table_agent_name .= '<div class="label_select_child_right agent_options_agent_name w70p">';
if ($id_agente) {
$table_agent_name .= '<label>'.__('ID').'</label><input style="width: 50%;" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<label>'.__('ID').'</label><input class="w50p" type="text" readonly value="'.$id_agente.'" />';
$table_agent_name .= '<a href="index.php?sec=gagente&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
$table_agent_name .= html_print_image(
'images/zoom.png',
@ -219,6 +221,7 @@ if (!$new_agent && $alias != '') {
[
'border' => 0,
'title' => __('Agent detail'),
'class' => 'invert_filter',
]
);
$table_agent_name .= '</a>';
@ -228,7 +231,14 @@ if (!$new_agent && $alias != '') {
// Delete link from here.
if (!is_central_policies_on_node()) {
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=".$id_agente."&search=&offset=0&sort_field=&sort=none'>".html_print_image('images/cross.png', true, ['title' => __('Delete agent')]).'</a>';
$table_agent_name .= "<a onClick=\"if (!confirm('".__('Are you sure?')."')) return false;\" href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=".$id_agente."&search=&offset=0&sort_field=&sort=none'>".html_print_image(
'images/cross.png',
true,
[
'title' => __('Delete agent'),
'class' => 'invert_filter',
]
).'</a>';
}
// Remote configuration available.
@ -245,6 +255,7 @@ if (!$new_agent && $alias != '') {
[
'border' => 0,
'title' => __('This agent can be remotely configured'),
'class' => 'invert_filter',
]
);
$table_agent_name .= '</a>';
@ -578,6 +589,7 @@ if (enterprise_installed()) {
[
'title' => __('Delete remote configuration file'),
'style' => 'vertical-align: middle;',
'class' => 'invert_filter',
]
).'</a>';
$table_adv_remote .= '</a>';
@ -736,11 +748,11 @@ $table_adv_agent_icon = '<div class="label_select"><p class="input_label">'.__('
if ($icon_path == '') {
$display_icons = 'none';
// Hack to show no icon. Use any given image to fix not found image errors.
$path_without = 'images/spinner.png';
$path_default = 'images/spinner.png';
$path_ok = 'images/spinner.png';
$path_bad = 'images/spinner.png';
$path_warning = 'images/spinner.png';
$path_without = 'images/spinner.gif';
$path_default = 'images/spinner.gif';
$path_ok = 'images/spinner.gif';
$path_bad = 'images/spinner.gif';
$path_warning = 'images/spinner.gif';
} else {
$display_icons = '';
$path_without = $path.$icon_path.'.default.png';
@ -794,7 +806,7 @@ if ($config['activate_gis']) {
if (enterprise_installed()) {
$advanced_div = '<div class="secondary_groups_list">';
} else {
$advanced_div = '<div class="secondary_groups_list" style="display: none">';
$advanced_div = '<div class="secondary_groups_list invisible" >';
}
// General display distribution.
@ -913,30 +925,25 @@ foreach ($fields as $field) {
2,
65,
$custom_value,
'style="min-height: 30px;"',
'class="min-height-30px',
true
);
}
if ($field['combo_values'] !== '') {
$data_field[1] = html_print_select(
$combo_values,
'customvalue_'.$field['id_field'],
$custom_value,
'',
__('None'),
'',
true,
false,
false,
'',
false,
false,
false,
false,
false,
'',
false
$data_field[1] = html_print_input(
[
'type' => 'select_search',
'fields' => $combo_values,
'name' => 'customvalue_'.$field['id_field'],
'selected' => $custom_value,
'nothing' => __('None'),
'nothing_value' => '',
'return' => true,
'sort' => false,
'size' => '400px',
'dropdownAutoWidth' => true,
]
);
};
@ -988,18 +995,18 @@ if (enterprise_installed()) {
);
}
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'">';
echo '</div>';
}
echo '<div class="action-buttons" style="display: flex; justify-content: flex-end; align-items: center; width: '.$table->width.'">';
echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'">';
// The context help about the learning mode.
if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help' style='padding-right:8px;'>";
echo "<span id='modules_not_learning_mode_context_help pdd_r_10px' '>";
} else {
echo "<span id='modules_not_learning_mode_context_help' style='display: none;'>";
echo "<span id='modules_not_learning_mode_context_help invisible'>";
}
echo clippy_context_help('modules_not_learning_mode');

View File

@ -179,11 +179,11 @@ foreach ($nps as $row) {
}
echo '<table width="100%" cellpadding="0" cellspacing="0" class="databox filters" >';
echo "<tr><td class='datos' style='width:50%'>";
echo "<tr><td class='datos w50p'>";
html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
echo '</td>';
echo '<td class="datos">';
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next" style="margin-top:0px;"');
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next mgn_tp_0"');
echo '</td>';
echo '</tr>';
echo '</form>';
@ -246,7 +246,7 @@ foreach ($result as $row) {
$data[0] = '<span>'.$row['nombre'];
if ($row['id_tipo_modulo'] > 0) {
$data[1] = html_print_image('images/'.modules_show_icon_type($row['id_tipo_modulo']), true, ['border' => '0']);
$data[1] = html_print_image('images/'.modules_show_icon_type($row['id_tipo_modulo']), true, ['border' => '0', 'class' => 'invert_filter']);
} else {
$data[1] = '';
}
@ -254,8 +254,8 @@ foreach ($result as $row) {
$data[2] = mb_substr($row['descripcion'], 0, 60);
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update')]).'</a>';
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Update')]).'</a>';
array_push($table->data, $data);
}

View File

@ -366,7 +366,14 @@ $img_style = [
if ($id_agente) {
// View tab.
$viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
$viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/eye.png',
true,
[
'title' => __('View'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'view') {
$viewtab['active'] = true;
@ -377,7 +384,14 @@ if ($id_agente) {
$viewtab['operation'] = 1;
// Main tab.
$maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup')]).'</a>';
$maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/gm_setup.png',
true,
[
'title' => __('Setup'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'main') {
$maintab['active'] = true;
} else {
@ -385,7 +399,14 @@ if ($id_agente) {
}
// Module tab.
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_modules.png', true, ['title' => __('Modules')]).'</a>';
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/gm_modules.png',
true,
[
'title' => __('Modules'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'module') {
$moduletab['active'] = true;
@ -394,7 +415,14 @@ if ($id_agente) {
}
// Alert tab.
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'.html_print_image('images/gm_alerts.png', true, ['title' => __('Alerts')]).'</a>';
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/gm_alerts.png',
true,
[
'title' => __('Alerts'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'alert') {
$alerttab['active'] = true;
@ -403,7 +431,14 @@ if ($id_agente) {
}
// Template tab.
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'.html_print_image('images/templates.png', true, ['title' => __('Module templates')]).'</a>';
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/templates.png',
true,
[
'title' => __('Module templates'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'template') {
$templatetab['active'] = true;
@ -446,7 +481,14 @@ if ($id_agente) {
}
// Group tab.
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image('images/group.png', true, [ 'title' => __('Group')]).'</a>';
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
'images/group.png',
true,
[
'title' => __('Group'),
'class' => 'invert_filter',
]
).'</a>';
$grouptab['active'] = false;
@ -454,7 +496,14 @@ if ($id_agente) {
// GIS tab.
if ($config['activate_gis']) {
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image('images/gm_gis.png', true, [ 'title' => __('GIS data')]).'</a>';
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image(
'images/gm_gis.png',
true,
[
'title' => __('GIS data'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'gis') {
$gistab['active'] = true;
@ -464,18 +513,46 @@ if ($id_agente) {
}
// Agent wizard tab.
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image('images/wand_agent.png', true, [ 'title' => __('Agent wizard')]).'</a>';
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image(
'images/wand_agent.png',
true,
[
'title' => __('Agent wizard'),
'class' => 'invert_filter',
]
).'</a>';
// Hidden subtab layer.
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu" style="display:none; float:none;">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_snmp.png', true, [ 'title' => __('SNMP Wizard')]).'</a>';
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu invisible float-none">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_snmp.png',
true,
[
'title' => __('SNMP Wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_interfaces.png', true, [ 'title' => __('SNMP Interfaces wizard')]).'</a>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_interfaces_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_interfaces.png',
true,
[
'title' => __('SNMP Interfaces wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'.html_print_image('images/wand_wmi.png', true, [ 'title' => __('WMI Wizard')]).'</a>';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode center" >';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=wmi_explorer&id_agente='.$id_agente.'">'.html_print_image(
'images/wand_wmi.png',
true,
[
'title' => __('WMI Wizard'),
'class' => 'invert_filter',
]
).'</a>';
$agent_wizard['sub_menu'] .= '</li>';
$agent_wizard['sub_menu'] .= '</ul>';
@ -491,7 +568,14 @@ if ($id_agente) {
// Incident tab.
if ($total_incidents > 0) {
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'.html_print_image('images/book_edit.png', true, ['title' => __('Incidents')]).'</a>';
$incidenttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=incident&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/book_edit.png',
true,
[
'title' => __('Incidents'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'incident') {
$incidenttab['active'] = true;
@ -509,7 +593,10 @@ if ($id_agente) {
$remote_configuration_tab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=remote_configuration&amp;id_agente='.$id_agente.'&amp;disk_conf='.$agent_md5.'">'.html_print_image(
'images/remote_configuration.png',
true,
['title' => __('Remote configuration')]
[
'title' => __('Remote configuration'),
'class' => 'invert_filter',
]
).'</a>';
if ($tab == 'remote_configuration') {
$remote_configuration_tab['active'] = true;
@ -725,7 +812,7 @@ if ($id_agente) {
// Create agent.
ui_print_page_header(
__('Agent manager'),
'images/bricks.png',
'images/agent.png',
false,
'create_agent',
true,
@ -1404,6 +1491,10 @@ if ($update_module || $create_module) {
$each_ff = (int) get_parameter('each_ff', $module['each_ff']);
$ff_timeout = (int) get_parameter('ff_timeout');
$unit = (string) get_parameter('unit');
if ($unit === '0') {
$unit = '';
}
$id_tag = (array) get_parameter('id_tag_selected');
$serialize_ops = (string) get_parameter('serialize_ops');
$critical_instructions = (string) get_parameter('critical_instructions');
@ -1570,24 +1661,43 @@ if ($update_module) {
'module_macros' => $module_macros,
];
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
if (preg_match('/http_auth_user/m', $values['plugin_parameter'])) {
$http_user_conf = true;
}
$values['plugin_parameter'] = '';
if (preg_match('/http_auth_pass/m', $values['plugin_parameter'])) {
$http_pass_conf = true;
}
foreach ($plugin_parameter_split as $key => $value) {
if ($key == 1) {
if ($http_user) {
$values['plugin_parameter'] .= 'http_auth_user&#x20;'.$http_user.'&#x0a;';
if (!$http_user_conf || !$http_pass_conf) {
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
$values['plugin_parameter'] = '';
foreach ($plugin_parameter_split as $key => $value) {
if ($key == 1) {
if ($http_user) {
if ($http_user_conf) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_user&#x20;'.$http_user.'&#x0a;';
}
if ($http_pass) {
if ($http_user_pass) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_pass&#x20;'.$http_pass.'&#x0a;';
}
$values['plugin_parameter'] .= $value.'&#x0a;';
} else {
$values['plugin_parameter'] .= $value.'&#x0a;';
}
if ($http_pass) {
$values['plugin_parameter'] .= 'http_auth_pass&#x20;'.$http_pass.'&#x0a;';
}
$values['plugin_parameter'] .= $value.'&#x0a;';
} else {
$values['plugin_parameter'] .= $value.'&#x0a;';
}
}
}
@ -2379,7 +2489,7 @@ switch ($tab) {
width: 600,
title: 'Changing the module name of a satellite agent',
open: function(){
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" style="float:left;margin-left:25px;"></td><td><p style="float:right;font-style:nunito;font-size:11pt;margin-right:50px;margin-left:40px;"><span style="font-weight:bold;font-size:12pt;">Warning</span> <br>The names of the modules of a satellite should not be altered manually. Unless you are absolutely certain of the process, do not alter these names.</p></td></tr></table>');
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" class="float-left mrgn_lft_25px"></td><td><p id="p_configurar_agente" ><span class="font_bold font_12pt">Warning</span> <br>The names of the modules of a satellite should not be altered manually. Unless you are absolutely certain of the process, do not alter these names.</p></td></tr></table>');
},
buttons: [{
text: "Ok",
@ -2413,7 +2523,7 @@ switch ($tab) {
width: 650,
title: 'Changing snmp module name',
open: function(){
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" style="float:left;margin-left:25px;margin-top:30px;"></td><td><p style="float:right;font-style:nunito;font-size:11pt;margin-right:50px;margin-left:40px;"><span style="font-weight:bold;font-size:12pt;">Warning</span> <br> If you change the name of this module, various features associated with this module, such as network maps, interface graphs or other network modules, may no longer work. If you are not completely sure of the process, please do not change the name of the module. </p></td></tr></table>');
$('#dialog').html('<br><table><tr><td><img src="images/icono-warning-triangulo.png" class="warning_triangulo"></td><td><p id="p_configurar_agente"><span class="font_bold font_12pt">Warning</span> <br> If you change the name of this module, various features associated with this module, such as network maps, interface graphs or other network modules, may no longer work. If you are not completely sure of the process, please do not change the name of the module. </p></td></tr></table>');
},
buttons: [{
text: "Ok",

View File

@ -33,7 +33,7 @@ if ($id_field) {
$name = $field['name'];
$display_on_front = $field['display_on_front'];
$is_password_type = $field['is_password_type'];
$combo_values = $field['combo_values'];
$combo_values = $field['combo_values'] ? $field['combo_values'] : '';
$is_combo_enable = $config['is_combo_enable'];
ui_print_page_header(__('Update agent custom field'), 'images/custom_field.png', false, '', true, '');
} else {
@ -49,20 +49,20 @@ $table->style[2] = 'font-weight: bold';
$table->style[4] = 'font-weight: bold';
$table->style[6] = 'font-weight: bold';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
echo '</div>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo "<div id='message_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('You cannot unset the enable combo until you clear the combo values and click on update.').'</p>';
echo '</div>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo "<div id='message_no_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('If you select Enabled combo the Password type will be disabled.').'</p>';
echo '</div>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo "<div id='message_no_set_combo' title='".__('Agent Custom Fields Information')."' class='invisible'>";
echo "<p class='center bolder'>".__('If you select Passord type the Enabled combo will be disabled.').'</p>';
echo '</div>';
@ -116,12 +116,12 @@ $table->data[4][0] = __('Combo values').ui_print_help_tip(
__('Set values separated by comma'),
true
);
$table->data[4][1] = html_print_input_text(
$table->data[4][1] = html_print_textarea(
'combo_values',
3,
65,
io_safe_output($combo_values),
'',
35,
200,
true
);
@ -144,7 +144,7 @@ echo '</form>';
<script>
$(document).ready (function () {
if($('input[type=hidden][name=update_field]').val() == 1 && $('input[type=text][name=combo_values]').val() != ''){
if($('input[type=hidden][name=update_field]').val() == 1 && $('#textarea_combo_values').val() != ''){
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();
$('input[type=checkbox][name=is_password_type]').change(function (e) {
@ -155,7 +155,7 @@ $(document).ready (function () {
e.preventDefault();
});
$('input[type=checkbox][name=is_combo_enable]').change(function (e) {
if($('input[type=text][name=combo_values]').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
if($('#textarea_combo_values').val() != '' && $('input[type=checkbox][name=is_combo_enable]').prop('checked', true)){
dialog_message("#message_set_combo");
$('input[type=checkbox][name=is_combo_enable]').prop('checked', true);
$('#configure_field-4').show();

View File

@ -141,14 +141,18 @@ foreach ($fields as $field) {
$data[1] = '<b>'.$field['name'].'</b>';
if ($field['display_on_front']) {
$data[2] = html_print_image('images/tick.png', true);
$data[2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else {
$data[2] = html_print_image('images/icono_stop.png', true, ['style' => 'width:21px;height:21px;']);
$data[2] = html_print_image(
'images/icono_stop.png',
true,
['style' => 'width:21px;height:21px;']
);
}
$table->cellclass[][3] = 'action_buttons';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0']).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0']).'</a>';
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
array_push($table->data, $data);
}

View File

@ -32,7 +32,16 @@ if (($ag_group == -1) && ($group_id != 0)) {
$ag_group = $group_id;
}
if (! check_acl($config['id_user'], 0, 'AW') && ! check_acl($config['id_user'], 0, 'AD')) {
if (! check_acl(
$config['id_user'],
0,
'AW'
) && ! check_acl(
$config['id_user'],
0,
'AD'
)
) {
db_pandora_audit(
'ACL Violation',
'Trying to access agent manager'
@ -51,7 +60,14 @@ $search = get_parameter('search', '');
$tab = 'view';
// Setup tab.
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image('images/operation.png', true, ['title' => __('View')]).'</a>';
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image(
'images/eye_show.png',
true,
[
'title' => __('View'),
'class' => 'invert_filter',
]
).'</a>';
$viewtab['operation'] = true;
@ -60,10 +76,19 @@ $viewtab['active'] = false;
$onheader = ['view' => $viewtab];
// Header.
ui_print_page_header(__('Agents defined in %s', get_product_name()), 'images/agent_mc.png', false, '', true, $onheader);
ui_print_page_header(
__('Agents defined in %s', get_product_name()),
'images/agent.png',
false,
'',
true,
$onheader
);
if (is_central_policies_on_node()) {
ui_print_warning_message(__('This node is configured with centralized mode. To delete an agent go to metaconsole.'));
ui_print_warning_message(
__('This node is configured with centralized mode. To delete an agent go to metaconsole.')
);
}
// Perform actions.
@ -72,9 +97,13 @@ $enable_agent = (int) get_parameter('enable_agent');
$disable_agent = (int) get_parameter('disable_agent');
if ($disable_agent != 0) {
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$disable_agent);
$server_name = db_get_row_sql(
'select server_name from tagente where id_agente = '.$disable_agent
);
} else if ($enable_agent != 0) {
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$enable_agent);
$server_name = db_get_row_sql(
'select server_name from tagente where id_agente = '.$enable_agent
);
}
@ -100,32 +129,68 @@ if ($agent_to_delete) {
exit;
}
ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.'));
ui_print_result_message(
$result,
__('Success deleted agent.'),
__('Could not be deleted.')
);
if (enterprise_installed()) {
// Check if the remote config file still exist.
if (isset($config['remote_config'])) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$id_agente])) {
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
enterprise_include_once(
'include/functions_config_agents.php'
);
if (enterprise_hook(
'config_agents_has_remote_configuration',
[$id_agente]
)
) {
ui_print_error_message(
__('Maybe the files conf or md5 could not be deleted')
);
}
}
}
}
if ($enable_agent) {
$result = db_process_sql_update('tagente', ['disabled' => 0], ['id_agente' => $enable_agent]);
$result = db_process_sql_update(
'tagente',
['disabled' => 0],
['id_agente' => $enable_agent]
);
$alias = io_safe_output(agents_get_alias($enable_agent));
if ($result) {
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 0];
enterprise_hook('agent_update_from_cache', [$enable_agent, $values, $server_name]);
enterprise_hook('config_agents_update_config_token', [$enable_agent, 'standby', 0]);
db_pandora_audit('Agent management', 'Enable '.$alias);
enterprise_hook(
'agent_update_from_cache',
[
$enable_agent,
$values,
$server_name,
]
);
enterprise_hook(
'config_agents_update_config_token',
[
$enable_agent,
'standby',
0,
]
);
db_pandora_audit(
'Agent management',
'Enable '.$alias
);
} else {
db_pandora_audit('Agent management', 'Fail to enable '.$alias);
db_pandora_audit(
'Agent management',
'Fail to enable '.$alias
);
}
ui_print_result_message(
@ -143,12 +208,32 @@ if ($disable_agent) {
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 1];
enterprise_hook('agent_update_from_cache', [$disable_agent, $values, $server_name]);
enterprise_hook('config_agents_update_config_token', [$disable_agent, 'standby', 1]);
enterprise_hook(
'agent_update_from_cache',
[
$disable_agent,
$values,
$server_name,
]
);
enterprise_hook(
'config_agents_update_config_token',
[
$disable_agent,
'standby',
1,
]
);
db_pandora_audit('Agent management', 'Disable '.$alias);
db_pandora_audit(
'Agent management',
'Disable '.$alias
);
} else {
db_pandora_audit('Agent management', 'Fail to disable '.$alias);
db_pandora_audit(
'Agent management',
'Fail to disable '.$alias
);
}
ui_print_result_message(
@ -158,7 +243,7 @@ if ($disable_agent) {
);
}
echo "<table cellpadding='4' cellspacing='4' class='databox filters' width='100%' style='font-weight: bold; margin-bottom: 10px;'>
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'>
<tr>";
echo "<form method='post'
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
@ -167,14 +252,33 @@ echo '<td>';
echo __('Group').'&nbsp;';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
if (!$own_info['is_admin'] && !check_acl(
$config['id_user'],
0,
'AR'
) && !check_acl($config['id_user'], 0, 'AW')
) {
$return_all_group = false;
} else {
$return_all_group = true;
}
echo '<div class="w250px inline">';
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
html_print_select_groups(
false,
'AR',
$return_all_group,
'ag_group',
$ag_group,
'this.form.submit();',
'',
0,
false,
false,
true,
'',
false
);
echo '</div>';
echo '<td>';
echo __('Show Agents').'&nbsp;';
@ -183,14 +287,21 @@ $fields = [
1 => __('Only disabled'),
0 => __('Only enabled'),
];
html_print_select($fields, 'disabled', $disabled, 'this.form.submit()');
html_print_select(
$fields,
'disabled',
$disabled,
'this.form.submit()'
);
echo '</td>';
echo '<td>';
echo __('Operative System').'&nbsp;';
$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os');
$pre_fields = db_get_all_rows_sql(
'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'
);
$fields = [];
foreach ($pre_fields as $key => $value) {
@ -203,13 +314,23 @@ echo '</td>';
echo '<td>';
echo __('Recursion').'&nbsp;';
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
html_print_checkbox(
'recursion',
1,
$recursion,
false,
false,
'this.form.submit()'
);
echo '</td><td>';
echo __('Search').'&nbsp;';
html_print_input_text('search', $search, '', 12);
echo ui_print_help_tip(__('Search filter by alias, name, description, IP address or custom fields content'), true);
echo ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
);
echo '</td><td>';
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
@ -495,7 +616,7 @@ if ($agents !== false) {
echo '<th>'.__('Type').'</th>';
echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
echo '<th>'.__('Description').'</th>';
echo "<th style='text-align:left'>".__('Actions').'</th>';
echo "<th class='context_help_body'>".__('Actions').'</th>';
echo '</tr></thead>';
$color = 1;
@ -503,16 +624,35 @@ if ($agents !== false) {
$iterator = 0;
foreach ($agents as $agent) {
// Begin Update tagente.remote 0/1 with remote agent function return.
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
db_process_sql_update('tagente', ['remote' => 1], 'id_agente = '.$agent['id_agente'].'');
if (enterprise_hook(
'config_agents_has_remote_configuration',
[$agent['id_agente']]
)
) {
db_process_sql_update(
'tagente',
['remote' => 1],
'id_agente = '.$agent['id_agente'].''
);
} else {
db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].'');
}
// End Update tagente.remote 0/1 with remote agent function return.
$all_groups = agents_get_all_groups_agent($agent['id_agente'], $agent['id_grupo']);
$check_aw = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW');
$check_ad = check_acl_one_of_groups($config['id_user'], $all_groups, 'AD');
$all_groups = agents_get_all_groups_agent(
$agent['id_agente'],
$agent['id_grupo']
);
$check_aw = check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AW'
);
$check_ad = check_acl_one_of_groups(
$config['id_user'],
$all_groups,
'AD'
);
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
@ -567,12 +707,12 @@ if ($agents !== false) {
$url = ui_get_full_url(
$url.'&op=update&id='.$cluster->id()
);
echo '<a href="'.$url.'">'.$agent['alias'].'</a>';
echo '<a href="'.$url.'">'.ui_print_truncate_text($agent['alias'], 'agent_medium').'</a>';
}
} else {
echo '<a alt ='.$agent['nombre']." href='index.php?sec=gagente&
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
id_agente=".$agent['id_agente']."'>".'<span class="'.$custom_font_size.' title ="'.$agent['nombre'].'">'.$agent['alias'].'</span>'.'</a>';
id_agente=".$agent['id_agente']."'>".'<span class="'.$custom_font_size.' title ="'.$agent['nombre'].'">'.ui_print_truncate_text($agent['alias'], 'agent_medium').'</span>'.'</a>';
}
echo '</strong>';
@ -593,16 +733,28 @@ if ($agents !== false) {
if ($agent['quiet']) {
echo '&nbsp;';
html_print_image('images/dot_blue.png', false, ['border' => '0', 'title' => __('Quiet'), 'alt' => '']);
html_print_image(
'images/dot_blue.png',
false,
[
'border' => '0',
'title' => __('Quiet'),
'alt' => '',
]
);
}
if ($in_planned_downtime) {
ui_print_help_tip(__('Agent in planned downtime'), false, 'images/minireloj-16.png');
ui_print_help_tip(
__('Agent in planned downtime'),
false,
$config['image']['minireloj_16']
);
echo '</em>';
}
echo '</span><div class="left actions" style="visibility: hidden; clear: left">';
echo '</span><div class="left actions clear_left" style=" visibility: hidden">';
if ($check_aw) {
if ($agent['id_os'] == CLUSTER_OS_ID) {
if (enterprise_installed()) {
@ -664,7 +816,15 @@ if ($agents !== false) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
echo "<a href='index.php?".'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$agent['id_agente']."&disk_conf=1'>";
echo html_print_image('images/application_edit.png', true, ['align' => 'middle', 'title' => __('Edit remote config')]);
echo html_print_image(
'images/application_edit.png',
true,
[
'align' => 'middle',
'title' => __('Edit remote config'),
'class' => 'invert_filter',
]
);
echo '</a>';
}
}
@ -702,7 +862,7 @@ if ($agents !== false) {
$offsetArg = $offset;
}
echo "<td class='$tdcolor action_buttons' align='left' style='width:7%' valign='middle'>";
echo "<td class='$tdcolor action_buttons' align='left' width=7% valign='middle'>";
if ($agent['disabled']) {
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
@ -724,7 +884,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('You are going to disable a cluster agent. Are you sure?').'\')) return false;">';
}
echo html_print_image('images/lightbulb.png', true, ['alt' => __('Disable agent'), 'title' => __('Disable agent')]).'</a>';
echo html_print_image('images/lightbulb.png', true, ['alt' => __('Disable agent'), 'title' => __('Disable agent'), 'class' => 'invert_filter']).'</a>';
}
if ($check_aw && !is_central_policies_on_node()) {
@ -737,7 +897,7 @@ if ($agents !== false) {
echo ' onClick="if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;">';
}
echo html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
echo html_print_image('images/cross.png', true, ['border' => '0', 'class' => 'invert_filter']).'</a>';
}
echo '</td>';
@ -752,7 +912,7 @@ if ($agents !== false) {
if (check_acl($config['id_user'], 0, 'AW')) {
// Create agent button.
echo '<div style="text-align: right;">';
echo '<div class="action-buttons">';
echo '<form method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
html_print_submit_button(
__('Create agent'),

View File

@ -45,7 +45,7 @@ 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' style='width:20%; font-weight: bold;'>";
echo "<tr><td class='datos bolder w20p'>";
echo __('Search').' '.html_print_input_text(
'search_string',
$search_string,
@ -63,10 +63,10 @@ if (($policy_page) || (isset($agent))) {
}
echo '</td>';
echo "<td class='datos' style='width:10%'>";
echo "<td class='datos w10p'>";
html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"');
echo '</td>';
echo "<td class='datos' style='width:10%'></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.
@ -162,7 +162,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" style="font-weight: bold; width:20%;">';
echo '<td class="datos w20p bolder">';
echo __('Show in hierachy mode');
if ($checked == 'true') {
$checked = true;
@ -181,7 +181,7 @@ if (($policy_page) || (isset($agent))) {
echo '</td>';
}
echo '<td class="datos" style="font-weight: bold; width:20%;">';
echo '<td class="datos w20p bolder">';
echo __('<p>Type</p>');
html_print_select(
$modules,
@ -199,7 +199,7 @@ if (($policy_page) || (isset($agent))) {
);
html_print_input_hidden('edit_module', 1);
echo '</td>';
echo '<td class="datos" style="width:10%;">';
echo '<td class="datos w10p">';
echo '<input align="right" name="updbutton" type="submit" class="sub next" value="'.__('Create').'">';
echo '</td>';
echo '</tr>';
@ -210,9 +210,9 @@ if (($policy_page) || (isset($agent))) {
echo '</table>';
if (!$config['disable_help']) {
echo '<div style="text-align: right; width: 100%;padding-top:10px;padding-bottom:10px">';
echo '<div class="disable_help">';
echo '<strong>';
echo "<a style='color: #373737;' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo "<a class='color-black-grey' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo '</strong>';
echo '</div>';
}
@ -222,9 +222,9 @@ if (! isset($id_agente)) {
}
$multiple_delete = (bool) get_parameter('multiple_delete');
$module_action = (string) get_parameter('module_action');
if ($multiple_delete) {
if ($module_action === 'delete') {
$id_agent_modules_delete = (array) get_parameter('id_delete');
$count_correct_delete_modules = 0;
@ -400,23 +400,63 @@ if ($multiple_delete) {
if ($count_correct_delete_modules == 0) {
ui_print_error_message(
sprintf(
__('There was a problem deleting %s modules, none deleted.'),
__('There was a problem completing the operation. Applied to 0/%d modules.'),
$count_modules_to_delete
)
);
} else {
if ($count_correct_delete_modules == $count_modules_to_delete) {
ui_print_success_message(__('All Modules deleted succesfully'));
ui_print_success_message(__('Operation finished successfully.'));
} else {
ui_print_error_message(
sprintf(
__('There was a problem only deleted %s modules of %s total.'),
count_correct_delete_modules,
__('There was a problem completing the operation. Applied to %d/%d modules.'),
$count_correct_delete_modules,
$count_modules_to_delete
)
);
}
}
} else if ($module_action === 'disable') {
$id_agent_modules_disable = (array) get_parameter('id_delete');
$count_correct_delete_modules = 0;
$updated_count = 0;
foreach ($id_agent_modules_disable as $id_agent_module_disable) {
$sql = sprintf(
'UPDATE tagente_modulo
SET disabled = 1
WHERE id_agente_modulo = %d',
$id_agent_module_disable
);
if (db_process_sql($sql)) {
$updated_count++;
}
}
$count_modules_to_disable = count($id_agent_modules_disable);
if ($updated_count === 0) {
ui_print_error_message(
sprintf(
__('There was a problem completing the operation. Applied to 0/%d modules.'),
$count_modules_to_disable
)
);
} else {
if ($updated_count == $count_modules_to_disable) {
ui_print_success_message(__('Operation finished successfully.'));
} else {
ui_print_error_message(
sprintf(
__('There was a problem completing the operation. Applied to %d/%d modules.'),
$updated_count,
$count_modules_to_disable
)
);
}
}
}
@ -845,6 +885,9 @@ foreach ($modules as $module) {
'id_delete[]',
$module['id_agente_modulo'],
false,
true,
false,
'',
true
);
}
@ -856,7 +899,10 @@ foreach ($modules as $module) {
$data[0] .= html_print_image(
'images/icono_escuadra.png',
true,
['style' => 'padding-bottom: inherit;']
[
'style' => 'padding-bottom: inherit;',
'class' => 'invert_filter',
]
).'&nbsp;&nbsp;';
}
@ -925,7 +971,7 @@ foreach ($modules as $module) {
$img = 'images/policies_brick.png';
$title = '('.__('Adopted').') '.$policyInfo['name_policy'];
} else {
$img = 'images/policies.png';
$img = 'images/policies_mc.png';
$title = $policyInfo['name_policy'];
}
} else {
@ -1035,6 +1081,7 @@ foreach ($modules as $module) {
[
'alt' => __('Disable module'),
'title' => __('Disable module'),
'class' => 'invert_filter',
]
).'</a>';
}
@ -1045,7 +1092,10 @@ foreach ($modules as $module) {
$data[8] .= html_print_image(
'images/copy.png',
true,
['title' => __('Duplicate')]
[
'title' => __('Duplicate'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a> ';
@ -1054,9 +1104,12 @@ foreach ($modules as $module) {
if ($numericModules[$type] === true) {
$data[8] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&fix_module='.$module['id_agente_modulo'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/chart_curve.png',
'images/chart.png',
true,
['title' => __('Normalize')]
[
'title' => __('Normalize'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a>';
}
@ -1076,9 +1129,12 @@ foreach ($modules as $module) {
$data[8] .= '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components&create_network_from_module=1&id_agente='.$id_agente.'&create_module_from='.$module['id_agente_modulo'].'"
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[8] .= html_print_image(
'images/network.png',
'images/op_network.png',
true,
['title' => __('Create network component')]
[
'title' => __('Create network component'),
'class' => 'invert_filter',
]
);
$data[8] .= '</a> ';
} else {
@ -1098,7 +1154,10 @@ foreach ($modules as $module) {
$data[9] .= html_print_image(
'images/cross.png',
true,
['title' => __('Delete')]
[
'title' => __('Delete'),
'class' => 'invert_filter',
]
);
$data[9] .= '</a> ';
}
@ -1123,12 +1182,29 @@ html_print_table($table);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('multiple_delete', 1);
html_print_submit_button(
__('Delete'),
'multiple_delete',
html_print_input_hidden('submit_modules_action', 1);
html_print_select(
[
'disable' => 'Disable selected modules',
'delete' => 'Delete selected modules',
],
'module_action',
'',
'',
'',
0,
false,
'class="sub delete"'
false,
false
);
html_print_submit_button(
__('Execute action'),
'submit_modules_action',
false,
'class="sub next"'
);
echo '</div>';
echo '</form>';

View File

@ -19,7 +19,7 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3();
function prepend_table_simple($row, $id=false)
global $config;function prepend_table_simple($row, $id=false)
{
global $table_simple;
@ -119,7 +119,7 @@ function add_component_selection($id_network_component_type)
);
$data[1] .= '</span>';
$data[1] .= ' <span id="component_loading" class="invisible">';
$data[1] .= html_print_image('images/spinner.png', true);
$data[1] .= html_print_image('images/spinner.gif', true);
$data[1] .= '</span>';
$table_simple->colspan['module_component'][1] = 3;
@ -210,7 +210,10 @@ if (!empty($id_agent_module) && isset($id_agente)) {
$table_simple->data[0][1] .= html_print_image(
'images/cross.png',
true,
['title' => __('Delete module')]
[
'title' => __('Delete module'),
'class' => 'invert_filter',
]
);
$table_simple->data[0][1] .= '</a> ';
}
@ -548,17 +551,17 @@ $table_advanced->data[0][4] = html_print_input_text(
$classdisabledBecauseInPolicy
);
// $table_advanced->colspan[1][4] = 3;
// $table_advanced->data[0][4] = html_print_extended_select_for_unit(
// 'unit',
// $unit,
// '',
// '',
// '0',
// false,
// true,
// false,
// false
// );
$table_advanced->data[0][4] = html_print_extended_select_for_unit(
'unit',
$unit,
'',
'none',
'0',
false,
true,
false,
false
);
$table_advanced->colspan[0][4] = 3;
$module_id_policy_module = 0;
@ -635,7 +638,14 @@ $table_advanced->data[3][1] = html_print_extended_select_for_time(
$classdisabledBecauseInPolicy,
$disabledBecauseInPolicy
);
$table_advanced->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image('images/cog.png', true, ['title' => __('Advanced options Dynamic Threshold')]).'</a>';
$table_advanced->data[3][1] .= '<a onclick=advanced_option_dynamic()>'.html_print_image(
'images/cog.png',
true,
[
'title' => __('Advanced options Dynamic Threshold'),
'class' => 'invert_filter',
]
).'</a>';
$table_advanced->cellclass[3][2] = 'hide_dinamic';
$table_advanced->cellclass[3][3] = 'hide_dinamic';
@ -717,6 +727,10 @@ $table_advanced->colspan[4][4] = 3;
// FF stands for Flip-flop.
$table_advanced->colspan[5][1] = 5;
$table_advanced->cellclass[5][1] = 'font_bold';
$table_advanced->data[5][0] = __('FF threshold').' ';
$table_advanced->data[5][1] .= __('Keep counters');
@ -933,10 +947,24 @@ if (!tags_has_user_acl_tags($config['id_user'])) {
}
}
$table_advanced->data[7][2] = html_print_image('images/darrowright.png', true, ['id' => 'right', 'title' => __('Add tags to module')]);
// html_print_input_image ('add', 'images/darrowright.png', 1, '', true, array ('title' => __('Add tags to module')));
$table_advanced->data[7][2] .= '<br><br><br><br>'.html_print_image('images/darrowleft.png', true, ['id' => 'left', 'title' => __('Delete tags to module')]);
// html_print_input_image ('add', 'images/darrowleft.png', 1, '', true, array ('title' => __('Delete tags to module')));
$table_advanced->data[7][2] = html_print_image(
'images/darrowright.png',
true,
[
'id' => 'right',
'title' => __('Add tags to module'),
'class' => 'invert_filter',
]
);
$table_advanced->data[7][2] .= '<br><br><br><br>'.html_print_image(
'images/darrowleft.png',
true,
[
'id' => 'left',
'title' => __('Delete tags to module'),
'class' => 'invert_filter',
]
);
$table_advanced->data[7][3] = '<b>'.__('Tags selected').'</b>';
$table_advanced->data[7][4] = html_print_select_from_sql(
"SELECT a.id_tag, name
@ -1002,7 +1030,7 @@ $table_advanced->data[8][3] = __('Cascade Protection Services');
$table_advanced->colspan[8][4] = 3;
$table_advanced->data[8][4] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, '', $disabledBecauseInPolicy);
$textarea_custom_style = ' style="min-height: 0px;"';
$textarea_custom_style = ' class="min-height-0px"';
$table_advanced->data[9][0] = __('Description');
$table_advanced->colspan[9][1] = 6;
@ -1128,7 +1156,7 @@ $table_macros->data = [];
$table_macros->style = [];
$table_macros->style[0] = 'font-weight: bold;';
$table_macros->style[2] = 'font-weight: bold;';
$table_macros->style[5] = 'width: 10px';
$table_macros->style[5] = 'font-weight: bold;';
$table_macros->colspan = [];
$macro_count = 0;
@ -1140,7 +1168,7 @@ if (isset($module_macros)) {
$table_macros->data[$macro_count][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text('module_macro_values[]', $macro_value, '', 50, 60, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
if (!$disabledBecauseInPolicy) {
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/cross.png', true).'</a>';
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro('.$macro_count.');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
}
$macro_count++;
@ -1149,7 +1177,7 @@ if (isset($module_macros)) {
}
if (!$disabledBecauseInPolicy) {
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png', true).'</a>';
$table_macros->data[$macro_count][0] = '<span>'.__('Custom macros').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png', true, ['class' => 'invert_filter']).'</a>';
$table_macros->colspan[$macro_count][0] = 5;
}
@ -1211,7 +1239,7 @@ $table_new_relations->data[0][6] = html_print_button(
'class="sub add"',
true
);
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' class='inline_line'></div>";
// Relationship list.
$table_relations = new stdClass();
@ -1237,14 +1265,23 @@ $table_relations->data[-1][0] = '';
$table_relations->data[-1][1] = '';
$table_relations->data[-1][2] = '';
$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
$table_relations->data[-1][3] .= html_print_image('images/lock.png', true).'</a>';
$table_relations->data[-1][3] .= html_print_image(
'images/lock_mc.png',
true
).'</a>';
$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
$table_relations->data[-1][4] .= html_print_image('images/cross.png', true).'</a>';
$table_relations->data[-1][4] .= html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
$relations_count = 0;
if ($id_agent_module) {
$module_relations = modules_get_relations(['id_module' => $id_agent_module]);
$module_relations = modules_get_relations(
['id_module' => $id_agent_module]
);
if (!$module_relations) {
$module_relations = [];
@ -1280,13 +1317,28 @@ if ($id_agent_module) {
// Agent name.
$table_relations->data[$relations_count][0] = $agent_name;
// Module name.
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[&hellip;]').'</a>';
$table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text(
$module_name,
'module_medium',
true,
true,
true,
'[&hellip;]'
).'</a>';
// Type.
$table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
// Lock relationship updates.
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
$table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
'images/lock_mc.png',
true,
['class' => 'invert_filter']
).'</a>';
// Delete relationship.
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
$table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image(
'images/cross.png',
true,
['class' => 'invert_filter']
).'</a>';
$relations_count++;
}
}
@ -1711,14 +1763,14 @@ function add_new_relation () {
'<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
'<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
'<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
'<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
'<td id="module_relations-' + relationsCount + '-3" class="w10p center">' +
'<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/lock.png', true); ?>' +
'<?php echo html_print_image('images/lock_mc.png', true, ['class' => 'invert_filter']); ?>' +
'</a>' +
'</td>' +
'<td id="module_relations-' + relationsCount + '-4" style="width: 10%; text-align: center;">' +
'<td id="module_relations-' + relationsCount + '-4" class="w10p center">' +
'<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data + ');">' +
'<?php echo html_print_image('images/cross.png', true); ?>' +
'<?php echo html_print_image('images/cross.png', true, ['class' => 'invert_filter']); ?>' +
'</a>' +
'</td>' +
'</tr>';

View File

@ -40,7 +40,7 @@ html_print_input_hidden(
'custom_action',
urlencode(
base64_encode(
'&nbsp;<a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" style="vertical-align: middle;"></img></a>'
'&nbsp;<a href="javascript:setOID()"><img src="'.ui_get_full_url('images').'/input_filter.disabled.png" title="'.__('Use this OID').'" class="vertical_middle"></img></a>'
)
),
false
@ -225,7 +225,7 @@ push_table_simple($data, 'snmp_1');
$data = [];
$data[0] = __('SNMP OID');
$data[1] = '<span class="left"; style="width: 50%">';
$data[1] = '<span class="left w50p">';
$data[1] .= html_print_input_text(
'snmp_oid',
$snmp_oid,
@ -261,7 +261,7 @@ $data[1] .= html_print_image(
]
);
$data[1] .= '</span>';
$data[1] .= '</span><span class="right" style="width: 50%; text-align: right">';
$data[1] .= '</span><span class="right w50p right">';
$data[1] .= html_print_button(
__('SNMP walk'),
'snmp_walk',

View File

@ -71,7 +71,7 @@ if (!empty($id_plugin)) {
$preload = '';
}
$data[2] = '<span style="font-weight: normal;" id="plugin_description">'.$preload.'</span>';
$data[2] = '<span class="normal" id="plugin_description">'.$preload.'</span>';
push_table_simple($data, 'plugin_1');

View File

@ -108,7 +108,7 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
$data[0] = '';
}
$data[1] = '<div id="module_data" style="top:1em; float:left; width:50%;">';
$data[1] = '<div id="module_data" class="w50p float-left top-1em">';
$data[1] .= html_print_label(__('Agent'), 'agent_name', true).'<br/>';
// Get module and agent of the target prediction module

File diff suppressed because it is too large Load Diff

View File

@ -364,12 +364,12 @@ else if (!$downtimes) {
// Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>';
echo '<div class="action-buttons" style="width: 100%">';
echo '<div class="action-buttons w100p" >';
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" class="display_in" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}
@ -476,22 +476,42 @@ else {
if (in_array($downtime['id_group'], $groupsAD)) {
// Stop button
if ($downtime['type_execution'] == 'once' && $downtime['executed'] == 1) {
$data['stop'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
if (check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AW')
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) {
$data['stop'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
} else {
$data['stop'] = html_print_image('images/cancel.png', true, ['title' => __('Stop downtime')]);
}
} else {
$data['stop'] = '';
}
// Edit & delete buttons.
if ($downtime['executed'] == 0) {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
// Delete.
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete')]);
if (check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AW')
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>';
// Delete.
$data['delete'] = '<a id="delete_downtime" href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
} else {
$data['edit'] = '';
$data['delete'] = '';
}
} else if ($downtime['executed'] == 1 && $downtime['type_execution'] == 'once') {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update')]).'</a>';
// Delete.
$data['delete'] = __('N/A');
if (check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AW')
|| check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AD')
) {
// Edit.
$data['edit'] = '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&edit_downtime=1&id_downtime='.$downtime['id'].'">'.html_print_image('images/config.png', true, ['title' => __('Update'), 'class' => 'invert_filter']).'</a>';
// Delete.
$data['delete'] = __('N/A');
} else {
$data['edit'] = '';
$data['delete'] = '';
}
} else {
$data['edit'] = '';
$data['delete'] = '';
@ -519,7 +539,7 @@ else {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
// CSV export button.
echo '<div style="display: inline;">';
echo '<div class="display_in">';
html_print_button(
__('Export to CSV'),
'csv_export',
@ -532,7 +552,7 @@ else {
// Create button.
if ($write_permisson) {
echo '&nbsp;';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" style="display: inline;">';
echo '<form method="post" action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" class="display_in" >';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
echo '</form>';
}

View File

@ -47,7 +47,7 @@ if ($default != 0) {
'value' => $status_monitor_fields,
];
// update 'status_monitor_fields' in tconfig table to keep the value at update.
// Update 'status_monitor_fields' in tconfig table to keep the value at update.
$result = db_process_sql_update(
'tconfig',
$values,
@ -65,7 +65,7 @@ $fields_selected = explode(',', $config['status_monitor_fields']);
$result_selected = [];
// show list of fields selected.
// Show list of fields selected.
if ($fields_selected[0] != '') {
foreach ($fields_selected as $field_selected) {
switch ($field_selected) {
@ -169,6 +169,7 @@ $table->data[1][1] = '<a href="javascript:">'.html_print_image(
[
'id' => 'right',
'title' => __('Add fields to select'),
'class' => 'invert_filter',
]
).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
@ -177,6 +178,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
[
'id' => 'left',
'title' => __('Delete fields to select'),
'class' => 'invert_filter',
]
).'</a>';

View File

@ -36,6 +36,8 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'LM')) {
@ -77,6 +79,15 @@ if ($copy_action) {
$al_action = alerts_get_alert_action($id);
if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
);
include 'general/noaccess.php';
exit;
}
if ($al_action !== false) {
// If user tries to copy an action with group=ALL.
if ($al_action['id_group'] == 0) {
@ -144,6 +155,15 @@ if ($delete_action) {
$al_action = alerts_get_alert_action($id);
if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert Management'
);
include 'general/noaccess.php';
exit;
}
if ($al_action !== false) {
// If user tries to delete an action with group=ALL.
if ($al_action['id_group'] == 0) {
@ -236,11 +256,18 @@ $table_filter->data[0][1] = html_print_input_text(
255,
true
);
$return_all_group = false;
if (users_can_manage_group_all('LM') === true) {
$return_all_group = true;
}
$table_filter->data[0][2] = __('Group');
$table_filter->data[0][3] = html_print_select_groups(
$config['id_user'],
'LM',
true,
$return_all_group,
'group_search',
$group_search,
'',
@ -370,7 +397,12 @@ foreach ($actions as $action) {
$data = [];
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.$action['name'].'</a>';
if (check_acl_restricted_all($config['id_user'], $action['id_group'], 'LM')) {
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&id='.$action['id'].'&pure='.$pure.'">'.$action['name'].'</a>';
} else {
$data[0] = $action['name'];
}
$data[1] = $action['command_name'];
$data[2] = ui_print_group_icon($action['id_group'], true).'&nbsp;';
if (!alerts_validate_command_to_action($action['id_group'], $action['command_group'])) {
@ -384,8 +416,11 @@ foreach ($actions as $action) {
);
}
$data[3] = '';
$data[4] = '';
if (is_central_policies_on_node() === false
&& check_acl($config['id_user'], $action['id_group'], 'LM')
&& check_acl_restricted_all($config['id_user'], $action['id_group'], 'LM')
) {
$table->cellclass[] = [
3 => 'action_buttons',
@ -396,9 +431,9 @@ foreach ($actions as $action) {
$text_confirm = __('Are you sure?');
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="copy_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/copy.png', true).'</a>';
onClick="copy_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
$data[4] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions"
onClick="delete_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/cross.png', true).'</a>';
onClick="delete_action('.$id_action.',\''.$text_confirm.'\');">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
}
array_push($table->data, $data);

View File

@ -28,6 +28,12 @@ if (! check_acl($config['id_user'], 0, 'LM')) {
exit;
}
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) {
echo "<div id='message_permissions' title='".__('Permissions warning')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('Command management is limited to administrator users or user profiles with permissions over Pandora FMS management').'</p>';
echo '</div>';
}
if (is_metaconsole()) {
$sec = 'advanced';
} else {
@ -40,6 +46,8 @@ $create_command = (bool) get_parameter('create_command');
$delete_command = (bool) get_parameter('delete_command');
$copy_command = (bool) get_parameter('copy_command');
$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands';
if (is_ajax()) {
$get_alert_command = (bool) get_parameter('get_alert_command');
if ($get_alert_command) {
@ -56,7 +64,7 @@ if (is_ajax()) {
$command = alerts_get_alert_command($id);
// If is setted a description, we change the carriage return by <br> tags
// If a description is set, change the carriage return by <br> tags.
if (isset($command['description'])) {
$command['description'] = str_replace(
[
@ -90,9 +98,15 @@ if (is_ajax()) {
if (!empty($field_description)) {
// If the value is 5, this because severity in snmp alerts is not permit to show.
if (($i > 5) && ($command['id'] == 3)) {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), ($i - 1)).'</span>';
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
($i - 1)
).'</span>';
} else {
$fdesc = $field_description.' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
$fdesc = $field_description.' <br><span class="normal xx-small">'.sprintf(
__('Field %s'),
$i
).'</span>';
}
// If the field is the number one, print the help message.
@ -125,7 +139,7 @@ if (is_ajax()) {
$field_value = io_safe_output($field_value);
// HTML type.
if (preg_match('/^_html_editor_$/i', $field_value)) {
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Basic');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails, text must be HTML format, if you want to use plain text, type it between the following labels: <pre></pre>'),
@ -166,7 +180,7 @@ if (is_ajax()) {
$is_central_policies_on_node
);
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Basic').'&nbsp;&nbsp;';
$editor_type_chkbx .= html_print_radio_button_extended(
'editor_type_recovery_value_'.$i,
@ -203,7 +217,7 @@ if (is_ajax()) {
$is_central_policies_on_node
);
} else if (preg_match('/^_content_type_$/i', $field_value)) {
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'),
@ -234,7 +248,7 @@ if (is_ajax()) {
$editor_type_chkbx .= '</small></b></div>';
$ffield = $editor_type_chkbx;
$editor_type_chkbx = '<div style="padding: 4px 0px;"><b><small>';
$editor_type_chkbx = '<div id="command_div"><b><small>';
$editor_type_chkbx .= __('Text/plain');
$editor_type_chkbx .= ui_print_help_tip(
__('For sending emails only text plain'),
@ -265,6 +279,76 @@ if (is_ajax()) {
$editor_type_chkbx .= '</small></b></div>';
$rfield = $editor_type_chkbx;
// Select type.
} else if (preg_match('/^_integria_type_custom_field_$/i', $field_value)) {
$ffield = '';
$rfield = '';
$ffield .= '<div name="field'.$i.'_value_container">'.html_print_switch(
[
'name' => 'field'.$i.'_value[]',
'value' => '',
]
).'</div>';
$rfield .= '<div name="field'.$i.'_recovery_value_container">'.html_print_switch(
[
'name' => 'field'.$i.'_recovery_value[]',
'value' => '',
]
).'</div>';
$ffield .= html_print_select(
'',
'field'.$i.'_value[]',
'',
'',
__('None'),
'',
true,
false,
false,
'fields',
$is_central_policies_on_node
);
$rfield .= html_print_select(
'',
'field'.$i.'_recovery_value[]',
'',
'',
__('None'),
'',
true,
false,
false,
'fields',
$is_central_policies_on_node
);
$ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
$rfield .= html_print_input_text('field'.$i.'_recovery_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
$ffield .= html_print_textarea(
'field'.$i.'_value[]',
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields"',
true,
'',
$is_central_policies_on_node
);
$rfield .= html_print_textarea(
'field'.$i.'_recovery_value[]',
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields_recovery',
true,
'',
$is_central_policies_on_node
);
} else {
$fields_value_select = [];
$fv = explode(';', $field_value);
@ -304,7 +388,7 @@ if (is_ajax()) {
'field'.$i.'_recovery_value',
'',
'',
'',
__('None'),
0,
true,
false,
@ -318,7 +402,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px; '.$style.'" class="fields"',
'style="'.$style.'" class="fields min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -328,7 +412,7 @@ if (is_ajax()) {
1,
1,
$fv[0],
'style="min-height:40px; '.$style.'" class="fields_recovery',
'style="'.$style.'" class="fields_recovery min-height-40px',
true,
'',
$is_central_policies_on_node
@ -341,7 +425,7 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields"',
'style="'.$style.'" class="fields min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -351,7 +435,7 @@ if (is_ajax()) {
1,
1,
'',
'style="min-height:40px; '.$style.'" class="fields_recovery"',
'style="'.$style.'" class="fields_recovery min-height-40px"',
true,
'',
$is_central_policies_on_node
@ -364,7 +448,7 @@ if (is_ajax()) {
$fields_rows[$i] = '';
} else {
$fields_rows[$i] = '<tr id="table_macros-field'.$i.'" class="datos">';
$fields_rows[$i] .= '<td style="font-weight:bold;width:20%" class="datos">'.$fdesc.'</td>';
$fields_rows[$i] .= '<td class="datos bolder w20p">'.$fdesc.'</td>';
$fields_rows[$i] .= '<td class="datos">'.$ffield.'</td>';
if ($get_recovery_fields) {
$fields_rows[$i] .= '<td class="datos recovery_col">'.$rfield.'</td>';
@ -552,11 +636,19 @@ if ($commands === false) {
$commands = [];
}
// Pagination.
$total_commands = count($commands);
$offset = (int) get_parameter('offset');
$limit = (int) $config['block_size'];
$commands = array_slice($commands, $offset, $limit);
foreach ($commands as $command) {
$data = [];
$data['name'] = '<span style="font-size: 7.5pt">';
if (! $command['internal']) {
$data['name'] = '<span>';
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if (!$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
$data['name'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&id='.$command['id'].'&pure='.$pure.'">'.$command['name'].'</a>';
} else {
$data['name'] .= $command['name'];
@ -580,25 +672,34 @@ foreach ($commands as $command) {
);
$data['action'] = '';
$table->cellclass[]['action'] = 'action_buttons';
if ($is_central_policies_on_node === false && !$command['internal']) {
$data['action'] = '<span style="display: inline-flex">';
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
if ($is_central_policies_on_node === false && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
$data['action'] = '<span class="inline_flex">';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&amp;copy_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>';
$data['action'] .= '</span>';
}
array_push($table->data, $data);
}
if (count($table->data) > 0) {
ui_pagination($total_commands, $url);
if (isset($data) === true && count($table->data) > 0) {
html_print_table($table);
ui_pagination($total_commands, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
} else {
ui_print_info_message(['no_close' => true, 'message' => __('No alert commands configured') ]);
ui_print_info_message(
[
'no_close' => true,
'message' => __('No alert commands configured'),
]
);
}
if ($is_central_policies_on_node === false) {
if ($is_central_policies_on_node === false && check_acl_restricted_all($config['id_user'], $command['id_group'], 'PM')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
@ -608,3 +709,26 @@ if ($is_central_policies_on_node === false) {
}
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript">
$(document).ready(function () {
dialog_message("#message_permissions");
});
function dialog_message(message) {
$(message)
.css("display", "inline")
.dialog({
modal: true,
width: "400px",
buttons: {
Close: function() {
$(this).dialog("close");
}
}
});
}
</script>

View File

@ -90,14 +90,21 @@ $table->data[0][1] = html_print_select(
$table->data[0][1] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
$table->data[0][1] .= html_print_image('images/spinner.png', true).'</span>';
$table->data[0][1] .= html_print_image('images/spinner.gif', true).'</span>';
$table->data[1][0] = __('Actions');
$groups_user = users_get_groups($config['id_user']);
if (!empty($groups_user)) {
$groups = implode(',', array_keys($groups_user));
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
if ($config['integria_enabled'] == 0) {
$integria_command = 'Integria&#x20;IMS&#x20;Ticket';
$sql = sprintf('SELECT taa.id, taa.name FROM talert_actions taa INNER JOIN talert_commands tac ON taa.id_alert_command = tac.id WHERE tac.name <> "%s" AND taa.id_group IN (%s)', $integria_command, $groups);
} else {
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
}
$actions = db_get_all_rows_sql($sql);
}
@ -124,8 +131,8 @@ $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= html_print_image('images/add.png', true);
$table->data[1][1] .= '<span style="margin-left:0.5em;">'.__('Create Action').'</span>';
$table->data[1][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[1][1] .= '<span class="mrgn_lft_05em">'.__('Create Action').'</span>';
$table->data[1][1] .= '</a>';
}
@ -157,8 +164,8 @@ if ($own_info['is_admin']) {
$table->data[2][1] .= ' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '<span style="margin-left:0.5em;">'.__('Create Template').'</span>';
$table->data[2][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
$table->data[2][1] .= '<span class=""mrgn_lft_05em>'.__('Create Template').'</span>';
$table->data[2][1] .= '</a>';
}
@ -190,7 +197,7 @@ if ($own_info['is_admin']) {
if (!isset($step)) {
if ($id_cluster) {
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button style='float:right;margin-left:20px;' name='store' class='sub upd' value='".__('Finish and view cluster')."'>";
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button name='store' class='sub upd right mrgn_lft_20px' value='".__('Finish and view cluster')."'>";
}
html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"');

View File

@ -50,9 +50,9 @@ if ($id_agente) {
// Table for filter controls
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&amp;sec2='.$sec2.'&amp;refr='.((int) get_parameter('refr', 0)).'&amp;pure='.$config['pure'].'">';
$form_filter .= "<input type='hidden' name='search' value='1' />";
$form_filter .= '<table style="width: 100%;" cellpadding="0" cellspacing="0" class="databox filters">';
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">';
$form_filter .= '<tr>';
$form_filter .= "<td style='font-weight: bold;'>".__('Template name').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Template name').'</td><td>';
$form_filter .= html_print_input_text('template_name', $templateName, '', 12, 255, true);
$form_filter .= '</td>';
$temp = agents_get_agents();
@ -65,7 +65,7 @@ if ($temp) {
}
}
$form_filter .= "<td style='font-weight: bold;'>".__('Agents').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Agents').'</td><td>';
$params = [];
$params['return'] = true;
@ -80,7 +80,7 @@ $form_filter .= ui_print_agent_autocomplete_input($params);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Module name').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Module name').'</td><td>';
$form_filter .= html_print_input_text('module_name', $moduleName, '', 12, 255, true);
$form_filter .= '</td>';
$form_filter .= '</tr>';
@ -111,30 +111,34 @@ if (is_array($temp)) {
}
}
$form_filter .= "<td style='font-weight: bold;'>".__('Actions').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Field content').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
$form_filter .= '</td>';
$form_filter .= "<td style='font-weight: bold;'>".__('Priority').'</td><td>';
$form_filter .= "<td class='bolder''>".__('Priority').'</td><td>';
$form_filter .= html_print_select(get_priorities(), 'priority', $priority, '', __('All'), -1, true);
$form_filter .= "</td style='font-weight: bold;'>";
$form_filter .= "</td class='bolder''>";
$form_filter .= '</tr>';
$form_filter .= '<tr>';
$form_filter .= "<td style='font-weight: bold;'>".__('Enabled / Disabled').'</td><td>';
$form_filter .= "<td class='bolder'>".__('Status').'</td><td>';
$ed_list = [];
$ed_list[0] = __('Enabled');
$ed_list[1] = __('Disabled');
$form_filter .= html_print_select($ed_list, 'enabledisable', $enabledisable, '', __('All'), -1, true);
$form_filter .= "</td><td style='font-weight: bold;'>".__('Standby').'</td><td>';
$alert_status_filter = [];
$alert_status_filter['all_enabled'] = __('All (Enabled)');
$alert_status_filter['all'] = __('All');
$alert_status_filter['fired'] = __('Fired');
$alert_status_filter['notfired'] = __('Not fired');
$alert_status_filter['disabled'] = __('Disabled');
$form_filter .= html_print_select($alert_status_filter, 'status_alert', $status_alert, '', '', '', true);
$form_filter .= "</td><td class='bolder'>".__('Standby').'</td><td>';
$sb_list = [];
$sb_list[1] = __('Standby on');
$sb_list[0] = __('Standby off');
$form_filter .= html_print_select($sb_list, 'standby', $standby, '', __('All'), -1, true);
$form_filter .= '</td>';
$form_filter .= "</td><td style='font-weight: bold;'>".__('Group').'</td><td>';
$form_filter .= "</td><td class='bolder''>".__('Group').'</td><td>';
$own_info = get_user_info($config['id_user']);
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
$return_all_group = false;
@ -144,6 +148,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_
$form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false);
$form_filter .= '</td></tr>';
if (defined('METACONSOLE')) {
$form_filter .= '<tr>';
$form_filter .= "<td colspan='6' align='right'>";
@ -153,7 +158,7 @@ if (defined('METACONSOLE')) {
$form_filter .= '</table>';
} else {
$form_filter .= '</table>';
$form_filter .= "<div style='text-align:right; height:100%;'>";
$form_filter .= "<div class='right height_100p'>";
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
$form_filter .= '</div>';
}
@ -174,8 +179,15 @@ $simple_alerts = [];
$total = 0;
$where = '';
if ($searchFlag) {
if ($status_alert === 'fired') {
$where .= ' AND talert_template_modules.times_fired > 0';
}
if ($status_alert === 'notfired') {
$where .= ' AND talert_template_modules.times_fired = 0';
}
if ($priority != -1 && $priority != '') {
$where .= ' AND id_alert_template IN (SELECT id FROM talert_templates WHERE priority = '.$priority.')';
}
@ -206,8 +218,12 @@ if ($searchFlag) {
$where .= ' AND talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action = '.$actionID.') OR talert_template_modules.id IN (SELECT id FROM talert_template_modules ttm WHERE ttm.id_alert_template IN (SELECT tat.id FROM talert_templates tat WHERE tat.id_alert_action = '.$actionID.'))';
}
if ($enabledisable != -1 && $enabledisable != '') {
$where .= ' AND talert_template_modules.disabled ='.$enabledisable;
if ($status_alert === 'disabled') {
$where .= ' AND talert_template_modules.disabled = 1';
}
if ($status_alert === 'all_enabled') {
$where .= ' AND talert_template_modules.disabled = 0';
}
if ($standby != -1 && $standby != '') {
@ -385,7 +401,7 @@ switch ($sortField) {
break;
}
$form_params = '&template_name='.$templateName.'&agent_name='.$agentName.'&module_name='.$moduleName.'&action_id='.$actionID.'&field_content='.$fieldContent.'&priority='.$priority.'&enabledisable='.$enabledisable.'&standby='.$standby.'&ag_group='.$ag_group;
$form_params = '&template_name='.$templateName.'&agent_name='.$agentName.'&module_name='.$moduleName.'&action_id='.$actionID.'&field_content='.$fieldContent.'&priority='.$priority.'&enabledisable='.$enabledisable.'&standby='.$standby.'&ag_group='.$ag_group.'&status_alert='.$status_alert;
$sort_params = '&sort_field='.$sortField.'&sort='.$sort;
if ($id_agente) {
@ -512,7 +528,7 @@ foreach ($simple_alerts as $alert) {
$data[0] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab='.$main_tab.'&id_agente='.$id_agent.'">';
if ($alert['disabled']) {
$data[0] .= '<span style="font-style: italic; color: #aaaaaa;">';
$data[0] .= '<span class="italic_a">';
}
$alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent);
@ -563,7 +579,14 @@ foreach ($simple_alerts as $alert) {
);
$data[2] .= ' <a class="template_details"
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
$data[2] .= html_print_image('images/zoom.png', true, ['id' => 'template-details-'.$alert['id_alert_template'], 'class' => 'img_help action_button_img']);
$data[2] .= html_print_image(
'images/zoom.png',
true,
[
'id' => 'template-details-'.$alert['id_alert_template'],
'class' => 'img_help action_button_img invert_filter',
]
);
$data[2] .= '</a> ';
if (check_acl($config['id_user'], $template_group, 'LW') || check_acl($config['id_user'], $template_group, 'LM')) {
@ -572,7 +595,7 @@ foreach ($simple_alerts as $alert) {
$actions = alerts_get_alert_agent_module_actions($alert['id']);
$data[3] = "<table style='width:100%;'>";
$data[3] = "<table class='w100p'>";
// Get and show default actions for this alert
$default_action = db_get_sql(
'SELECT id_alert_action
@ -587,12 +610,12 @@ foreach ($simple_alerts as $alert) {
}
foreach ($actions as $action_id => $action) {
$data[3] .= '<tr style="display: grid; grid-template-columns: 1fr 1fr; align-items: center;">';
$data[3] .= '<tr class="alert_action_list">';
$data[3] .= '<td>';
$data[3] .= '<ul class="action_list" style="display:inline;">';
$data[3] .= '<li style="display:inline;">';
$data[3] .= '<ul class="action_list inline_line">';
$data[3] .= '<li class="inline_line">';
if ($alert['disabled']) {
$data[3] .= '<font class="action_name" style="font-style: italic; color: #aaaaaa;">';
$data[3] .= '<font class="action_name italic_a">';
} else {
$data[3] .= '<font class="action_name">';
}
@ -626,12 +649,11 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '<td style=" display: flex; align-items: center;">';
$data[3] .= '<td class="flex_center">';
$data[3] .= ui_print_help_tip(__('The default actions will be executed every time that the alert is fired and no other action is executed'), true);
// Is possible manage actions if have LW permissions in the agent group of the alert module
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
// ~ $data[2] .= '<form method="post" action="' . $url . '" class="delete_link" style="display: inline; vertical-align: -50%;">';
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link" style="display: inline;">';
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link display_in">';
$data[3] .= html_print_input_image(
'delete',
'images/cross.png',
@ -640,7 +662,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Delete action'),
'class' => 'action_button_img',
'class' => 'action_button_img invert_filter',
]
);
$data[3] .= html_print_input_hidden('delete_action', 1, true);
@ -655,7 +677,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Update action'),
'class' => 'action_button_img',
'class' => 'action_button_img invert_filter',
'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')',
]
);
@ -666,7 +688,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</tr>';
}
$data[3] .= '<div id="update_action-div" style="display:none;text-align:left">';
$data[3] .= '<div id="update_action-div" class="invisible left">';
$data[3] .= '</div>';
$data[3] .= '</table>';
// Is possible manage actions if have LW permissions in the agent group of the alert module
@ -684,15 +706,15 @@ foreach ($simple_alerts as $alert) {
$actions = alerts_get_alert_actions_filter(true, 'id_group IN ('.$filter_groups.')');
}
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" style="display:none;text-align:left">';
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible left">';
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post">';
$data[3] .= '<table class="databox_color" style="width:100%">';
$data[3] .= '<table class="databox_color w100p">';
$data[3] .= html_print_input_hidden('add_action', 1, true);
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
if (! $id_agente) {
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Agent');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -702,7 +724,7 @@ foreach ($simple_alerts as $alert) {
}
$data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos bolder pdd_6px">';
$data[3] .= __('Module');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -710,7 +732,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Action');
$data[3] .= '</td>';
$data[3] .= '<td class="datos2">';
@ -718,7 +740,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos">';
$data[3] .= '<td class="datos" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos bolder pdd_6px">';
$data[3] .= __('Number of alerts match from');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
@ -742,7 +764,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '<tr class="datos2">';
$data[3] .= '<td class="datos2" style="font-weight:bold;padding:6px;">';
$data[3] .= '<td class="datos2 bolder pdd_6px">';
$data[3] .= __('Threshold');
$data[3] .= '</td>';
$data[3] .= '<td class="datos2">';
@ -766,7 +788,13 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '</td>';
$data[3] .= '</tr>';
$data[3] .= '</table>';
$data[3] .= html_print_submit_button(__('Add'), 'addbutton', false, ['class' => 'sub next', 'style' => 'float:right'], true);
$data[3] .= html_print_submit_button(
__('Add'),
'addbutton',
false,
['class' => 'sub next right'],
true
);
$data[3] .= '</form>';
$data[3] .= '</div>';
}
@ -775,12 +803,24 @@ foreach ($simple_alerts as $alert) {
1 => 'action_buttons',
4 => 'action_buttons',
];
$data[4] = '<form class="disable_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] = '<form class="disable_alert_form display_in" action="'.$url.'" method="post" >';
if ($alert['disabled']) {
$data[4] .= html_print_input_image('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true);
$data[4] .= html_print_input_image(
'enable',
'images/lightbulb_off.png',
1,
'padding:0px',
true
);
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else {
$data[4] .= html_print_input_image('disable', 'images/lightbulb.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'disable',
'images/lightbulb.png',
1,
'padding:0px;',
true
);
$data[4] .= html_print_input_hidden('disable_alert', 1, true);
}
@ -789,12 +829,26 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '<form class="standby_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] .= '<form class="standby_alert_form display_in" action="'.$url.'" method="post">';
if (!$alert['standby']) {
$data[4] .= html_print_input_image('standby_off', 'images/bell.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'standby_off',
'images/bell.png',
1,
'padding:0px;',
true,
['class' => 'invert_filter']
);
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
} else {
$data[4] .= html_print_input_image('standby_on', 'images/bell_pause.png', 1, 'padding:0px;', true);
$data[4] .= html_print_input_image(
'standby_on',
'images/bell_pause.png',
1,
'padding:0px;',
true,
['class' => 'invert_filter']
);
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
}
@ -809,7 +863,7 @@ foreach ($simple_alerts as $alert) {
if ($policyInfo === false) {
$data[1] .= '';
} else {
$img = 'images/policies.png';
$img = 'images/policies_mc.png';
$data[1] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id='.$policyInfo['id'].'">'.html_print_image($img, true, ['title' => $policyInfo['name']]).'</a>';
}
@ -818,7 +872,7 @@ foreach ($simple_alerts as $alert) {
// To manage alert is necessary LW permissions in the agent group
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
$data[4] .= '<form class="delete_alert_form" action="'.$url.'" method="post" style="display: inline;">';
$data[4] .= '<form class="delete_alert_form display_in" action="'.$url.'" method="post" >';
$is_cluster = (bool) get_parameter('id_cluster');
if (!$is_cluster) {
if ($alert['disabled']) {
@ -828,21 +882,23 @@ foreach ($simple_alerts as $alert) {
['title' => __('Add action')]
);
} else {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action')]);
$data[4] .= '</a>';
if ((int) $alert['id_policy_alerts'] === 0) {
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']);
$data[4] .= '</a>';
}
}
}
$data[4] .= html_print_input_image('delete', 'images/cross.png', 1, '', true, ['title' => __('Delete')]);
$data[4] .= html_print_input_image('delete', 'images/cross.png', 1, '', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('delete_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>';
if ($is_cluster) {
$data[4] .= '<form class="view_alert_form" method="post" style="display: inline;">';
$data[4] .= '<form class="view_alert_form display_in" method="post">';
$data[4] .= html_print_input_image('update', 'images/builder.png', 1, '', true, ['title' => __('Update')]);
$data[4] .= html_print_input_image('update', 'images/builder.png', 1, '', true, ['title' => __('Update'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('upd_alert', 1, true);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
@ -851,8 +907,8 @@ foreach ($simple_alerts as $alert) {
}
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
$data[4] .= '<form class="view_alert_form" method="post" style="display: inline;" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
$data[4] .= html_print_input_image('view_alert', 'images/eye.png', 1, '', true, ['title' => __('View alert advanced details')]);
$data[4] .= '<form class="view_alert_form display_in" method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
$data[4] .= html_print_input_image('view_alert', 'images/operation.png', 1, '', true, ['title' => __('View alert advanced details'), 'class' => 'invert_filter']);
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
$data[4] .= '</form>';
}
@ -927,37 +983,109 @@ if (! $id_agente) {
$("input[name=disable]").attr ("title", "<?php echo __('Disable'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb_off.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb_off.png',
true,
false,
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);
$("input[name=enable]").attr ("title", "<?php echo __('Enable'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/lightbulb_off.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/lightbulb_off.png',
true,
false,
true
).'"';
?>
);
}
);
$("input[name=standby_on]").attr ("title", "<?php echo __('Set off standby'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell_pause.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell_pause.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);
$("input[name=standby_off]").attr ("title", "<?php echo __('Set standby'); ?>")
.hover (function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell_pause.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell_pause.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
},
function () {
$(this).attr ("src", <?php echo '"'.html_print_image('images/bell.png', true, false, true).'"'; ?> );
$(this).attr ("src",
<?php
echo '"'.html_print_image(
'images/bell.png',
true,
['class' => 'invert_filter'],
true
).'"';
?>
);
}
);

View File

@ -65,6 +65,7 @@ $searchType = get_parameter('search_type', '');
$priority = get_parameter('priority', '');
$searchFlag = get_parameter('search', 0);
$enabledisable = get_parameter('enabledisable', '');
$status_alert = get_parameter('status_alert', '');
$standby = get_parameter('standby', '');
$pure = get_parameter('pure', 0);
$ag_group = get_parameter('ag_group', 0);
@ -433,11 +434,11 @@ if ($id_agente) {
$buttons = [
'list' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts')]).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts'), 'class' => 'invert_filter']).'</a>',
],
'builder' => [
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Builder alert')]).'</a>',
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pencil.png', true, ['title' => __('Builder alert'), 'class' => 'invert_filter']).'</a>',
],
];

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