Merge branch 'develop' into ent-9220-verificar-y-capar-en-su-caso-que-las-colecciones-no-funcionan-en-la-nms-2
This commit is contained in:
commit
54e4da7aad
|
@ -285,11 +285,16 @@ server_dependencies=" \
|
|||
java \
|
||||
bind-utils \
|
||||
whois \
|
||||
cpanminus \
|
||||
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.artica.es/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
|
||||
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
# install cpan dependencies
|
||||
execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore"
|
||||
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#######################################################
|
||||
## Tested versions ##
|
||||
# Centos 8.4, 8.5
|
||||
# Rocky 8.4, 8.5
|
||||
# Rocky 8.4, 8.5, 8.6, 8.7
|
||||
# Almalinuz 8.4, 8.5
|
||||
# RedHat 8.5
|
||||
|
||||
|
@ -14,24 +14,25 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='202209231'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$TZ" ] || TZ="Europe/Madrid"
|
||||
[ "$MYVER" ] || MYVER=57
|
||||
[ "$PHPVER" ] || PHPVER=8
|
||||
[ "$DBHOST" ] || DBHOST=127.0.0.1
|
||||
[ "$DBNAME" ] || DBNAME=pandora
|
||||
[ "$DBUSER" ] || DBUSER=pandora
|
||||
[ "$DBPASS" ] || DBPASS=pandora
|
||||
[ "$DBPORT" ] || DBPORT=3306
|
||||
[ "$DBROOTUSER" ] || DBROOTUSER=root
|
||||
[ "$DBROOTPASS" ] || DBROOTPASS=pandora
|
||||
[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0
|
||||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
|
||||
# Ansi color code variables
|
||||
|
@ -41,7 +42,6 @@ cyan="\e[0;36m"
|
|||
reset="\e[0m"
|
||||
|
||||
# Functions
|
||||
|
||||
execute_cmd () {
|
||||
local cmd="$1"
|
||||
local msg="$2"
|
||||
|
@ -76,7 +76,7 @@ check_cmd_status () {
|
|||
check_pre_pandora () {
|
||||
|
||||
echo -en "${cyan}Checking environment ... ${reset}"
|
||||
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
rpm -qa | grep -v "pandorawmic" | grep 'pandorafms_' &>> /dev/null && local fail=true
|
||||
[ -d "$PANDORA_CONSOLE" ] && local fail=true
|
||||
[ -f /usr/bin/pandora_server ] && local fail=true
|
||||
|
||||
|
@ -137,7 +137,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -467,6 +470,8 @@ query_cache_size = 64M
|
|||
query_cache_min_res_unit = 2k
|
||||
query_cache_limit = 256K
|
||||
|
||||
#skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
[mysqld_safe]
|
||||
|
@ -477,6 +482,7 @@ EO_CONFIG_F
|
|||
|
||||
if [ "$MYVER" -eq '80' ] ; then
|
||||
sed -i -e "/query_cache.*/ s/^#*/#/g" /etc/my.cnf
|
||||
sed -i -e "s/#skip-log-bin/skip-log-bin/g" /etc/my.cnf
|
||||
fi
|
||||
|
||||
execute_cmd "systemctl restart mysqld" "Configuring database engine"
|
||||
|
@ -485,11 +491,18 @@ fi
|
|||
export MYSQL_PWD=$DBPASS
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
fi
|
||||
|
||||
# if beta is enable
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://pandorafms.com/community/community-console-rpm-beta/"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
|
|
|
@ -16,7 +16,7 @@ PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
|||
WORKDIR=/opt/pandora/deploy
|
||||
|
||||
|
||||
S_VERSION='2022052501'
|
||||
S_VERSION='202301251'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
rm -f $LOGFILE &> /dev/null # remove last log before start
|
||||
|
||||
|
@ -34,6 +34,8 @@ rm -f $LOGFILE &> /dev/null # remove last log before start
|
|||
[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0
|
||||
[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g")
|
||||
[ "$PANDORA_BETA" ] || PANDORA_BETA=0
|
||||
[ "$PANDORA_LTS" ] || PANDORA_LTS=1
|
||||
|
||||
|
||||
# Ansi color code variables
|
||||
red="\e[0;91m"
|
||||
|
@ -134,7 +136,10 @@ check_root_permissions
|
|||
[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora
|
||||
|
||||
#advicing BETA PROGRAM
|
||||
[ "$PANDORA_BETA" -ne '0' ] && echo -e "${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
INSTALLING_VER="${green}RRR version enable using RRR PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_BETA" -ne '0' ] && INSTALLING_VER="${red}BETA version enable using nightly PandoraFMS packages${reset}"
|
||||
[ "$PANDORA_LTS" -ne '0' ] && INSTALLING_VER="${green}LTS version enable using LTS PandoraFMS packages${reset}"
|
||||
echo -e $INSTALLING_VER
|
||||
|
||||
# Connectivity
|
||||
check_repo_connection
|
||||
|
@ -272,14 +277,19 @@ echo -en "${cyan}Installing phantomjs...${reset}"
|
|||
/usr/bin/phantomjs --version &>> "$LOGFILE"
|
||||
check_cmd_status "Error Installing phanromjs"
|
||||
|
||||
# create symlink for fping
|
||||
rm -f /usr/sbin/fping &>> "$LOGFILE"
|
||||
ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
|
||||
|
||||
# Chrome
|
||||
rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
|
||||
execute_cmd "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" "Downloading google chrome"
|
||||
execute_cmd "apt install -y ./google-chrome-stable_current_amd64.deb" "Intalling google chrome"
|
||||
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
|
||||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
lib32z1 \
|
||||
vmware_dependencies="\
|
||||
lib32z1 \
|
||||
lib32z1 \
|
||||
build-essential \
|
||||
uuid uuid-dev \
|
||||
|
@ -350,16 +360,22 @@ systemctl stop apparmor &>> "$LOGFILE"
|
|||
systemctl disable apparmor &>> "$LOGFILE"
|
||||
|
||||
#install mysql
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password password $DBROOTPASS") &>> "$LOGFILE"
|
||||
debconf-set-selections <<< $(echo -n "mysql-server mysql-server/root_password_again password $DBROOTPASS") &>> "$LOGFILE"
|
||||
echo -en "${cyan}Installing MySql Server...${reset}"
|
||||
env DEBIAN_FRONTEND=noninteractive apt install -y mysql-server &>> "$LOGFILE"
|
||||
execute_cmd "curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb" "Downloading Percona repository for MySQL8"
|
||||
execute_cmd "apt install -y gnupg2 lsb-release ./percona-release_latest.generic_all.deb" "Installing Percona repository for MySQL8"
|
||||
execute_cmd "percona-release setup ps80" "Configuring Percona repository for MySQL8"
|
||||
|
||||
echo -en "${cyan}Installing Percona Server for MySQL8...${reset}"
|
||||
env DEBIAN_FRONTEND=noninteractive apt install -y percona-server-server &>> "$LOGFILE"
|
||||
check_cmd_status "Error Installing MySql Server"
|
||||
|
||||
|
||||
#Configuring Database
|
||||
if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then
|
||||
execute_cmd "systemctl start mysql" "Starting database engine"
|
||||
|
||||
echo """
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DBROOTPASS';
|
||||
""" | mysql -uroot &>> "$LOGFILE"
|
||||
|
||||
export MYSQL_PWD=$DBROOTPASS
|
||||
echo -en "${cyan}Creating Pandora FMS database...${reset}"
|
||||
|
@ -399,11 +415,12 @@ max_connections = 100
|
|||
|
||||
key_buffer_size=4M
|
||||
read_buffer_size=128K
|
||||
|
||||
read_rnd_buffer_size=128K
|
||||
sort_buffer_size=128K
|
||||
join_buffer_size=4M
|
||||
|
||||
skip-log-bin
|
||||
|
||||
sql_mode=""
|
||||
|
||||
log-error=/var/log/mysql/error.log
|
||||
|
@ -417,11 +434,17 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin
|
|||
|
||||
|
||||
#Define packages
|
||||
if [ "$PANDORA_BETA" -eq '0' ] ; then
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
elif [ "$PANDORA_BETA" -ne '0' ] ; then
|
||||
fi
|
||||
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.artica.es/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.artica.es/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.768-230124
|
||||
Version: 7.0NG.768-230203
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230124"
|
||||
pandora_version="7.0NG.768-230203"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.768';
|
||||
use constant AGENT_BUILD => '230124';
|
||||
use constant AGENT_BUILD => '230203';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230124"
|
||||
PI_BUILD="230203"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230124}
|
||||
{230203}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230124")
|
||||
#define PANDORA_VERSION ("7.0NG.768 Build 230203")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230124))"
|
||||
VALUE "ProductVersion", "(7.0NG.768(Build 230203))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.768-230124
|
||||
Version: 7.0NG.768-230203
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230124"
|
||||
pandora_version="7.0NG.768-230203"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -103,6 +103,15 @@ function api_execute(
|
|||
}
|
||||
}
|
||||
|
||||
$url_protocol = parse_url($url)['scheme'];
|
||||
|
||||
if ($url_protocol !== 'http' && $url_protocol !== 'https') {
|
||||
return [
|
||||
'url' => $url,
|
||||
'result' => '',
|
||||
];
|
||||
}
|
||||
|
||||
$curlObj = curl_init($url);
|
||||
if (empty($data) === false) {
|
||||
$url .= http_build_query($data);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tserver` ADD COLUMN `server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
||||
`id_filter` INT NOT NULL AUTO_INCREMENT,
|
||||
`id_name` TEXT NULL,
|
||||
|
@ -11,4 +13,15 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter` (
|
|||
PRIMARY KEY (`id_filter`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE INDEX `tusuario_perfil_user` ON `tusuario_perfil` (`id_usuario`);
|
||||
CREATE INDEX `tusuario_perfil_group` ON `tusuario_perfil` (`id_grupo`);
|
||||
CREATE INDEX `tusuario_perfil_profile` ON `tusuario_perfil` (`id_perfil`);
|
||||
CREATE INDEX `tlayout_data_layout` ON `tlayout_data` (`id_layout`);
|
||||
CREATE INDEX `taddress_agent_agent` ON `taddress_agent` (`id_agent`);
|
||||
CREATE INDEX `ttag_name` ON `ttag` (name(15));
|
||||
CREATE INDEX `tservice_element_service` ON `tservice_element` (`id_service`);
|
||||
CREATE INDEX `tservice_element_agent` ON `tservice_element` (`id_agent`);
|
||||
CREATE INDEX `tservice_element_am` ON `tservice_element` (`id_agente_modulo`);
|
||||
CREATE INDEX `tagent_module_log_agent` ON `tagent_module_log` (`id_agent`);
|
||||
|
||||
COMMIT;
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1996,7 +1996,7 @@ if ($create_module) {
|
|||
$agent = db_get_row('tagente', 'id_agente', $id_agente);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_AGENT_MANAGEMENT,
|
||||
"Added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']),
|
||||
"Added module '".db_escape_string_sql($name)."' for agent ".io_safe_output($agent['alias']),
|
||||
false,
|
||||
true,
|
||||
io_json_mb_encode($values)
|
||||
|
|
|
@ -1283,9 +1283,13 @@ foreach ($modules as $module) {
|
|||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
||||
// Check module relatonships to show warning message.
|
||||
$url = htmlentities('index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo']);
|
||||
|
||||
// Delete module.
|
||||
$data[9] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$module['id_agente_modulo'].'"
|
||||
onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[9] = '<a href="#"
|
||||
onClick="get_children_modules(false, \''.$module['id_agente_modulo'].'\', \''.$url.'\')">';
|
||||
|
||||
$data[9] .= html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
|
@ -1309,8 +1313,7 @@ foreach ($modules as $module) {
|
|||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module"
|
||||
onsubmit="if (! confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module" id="form_multiple_delete">';
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
@ -1344,6 +1347,8 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
@ -1352,7 +1357,18 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
<script type="text/javascript">
|
||||
|
||||
$(document).ready (function () {
|
||||
|
||||
|
||||
$("input[name=submit_modules_action]").click(function (event) {
|
||||
event.preventDefault();
|
||||
var module_action = $('#module_action').val();
|
||||
if(module_action !== 'delete') {
|
||||
$("#form_multiple_delete").submit();
|
||||
} else {
|
||||
get_children_modules(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('[id^=checkbox-id_delete]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
|
@ -1394,4 +1410,60 @@ if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
|||
window.location = window.location + "&checked=true";
|
||||
}
|
||||
}
|
||||
|
||||
function get_children_modules(multiple, id_module, url) {
|
||||
var selected_modules = [];
|
||||
|
||||
if(typeof(id_module) === 'undefined' && multiple === true) {
|
||||
$("input[id^='checkbox-id_delete']:checked").each(function () {
|
||||
selected_modules.push(this.value);
|
||||
});
|
||||
} else {
|
||||
selected_modules = [id_module];
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: 'include/ajax/module',
|
||||
get_children_modules: true,
|
||||
parent_modulues: JSON.parse(JSON.stringify(selected_modules)),
|
||||
},
|
||||
success: function (data) {
|
||||
delete_module_warning(data, multiple, id_module, url);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delete_module_warning(children, multiple, id_module, url) {
|
||||
var message = '<?php echo __('Are you sure?'); ?>';
|
||||
var ret = false;
|
||||
|
||||
if(children != false) {
|
||||
message += '<br><strong>' + '<?php echo __('This module has children modules.The following modules will also be deleted: '); ?>' + '</strong><ul>';
|
||||
$.each(children, function (key, value) {
|
||||
message += '<li>' + value['nombre'] + '</li>';
|
||||
});
|
||||
message += '</ul>';
|
||||
}
|
||||
|
||||
confirmDialog({
|
||||
title: "<?php echo __('Delete module'); ?>",
|
||||
message: message,
|
||||
onAccept: function() {
|
||||
if(multiple === true) {
|
||||
$("#form_multiple_delete").submit();
|
||||
return true;
|
||||
} else {
|
||||
window.location.href = url;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -393,7 +393,7 @@ $data[1] = html_print_input_text(
|
|||
$data[2] = __('Auth password').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||
$data[3] = html_print_input_password(
|
||||
'snmp3_auth_pass',
|
||||
$snmp3_auth_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -415,7 +415,7 @@ $data[1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_pr
|
|||
$data[2] = __('Privacy pass').ui_print_help_tip(__('The pass length must be eight character minimum.'), true);
|
||||
$data[3] = html_print_input_password(
|
||||
'snmp3_privacy_pass',
|
||||
$snmp3_privacy_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -711,6 +711,12 @@ $(document).ready (function () {
|
|||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
$('#password-snmp3_auth_pass').val('<?php echo $snmp3_auth_pass; ?>');
|
||||
$('#password-snmp3_privacy_pass').val('<?php echo $snmp3_privacy_pass; ?>');
|
||||
|
||||
observerInputPassword();
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ $table_simple->rowstyle['macro_field'] = 'display:none';
|
|||
|
||||
push_table_simple($data, 'macro_field');
|
||||
|
||||
$password_fields = [];
|
||||
|
||||
// If there are $macros, we create the form fields
|
||||
if (!empty($macros)) {
|
||||
$macros = json_decode($macros, true);
|
||||
|
@ -102,7 +104,8 @@ if (!empty($macros)) {
|
|||
}
|
||||
|
||||
if ($m_hide) {
|
||||
$data[1] = html_print_input_password($m['macro'], io_output_password($m['value']), '', 100, 1024, true);
|
||||
$data[1] = html_print_input_password($m['macro'], '', '', 100, 1024, true);
|
||||
array_push($password_fields, $m);
|
||||
} else {
|
||||
$data[1] = html_print_input_text(
|
||||
$m['macro'],
|
||||
|
@ -125,6 +128,17 @@ if (!empty($macros)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
foreach ($password_fields as $k => $p) {
|
||||
echo "
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
$('input[name=\"".$p['macro']."\"]').val('".$p['value']."');
|
||||
});
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function changePluginSelect() {
|
||||
|
@ -140,4 +154,8 @@ if (!empty($macros)) {
|
|||
|
||||
forced_title_callback();
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
observerInputPassword();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -116,7 +116,7 @@ $data[1] = html_print_input_text(
|
|||
$data[2] = __('Password');
|
||||
$data[3] = html_print_input_password(
|
||||
'plugin_pass',
|
||||
$plugin_pass,
|
||||
'',
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
|
@ -191,6 +191,11 @@ $(document).ready (function () {
|
|||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Add input password values with js to hide it in browser inspector.
|
||||
$('#password-plugin_pass').val('<?php echo $plugin_pass; ?>');
|
||||
|
||||
observerInputPassword();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -290,7 +290,7 @@ $search_text = (string) get_parameter('search_text');
|
|||
$date_from = (string) get_parameter('date_from');
|
||||
$date_to = (string) get_parameter('date_to');
|
||||
$execution_type = (string) get_parameter('execution_type');
|
||||
$show_archived = (bool) get_parameter('archived');
|
||||
$show_archived = (bool) get_parameter_switch('archived', false);
|
||||
$agent_id = (int) get_parameter('agent_id');
|
||||
$agent_name = (string) ((empty($agent_id) === false) ? get_parameter('agent_name') : '');
|
||||
$module_id = (int) get_parameter('module_name_hidden');
|
||||
|
@ -313,12 +313,20 @@ $table_form = new StdClass();
|
|||
$table_form->class = 'databox filters';
|
||||
$table_form->width = '100%';
|
||||
$table_form->rowstyle = [];
|
||||
$table_form->cellstyle[0] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
|
||||
$table_form->cellstyle[2] = ['width: 100px;'];
|
||||
$table_form->cellstyle[3] = ['text-align: right;'];
|
||||
$table_form->colspan[3][0] = 3;
|
||||
$table_form->data = [];
|
||||
|
||||
$row = [];
|
||||
|
||||
// Search text.
|
||||
$row[] = __('Search').' '.html_print_input_text(
|
||||
$row[] = __('Search');
|
||||
|
||||
$row[] = html_print_input_text(
|
||||
'search_text',
|
||||
$search_text,
|
||||
'',
|
||||
|
@ -356,7 +364,8 @@ $execution_type_fields = [
|
|||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron'),
|
||||
];
|
||||
$row[] = __('Execution type').' '.html_print_select(
|
||||
$row[] = __('Execution type');
|
||||
$row[] = html_print_select(
|
||||
$execution_type_fields,
|
||||
'execution_type',
|
||||
$execution_type,
|
||||
|
@ -368,11 +377,11 @@ $row[] = __('Execution type').' '.html_print_select(
|
|||
false
|
||||
);
|
||||
// Show past downtimes.
|
||||
$row[] = __('Show past downtimes').' '.html_print_checkbox(
|
||||
'archived',
|
||||
1,
|
||||
$show_archived,
|
||||
true
|
||||
$row[] = __('Show past downtimes').' '.html_print_switch(
|
||||
[
|
||||
'name' => 'archived',
|
||||
'value' => $show_archived,
|
||||
]
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
@ -388,8 +397,8 @@ $params['return'] = true;
|
|||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
$agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params);
|
||||
$row[] = $agent_input;
|
||||
$row[] = __('Agent');
|
||||
$row[] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
// Module.
|
||||
$row[] = __('Module').' '.html_print_autocomplete_modules(
|
||||
|
@ -402,6 +411,10 @@ $row[] = __('Module').' '.html_print_autocomplete_modules(
|
|||
true
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
$row[] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'search',
|
||||
|
|
|
@ -550,7 +550,22 @@ $table->data['form_agents_3'][3] = html_print_select(
|
|||
|
||||
|
||||
$table->data['edit0'][0] = __('Dynamic Interval');
|
||||
$table->data['edit0'][1] = html_print_extended_select_for_time('dynamic_interval', '', '', 'None', '0', 10, true, 'width:150px', false);
|
||||
$table->data['edit0'][1] = html_print_extended_select_for_time(
|
||||
'dynamic_interval',
|
||||
-2,
|
||||
'',
|
||||
'None',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:150px',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['edit0'][2] = '<table width="100%"><tr><td><em>'.__('Dynamic Min.').'</em></td>';
|
||||
$table->data['edit0'][2] .= '<td align="right">'.html_print_input_text('dynamic_min', '', '', 10, 255, true).'</td></tr>';
|
||||
$table->data['edit0'][2] .= '<tr><td><em>'.__('Dynamic Max.').'</em></td>';
|
||||
|
@ -2128,6 +2143,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
|||
}
|
||||
break;
|
||||
|
||||
case 'dynamic_interval':
|
||||
if ($value !== '-2') {
|
||||
$values[$field] = $value;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'plugin_pass':
|
||||
if ($value != '') {
|
||||
$values['plugin_pass'] = io_input_password($value);
|
||||
|
|
|
@ -865,6 +865,11 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
|||
var id_layout_data = $("#active_id_layout_data").val();
|
||||
var label = tinyMCE.activeEditor.getContent();
|
||||
$("#hidden-label_" + id_layout_data).val(label);
|
||||
},
|
||||
buttons: {
|
||||
Save: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ switch ($activeTab) {
|
|||
$background_color = (string) get_parameter('background_color');
|
||||
$width = (int) get_parameter('width');
|
||||
$height = (int) get_parameter('height');
|
||||
$visualConsoleName = (string) get_parameter('name');
|
||||
$visualConsoleName = io_safe_input((string) get_parameter('name'));
|
||||
$is_favourite = (int) get_parameter('is_favourite_sent');
|
||||
$auto_adjust = (int) get_parameter('auto_adjust_sent');
|
||||
|
||||
|
|
|
@ -230,9 +230,64 @@ if ($filemanager) {
|
|||
$directory = filemanager_safe_directory($directory, $fallback_directory);
|
||||
}
|
||||
|
||||
$base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin';
|
||||
$setup_url = $base_url.'&filemanager=1&tab=Attachments';
|
||||
$tab = get_parameter('tab', null);
|
||||
$tabs = [
|
||||
'list' => [
|
||||
'text' => '<a href="'.$base_url.'">'.html_print_image(
|
||||
'images/eye_show.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Plugins'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => (bool) ($tab != 'Attachments'),
|
||||
],
|
||||
'options' => [
|
||||
'text' => '<a href="'.$setup_url.'">'.html_print_image(
|
||||
'images/collection.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Attachments'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => (bool) ($tab == 'Attachments'),
|
||||
],
|
||||
];
|
||||
|
||||
if ($tab === 'Attachments') {
|
||||
$helpHeader = '';
|
||||
$titleHeader = __('Index of attachment/plugin');
|
||||
} else {
|
||||
$helpHeader = 'servers_ha_clusters_tab';
|
||||
$titleHeader = __('Plug-ins registered on %s', get_product_name());
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$titleHeader,
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
$helpHeader,
|
||||
false,
|
||||
$tabs,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Plugins'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$real_directory = realpath($config['homedir'].'/'.$directory);
|
||||
|
||||
echo '<h4>'.__('Index of %s', $directory).'</h4>';
|
||||
|
||||
$chunck_url = '&view='.$id_plugin;
|
||||
if ($id_plugin == 0) {
|
||||
|
@ -255,7 +310,7 @@ if ($filemanager) {
|
|||
filemanager_file_explorer(
|
||||
$real_directory,
|
||||
$directory,
|
||||
'index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$id_plugin,
|
||||
'index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$id_plugin.'&tab=Attachments',
|
||||
$fallback_directory,
|
||||
true,
|
||||
false,
|
||||
|
@ -401,7 +456,7 @@ if (($create != '') || ($view != '')) {
|
|||
$data[0] = __('Plugin command').ui_print_help_tip(__('Specify interpreter and plugin path. The server needs permissions to run it.'), true);
|
||||
$data[1] = '<input type="text" name="form_execute" id="form_execute" class="command_component command_advanced_conf text_input" size=100 value="'.$form_execute.'" >';
|
||||
|
||||
$data[1] .= ' <a href="index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&id_plugin='.$form_id.'" class="bot">';
|
||||
$data[1] .= ' <a href="index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&tab=Attachments&id_plugin='.$form_id.'" class="bot">';
|
||||
$data[1] .= html_print_image('images/file.png', true, ['class' => 'invert_filter'], false, true);
|
||||
$data[1] .= '</a>';
|
||||
$table->data['plugin_command'] = $data;
|
||||
|
@ -597,15 +652,60 @@ if (($create != '') || ($view != '')) {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__(
|
||||
'Plug-ins registered on %s',
|
||||
get_product_name()
|
||||
),
|
||||
$base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin';
|
||||
$setup_url = $base_url.'&filemanager=1&tab=Attachments';
|
||||
$tab = get_parameter('tab', null);
|
||||
$tabs = [
|
||||
'list' => [
|
||||
'text' => '<a href="'.$base_url.'">'.html_print_image(
|
||||
'images/eye_show.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Plugins'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => (bool) ($tab != 'Attachments'),
|
||||
],
|
||||
'options' => [
|
||||
'text' => '<a href="'.$setup_url.'">'.html_print_image(
|
||||
'images/collection.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Attachments'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => (bool) ($tab == 'Attachments'),
|
||||
],
|
||||
];
|
||||
|
||||
if ($tab === 'Attachments') {
|
||||
$helpHeader = '';
|
||||
$titleHeader = __('Index of attachment/plugin');
|
||||
} else {
|
||||
$helpHeader = 'servers_ha_clusters_tab';
|
||||
$titleHeader = __('Plug-ins registered on %s', get_product_name());
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$titleHeader,
|
||||
'images/gm_servers.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
$helpHeader,
|
||||
false,
|
||||
$tabs,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Plugins'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$management_allowed = is_management_allowed();
|
||||
|
|
|
@ -110,6 +110,12 @@ foreach ($servers as $server) {
|
|||
];
|
||||
$data[0] = '<span title="'.$server['version'].'">'.strip_tags($server['name']).'</span>';
|
||||
|
||||
$server_keepalive = time_w_fixed_tz($server['keepalive']);
|
||||
|
||||
if ($server['server_keepalive_utimestamp'] > 0) {
|
||||
$server_keepalive = $server['server_keepalive_utimestamp'];
|
||||
}
|
||||
|
||||
// Status.
|
||||
$data[1] = ui_print_status_image(STATUS_SERVER_OK, '', true);
|
||||
if ($server['status'] == -1) {
|
||||
|
@ -119,7 +125,7 @@ foreach ($servers as $server) {
|
|||
true
|
||||
);
|
||||
} else if ((int) ($server['status'] === 0)
|
||||
|| (($date - time_w_fixed_tz($server['keepalive'])) > ($server['server_keepalive']) * 2)
|
||||
|| (($date - $server_keepalive) > ($server['server_keepalive']) * 2)
|
||||
) {
|
||||
$data[1] = ui_print_status_image(
|
||||
STATUS_SERVER_DOWN,
|
||||
|
|
|
@ -87,6 +87,20 @@ $create_text_file = (bool) get_parameter('create_text_file');
|
|||
|
||||
$default_real_directory = realpath($config['homedir'].'/');
|
||||
|
||||
// Remove double dot in filename path.
|
||||
$file_name = $_FILES['file']['name'];
|
||||
$path_parts = explode('/', $file_name);
|
||||
|
||||
$stripped_parts = array_filter(
|
||||
$path_parts,
|
||||
function ($value) {
|
||||
return $value !== '..';
|
||||
}
|
||||
);
|
||||
|
||||
$stripped_path = implode('/', $stripped_parts);
|
||||
$_FILES['file']['name'] = $stripped_path;
|
||||
|
||||
if ($upload_file === true) {
|
||||
upload_file(
|
||||
$upload_file,
|
||||
|
|
|
@ -1353,11 +1353,8 @@ $values = [
|
|||
'Alert detail' => __('Alert detail'),
|
||||
'External link' => __('External link'),
|
||||
'Other' => __('Other'),
|
||||
'Dashboard' => __('Dashboard'),
|
||||
];
|
||||
if (!is_metaconsole()) {
|
||||
$values['Dashboard'] = __('Dashboard');
|
||||
}
|
||||
|
||||
|
||||
$home_screen .= html_print_select(
|
||||
$values,
|
||||
|
@ -1372,7 +1369,14 @@ $home_screen .= html_print_select(
|
|||
).'</div>';
|
||||
|
||||
|
||||
$dashboards = Manager::getDashboards(-1, -1);
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
Binary file not shown.
After Width: | Height: | Size: 668 KiB |
|
@ -1515,9 +1515,37 @@ if ($change_status === true) {
|
|||
}
|
||||
|
||||
if ($get_Acknowledged === true) {
|
||||
$event_id = get_parameter('event_id');
|
||||
echo events_page_general_acknowledged($event_id);
|
||||
return;
|
||||
$event_id = (int) get_parameter('event_id', 0);
|
||||
$server_id = (int) get_parameter('server_id', 0);
|
||||
|
||||
$return = '';
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
echo events_page_general_acknowledged($event_id);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$return = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if ($change_owner === true) {
|
||||
|
|
|
@ -340,7 +340,7 @@ if (is_ajax() === true) {
|
|||
|
||||
// Group.
|
||||
$secondary_groups = '';
|
||||
$secondary = agents_get_secondary_groups($data['id_agente']);
|
||||
$secondary = enterprise_hook('agents_get_secondary_groups', [$data['id_agente']]);
|
||||
if (isset($secondary['for_select']) === true && empty($secondary['for_select']) === false) {
|
||||
$secondary_groups = implode(', ', $secondary['for_select']);
|
||||
$secondary_groups = ', '.$secondary_groups;
|
||||
|
@ -353,19 +353,26 @@ if (is_ajax() === true) {
|
|||
|
||||
|
||||
// Events.
|
||||
echo '<div class="div-dialog">';
|
||||
echo graph_graphic_agentevents(
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1
|
||||
$result_graph_event = enterprise_hook(
|
||||
'graph_graphic_agentevents',
|
||||
[
|
||||
$id,
|
||||
100,
|
||||
40,
|
||||
SECONDS_1DAY,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
1,
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
if ($result_graph_event !== -1) {
|
||||
echo '<div class="div-dialog">';
|
||||
echo $result_graph_event;
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,8 @@ if (check_login()) {
|
|||
0
|
||||
);
|
||||
|
||||
$get_children_modules = (bool) get_parameter('get_children_modules', false);
|
||||
|
||||
$get_data_dataMatrix = (bool) get_parameter(
|
||||
'get_data_dataMatrix',
|
||||
0
|
||||
|
@ -1629,4 +1631,36 @@ if (check_login()) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_children_modules === true) {
|
||||
$parent_modules = get_parameter('parent_modulues', false);
|
||||
$children_selected = [];
|
||||
|
||||
if ($parent_modules === false) {
|
||||
$children_selected = false;
|
||||
} else {
|
||||
foreach ($parent_modules as $parent) {
|
||||
$child_modules = get_children_module($parent_modules, ['nombre', 'id_agente_modulo'], true);
|
||||
if ((bool) $child_modules === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($child_modules as $child) {
|
||||
$module_exist = in_array($child['id_agente_modulo'], $parent_modules);
|
||||
$child_exist = in_array($child, $children_selected);
|
||||
|
||||
if ($module_exist === false && $child_exist === false) {
|
||||
array_push($children_selected, $child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($children_selected) === true) {
|
||||
$children_selected = false;
|
||||
}
|
||||
|
||||
echo json_encode($children_selected);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -843,6 +843,7 @@ class AgentWizard extends HTML
|
|||
html_print_div(
|
||||
[
|
||||
'class' => 'white_box',
|
||||
'style' => 'padding: 20px',
|
||||
'content' => $this->printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
|
@ -2723,7 +2724,7 @@ class AgentWizard extends HTML
|
|||
'action' => $this->sectionUrl,
|
||||
'id' => 'form-filter-interfaces',
|
||||
'method' => 'POST',
|
||||
'class' => 'modal flex flex-row searchbox',
|
||||
'class' => 'modal searchbox',
|
||||
'extra' => '',
|
||||
];
|
||||
|
||||
|
@ -5476,6 +5477,19 @@ class AgentWizard extends HTML
|
|||
*/
|
||||
private function getInterfacesModulesx64(array $data=[])
|
||||
{
|
||||
$equivalencies_x86 = [
|
||||
'ifHCInOctets' => 'ifInOctets',
|
||||
'ifHCOutOctets' => 'ifOutOctets',
|
||||
'ifHCInUcastPkts' => 'ifInUcastPkts',
|
||||
'ifHCOutUcastPkts' => 'ifOutUcastPkts',
|
||||
'ifHCInNUcastPkts' => 'ifInNUcastPkts',
|
||||
'ifHCOutNUcastPkts' => 'ifOutNUcastPkts',
|
||||
];
|
||||
|
||||
foreach ($equivalencies_x86 as $key => $equivalencie) {
|
||||
$this->defaultSNMPValues[$key] = $this->defaultSNMPValues[$equivalencie];
|
||||
}
|
||||
|
||||
$moduleDescription = '';
|
||||
$name = '';
|
||||
$value = '1';
|
||||
|
|
|
@ -415,7 +415,7 @@ class AuditLog extends HTML
|
|||
var row = table.row(tr);
|
||||
|
||||
if (row.child.isShown()) {
|
||||
// This row is already open - close it
|
||||
// This row is already open - close it
|
||||
row.child.hide();
|
||||
tr.removeClass('shown');
|
||||
} else {
|
||||
|
@ -423,6 +423,8 @@ class AuditLog extends HTML
|
|||
row.child(format(row.data())).show();
|
||||
tr.addClass('shown');
|
||||
}
|
||||
$('#audit_logs').css('table-layout','fixed');
|
||||
$('#audit_logs').css('width','95% !important');
|
||||
});
|
||||
|
||||
$('#save-filter').click(function() {
|
||||
|
|
|
@ -900,7 +900,7 @@ class CalendarManager
|
|||
$id_group = get_parameter('id_group', null);
|
||||
$day_code = get_parameter('day_code', null);
|
||||
$id_calendar = get_parameter('id_calendar', null);
|
||||
$description = get_parameter('description', null);
|
||||
$description = io_safe_input(get_parameter('description', null));
|
||||
$change = true;
|
||||
if ($new === false
|
||||
&& ($date === $specialDay->date()
|
||||
|
|
|
@ -659,15 +659,6 @@ class Diagnostics extends Wizard
|
|||
{
|
||||
global $config;
|
||||
|
||||
// Size BBDD.
|
||||
$dbSizeSql = db_get_value_sql(
|
||||
'SELECT ROUND(SUM(data_length+index_length)/1024/1024,3)
|
||||
FROM information_schema.TABLES'
|
||||
);
|
||||
|
||||
// Add unit size.
|
||||
$dbSize = $dbSizeSql.' M';
|
||||
|
||||
$result = [
|
||||
'error' => false,
|
||||
'data' => [
|
||||
|
@ -683,10 +674,6 @@ class Diagnostics extends Wizard
|
|||
'name' => __('DB Schema Build'),
|
||||
'value' => $config['db_scheme_build'],
|
||||
],
|
||||
'dbSize' => [
|
||||
'name' => __('DB Size'),
|
||||
'value' => $dbSize,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC230124';
|
||||
$build_version = 'PC230203';
|
||||
$pandora_version = 'v7.0NG.768';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -226,7 +226,7 @@ function format_numeric($number, $decimals=1)
|
|||
global $config;
|
||||
|
||||
// Translate to float in case there are characters in the string so
|
||||
// fmod doesn't throw a notice
|
||||
// fmod doesn't throw a notice.
|
||||
$number = (float) $number;
|
||||
|
||||
if ($number == 0) {
|
||||
|
@ -234,10 +234,20 @@ function format_numeric($number, $decimals=1)
|
|||
}
|
||||
|
||||
if (fmod($number, 1) > 0) {
|
||||
return number_format($number, $decimals, $config['decimal_separator'], $config['thousand_separator']);
|
||||
return number_format(
|
||||
$number,
|
||||
$decimals,
|
||||
$config['decimal_separator'],
|
||||
($config['thousand_separator'] ?? ',')
|
||||
);
|
||||
}
|
||||
|
||||
return number_format($number, 0, $config['decimal_separator'], $config['thousand_separator']);
|
||||
return number_format(
|
||||
$number,
|
||||
0,
|
||||
$config['decimal_separator'],
|
||||
($config['thousand_separator'] ?? ',')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1369,12 +1369,14 @@ function agents_get_group_agents(
|
|||
'id_agente',
|
||||
'alias',
|
||||
'ta.id_tmetaconsole_setup AS id_server',
|
||||
'ta.disabled',
|
||||
];
|
||||
} else {
|
||||
$fields = [
|
||||
'ta.id_tagente AS id_agente',
|
||||
'alias',
|
||||
'ta.id_tmetaconsole_setup AS id_server',
|
||||
'ta.disabled',
|
||||
];
|
||||
}
|
||||
} else {
|
||||
|
@ -1383,6 +1385,7 @@ function agents_get_group_agents(
|
|||
$fields = [
|
||||
'id_agente',
|
||||
'alias',
|
||||
'disabled',
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1427,6 +1430,13 @@ function agents_get_group_agents(
|
|||
$value = mb_strtoupper($row['alias'], 'UTF-8');
|
||||
break;
|
||||
|
||||
case 'disabled':
|
||||
$value = $row['alias'];
|
||||
if ($row['disabled'] == 1) {
|
||||
$value .= ' ('.__('Disabled').')';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$value = $row['alias'];
|
||||
break;
|
||||
|
|
|
@ -12481,9 +12481,26 @@ function api_get_total_modules($id_group, $trash1, $trash2, $returnType)
|
|||
return;
|
||||
}
|
||||
|
||||
$partial = tactical_status_modules_agents($config['id_user'], false, 'AR');
|
||||
if ($id_group) {
|
||||
$groups_clause = '1 = 1';
|
||||
if (!users_is_admin($config['id_user'])) {
|
||||
$user_groups = implode(',', array_keys(users_get_groups()));
|
||||
$groups_clause = "(ta.id_grupo IN ($user_groups) OR tasg.id_group IN ($user_groups))";
|
||||
}
|
||||
|
||||
$total = (int) $partial['_monitor_total_'];
|
||||
$sql = "SELECT COUNT(DISTINCT(id_agente_modulo))
|
||||
FROM tagente_modulo tam, tagente ta
|
||||
LEFT JOIN tagent_secondary_group tasg
|
||||
ON ta.id_agente = tasg.id_agent
|
||||
WHERE tam.id_agente = ta.id_agente AND id_module_group = $id_group
|
||||
AND delete_pending = 0 AND $groups_clause";
|
||||
|
||||
$total = db_get_value_sql($sql);
|
||||
} else {
|
||||
$partial = tactical_status_modules_agents($config['id_user'], false, 'AR');
|
||||
|
||||
$total = (int) $partial['_monitor_total_'];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'type' => 'string',
|
||||
|
@ -14440,7 +14457,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
|||
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : 225;
|
||||
|
||||
// Graph width (optional).
|
||||
$width = (!empty($other) && isset($other['data'][4]) && $other['data'][4]) ? $other['data'][4] : '';
|
||||
$width = (!empty($other) && isset($other['data'][4]) && $other['data'][4]) ? $other['data'][4] : 600;
|
||||
|
||||
// If recive value its from mail call.
|
||||
$graph_font_size = $other['data'][5];
|
||||
|
|
|
@ -67,7 +67,7 @@ function config_create_value($token, $value)
|
|||
*
|
||||
* @return boolean True if success. False on failure.
|
||||
*/
|
||||
function config_update_value($token, $value, $noticed=false)
|
||||
function config_update_value($token, $value, $noticed=false, $password=false)
|
||||
{
|
||||
global $config;
|
||||
// Include functions_io to can call __() function.
|
||||
|
@ -91,7 +91,11 @@ function config_update_value($token, $value, $noticed=false)
|
|||
|
||||
if (isset($config[$token]) === false) {
|
||||
$config[$token] = $value;
|
||||
return (bool) config_create_value($token, io_safe_input($value));
|
||||
if (($password === false)) {
|
||||
return (bool) config_create_value($token, io_safe_input($value));
|
||||
} else {
|
||||
return (bool) config_create_value($token, io_input_password($value));
|
||||
}
|
||||
}
|
||||
|
||||
// If it has not changed.
|
||||
|
@ -104,7 +108,7 @@ function config_update_value($token, $value, $noticed=false)
|
|||
|
||||
$result = db_process_sql_update(
|
||||
'tconfig',
|
||||
['value' => io_safe_input($value)],
|
||||
['value' => ($password === false) ? io_safe_input($value) : io_input_password($value)],
|
||||
['token' => $token]
|
||||
);
|
||||
|
||||
|
|
|
@ -496,9 +496,13 @@ function events_update_status($id_evento, $status, $filter=null)
|
|||
// No groups option direct update.
|
||||
$update_sql = sprintf(
|
||||
'UPDATE tevento
|
||||
SET estado = %d
|
||||
SET estado = %d,
|
||||
ack_utimestamp = %d,
|
||||
id_usuario = "%s"
|
||||
WHERE id_evento = %d',
|
||||
$status,
|
||||
time(),
|
||||
$config['id_user'],
|
||||
$id_evento
|
||||
);
|
||||
break;
|
||||
|
@ -4732,7 +4736,7 @@ function events_page_general($event)
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Owner');
|
||||
if (empty($event['owner_user']) === true) {
|
||||
if ($event['owner_user'] == -1) {
|
||||
$data[1] = '<i>'.__('N/A').'</i>';
|
||||
} else {
|
||||
$user_owner = db_get_value(
|
||||
|
@ -4797,14 +4801,15 @@ function events_page_general($event)
|
|||
|
||||
$data = [];
|
||||
|
||||
$table_general->rowid[7] = 'general_status';
|
||||
$table_general->rowid[count($table_general->data)] = 'general_status';
|
||||
$table_general->cellclass[count($table_general->data)][1] = 'general_status';
|
||||
$data[0] = __('Status');
|
||||
$data[1] = $event_st['title'];
|
||||
$data[2] = html_print_image($event_st['img'], true);
|
||||
$table_general->data[] = $data;
|
||||
|
||||
// If event is validated, show who and when acknowleded it.
|
||||
$table_general->cellclass[8][1] = 'general_acknowleded';
|
||||
$table_general->cellclass[count($table_general->data)][1] = 'general_acknowleded';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Acknowledged by');
|
||||
|
@ -4825,7 +4830,17 @@ function events_page_general($event)
|
|||
}
|
||||
}
|
||||
|
||||
$data[1] = $user_ack.' ( '.date($config['date_format'], $event['ack_utimestamp_raw']).' ) ';
|
||||
$data[1] = $user_ack.' ( ';
|
||||
if ($event['ack_utimestamp_raw'] !== false
|
||||
&& $event['ack_utimestamp_raw'] !== 'false'
|
||||
) {
|
||||
$data[1] .= date(
|
||||
$config['date_format'],
|
||||
$event['ack_utimestamp_raw']
|
||||
);
|
||||
}
|
||||
|
||||
$data[1] .= ' ) ';
|
||||
} else {
|
||||
$data[1] = '<i>'.__('N/A').'</i>';
|
||||
}
|
||||
|
@ -4932,9 +4947,9 @@ function events_page_general_acknowledged($event_id)
|
|||
{
|
||||
global $config;
|
||||
$Acknowledged = '';
|
||||
$event = db_get_all_rows_filter('tevento', 'id_evento', $event_id);
|
||||
|
||||
if ($event) {
|
||||
$event = db_get_row('tevento', 'id_evento', $event_id);
|
||||
hd($event['ack_utimestamp'], true);
|
||||
if ($event !== false && $event['estado'] == 1) {
|
||||
$user_ack = db_get_value(
|
||||
'fullname',
|
||||
'tusuario',
|
||||
|
@ -4946,7 +4961,17 @@ function events_page_general_acknowledged($event_id)
|
|||
$user_ack = $config['id_user'];
|
||||
}
|
||||
|
||||
$Acknowledged = $user_ack.' ( '.date($config['date_format'], $event['ack_utimestamp_raw']).' ) ';
|
||||
$Acknowledged = $user_ack.' ( ';
|
||||
if ($event['ack_utimestamp'] !== false
|
||||
&& $event['ack_utimestamp'] !== 'false'
|
||||
) {
|
||||
$Acknowledged .= date(
|
||||
$config['date_format'],
|
||||
$event['ack_utimestamp']
|
||||
);
|
||||
}
|
||||
|
||||
$Acknowledged .= ' ) ';
|
||||
} else {
|
||||
$Acknowledged = 'N/A';
|
||||
}
|
||||
|
|
|
@ -139,8 +139,25 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_
|
|||
$nombre_archivo = sprintf('%s/%s', $real_directory, $filename);
|
||||
try {
|
||||
$mimeContentType = mime_content_type($_FILES['file']['tmp_name']);
|
||||
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
|
||||
|
||||
if (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true) {
|
||||
$validFileExtension = true;
|
||||
|
||||
if (empty($fileExtension) === false) {
|
||||
$filtered_types = array_filter(
|
||||
$filterFilesType,
|
||||
function ($value) use ($fileExtension) {
|
||||
$mimeTypeExtensionName = explode('/', $value)[1];
|
||||
return $mimeTypeExtensionName === $fileExtension;
|
||||
}
|
||||
);
|
||||
|
||||
if (empty($filtered_types) === true) {
|
||||
$validFileExtension = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($validFileExtension === true && (empty($filterFilesType) === true || in_array($mimeContentType, $filterFilesType) === true)) {
|
||||
$result = copy($_FILES['file']['tmp_name'], $nombre_archivo);
|
||||
} else {
|
||||
$error_message = 'The uploaded file is not allowed. Only gif, png or jpg files can be uploaded.';
|
||||
|
|
|
@ -508,6 +508,14 @@ function menu_add_extras(&$menu)
|
|||
$menu_extra['reporting']['sub']['enterprise/godmode/reporting/graph_template_wizard']['text'] = __('Graph template wizard');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard&action=wizard']['text'] = __('Templates wizard');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=template&action=list_template']['text'] = __('Templates');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&action=edit']['text'] = __('Edit custom reports');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=list_items&action=edit']['text'] = __('List items');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=item_editor&action=new']['text'] = __('Edit item');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard&action=edit']['text'] = __('Wizard');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=wizard_sla&action=edit']['text'] = __('Wizard sla');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=global&action=edit']['text'] = __('Global custom reports');
|
||||
$menu_extra['reporting']['sub']['godmode/reporting/reporting_builder&tab=advanced&action=edit']['text'] = __('Avanced options');
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
$menu_extra['godgismaps']['sub']['godmode/gis_maps/configure_gis_map']['text'] = __('Manage GIS Maps');
|
||||
}
|
||||
|
@ -811,6 +819,27 @@ if (is_ajax()) {
|
|||
);
|
||||
}
|
||||
|
||||
$image_about = ui_get_full_url('/images/custom_logo/logo-default-pandorafms.png', false, false, false);
|
||||
if (enterprise_installed() === false) {
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
$image_about = 'images/custom_logo/'.HEADER_LOGO_BLACK_CLASSIC;
|
||||
} else if ($config['style'] === 'pandora') {
|
||||
$image_about = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_CLASSIC;
|
||||
}
|
||||
} else {
|
||||
if ($config['style'] === 'pandora_black' && $config['custom_logo'] === HEADER_LOGO_DEFAULT_CLASSIC) {
|
||||
$config['custom_logo'] = HEADER_LOGO_BLACK_CLASSIC;
|
||||
} else if ($config['style'] === 'pandora' && $config['custom_logo'] === HEADER_LOGO_BLACK_CLASSIC) {
|
||||
$config['custom_logo'] = HEADER_LOGO_DEFAULT_CLASSIC;
|
||||
}
|
||||
|
||||
$image_about = 'images/custom_logo/'.$config['custom_logo'];
|
||||
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$image_about) === true) {
|
||||
$image_about = ENTERPRISE_DIR.'/'.$image_about;
|
||||
}
|
||||
}
|
||||
|
||||
$dialog = '
|
||||
<div id="about-tabs" class="invisible overflow-hidden">
|
||||
<ul>
|
||||
|
@ -827,7 +856,7 @@ if (is_ajax()) {
|
|||
<tbody>
|
||||
<tr>
|
||||
<th style="width: 40%;">
|
||||
<img src="'.ui_get_full_url('/images/custom_logo/'.$config['custom_logo'], false, false, false).'" alt="logo" width="70%">
|
||||
<img src="'.$image_about.'" alt="logo" width="70%">
|
||||
</th>
|
||||
<th style="width: 60%; text-align: left;">
|
||||
<h1>'.$product_name.'</h1>
|
||||
|
|
|
@ -3992,16 +3992,28 @@ function recursive_get_dt_from_modules_tree(&$f_modules, $modules, $deep)
|
|||
* Get the module data from a children
|
||||
*
|
||||
* @param integer $id_module Id module
|
||||
* @param boolean $recursive Recursive children search.
|
||||
* @return array Children module data
|
||||
*/
|
||||
function get_children_module($id_module)
|
||||
function get_children_module($id_module, $fields=false, $recursion=false)
|
||||
{
|
||||
$children_module_data = db_get_all_rows_sql(
|
||||
'SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE parent_module_id = '.$id_module
|
||||
$children_module_data = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['parent_module_id' => $id_module],
|
||||
$fields
|
||||
);
|
||||
|
||||
if ($children_module_data !== false && $recursion === true) {
|
||||
foreach ($children_module_data as $child) {
|
||||
$niece = get_children_module($child['id_agente_modulo'], $fields, false);
|
||||
if ((bool) $niece === false) {
|
||||
continue;
|
||||
} else {
|
||||
$children_module_data = array_merge($children_module_data, $niece);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $children_module_data;
|
||||
}
|
||||
|
||||
|
|
|
@ -257,6 +257,10 @@ function reporting_make_reporting_data(
|
|||
|
||||
$content['style'] = json_decode(io_safe_output($content['style']), true);
|
||||
|
||||
if (!empty($content['style']['event_filter_search'])) {
|
||||
$content['style']['event_filter_search'] = io_safe_input($content['style']['event_filter_search']);
|
||||
}
|
||||
|
||||
$graphs_to_macro = db_get_all_rows_field_filter(
|
||||
'tgraph_source',
|
||||
'id_graph',
|
||||
|
@ -8802,24 +8806,27 @@ function reporting_availability($report, $content, $date=false, $time=false)
|
|||
$data = [];
|
||||
|
||||
$style = io_safe_output($content['style']);
|
||||
if ($style['hide_notinit_agents']) {
|
||||
$aux_id_agents = $agents;
|
||||
$i = 0;
|
||||
foreach ($items as $item) {
|
||||
$utimestamp = db_get_value(
|
||||
'utimestamp',
|
||||
'tagente_datos',
|
||||
'id_agente_modulo',
|
||||
$item['id_agent_module'],
|
||||
true
|
||||
);
|
||||
if (($utimestamp === false)
|
||||
|| (intval($utimestamp) > intval($datetime_to))
|
||||
) {
|
||||
unset($items[$i]);
|
||||
}
|
||||
|
||||
$i++;
|
||||
if (is_array($style)) {
|
||||
if ($style['hide_notinit_agents']) {
|
||||
$aux_id_agents = $agents;
|
||||
$i = 0;
|
||||
foreach ($items as $item) {
|
||||
$utimestamp = db_get_value(
|
||||
'utimestamp',
|
||||
'tagente_datos',
|
||||
'id_agente_modulo',
|
||||
$item['id_agent_module'],
|
||||
true
|
||||
);
|
||||
if (($utimestamp === false)
|
||||
|| (intval($utimestamp) > intval($datetime_to))
|
||||
) {
|
||||
unset($items[$i]);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -478,8 +478,13 @@ function tactical_get_data(
|
|||
$list['_monitors_alerts_fired_'] = tactical_monitor_fired_alerts(explode(',', $user_groups_ids), $user_strict, explode(',', $user_groups_ids));
|
||||
$list['_monitors_alerts_'] = tactical_monitor_alerts($user_strict);
|
||||
|
||||
$filter_agents = [];
|
||||
if (users_is_admin() === false) {
|
||||
$filter_agents = ['id_grupo' => explode(',', $user_groups_ids)];
|
||||
}
|
||||
|
||||
$total_agentes = agents_get_agents(
|
||||
['id_grupo' => explode(',', $user_groups_ids)],
|
||||
$filter_agents,
|
||||
['count(DISTINCT id_agente) as total_agents'],
|
||||
'AR',
|
||||
false,
|
||||
|
|
|
@ -847,30 +847,38 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$permission = check_acl($config['id_user'], $agent['id_grupo'], 'RR');
|
||||
|
||||
if ($permission) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agente,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
if ($interface['traffic']['in'] > 0 && $interface['traffic']['out'] > 0) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agente,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
|
||||
if (defined('METACONSOLE') && !empty($server_id)) {
|
||||
$params['server'] = $server_id;
|
||||
if (defined('METACONSOLE') && !empty($server_id)) {
|
||||
$params['server'] = $server_id;
|
||||
}
|
||||
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$url = ui_get_full_url('operation/agentes/interface_traffic_graph_win.php', false, false, false);
|
||||
$graph_url = "$url?params=$params_encoded";
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('".$graph_url."','".$win_handle."', 800, 480)\">";
|
||||
$graph_link .= html_print_image(
|
||||
'images/chart_curve.png',
|
||||
true,
|
||||
['title' => __('Interface traffic')]
|
||||
);
|
||||
$graph_link .= '</a>';
|
||||
} else {
|
||||
$graph_link = html_print_image(
|
||||
'images/chart_curve.disabled.png',
|
||||
true,
|
||||
['title' => __('inOctets and outOctets must be enabled.')]
|
||||
);
|
||||
}
|
||||
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$url = ui_get_full_url('operation/agentes/interface_traffic_graph_win.php', false, false, false);
|
||||
$graph_url = "$url?params=$params_encoded";
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('".$graph_url."','".$win_handle."', 800, 480)\">";
|
||||
$graph_link .= html_print_image(
|
||||
'images/chart_curve.png',
|
||||
true,
|
||||
['title' => __('Interface traffic')]
|
||||
);
|
||||
$graph_link .= '</a>';
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
|
|
|
@ -6597,10 +6597,10 @@ function ui_print_comments($comments)
|
|||
$rest_time = (time() - $last_comment['utimestamp']);
|
||||
$time_last = (($rest_time / 60) / 60);
|
||||
|
||||
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], $config['thousand_separator']).' Hours ('.$last_comment['id_user'].'): '.$last_comment['comment'].'';
|
||||
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], ($config['thousand_separator'] ?? ',')).' Hours ('.$last_comment['id_user'].'): '.$last_comment['comment'].'';
|
||||
|
||||
if (strlen($comentario) > '200px') {
|
||||
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], $config['thousand_separator']).' Hours ('.$last_comment['id_user'].'): '.$short_comment.'...';
|
||||
$comentario = '<i>'.number_format($time_last, 0, $config['decimal_separator'], ($config['thousand_separator'] ?? ',')).' Hours ('.$last_comment['id_user'].'): '.$short_comment.'...';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,13 +142,21 @@ function users_get_groups_for_select(
|
|||
null
|
||||
);
|
||||
|
||||
if ($id_groups !== null) {
|
||||
$children = groups_get_children($id_groups);
|
||||
foreach ($children as $child) {
|
||||
unset($user_groups[$child['id_grupo']]);
|
||||
if ($id_groups !== null && empty($id_groups) === false) {
|
||||
$children = [];
|
||||
foreach ($id_groups as $key => $id_group) {
|
||||
$children[] = groups_get_children($id_group);
|
||||
}
|
||||
|
||||
unset($user_groups[$id_groups]);
|
||||
if (empty($children) === false) {
|
||||
foreach ($children as $child) {
|
||||
unset($user_groups[$child['id_grupo']]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($id_groups as $key => $id_group) {
|
||||
unset($user_groups[$id_group]);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($user_groups)) {
|
||||
|
|
|
@ -1387,9 +1387,7 @@ function dashboardLoadVC(settings) {
|
|||
);
|
||||
|
||||
if (settings.props.maintenanceMode != null) {
|
||||
if (settings.props.maintenanceMode.user !== settings.id_user) {
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
}
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
}
|
||||
|
||||
if (settings.mobile_view_orientation_vc === true) {
|
||||
|
|
|
@ -336,19 +336,17 @@ function event_change_status(event_ids, server_id) {
|
|||
}
|
||||
|
||||
if (data.status == "status_ok") {
|
||||
// if (typeof dt_events !== "undefined") {
|
||||
// dt_events.draw(false);
|
||||
// }
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: "include/ajax/events",
|
||||
get_Acknowledged: 1,
|
||||
event_id: event_ids
|
||||
event_id: event_ids,
|
||||
server_id: server_id
|
||||
},
|
||||
success: function(response) {
|
||||
$("#table4-9-1").html(response);
|
||||
$(".general_acknowleded").html(response);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -356,15 +354,6 @@ function event_change_status(event_ids, server_id) {
|
|||
.DataTable()
|
||||
.draw(false);
|
||||
$("#notification_status_success").show();
|
||||
if (new_status == 1) {
|
||||
$("#extended_event_general_page table td.general_acknowleded").text(
|
||||
data.user
|
||||
);
|
||||
} else {
|
||||
$("#extended_event_general_page table td.general_acknowleded").text(
|
||||
"N/A"
|
||||
);
|
||||
}
|
||||
|
||||
$("#general_status")
|
||||
.find(".general_status")
|
||||
|
|
|
@ -1685,3 +1685,17 @@ function changePlugin() {
|
|||
|
||||
$("#selected_plugin_description_" + moduleProtocol).html(pluginDescription);
|
||||
}
|
||||
|
||||
// Add observer to clear value when type attribute changes.
|
||||
function observerInputPassword() {
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.type === "attributes" && mutation.attributeName === "type") {
|
||||
mutation.target.value = "";
|
||||
}
|
||||
});
|
||||
});
|
||||
Array.from($("input[type=password]")).forEach(function(input) {
|
||||
observer.observe(input, { attributes: true });
|
||||
});
|
||||
}
|
||||
|
|
|
@ -117,13 +117,12 @@ function createVisualConsole(
|
|||
visualConsole.updateElements(items);
|
||||
}
|
||||
|
||||
if (
|
||||
visualConsole.props.maintenanceMode != null &&
|
||||
visualConsole.props.maintenanceMode.user !== id_user
|
||||
) {
|
||||
visualConsole.enableMaintenanceMode();
|
||||
} else {
|
||||
visualConsole.disableMaintenanceMode();
|
||||
if (window.location.pathname.indexOf("index.php") <= 0) {
|
||||
if (visualConsole.props.maintenanceMode != null) {
|
||||
visualConsole.enableMaintenanceMode();
|
||||
} else {
|
||||
visualConsole.disableMaintenanceMode();
|
||||
}
|
||||
}
|
||||
|
||||
// Emit the VC update event.
|
||||
|
|
|
@ -675,7 +675,8 @@ class Manager implements PublicLogin
|
|||
int $offset=-1,
|
||||
int $limit=-1,
|
||||
bool $favourite=false,
|
||||
bool $slideshow=false
|
||||
bool $slideshow=false,
|
||||
string $id_user=''
|
||||
):array {
|
||||
global $config;
|
||||
|
||||
|
@ -693,11 +694,15 @@ class Manager implements PublicLogin
|
|||
$sql_where .= 'AND td.cells_slideshow = 1';
|
||||
}
|
||||
|
||||
if (empty($id_user) === true) {
|
||||
$id_user = $config['id_user'];
|
||||
}
|
||||
|
||||
// Check ACl.
|
||||
if (\is_user_admin($config['id_user']) !== true) {
|
||||
if (\is_user_admin($id_user) !== true) {
|
||||
// Non-admin user can see dashboards of his groups and 'AR' profile.
|
||||
$group_list = \users_get_groups(
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
'RR',
|
||||
true
|
||||
);
|
||||
|
@ -727,7 +732,7 @@ class Manager implements PublicLogin
|
|||
GROUP BY td.id
|
||||
ORDER BY name%s",
|
||||
$string_groups,
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
$sql_where,
|
||||
$sql_limit
|
||||
);
|
||||
|
@ -746,7 +751,7 @@ class Manager implements PublicLogin
|
|||
WHERE td.id_group = 0 AND td.id_user = '%s' %s
|
||||
GROUP BY td.id
|
||||
ORDER BY name%s",
|
||||
$config['id_user'],
|
||||
$id_user,
|
||||
$sql_where,
|
||||
$sql_limit
|
||||
);
|
||||
|
|
|
@ -357,7 +357,7 @@ final class Container extends Model
|
|||
$config['dbpass'].$row['id'].$config['id_user']
|
||||
);
|
||||
|
||||
return \io_safe_output($row);
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,200 +15,383 @@
|
|||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font: bold 1em;
|
||||
font-size: 18px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
h2 {
|
||||
font: Verdana;
|
||||
font-size: 16px;
|
||||
@font-face {
|
||||
font-family: "Circular Std Book";
|
||||
src: url("../../fonts/CircularStd-Book.woff") format("woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
div#install_container {
|
||||
@font-face {
|
||||
font-family: "Circular Std";
|
||||
src: url("../../CircularStd-Medium.woff") format("woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
html {
|
||||
background-image: url("../../images/installer-background.jpg");
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
#install_container {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
margin-top: 45px;
|
||||
width: 650px;
|
||||
margin-top: 50px;
|
||||
background-color: #131727;
|
||||
color: white;
|
||||
font-family: "Circular Std Book";
|
||||
border-radius: 10px;
|
||||
}
|
||||
div#logo_img {
|
||||
#wizard {
|
||||
padding: 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.title {
|
||||
font-size: 40px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.subtitle {
|
||||
font-size: 30px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.text {
|
||||
font-size: 17px;
|
||||
}
|
||||
.content-footer {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.title-pandora {
|
||||
margin: 0px;
|
||||
font-size: 18px;
|
||||
}
|
||||
.steps {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.step {
|
||||
font-size: 17px;
|
||||
border: 1px solid #8a96a6;
|
||||
color: #8a96a6;
|
||||
border-radius: 30px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #666;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
div#wizard {
|
||||
text-align: left;
|
||||
margin-top: 1em;
|
||||
|
||||
width: 650px;
|
||||
padding-left: 0px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 20px;
|
||||
background-color: #ffffff;
|
||||
margin-top: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
.step.active {
|
||||
background-color: #82b92e;
|
||||
color: #ffffff;
|
||||
border-color: #82b92e;
|
||||
}
|
||||
|
||||
div#wizard a img {
|
||||
padding-right: 30px;
|
||||
.step-separator {
|
||||
min-width: 15px;
|
||||
margin: 0px 5px;
|
||||
border-color: #8a96a6;
|
||||
}
|
||||
|
||||
div#wizard > input {
|
||||
padding-right: 30px;
|
||||
float: right;
|
||||
.build-banner {
|
||||
color: #8a96a6;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
margin-left: 20px;
|
||||
}
|
||||
#foot_install {
|
||||
border-top: 1px solid white;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
div#install_box,
|
||||
div#install_img {
|
||||
padding-right: 20px;
|
||||
margin-top: 0px;
|
||||
width: 80%;
|
||||
margin: 0px auto;
|
||||
.signature {
|
||||
color: #8a96a6;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
margin-right: auto;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
div#install_box {
|
||||
background: F3F3F3;
|
||||
border: 1px solid #ccc;
|
||||
padding: 10px 25px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
div#install_box h2 {
|
||||
.link {
|
||||
color: #82b92e;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div#install_img {
|
||||
margin-bottom: 25px;
|
||||
margin-left: 25px;
|
||||
}
|
||||
div#foot_install {
|
||||
font-size: 7pt;
|
||||
color: #fff;
|
||||
margin-top: #000;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
div#foot_install a {
|
||||
color: #ccc;
|
||||
}
|
||||
input#step4,
|
||||
input#step4:hover {
|
||||
width: 70px;
|
||||
height: 16px;
|
||||
border: 0px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
div.warn {
|
||||
min-height: 24px;
|
||||
background: url(../../images/icono_warning_install.png) no-repeat 0% -2px;
|
||||
color: #222;
|
||||
margin-top: 14px;
|
||||
padding: 2px 1px 6px 40px;
|
||||
}
|
||||
div.info {
|
||||
min-height: 24px;
|
||||
background: url(../../images/icono_info_install.png) no-repeat 0% -2px;
|
||||
color: #222;
|
||||
margin-top: 14px;
|
||||
padding: 2px 1px 6px 40px;
|
||||
}
|
||||
div.err {
|
||||
min-height: 24px;
|
||||
background: url(../../images/icono_critical_install.png) no-repeat 0% -2px;
|
||||
color: #cc0000;
|
||||
margin-top: 14px;
|
||||
padding: 2px 1px 6px 40px;
|
||||
}
|
||||
span.arr {
|
||||
background: url(../../images/arrow.png) no-repeat;
|
||||
margin-top: 2px;
|
||||
margin-left: 5px;
|
||||
padding: 2px 1px 6px 15px;
|
||||
display: block;
|
||||
font-size: 8.5pt;
|
||||
}
|
||||
|
||||
body,
|
||||
td {
|
||||
font-size: 9pt;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #555555;
|
||||
}
|
||||
|
||||
div.installation_step {
|
||||
position: static;
|
||||
float: right;
|
||||
top: 7px;
|
||||
right: 10px;
|
||||
color: #666;
|
||||
margin-top: 14px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.btn_install_next {
|
||||
transition-property: background-color, color;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
-webkit-transition-duration: 1s;
|
||||
-o-transition-property: background-color, color;
|
||||
-o-transition-duration: 1s;
|
||||
margin: 10px;
|
||||
padding: 8px 20px 8px 20px;
|
||||
background-color: transparent;
|
||||
border: 1px solid #82b92e;
|
||||
font: 1em Verdana;
|
||||
font-size: 11pt;
|
||||
.signature a {
|
||||
color: #82b92e;
|
||||
border-radius: 0%;
|
||||
text-decoration: none;
|
||||
}
|
||||
.btn_install_next:hover {
|
||||
.btn_primary {
|
||||
color: white;
|
||||
background-color: #82b92e;
|
||||
border: 20px;
|
||||
font-size: 15px;
|
||||
border-radius: 6px;
|
||||
padding: 10px 20px;
|
||||
cursor: pointer;
|
||||
transition-property: background-color, color;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
-webkit-transition-duration: 1s;
|
||||
-o-transition-property: background-color, color;
|
||||
-o-transition-duration: 1s;
|
||||
text-decoration: none;
|
||||
}
|
||||
.btn_primary.outline {
|
||||
background-color: transparent;
|
||||
border: 1px solid white;
|
||||
}
|
||||
.info {
|
||||
background: #d6e2ff;
|
||||
color: #454545;
|
||||
font-size: 15px;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
margin: 25px 0px;
|
||||
}
|
||||
.info::before {
|
||||
content: "|";
|
||||
color: blue;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 77%;
|
||||
background: blue;
|
||||
border-radius: 12px;
|
||||
width: 4px;
|
||||
}
|
||||
.warn {
|
||||
background: #fffbdf;
|
||||
color: #454545;
|
||||
font-size: 15px;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
margin: 25px 0px;
|
||||
}
|
||||
.warn::before {
|
||||
content: "|";
|
||||
color: #dd9900;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 77%;
|
||||
background: #dd9900;
|
||||
border-radius: 12px;
|
||||
width: 4px;
|
||||
}
|
||||
.err {
|
||||
background: #fbdada;
|
||||
color: #454545;
|
||||
font-size: 15px;
|
||||
border-radius: 5px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
margin: 25px 0px;
|
||||
}
|
||||
.err::before {
|
||||
content: "|";
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
height: 77%;
|
||||
background: red;
|
||||
border-radius: 12px;
|
||||
width: 4px;
|
||||
}
|
||||
.check-table {
|
||||
background-color: #0f111b;
|
||||
color: #c1ccdc;
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.check-table td {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.incomplete {
|
||||
color: red;
|
||||
}
|
||||
.checked {
|
||||
color: #82b92e;
|
||||
}
|
||||
.row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
.reverse {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
.col-md-6 {
|
||||
width: 47%;
|
||||
position: relative;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.content-animation {
|
||||
display: flex;
|
||||
height: 94%;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 90%;
|
||||
}
|
||||
.content-animation::before {
|
||||
content: "";
|
||||
width: 120%;
|
||||
position: absolute;
|
||||
height: 103%;
|
||||
background-image: linear-gradient(225deg, #731dd854 0%, #2eb9b83d 100%);
|
||||
top: 0;
|
||||
left: 0;
|
||||
border-top-left-radius: 100px;
|
||||
}
|
||||
.popuphero {
|
||||
margin-top: 48px;
|
||||
margin-left: -26px;
|
||||
}
|
||||
|
||||
.popupgear1 img,
|
||||
.popupgear2 img {
|
||||
height: 176px;
|
||||
position: absolute;
|
||||
}
|
||||
.popupgear1 img {
|
||||
margin: 0px 0px 0px 129px;
|
||||
animation: rotar1 10s infinite linear;
|
||||
}
|
||||
.popupgear2 img {
|
||||
margin: 130px 0px 0px 0px;
|
||||
animation: rotar2 10s infinite linear;
|
||||
}
|
||||
.popuplaptop img {
|
||||
height: 352px;
|
||||
position: absolute;
|
||||
margin: 115px 0px 0px 0px;
|
||||
}
|
||||
.login {
|
||||
font-size: 14px;
|
||||
padding: 8px 10px;
|
||||
border-radius: 5px;
|
||||
border: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
.input-label {
|
||||
color: #8a96a6;
|
||||
font-size: 13px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.example-message {
|
||||
color: #8a96a6;
|
||||
font-size: 8px;
|
||||
}
|
||||
.login[type="checkbox"] {
|
||||
width: auto;
|
||||
}
|
||||
.table-config-database td {
|
||||
text-align: left;
|
||||
}
|
||||
.table-config-database td.inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.table-config-database td.inline .input-label {
|
||||
margin-left: 10px;
|
||||
}
|
||||
@keyframes rotar1 {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes rotar2 {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.col-md-6 {
|
||||
width: 100%;
|
||||
}
|
||||
.hide-phone {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* SWITCH */
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 33px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #ccc;
|
||||
-webkit-transition: 0.4s;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 19px;
|
||||
width: 19px;
|
||||
left: 0px;
|
||||
background-color: white;
|
||||
-webkit-transition: 0.4s;
|
||||
transition: 0.4s;
|
||||
transform: translateY(-50%);
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: #82b92e;
|
||||
}
|
||||
.btn_install_next_text {
|
||||
transition-property: background-color, color;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
-webkit-transition-duration: 1s;
|
||||
-o-transition-property: background-color, color;
|
||||
-o-transition-duration: 1s;
|
||||
color: #82b92e;
|
||||
}
|
||||
.btn_install_next:hover .btn_install_next_text {
|
||||
transition-property: background-color, color;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-out;
|
||||
-webkit-transition-property: background-color, color;
|
||||
-webkit-transition-duration: 1s;
|
||||
-o-transition-property: background-color, color;
|
||||
-o-transition-duration: 1s;
|
||||
color: white;
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #82b92e;
|
||||
}
|
||||
|
||||
:focus {
|
||||
outline: 0;
|
||||
input:checked + .slider:before {
|
||||
-webkit-transform: translate(15px, -50%);
|
||||
-ms-transform: translate(15px, -50%);
|
||||
transform: translate(15px, -50%);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
/* POPUP */
|
||||
.popup-lightbox {
|
||||
position: fixed;
|
||||
|
@ -218,6 +401,7 @@ div.installation_step {
|
|||
background-color: #000;
|
||||
opacity: 0.6;
|
||||
visibility: hidden;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.popup {
|
||||
|
@ -227,17 +411,22 @@ div.installation_step {
|
|||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
background-color: #fff;
|
||||
z-index: 9999;
|
||||
display: none;
|
||||
font-family: "Circular Std Book";
|
||||
}
|
||||
.popup .btn_primary.outline {
|
||||
color: #82b92e;
|
||||
border-color: #82b92e;
|
||||
margin: 0px 20px;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
background-color: #82b92e;
|
||||
padding: 10px 20px;
|
||||
color: #fff;
|
||||
font-size: 12pt;
|
||||
text-align: center;
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.popup-inner {
|
||||
|
@ -246,6 +435,7 @@ div.installation_step {
|
|||
/* overflow-y: scroll;*/
|
||||
padding: 25px 35px;
|
||||
font-size: 11pt;
|
||||
border-radius: 0px 0px 10px 10px;
|
||||
}
|
||||
|
||||
.popup-button-green {
|
||||
|
|
|
@ -6223,7 +6223,7 @@ div.text_message_dialog p {
|
|||
}
|
||||
|
||||
form#form-filter-interfaces {
|
||||
margin-left: -30px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
form#form-filter-interfaces ul {
|
||||
|
@ -6240,7 +6240,7 @@ form#form-filter-interfaces ul li {
|
|||
align-items: center;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
max-width: 35%;
|
||||
max-width: 45%;
|
||||
}
|
||||
|
||||
form#form-filter-interfaces ul li.select-interfaces {
|
||||
|
|
|
@ -1210,3 +1210,92 @@ input[type="image"] {
|
|||
.mono {
|
||||
font-family: source-code, mono, monospace;
|
||||
}
|
||||
|
||||
* table about dialog */ .table-about {
|
||||
background-color: #222 !important;
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border-color: #222 !important;
|
||||
}
|
||||
|
||||
.table-about th {
|
||||
background-color: #222 !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-about h1 {
|
||||
text-transform: none !important;
|
||||
font-size: 28px !important;
|
||||
color: white;
|
||||
margin-top: 34px;
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
.table-about h2 {
|
||||
text-transform: none !important;
|
||||
font-size: 15px !important;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 9px;
|
||||
color: #95a3bf;
|
||||
}
|
||||
|
||||
.table-about h2 span {
|
||||
color: #95a3bf;
|
||||
font-size: large;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.table-about p {
|
||||
color: white;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
margin: 7px;
|
||||
margin-left: 9px;
|
||||
}
|
||||
|
||||
.table-about p span {
|
||||
color: white;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
margin: 9px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.table-about p.about-last-p {
|
||||
padding-bottom: 17px;
|
||||
}
|
||||
|
||||
.table-about .about-last-tr {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
}
|
||||
|
||||
.about-copyright-div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
p.trademark-copyright {
|
||||
width: 90%;
|
||||
color: #8a96a6;
|
||||
font-size: 13px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 0px;
|
||||
text-align: center !important;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#about-tabs,
|
||||
#tab-general-view {
|
||||
padding-bottom: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
#about-tabs {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tab-database {
|
||||
height: 80%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1440,6 +1440,16 @@ if ($searchPage) {
|
|||
}
|
||||
}
|
||||
|
||||
if (__PAN_XHPROF__ === 1) {
|
||||
echo "<span style='font-size: 0.8em;'>";
|
||||
echo __('Page generated at').' ';
|
||||
echo date('D F d, Y H:i:s', $time).'</span>';
|
||||
echo ' - ( ';
|
||||
pandora_xhprof_display_result('node_index');
|
||||
echo ' )';
|
||||
echo '</center>';
|
||||
}
|
||||
|
||||
if ($config['pure'] == 0) {
|
||||
echo '<div id="both"></div>';
|
||||
echo '</div>';
|
||||
|
@ -1623,7 +1633,3 @@ require 'include/php_to_js_values.php';
|
|||
);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
if (__PAN_XHPROF__ === 1) {
|
||||
pandora_xhprof_display_result('node_index');
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -53,7 +53,7 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
|||
|
||||
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
$filter = get_parameter('filter', 'all_enabled');
|
||||
$disabled = get_parameter('disabled', 'all_enabled');
|
||||
$filter_standby = get_parameter('standby', 'all');
|
||||
$id_group = (int) get_parameter('ag_group', 0);
|
||||
// 0 is the All group (selects all groups)
|
||||
|
@ -113,7 +113,7 @@ $tab = get_parameter_get('tab', null);
|
|||
$refr = (int) get_parameter('refr', 0);
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$refr.'&filter='.$filter.'&filter_standby='.$filter_standby.'&ag_group='.$id_group.'&tag_filter='.$tag_filter.'&action_filter='.$action_filter;
|
||||
$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$refr.'&disabled='.$disabled.'&filter_standby='.$filter_standby.'&ag_group='.$id_group.'&tag_filter='.$tag_filter.'&action_filter='.$action_filter;
|
||||
|
||||
if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, 'AW')) {
|
||||
forceExecution($id_group);
|
||||
|
@ -418,7 +418,7 @@ if ($agent_view_page === true) {
|
|||
'form' => [
|
||||
'html' => printFormFilterAlert(
|
||||
$id_group,
|
||||
$filter,
|
||||
$disabled,
|
||||
$free_search,
|
||||
$url,
|
||||
$filter_standby,
|
||||
|
|
|
@ -68,13 +68,16 @@ function print_filters($sec)
|
|||
]
|
||||
);
|
||||
|
||||
$table->data[1][0] = __('Agents');
|
||||
$table->data[1][0] = __('Filter Agents');
|
||||
$table->data[1][1] = html_print_input_text('filter_agents', '', '', 20, 255, true);
|
||||
|
||||
$table->data[2][0] = __('Agents');
|
||||
|
||||
if (empty($agents) === true || $agents == -1) {
|
||||
$agents = [];
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select(
|
||||
$table->data[2][1] = html_print_select(
|
||||
[],
|
||||
'selected_agents[]',
|
||||
'',
|
||||
|
@ -90,8 +93,8 @@ function print_filters($sec)
|
|||
);
|
||||
|
||||
// Interfaces.
|
||||
$table->data[1][3] = '<b>'.__('Interfaces').'</b>';
|
||||
$table->data[1][4] = html_print_select(
|
||||
$table->data[2][3] = '<b>'.__('Interfaces').'</b>';
|
||||
$table->data[2][4] = html_print_select(
|
||||
[],
|
||||
'selected_interfaces[]',
|
||||
$selected_interfaces,
|
||||
|
@ -536,8 +539,10 @@ function print_table(
|
|||
$select_if_usage_module_data_out_down
|
||||
);
|
||||
|
||||
$table->head[8] = __('Last data');
|
||||
$table->head[8] .= ui_get_sorting_arrows(
|
||||
$table->head[8] = __('Graph');
|
||||
|
||||
$table->head[9] = __('Last data');
|
||||
$table->head[9] .= ui_get_sorting_arrows(
|
||||
$last_data.'up',
|
||||
$last_data.'down',
|
||||
$select_if_last_data_up,
|
||||
|
@ -677,6 +682,42 @@ function print_table(
|
|||
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
|
||||
}
|
||||
|
||||
$all_groups = agents_get_all_groups_agent($agent_interfaces['agent_id']);
|
||||
$permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR');
|
||||
|
||||
if ($permission) {
|
||||
if ($agent_interfaces['traffic']['in'] > 0 && $agent_interfaces['traffic']['out'] > 0) {
|
||||
$params = [
|
||||
'interface_name' => $agent_interfaces['if_name'],
|
||||
'agent_id' => $agent_interfaces['agent_id'],
|
||||
'traffic_module_in' => $agent_interfaces['traffic']['in'],
|
||||
'traffic_module_out' => $agent_interfaces['traffic']['out'],
|
||||
];
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$agent_interfaces['if_name']));
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('operation/agentes/interface_traffic_graph_win.php?params=";
|
||||
$graph_link .= $params_encoded."','";
|
||||
$graph_link .= $win_handle."', 800, 480)\">";
|
||||
$graph_link .= html_print_image(
|
||||
'images/chart.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Interface traffic'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
} else {
|
||||
$graph_link = html_print_image(
|
||||
'images/chart_curve.disabled.png',
|
||||
true,
|
||||
['title' => __('inOctets and outOctets must be enabled.')]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
|
||||
$table_data[$loop_index]['if_name'] = $agent_interfaces['if_name'];
|
||||
$table_data[$loop_index]['if_status_image'] = $agent_interfaces['status_image'];
|
||||
$table_data[$loop_index]['if_speed_data'] = ($if_speed_value === null) ? __('N/A') : $if_speed_value.' '.$if_speed_unit;
|
||||
|
@ -684,6 +725,7 @@ function print_table(
|
|||
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
|
||||
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
|
||||
$table_data[$loop_index]['if_graph'] = $graph_link;
|
||||
$table_data[$loop_index]['if_last_data'] = human_time_comparation($agent_interfaces['last_contact']);
|
||||
|
||||
$loop_index++;
|
||||
|
|
|
@ -137,6 +137,7 @@ $(document).ready(function() {
|
|||
if (sec === 'estado' && agent_id > 0) {
|
||||
load_agent_interfaces_selector([agent_id]);
|
||||
}
|
||||
$("#selected_agents").filterByText($("#text-filter_agents"));
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -1265,16 +1265,24 @@ if (is_ajax() === true) {
|
|||
$permission = check_acl($config['id_user'], $agent['id_grupo'], 'RR');
|
||||
|
||||
if ($permission) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agent,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('operation/agentes/interface_traffic_graph_win.php?params=$params_encoded','$win_handle', 800, 480)\">".html_print_image('images/chart_curve.png', true, ['title' => __('Interface traffic')]).'</a>';
|
||||
if ($interface['traffic']['in'] > 0 && $interface['traffic']['out'] > 0) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agent,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('operation/agentes/interface_traffic_graph_win.php?params=$params_encoded','$win_handle', 800, 480)\">".html_print_image('images/chart_curve.png', true, ['title' => __('Interface traffic')]).'</a>';
|
||||
} else {
|
||||
$graph_link = html_print_image(
|
||||
'images/chart_curve.disabled.png',
|
||||
true,
|
||||
['title' => __('inOctets and outOctets must be enabled.')]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
|
|
|
@ -1411,8 +1411,8 @@ $agent_interfaces = agents_get_network_interfaces(
|
|||
|
||||
if (isset($agent_interfaces) !== true
|
||||
|| isset($agent_interfaces[$id_agente]) !== true
|
||||
|| is_array($agent_interfaces[$id_agente]['interfaces']) !== true
|
||||
|| is_object($agent_interfaces[$id_agente]['interfaces']) !== true
|
||||
|| (is_array($agent_interfaces[$id_agente]['interfaces']) !== true
|
||||
&& is_object($agent_interfaces[$id_agente]['interfaces']) !== true)
|
||||
) {
|
||||
$agent_interfaces_count = 0;
|
||||
} else {
|
||||
|
|
|
@ -524,7 +524,7 @@ if (is_ajax() === true) {
|
|||
$tmp->ack_utimestamp_raw = strtotime($tmp->ack_utimestamp);
|
||||
|
||||
$tmp->ack_utimestamp = ui_print_timestamp(
|
||||
(int) $tmp->ack_utimestamp,
|
||||
(empty($tmp->ack_utimestamp) === true) ? 0 : $tmp->ack_utimestamp,
|
||||
true
|
||||
);
|
||||
$tmp->timestamp = ui_print_timestamp(
|
||||
|
@ -1475,7 +1475,24 @@ if ($pure) {
|
|||
|
||||
// Sound events.
|
||||
$sound_event['active'] = false;
|
||||
$sound_event['text'] = '<a href="javascript: openSoundEventWindow();">'.html_print_image(
|
||||
|
||||
// Sound Events.
|
||||
$data_sound = base64_encode(
|
||||
json_encode(
|
||||
[
|
||||
'title' => __('Sound Console'),
|
||||
'start' => __('Start'),
|
||||
'stop' => __('Stop'),
|
||||
'noAlert' => __('No alert'),
|
||||
'silenceAlarm' => __('Silence alarm'),
|
||||
'url' => ui_get_full_url('ajax.php'),
|
||||
'page' => 'include/ajax/events',
|
||||
'urlSound' => 'include/sounds/',
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$sound_event['text'] = '<a href="javascript: openSoundEventModal(`'.$data_sound.'`);">'.html_print_image(
|
||||
'images/sound.png',
|
||||
true,
|
||||
[
|
||||
|
@ -1565,27 +1582,6 @@ if ($pure) {
|
|||
unset($onheader['fullscreen']);
|
||||
ui_meta_print_header(__('Events'), $section_string, $onheader);
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function openSoundEventWindow() {
|
||||
url = '<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>';
|
||||
// devicePixelRatio knows how much zoom browser applied.
|
||||
var windowScale = parseFloat(window.devicePixelRatio);
|
||||
var defaultWidth = 630;
|
||||
var defaultHeight = 630;
|
||||
// If the scale is 1, no zoom has been applied.
|
||||
var windowWidth = windowScale <= 1 ? defaultWidth : windowScale*defaultWidth;
|
||||
var windowHeight = windowScale <= 1 ? defaultHeight : windowScale*defaultHeight + (defaultHeight*0.1);
|
||||
|
||||
window.open(
|
||||
url,
|
||||
'<?php __('Sound Alerts'); ?>',
|
||||
'width='+windowWidth+', height='+windowHeight+', resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
|
|
|
@ -320,6 +320,7 @@ try {
|
|||
$rss .= xml_entry('link', $url.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agente']);
|
||||
}
|
||||
|
||||
$rss .= xml_entry('author', $row['agent_name']);
|
||||
$rss .= xml_entry('comments', $row['']);
|
||||
$rss .= xml_entry('pubDate', $row['timestamp']);
|
||||
$rss .= xml_entry('category', $row['source']);
|
||||
|
|
|
@ -457,26 +457,6 @@ if ($access_console_node === true) {
|
|||
|
||||
ui_require_javascript_file('pandora_events');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function openSoundEventWindow() {
|
||||
url = '<?php echo ui_get_full_url('operation/events/sound_events.php'); ?>';
|
||||
// devicePixelRatio knows how much zoom browser applied.
|
||||
var windowScale = parseFloat(window.devicePixelRatio);
|
||||
var defaultWidth = 630;
|
||||
var defaultHeight = 630;
|
||||
// If the scale is 1, no zoom has been applied.
|
||||
var windowWidth = windowScale <= 1 ? defaultWidth : windowScale*defaultWidth;
|
||||
var windowHeight = windowScale <= 1 ? defaultHeight : windowScale*defaultHeight + (defaultHeight*0.1);
|
||||
|
||||
window.open(
|
||||
url,
|
||||
'<?php __('Sound Alerts'); ?>',
|
||||
'width='+windowWidth+', height='+windowHeight+', resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no'
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
$menu_operation['eventos']['sub'] = $sub;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ global $config;
|
|||
$headerTitle = __('User detail editor');
|
||||
// Load the header.
|
||||
require $config['homedir'].'/operation/users/user_edit_header.php';
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
include 'include/javascript/timezonepicker/includes/parser.inc';
|
||||
|
@ -442,7 +443,13 @@ if (!$meta) {
|
|||
|
||||
$home_screen .= html_print_select($values, 'section', io_safe_output($user_info['section']), 'show_data_section();', '', -1, true, false, false).'</div>';
|
||||
|
||||
$dashboards = get_user_dashboards($config['id_user']);
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$config['id_user']
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
|
|
|
@ -282,9 +282,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
);
|
||||
|
||||
if(props.maintenanceMode != null) {
|
||||
if(props.maintenanceMode.user !== '<?php echo $config['id_user']; ?>') {
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
}
|
||||
visualConsoleManager.visualConsole.enableMaintenanceMode();
|
||||
}
|
||||
|
||||
var controls = document.getElementById('vc-controls');
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -42,7 +42,8 @@ CREATE TABLE IF NOT EXISTS `taddress_agent` (
|
|||
`id_ag` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_a` BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`id_agent` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id_ag`)
|
||||
PRIMARY KEY (`id_ag`),
|
||||
INDEX `taddress_agent_agent` (`id_agent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1157,6 +1158,7 @@ CREATE TABLE IF NOT EXISTS `tserver` (
|
|||
`stat_utimestamp` BIGINT NOT NULL DEFAULT 0,
|
||||
`exec_proxy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`port` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`server_keepalive_utimestamp` BIGINT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id_server`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
@ -1333,7 +1335,10 @@ CREATE TABLE IF NOT EXISTS `tusuario_perfil` (
|
|||
`assigned_by` VARCHAR(100) NOT NULL DEFAULT '',
|
||||
`id_policy` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`tags` TEXT,
|
||||
PRIMARY KEY (`id_up`)
|
||||
PRIMARY KEY (`id_up`),
|
||||
INDEX `tusuario_perfil_user` (`id_usuario`),
|
||||
INDEX `tusuario_perfil_group` (`id_grupo`),
|
||||
INDEX `tusuario_perfil_profile` (`id_perfil`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
|
@ -1731,7 +1736,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` (
|
|||
`show_last_value` TINYINT UNSIGNED NULL DEFAULT 0,
|
||||
`cache_expiration` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`title` TEXT ,
|
||||
PRIMARY KEY(`id`)
|
||||
PRIMARY KEY(`id`),
|
||||
INDEX `tlayout_data_layout` (`id_layout`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -2136,7 +2142,8 @@ CREATE TABLE IF NOT EXISTS `ttag` (
|
|||
`email` TEXT NULL,
|
||||
`phone` TEXT NULL,
|
||||
`previous_name` TEXT NULL,
|
||||
PRIMARY KEY (`id_tag`)
|
||||
PRIMARY KEY (`id_tag`),
|
||||
INDEX `ttag_name` (name(15))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
|
@ -2867,7 +2874,10 @@ CREATE TABLE IF NOT EXISTS `tservice_element` (
|
|||
`id_server_meta` INT unsigned NOT NULL DEFAULT 0,
|
||||
`rules` TEXT,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `IDX_tservice_element` (`id_service`,`id_agente_modulo`)
|
||||
INDEX `IDX_tservice_element` (`id_service`,`id_agente_modulo`),
|
||||
INDEX `tservice_element_service` (`id_service`),
|
||||
INDEX `tservice_element_agent` (`id_agent`),
|
||||
INDEX `tservice_element_am` (`id_agente_modulo`)
|
||||
) ENGINE=InnoDB
|
||||
COMMENT = 'Table to define the modules and the weights of the modules that define a service'
|
||||
DEFAULT CHARSET=UTF8MB4;
|
||||
|
@ -3345,7 +3355,8 @@ CREATE TABLE IF NOT EXISTS `tagent_module_log` (
|
|||
`source` TEXT,
|
||||
`timestamp` DATETIME DEFAULT '1970-01-01 00:00:00',
|
||||
`utimestamp` BIGINT DEFAULT 0,
|
||||
PRIMARY KEY (`id_agent_module_log`)
|
||||
PRIMARY KEY (`id_agent_module_log`),
|
||||
INDEX `tagent_module_log_agent` (`id_agent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -140,7 +140,7 @@ $inputs[] = [
|
|||
'type' => 'textarea',
|
||||
'name' => 'description',
|
||||
'required' => false,
|
||||
'value' => $specialDay->description(),
|
||||
'value' => io_safe_output($specialDay->description()),
|
||||
'rows' => 50,
|
||||
'columns' => 30,
|
||||
],
|
||||
|
|
|
@ -0,0 +1,579 @@
|
|||
import ibm_db
|
||||
import re
|
||||
import argparse,sys,re,json,os,traceback,hashlib
|
||||
from datetime import datetime
|
||||
import subprocess
|
||||
|
||||
__author__ = "Alejandro Sánchez Carrion"
|
||||
__copyright__ = "Copyright 2022, PandoraFMS"
|
||||
__maintainer__ = "Operations department"
|
||||
__status__ = "Production"
|
||||
__version__= '1.0'
|
||||
|
||||
info = f"""
|
||||
Pandora FMS DB2
|
||||
Version = {__version__}
|
||||
|
||||
Manual execution
|
||||
|
||||
./pandora_informix --hostname <host> --port <port> --uid <user> --database <database> --password <password> --conf <path conf> --as_agent_plugin 1
|
||||
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser(description= info, formatter_class=argparse.RawTextHelpFormatter)
|
||||
|
||||
parser.add_argument('--database', help="database name",default="sysmaster")
|
||||
parser.add_argument('--hostname', help="IP")
|
||||
parser.add_argument('--port', help="default:9089")
|
||||
parser.add_argument('--uid', help="user")
|
||||
parser.add_argument('--password', help="password")
|
||||
|
||||
parser.add_argument('--default_metrics', help="",type=int,default=1)
|
||||
parser.add_argument('--conf', help='path for the file with the queries')
|
||||
|
||||
parser.add_argument('--agent_name', help='agent name', default= "Informix")
|
||||
parser.add_argument('-a','--agent_alias', help='Name of the agent to store monitoring, default=p: informix', default= "Informix")
|
||||
parser.add_argument('-A', '--use_alias_as_name', help='Use Agent Alias as Agent Name name', action='store_true')
|
||||
parser.add_argument('-m', '--module_prefix', help='PandoraFMS module prefix', default='informix')
|
||||
|
||||
parser.add_argument('-g', '--group', help='PandoraFMS destination group (default informix)', default='informix')
|
||||
parser.add_argument('--data_dir', help='PandoraFMS data dir (default: /var/spool/pandora/data_in/)', default='/var/spool/pandora/data_in/')
|
||||
parser.add_argument('--as_agent_plugin', help='mode plugin', default=0,type=int)
|
||||
parser.add_argument('--tentacle_port', help='tentacle port', default=41121)
|
||||
parser.add_argument('--tentacle_address', help='tentacle adress', default=None)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
conn_str=f'database={args.database};hostname={args.hostname};port={args.port};protocol=tcpip;uid={args.uid};pwd={args.password}'
|
||||
|
||||
def connect(conn_str):
|
||||
try:
|
||||
ibm_db_conn = ibm_db.connect(conn_str,'','')
|
||||
return ibm_db_conn
|
||||
except:
|
||||
print("no connection:", ibm_db.conn_errormsg())
|
||||
sys.exit(1)
|
||||
|
||||
def executeQuery(con, query):
|
||||
try:
|
||||
stmt = ibm_db.exec_immediate(con, query)
|
||||
result = ibm_db.fetch_both(stmt)
|
||||
return result
|
||||
|
||||
except Exception as message:
|
||||
pass
|
||||
|
||||
### Pandora Tools ###-------------------------------------------------------------------------------------------------------
|
||||
modules = []
|
||||
|
||||
|
||||
#########################################################################################
|
||||
# print_agent
|
||||
#########################################################################################
|
||||
def print_agent(agent, modules, data_dir="/var/spool/pandora/data_in/", log_modules= None, print_flag = None):
|
||||
"""Prints agent XML. Requires agent conf (dict) and modules (list) as arguments.
|
||||
- Use print_flag to show modules' XML in STDOUT.
|
||||
- Returns a tuple (xml, data_file).
|
||||
"""
|
||||
data_file=None
|
||||
|
||||
header = "<?xml version='1.0' encoding='UTF-8'?>\n"
|
||||
header += "<agent_data"
|
||||
for dato in agent:
|
||||
header += " " + str(dato) + "='" + str(agent[dato]) + "'"
|
||||
header += ">\n"
|
||||
xml = header
|
||||
if modules :
|
||||
for module in modules:
|
||||
modules_xml = print_module(module)
|
||||
xml += str(modules_xml)
|
||||
xml += "</agent_data>"
|
||||
if not print_flag:
|
||||
data_file = write_xml(xml, agent["agent_name"], data_dir)
|
||||
else:
|
||||
print(xml)
|
||||
|
||||
return (xml,data_file)
|
||||
|
||||
#########################################################################################
|
||||
# print_module
|
||||
#########################################################################################
|
||||
def print_module(module, print_flag=None):
|
||||
"""Returns module in XML format. Accepts only {dict}.\n
|
||||
- Only works with one module at a time: otherwise iteration is needed.
|
||||
- Module "value" field accepts str type or [list] for datalists.
|
||||
- Use print_flag to show modules' XML in STDOUT.
|
||||
"""
|
||||
data = dict(module)
|
||||
module_xml = ("<module>\n"
|
||||
"\t<name><![CDATA[" + str(data["name"]) + "]]></name>\n"
|
||||
"\t<type>" + str(data["type"]) + "</type>\n"
|
||||
)
|
||||
|
||||
if type(data["type"]) is not str and "string" not in data["type"]: #### Strip spaces if module not generic_data_string
|
||||
data["value"] = data["value"].strip()
|
||||
if isinstance(data["value"], list): # Checks if value is a list
|
||||
module_xml += "\t<datalist>\n"
|
||||
for value in data["value"]:
|
||||
if type(value) is dict and "value" in value:
|
||||
module_xml += "\t<data>\n"
|
||||
module_xml += "\t\t<value><![CDATA[" + str(value["value"]) + "]]></value>\n"
|
||||
if "timestamp" in value:
|
||||
module_xml += "\t\t<timestamp><![CDATA[" + str(value["timestamp"]) + "]]></timestamp>\n"
|
||||
module_xml += "\t</data>\n"
|
||||
module_xml += "\t</datalist>\n"
|
||||
else:
|
||||
module_xml += "\t<data><![CDATA[" + str(data["value"]) + "]]></data>\n"
|
||||
if "desc" in data:
|
||||
module_xml += "\t<description><![CDATA[" + str(data["desc"]) + "]]></description>\n"
|
||||
if "unit" in data:
|
||||
module_xml += "\t<unit><![CDATA[" + str(data["unit"]) + "]]></unit>\n"
|
||||
if "interval" in data:
|
||||
module_xml += "\t<module_interval><![CDATA[" + str(data["interval"]) + "]]></module_interval>\n"
|
||||
if "tags" in data:
|
||||
module_xml += "\t<tags>" + str(data["tags"]) + "</tags>\n"
|
||||
if "module_group" in data:
|
||||
module_xml += "\t<module_group>" + str(data["module_group"]) + "</module_group>\n"
|
||||
if "module_parent" in data:
|
||||
module_xml += "\t<module_parent>" + str(data["module_parent"]) + "</module_parent>\n"
|
||||
if "min_warning" in data:
|
||||
module_xml += "\t<min_warning><![CDATA[" + str(data["min_warning"]) + "]]></min_warning>\n"
|
||||
if "min_warning_forced" in data:
|
||||
module_xml += "\t<min_warning_forced><![CDATA[" + str(data["min_warning_forced"]) + "]]></min_warning_forced>\n"
|
||||
if "max_warning" in data:
|
||||
module_xml += "\t<max_warning><![CDATA[" + str(data["max_warning"]) + "]]></max_warning>\n"
|
||||
if "max_warning_forced" in data:
|
||||
module_xml += "\t<max_warning_forced><![CDATA[" + str(data["max_warning_forced"]) + "]]></max_warning_forced>\n"
|
||||
if "min_critical" in data:
|
||||
module_xml += "\t<min_critical><![CDATA[" + str(data["min_critical"]) + "]]></min_critical>\n"
|
||||
if "min_critical_forced" in data:
|
||||
module_xml += "\t<min_critical_forced><![CDATA[" + str(data["min_critical_forced"]) + "]]></min_critical_forced>\n"
|
||||
if "max_critical" in data:
|
||||
module_xml += "\t<max_critical><![CDATA[" + str(data["max_critical"]) + "]]></max_critical>\n"
|
||||
if "max_critical_forced" in data:
|
||||
module_xml += "\t<max_critical_forced><![CDATA[" + str(data["max_critical_forced"]) + "]]></max_critical_forced>\n"
|
||||
if "str_warning" in data:
|
||||
module_xml += "\t<str_warning><![CDATA[" + str(data["str_warning"]) + "]]></str_warning>\n"
|
||||
if "str_warning_forced" in data:
|
||||
module_xml += "\t<str_warning_forced><![CDATA[" + str(data["str_warning_forced"]) + "]]></str_warning_forced>\n"
|
||||
if "str_critical" in data:
|
||||
module_xml += "\t<str_critical><![CDATA[" + str(data["str_critical"]) + "]]></str_critical>\n"
|
||||
if "str_critical_forced" in data:
|
||||
module_xml += "\t<str_critical_forced><![CDATA[" + str(data["str_critical_forced"]) + "]]></str_critical_forced>\n"
|
||||
if "critical_inverse" in data:
|
||||
module_xml += "\t<critical_inverse><![CDATA[" + str(data["critical_inverse"]) + "]]></critical_inverse>\n"
|
||||
if "warning_inverse" in data:
|
||||
module_xml += "\t<warning_inverse><![CDATA[" + str(data["warning_inverse"]) + "]]></warning_inverse>\n"
|
||||
if "max" in data:
|
||||
module_xml += "\t<max><![CDATA[" + str(data["max"]) + "]]></max>\n"
|
||||
if "min" in data:
|
||||
module_xml += "\t<min><![CDATA[" + str(data["min"]) + "]]></min>\n"
|
||||
if "post_process" in data:
|
||||
module_xml += "\t<post_process><![CDATA[" + str(data["post_process"]) + "]]></post_process>\n"
|
||||
if "disabled" in data:
|
||||
module_xml += "\t<disabled><![CDATA[" + str(data["disabled"]) + "]]></disabled>\n"
|
||||
if "min_ff_event" in data:
|
||||
module_xml += "\t<min_ff_event><![CDATA[" + str(data["min_ff_event"]) + "]]></min_ff_event>\n"
|
||||
if "status" in data:
|
||||
module_xml += "\t<status><![CDATA[" + str(data["status"]) + "]]></status>\n"
|
||||
if "timestamp" in data:
|
||||
module_xml += "\t<timestamp><![CDATA[" + str(data["timestamp"]) + "]]></timestamp>\n"
|
||||
if "custom_id" in data:
|
||||
module_xml += "\t<custom_id><![CDATA[" + str(data["custom_id"]) + "]]></custom_id>\n"
|
||||
if "critical_instructions" in data:
|
||||
module_xml += "\t<critical_instructions><![CDATA[" + str(data["critical_instructions"]) + "]]></critical_instructions>\n"
|
||||
if "warning_instructions" in data:
|
||||
module_xml += "\t<warning_instructions><![CDATA[" + str(data["warning_instructions"]) + "]]></warning_instructions>\n"
|
||||
if "unknown_instructions" in data:
|
||||
module_xml += "\t<unknown_instructions><![CDATA[" + str(data["unknown_instructions"]) + "]]></unknown_instructions>\n"
|
||||
if "quiet" in data:
|
||||
module_xml += "\t<quiet><![CDATA[" + str(data["quiet"]) + "]]></quiet>\n"
|
||||
if "module_ff_interval" in data:
|
||||
module_xml += "\t<module_ff_interval><![CDATA[" + str(data["module_ff_interval"]) + "]]></module_ff_interval>\n"
|
||||
if "crontab" in data:
|
||||
module_xml += "\t<crontab><![CDATA[" + str(data["crontab"]) + "]]></crontab>\n"
|
||||
if "min_ff_event_normal" in data:
|
||||
module_xml += "\t<min_ff_event_normal><![CDATA[" + str(data["min_ff_event_normal"]) + "]]></min_ff_event_normal>\n"
|
||||
if "min_ff_event_warning" in data:
|
||||
module_xml += "\t<min_ff_event_warning><![CDATA[" + str(data["min_ff_event_warning"]) + "]]></min_ff_event_warning>\n"
|
||||
if "min_ff_event_critical" in data:
|
||||
module_xml += "\t<min_ff_event_critical><![CDATA[" + str(data["min_ff_event_critical"]) + "]]></min_ff_event_critical>\n"
|
||||
if "ff_type" in data:
|
||||
module_xml += "\t<ff_type><![CDATA[" + str(data["ff_type"]) + "]]></ff_type>\n"
|
||||
if "ff_timeout" in data:
|
||||
module_xml += "\t<ff_timeout><![CDATA[" + str(data["ff_timeout"]) + "]]></ff_timeout>\n"
|
||||
if "each_ff" in data:
|
||||
module_xml += "\t<each_ff><![CDATA[" + str(data["each_ff"]) + "]]></each_ff>\n"
|
||||
if "module_parent_unlink" in data:
|
||||
module_xml += "\t<module_parent_unlink><![CDATA[" + str(data["parent_unlink"]) + "]]></module_parent_unlink>\n"
|
||||
if "global_alerts" in data:
|
||||
for alert in data["alert"]:
|
||||
module_xml += "\t<alert_template><![CDATA[" + alert + "]]></alert_template>\n"
|
||||
module_xml += "</module>\n"
|
||||
|
||||
if print_flag:
|
||||
print (module_xml)
|
||||
|
||||
return (module_xml)
|
||||
|
||||
#########################################################################################
|
||||
# write_xml
|
||||
#########################################################################################
|
||||
|
||||
def write_xml(xml, agent_name, data_dir="/var/spool/pandora/data_in/"):
|
||||
"""Creates a agent .data file in the specified data_dir folder\n
|
||||
Args:
|
||||
- xml (str): XML string to be written in the file.
|
||||
- agent_name (str): agent name for the xml and file name.
|
||||
- data_dir (str): folder in which the file will be created."""
|
||||
Utime = datetime.now().strftime('%s')
|
||||
data_file = "%s/%s.%s.data" %(str(data_dir),agent_name,str(Utime))
|
||||
try:
|
||||
with open(data_file, 'x') as data:
|
||||
data.write(xml)
|
||||
except OSError as o:
|
||||
sys.exit(f"ERROR - Could not write file: {o}, please check directory permissions")
|
||||
except Exception as e:
|
||||
sys.exit(f"{type(e).__name__}: {e}")
|
||||
return (data_file)
|
||||
|
||||
# # default agent
|
||||
def clean_agent() :
|
||||
global agent
|
||||
agent = {
|
||||
"agent_name" : "",
|
||||
"agent_alias" : "",
|
||||
"parent_agent_name" : "",
|
||||
"description" : "",
|
||||
"version" : "",
|
||||
"os_name" : "",
|
||||
"os_version" : "",
|
||||
"timestamp" : datetime.today().strftime('%Y/%m/%d %H:%M:%S'),
|
||||
#"utimestamp" : int(datetime.timestamp(datetime.today())),
|
||||
"address" : "",
|
||||
"group" : args.group,
|
||||
"interval" : "",
|
||||
"agent_mode" : "1",
|
||||
}
|
||||
return agent
|
||||
|
||||
# default module
|
||||
def clean_module() :
|
||||
global modulo
|
||||
modulo = {
|
||||
"name" : "",
|
||||
"type" : "generic_data_string",
|
||||
"desc" : "",
|
||||
"value" : "",
|
||||
}
|
||||
return modulo
|
||||
|
||||
#########################################################################################
|
||||
# tentacle_xml
|
||||
#########################################################################################
|
||||
def tentacle_xml(file, tentacle_ops,tentacle_path='', debug=0):
|
||||
"""Sends file using tentacle protocol\n
|
||||
- Only works with one file at time.
|
||||
- file variable needs full file path.
|
||||
- tentacle_opts should be a dict with tentacle options (address [password] [port]).
|
||||
- tentacle_path allows to define a custom path for tentacle client in case is not in sys path).
|
||||
- if debug is enabled, the data file will not be removed after being sent.
|
||||
|
||||
Returns 0 for OK and 1 for errors.
|
||||
"""
|
||||
|
||||
if file is None :
|
||||
sys.stderr.write("Tentacle error: file path is required.")
|
||||
else :
|
||||
data_file = file
|
||||
|
||||
if tentacle_ops['address'] is None :
|
||||
sys.stderr.write("Tentacle error: No address defined")
|
||||
return 1
|
||||
|
||||
try :
|
||||
with open(data_file, 'r') as data:
|
||||
data.read()
|
||||
data.close()
|
||||
except Exception as e :
|
||||
sys.stderr.write(f"Tentacle error: {type(e).__name__} {e}")
|
||||
return 1
|
||||
|
||||
tentacle_cmd = f"{tentacle_path}tentacle_client -v -a {tentacle_ops['address']} "
|
||||
if "port" in tentacle_ops:
|
||||
tentacle_cmd += f"-p {tentacle_ops['port']} "
|
||||
if "password" in tentacle_ops:
|
||||
tentacle_cmd += f"-x {tentacle_ops['password']} "
|
||||
tentacle_cmd += f"{data_file} "
|
||||
|
||||
tentacle_exe=subprocess.Popen(tentacle_cmd, stdout=subprocess.PIPE, shell=True)
|
||||
rc=tentacle_exe.wait()
|
||||
|
||||
if rc != 0 :
|
||||
sys.stderr.write("Tentacle error")
|
||||
return 1
|
||||
elif debug == 0 :
|
||||
os.remove(file)
|
||||
|
||||
return 0
|
||||
|
||||
## funcion agent
|
||||
def agentplugin(modules,agent,plugin_type="server",data_dir="/var/spool/pandora/data_in/",tentacle=False,tentacle_conf=None) :
|
||||
if plugin_type == "server":
|
||||
for modulo in modules:
|
||||
print_module(modulo,1)
|
||||
|
||||
elif tentacle == True and tentacle_conf is not None:
|
||||
agent_file=print_agent(agent, modules,data_dir)
|
||||
if agent_file[1] is not None:
|
||||
tentacle_xml(agent_file[1],tentacle_conf)
|
||||
print ("1")
|
||||
else:
|
||||
print_agent(agent, modules,data_dir)
|
||||
print ("1")
|
||||
|
||||
|
||||
### Pandora Tools end ###-------------------------------------------------------------------------------------------------------
|
||||
|
||||
# hash md5 agent name
|
||||
if args.use_alias_as_name is not True:
|
||||
agent_name_md5 = (hashlib.md5(args.agent_alias.encode()).hexdigest())
|
||||
else:
|
||||
agent_name_md5 = args.agent_alias
|
||||
|
||||
ibm_db_conn=connect(conn_str)
|
||||
|
||||
|
||||
if args.default_metrics == 1:
|
||||
|
||||
clean_agent()
|
||||
agent.update(
|
||||
agent_name = args.agent_name +"_metrics",
|
||||
agent_alias =agent_name_md5 ,
|
||||
description ="Agent generated by pandora_db2"
|
||||
)
|
||||
|
||||
#Dbspace I/O
|
||||
|
||||
dbspaceIO = executeQuery(ibm_db_conn, 'SELECT d.name[1,18] dbspace,fname [1,22], sum(pagesread) dreads, sum(pageswritten) dwrites FROM syschkio c, syschunks k, sysdbspaces d WHERE d.dbsnum = k.dbsnum AND k.chknum = c.chunknum GROUP BY 1, 2 ORDER BY 3 desc;')
|
||||
|
||||
for dato,value in dbspaceIO.items():
|
||||
if 'dbspace' in str(dato):
|
||||
|
||||
name=value
|
||||
|
||||
if 'fname' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.fname',
|
||||
type = "generic_data_string",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
if 'dreads' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.dreads',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'dwrites' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.dwrites',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
#Dbspace usage
|
||||
|
||||
dbspaceusage = executeQuery(ibm_db_conn, 'SELECT sysdbspaces.name[1,18] name, nchunks, format_units(sum(syschunks.chksize * (SELECT sh_pagesize FROM sysshmvals)))::CHAR(12) total, format_units(sum(syschunks.chksize * (SELECT sh_pagesize FROM sysshmvals)) - sum(syschunks.nfree * (SELECT sh_pagesize FROM sysshmvals)))::CHAR(12) used, round (100 - ((sum(syschunks.nfree)) / (sum(syschunks.chksize)) * 100), 2) pct_used FROM sysdbspaces,syschunks WHERE sysdbspaces.dbsnum = syschunks.dbsnum AND sysdbspaces.is_sbspace = 0 GROUP BY 1,2 UNION SELECT sysdbspaces.name[1,18] name, nchunks, format_units(sum(syschunks.chksize * (SELECT sh_pagesize FROM sysshmvals)))::CHAR(12) total, format_units(sum(syschunks.chksize * (SELECT sh_pagesize FROM sysshmvals)) - sum(syschunks.nfree * (SELECT sh_pagesize FROM sysshmvals)))::CHAR(12) used, round (100 - ((sum(syschunks.nfree)) / (sum(syschunks.chksize)) * 100), 2) pct_used FROM sysdbspaces,syschunks WHERE sysdbspaces.dbsnum = syschunks.dbsnum AND sysdbspaces.is_sbspace = 1 GROUP BY 1,2 ORDER BY pct_used DESC;')
|
||||
patron='[+-]?\d*\.?\d+'
|
||||
for dato,value in dbspaceusage.items():
|
||||
if 'name' in str(dato):
|
||||
name=value
|
||||
if 'nchunks' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.nchunks',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'total' in str(dato):
|
||||
value_module=re.findall(patron,str(value))
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.total',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value_module[0],
|
||||
unit="MB"
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'used' in str(dato) and 'pct_used' not in str(dato):
|
||||
value_module=re.findall(patron,str(value))
|
||||
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.used',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value_module[0],
|
||||
unit="MB"
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'pct_used' in str(dato):
|
||||
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.pct_used',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value,
|
||||
unit="%"
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
|
||||
# #Checking tables I/O
|
||||
|
||||
tablesIO = executeQuery(ibm_db_conn, 'SELECT dbsname[1,18], tabname[1,18], (isreads + pagreads) diskreads,(iswrites + pagwrites) diskwrites FROM sysptprof ORDER BY 3 desc, 4 desc;')
|
||||
|
||||
for dato,value in tablesIO.items():
|
||||
|
||||
if 'dbsname' in str(dato):
|
||||
name=value
|
||||
if 'tabname' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.tabname',
|
||||
type = "generic_data_string",
|
||||
desc = "",
|
||||
value = value.strip()
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'diskreads' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.diskreads',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'diskwrites' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'{name.strip()}.diskwrites',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
|
||||
# #Session statistics
|
||||
|
||||
sessionstatics = executeQuery(ibm_db_conn, 'select sid, username[1,20], hostname[1,20], connected logint_time, hex(state) s_state from syssessions order by logint_time')
|
||||
|
||||
for dato,value in sessionstatics.items():
|
||||
if 'sid' in str(dato):
|
||||
name=value
|
||||
|
||||
if 'hostname' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.hostname',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'logint_time' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.diskwrites',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 's_state' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.diskwrites',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
##Session profile
|
||||
|
||||
sessionprofile = executeQuery(ibm_db_conn, 'select syssessions.sid, username[1,20],(isreads+bufreads+bufwrites+pagreads+pagwrites) access,locksheld, seqscans,total_sorts,dsksorts from syssesprof, syssessions where syssesprof.sid = syssessions.sid')
|
||||
|
||||
for dato,value in sessionprofile.items():
|
||||
if 'sid' in str(dato):
|
||||
name=value
|
||||
|
||||
if 'access' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.access',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'locksheld' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.locksheld',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'seqscans' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.seqscans',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'total_sorts' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.total_sorts',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
if 'dsksorts' in str(dato):
|
||||
clean_module()
|
||||
modulo.update(
|
||||
name = f'sid->{name}.dsksorts',
|
||||
type = "generic_data",
|
||||
desc = "",
|
||||
value = value
|
||||
)
|
||||
modules.append(modulo)
|
||||
|
||||
if args.tentacle_address is not None:
|
||||
tentacle_conf={"address":args.tentacle_address,"port":args.tentacle_port}
|
||||
agentplugin(modules,agent,"agent",config["data_in"],True,tentacle_conf)
|
||||
elif args.as_agent_plugin!=1:
|
||||
agentplugin(modules,agent,"agent",config["data_in"])
|
||||
else:
|
||||
agentplugin(modules,agent)
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.768-230124
|
||||
Version: 7.0NG.768-230203
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.768-230124"
|
||||
pandora_version="7.0NG.768-230203"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230124";
|
||||
my $pandora_build = "230203";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -118,7 +118,7 @@ use Tie::File;
|
|||
use Time::Local;
|
||||
use Time::HiRes qw(time);
|
||||
eval "use POSIX::strftime::GNU;1" if ($^O =~ /win/i);
|
||||
use POSIX qw(strftime);
|
||||
use POSIX qw(strftime mktime);
|
||||
use threads;
|
||||
use threads::shared;
|
||||
use JSON qw(decode_json encode_json);
|
||||
|
@ -1547,11 +1547,11 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
|
|||
my $threshold = shift;
|
||||
my $period = $hours * 3600; # Hours to seconds
|
||||
if($threshold == 0){
|
||||
$params->{"other"} = $period . '%7C1%7C0%7C225%7C""%7C14';
|
||||
$params->{"other"} = $period . '%7C1%7C0%7C225%7C%7C14';
|
||||
$cid = 'module_graph_' . $hours . 'h';
|
||||
}
|
||||
else{
|
||||
$params->{"other"} = $period . '%7C1%7C1%7C225%7C""%7C14';
|
||||
$params->{"other"} = $period . '%7C1%7C1%7C225%7C%7C14';
|
||||
$cid = 'module_graphth_' . $hours . 'h';
|
||||
}
|
||||
|
||||
|
@ -3173,16 +3173,20 @@ sub pandora_update_server ($$$$$$;$$$$) {
|
|||
$version = $pa_config->{'version'} . ' (P) ' . $pa_config->{'build'} unless defined($version);
|
||||
|
||||
my $master = ($server_type == SATELLITESERVER) ? 0 : $pa_config->{'pandora_master'};
|
||||
|
||||
|
||||
my ($year, $month, $day, $hour, $minute, $second) = split /[- :]/, $timestamp;
|
||||
|
||||
my $keepalive_utimestamp = mktime($second, $minute, $hour, $day, $month-1, $year-1900);
|
||||
|
||||
# First run
|
||||
if ($server_id == 0) {
|
||||
|
||||
# Create an entry in tserver if needed
|
||||
my $server = get_db_single_row ($dbh, 'SELECT id_server FROM tserver WHERE BINARY name = ? AND server_type = ?', $server_name, $server_type);
|
||||
if (! defined ($server)) {
|
||||
$server_id = db_insert ($dbh, 'id_server', 'INSERT INTO tserver (name, server_type, description, version, threads, queued_modules, server_keepalive)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?)', $server_name, $server_type,
|
||||
'Autocreated at startup', $version, $num_threads, $queue_size, $keepalive);
|
||||
$server_id = db_insert ($dbh, 'id_server', 'INSERT INTO tserver (name, server_type, description, version, threads, queued_modules, server_keepalive, server_keepalive_utimestamp)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)', $server_name, $server_type,
|
||||
'Autocreated at startup', $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp);
|
||||
|
||||
$server = get_db_single_row ($dbh, 'SELECT status FROM tserver WHERE id_server = ?', $server_id);
|
||||
if (! defined ($server)) {
|
||||
|
@ -3193,14 +3197,14 @@ sub pandora_update_server ($$$$$$;$$$$) {
|
|||
$server_id = $server->{'id_server'};
|
||||
}
|
||||
|
||||
db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, laststart = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?
|
||||
db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, laststart = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?, server_keepalive_utimestamp = ?
|
||||
WHERE id_server = ?',
|
||||
1, $timestamp, $master, $timestamp, $version, $num_threads, $queue_size, $keepalive, $server_id);
|
||||
1, $timestamp, $master, $timestamp, $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp, $server_id);
|
||||
return;
|
||||
}
|
||||
|
||||
db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?
|
||||
WHERE id_server = ?', $status, $timestamp, $master, $version, $num_threads, $queue_size, $keepalive, $server_id);
|
||||
|
||||
db_do ($dbh, 'UPDATE tserver SET status = ?, keepalive = ?, master = ?, version = ?, threads = ?, queued_modules = ?, server_keepalive = ?, server_keepalive_utimestamp = ?
|
||||
WHERE id_server = ?', $status, $timestamp, $master, $version, $num_threads, $queue_size, $keepalive, $keepalive_utimestamp, $server_id);
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
|
@ -3886,7 +3890,7 @@ sub pandora_create_agent ($$$$$$$$$$;$$$$$$$$$$) {
|
|||
$agent_mode = 1 unless defined($agent_mode);
|
||||
$alias = $agent_name unless defined($alias);
|
||||
|
||||
$description = "Created by $server_name" unless (defined($description) && $description ne '');
|
||||
$description = '' unless (defined($description));
|
||||
my ($columns, $values) = db_insert_get_values ({ 'nombre' => safe_input($agent_name),
|
||||
'direccion' => $address,
|
||||
'comentarios' => $description,
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.768";
|
||||
my $pandora_build = "230124";
|
||||
my $pandora_build = "230203";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.768
|
||||
%define release 230124
|
||||
%define release 230203
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.768"
|
||||
PI_BUILD="230124"
|
||||
PI_BUILD="230203"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.768 Build 230124";
|
||||
my $version = "7.0NG.768 Build 230203";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -188,7 +188,7 @@ sub process_module($$$$$){
|
|||
|
||||
$data_object{"data"} = $valor;
|
||||
|
||||
pandora_process_module ($pa_config, \%data_object, $agent, $module, '', $timestamp, $utimestamp, 1, $dbh, "");
|
||||
pandora_process_module ($pa_config, \%data_object, $agent, $module, '', $timestamp, $utimestamp, 1, $dbh);
|
||||
pandora_update_agent($pa_config, $timestamp, $target_agent, undef, undef, -1, $dbh);
|
||||
|
||||
$modules_processed++;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.768 Build 230124";
|
||||
my $version = "7.0NG.768 Build 230203";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,28 +29,29 @@
|
|||
"@types/jest": "^24.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^1.13.0",
|
||||
"@typescript-eslint/parser": "^1.13.0",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"clean-webpack-plugin": "^2.0.2",
|
||||
"css-loader": "^2.1.1",
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"d3-shape": "^1.3.7",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-prettier": "^4.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"file-loader": "^3.0.1",
|
||||
"jest": "^24.9.0",
|
||||
"mini-css-extract-plugin": "^0.5.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"jest": "^29.3.1",
|
||||
"mini-css-extract-plugin": "^2.7.2",
|
||||
"npm-watch": "^0.11.0",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^1.19.1",
|
||||
"ts-jest": "^24.3.0",
|
||||
"typescript": "^3.9.9",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-dev-server": "^3.11.2"
|
||||
"ts-jest": "^29.0.3",
|
||||
"typescript": "^4.9.4",
|
||||
"webpack": "^5.75.0",
|
||||
"webpack-cli": "^5.0.1",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
]
|
||||
],
|
||||
"devDependencies": {
|
||||
"ts-loader": "^9.4.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -821,15 +821,34 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
prevProps: Props | null = null,
|
||||
prevMeta: ItemMeta | null = null
|
||||
): void {
|
||||
if (
|
||||
prevProps &&
|
||||
(prevProps.type == ItemType.LINE_ITEM ||
|
||||
prevProps.type == ItemType.NETWORK_LINK)
|
||||
) {
|
||||
this.updateDomElement(this.childElementRef);
|
||||
}
|
||||
// Move box.
|
||||
if (!prevProps || this.positionChanged(prevProps, this.props)) {
|
||||
this.moveElement(this.props.x, this.props.y);
|
||||
this.updateDomElement(this.childElementRef);
|
||||
if (
|
||||
prevProps &&
|
||||
prevProps.type != ItemType.LINE_ITEM &&
|
||||
prevProps.type != ItemType.NETWORK_LINK
|
||||
) {
|
||||
this.updateDomElement(this.childElementRef);
|
||||
}
|
||||
}
|
||||
// Resize box.
|
||||
if (!prevProps || this.sizeChanged(prevProps, this.props)) {
|
||||
this.resizeElement(this.props.width, this.props.height);
|
||||
this.updateDomElement(this.childElementRef);
|
||||
if (
|
||||
prevProps &&
|
||||
prevProps.type != ItemType.LINE_ITEM &&
|
||||
prevProps.type != ItemType.NETWORK_LINK
|
||||
) {
|
||||
this.updateDomElement(this.childElementRef);
|
||||
}
|
||||
}
|
||||
// Change label.
|
||||
const oldLabelHtml = this.labelElementRef.innerHTML;
|
||||
|
|
|
@ -558,6 +558,20 @@ export default class VisualConsole {
|
|||
delete this.lineLinks[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(this.lineLinks[i][line].start != itemAtStart &&
|
||||
this.lineLinks[i][line].end == itemAtEnd) ||
|
||||
(this.lineLinks[i][line].start == itemAtStart &&
|
||||
this.lineLinks[i][line].end != itemAtEnd)
|
||||
) {
|
||||
// Object not connected to a line.
|
||||
delete this.lineLinks[i][line];
|
||||
|
||||
if (Object.keys(this.lineLinks[i]).length === 0) {
|
||||
delete this.lineLinks[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -722,7 +736,7 @@ export default class VisualConsole {
|
|||
context.containerRef.append(itemInstance.elementRef);
|
||||
return itemInstance;
|
||||
} catch (error) {
|
||||
console.error("Error creating a new element:", error.message);
|
||||
console.error("Error creating a new element:", (error as Error).message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -759,7 +773,10 @@ export default class VisualConsole {
|
|||
try {
|
||||
this.elementsById[item.id].props = decodeProps(item);
|
||||
} catch (error) {
|
||||
console.error("Error updating an element:", error.message);
|
||||
console.error(
|
||||
"Error updating an element:",
|
||||
(error as Error).message
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +797,7 @@ export default class VisualConsole {
|
|||
...decodeProps(item)
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Error updating element:", error.message);
|
||||
console.error("Error updating element:", (error as Error).message);
|
||||
}
|
||||
|
||||
// Re-build relations.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue