#9033 conflict resolved
This commit is contained in:
commit
2049805de7
|
@ -256,6 +256,8 @@ console_dependencies=" \
|
|||
poppler-data \
|
||||
php-yaml \
|
||||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
|
|
|
@ -307,6 +307,8 @@ console_dependencies=" \
|
|||
poppler-data \
|
||||
php-yaml \
|
||||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Version 7.0NG.763, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Version 7.0NG.763, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Version 7.0NG.763, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, HPUX Version
|
||||
# Version 7.0NG.763, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, Solaris version
|
||||
# Version 7.0NG.763, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.762-220609
|
||||
Version: 7.0NG.763-220627
|
||||
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.762-220609"
|
||||
pandora_version="7.0NG.763-220627"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.762"
|
||||
VERSION="7.0NG.763"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.762" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.763" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.762" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.763" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.762</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.762 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.762</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.763</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.763 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.763</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Version 7.0NG.763, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Version 7.0NG.763, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, NetBSD Version
|
||||
# Version 7.0NG.763, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Version 7.0NG.763, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.762';
|
||||
use constant AGENT_BUILD => '220609';
|
||||
use constant AGENT_VERSION => '7.0NG.763';
|
||||
use constant AGENT_BUILD => '220627';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220609
|
||||
%define version 7.0NG.763
|
||||
%define release 220627
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220609
|
||||
%define version 7.0NG.763
|
||||
%define release 220627
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220609"
|
||||
PI_VERSION="7.0NG.763"
|
||||
PI_BUILD="220627"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.762}
|
||||
{Pandora FMS Windows Agent v7.0NG.763}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{220609}
|
||||
{220627}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.762 Build 220609")
|
||||
#define PANDORA_VERSION ("7.0NG.763 Build 220627")
|
||||
|
||||
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.762(Build 220609))"
|
||||
VALUE "ProductVersion", "(7.0NG.763(Build 220627))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.762-220609
|
||||
Version: 7.0NG.763-220627
|
||||
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.762-220609"
|
||||
pandora_version="7.0NG.763-220627"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
},
|
||||
"require": {
|
||||
"mpdf/mpdf": "^8.0.15",
|
||||
"swiftmailer/swiftmailer": "^6.0"
|
||||
"swiftmailer/swiftmailer": "^6.0",
|
||||
"amphp/parallel-functions": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -23,7 +24,10 @@
|
|||
"PandoraFMS\\": "include/lib",
|
||||
"PandoraFMS\\Enterprise\\": "enterprise/include/lib",
|
||||
"UpdateManager\\": "update_manager_client/lib/UpdateManager"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"include/global_config.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
|
|
@ -4,8 +4,551 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "1ca1e8936d9ffb13f23a5b5cefbf02ad",
|
||||
"content-hash": "643ac0dc8a8e1f129104399054f8dd0c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
"version": "v2.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/amp.git",
|
||||
"reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
|
||||
"reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1",
|
||||
"ext-json": "*",
|
||||
"jetbrains/phpstorm-stubs": "^2019.3",
|
||||
"phpunit/phpunit": "^7 | ^8 | ^9",
|
||||
"psalm/phar": "^3.11@dev",
|
||||
"react/promise": "^2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php",
|
||||
"lib/Internal/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Daniel Lowrey",
|
||||
"email": "rdlowrey@php.net"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Bob Weinand",
|
||||
"email": "bobwei9@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "A non-blocking concurrency framework for PHP applications.",
|
||||
"homepage": "https://amphp.org/amp",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"awaitable",
|
||||
"concurrency",
|
||||
"event",
|
||||
"event-loop",
|
||||
"future",
|
||||
"non-blocking",
|
||||
"promise"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/amphp",
|
||||
"issues": "https://github.com/amphp/amp/issues",
|
||||
"source": "https://github.com/amphp/amp/tree/v2.6.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-02-20T17:52:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/byte-stream",
|
||||
"version": "v1.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/byte-stream.git",
|
||||
"reference": "acbd8002b3536485c997c4e019206b3f10ca15bd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd",
|
||||
"reference": "acbd8002b3536485c997c4e019206b3f10ca15bd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.4",
|
||||
"friendsofphp/php-cs-fixer": "^2.3",
|
||||
"jetbrains/phpstorm-stubs": "^2019.3",
|
||||
"phpunit/phpunit": "^6 || ^7 || ^8",
|
||||
"psalm/phar": "^3.11.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\ByteStream\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "A stream abstraction to make working with non-blocking I/O simple.",
|
||||
"homepage": "http://amphp.org/byte-stream",
|
||||
"keywords": [
|
||||
"amp",
|
||||
"amphp",
|
||||
"async",
|
||||
"io",
|
||||
"non-blocking",
|
||||
"stream"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/amphp",
|
||||
"issues": "https://github.com/amphp/byte-stream/issues",
|
||||
"source": "https://github.com/amphp/byte-stream/tree/v1.8.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-30T17:13:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parallel",
|
||||
"version": "v1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parallel.git",
|
||||
"reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parallel/zipball/fbc128383c1ffb3823866f71b88d8c4722a25ce9",
|
||||
"reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"amphp/byte-stream": "^1.6.1",
|
||||
"amphp/parser": "^1",
|
||||
"amphp/process": "^1",
|
||||
"amphp/serialization": "^1",
|
||||
"amphp/sync": "^1.0.1",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.1",
|
||||
"phpunit/phpunit": "^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/Context/functions.php",
|
||||
"lib/Sync/functions.php",
|
||||
"lib/Worker/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Parallel\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Stephen Coakley",
|
||||
"email": "me@stephencoakley.com"
|
||||
}
|
||||
],
|
||||
"description": "Parallel processing component for Amp.",
|
||||
"homepage": "https://github.com/amphp/parallel",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"concurrent",
|
||||
"multi-processing",
|
||||
"multi-threading"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parallel/issues",
|
||||
"source": "https://github.com/amphp/parallel/tree/v1.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-10-25T19:16:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parallel-functions",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parallel-functions.git",
|
||||
"reference": "af9795d51abfafc3676cbe7e17965479491abaad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parallel-functions/zipball/af9795d51abfafc3676cbe7e17965479491abaad",
|
||||
"reference": "af9795d51abfafc3676cbe7e17965479491abaad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2.0.3",
|
||||
"amphp/parallel": "^1.1",
|
||||
"opis/closure": "^3.0.7",
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/phpunit-util": "^1.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.9",
|
||||
"phpunit/phpunit": "^6.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\ParallelFunctions\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Parallel processing made simple.",
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parallel-functions/issues",
|
||||
"source": "https://github.com/amphp/parallel-functions/tree/master"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-10T17:05:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parser",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parser.git",
|
||||
"reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parser/zipball/f83e68f03d5b8e8e0365b8792985a7f341c57ae1",
|
||||
"reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.3",
|
||||
"phpunit/phpunit": "^6"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Amp\\Parser\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
}
|
||||
],
|
||||
"description": "A generator parser to make streaming parsers simple.",
|
||||
"homepage": "https://github.com/amphp/parser",
|
||||
"keywords": [
|
||||
"async",
|
||||
"non-blocking",
|
||||
"parser",
|
||||
"stream"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parser/issues",
|
||||
"source": "https://github.com/amphp/parser/tree/is-valid"
|
||||
},
|
||||
"time": "2017-06-06T05:29:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/process",
|
||||
"version": "v1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/process.git",
|
||||
"reference": "f09e3ed3b0a953ccbfff1140f12be4a884f0aa83"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/process/zipball/f09e3ed3b0a953ccbfff1140f12be4a884f0aa83",
|
||||
"reference": "f09e3ed3b0a953ccbfff1140f12be4a884f0aa83",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"amphp/byte-stream": "^1.4",
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1",
|
||||
"phpunit/phpunit": "^6"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Process\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bob Weinand",
|
||||
"email": "bobwei9@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Asynchronous process manager.",
|
||||
"homepage": "https://github.com/amphp/process",
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/process/issues",
|
||||
"source": "https://github.com/amphp/process/tree/v1.1.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-12-17T19:09:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/serialization",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/serialization.git",
|
||||
"reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1",
|
||||
"reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"phpunit/phpunit": "^9 || ^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Serialization\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Serialization tools for IPC and data storage in PHP.",
|
||||
"homepage": "https://github.com/amphp/serialization",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/serialization/issues",
|
||||
"source": "https://github.com/amphp/serialization/tree/master"
|
||||
},
|
||||
"time": "2020-03-25T21:39:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/sync",
|
||||
"version": "v1.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/sync.git",
|
||||
"reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/sync/zipball/85ab06764f4f36d63b1356b466df6111cf4b89cf",
|
||||
"reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2.2",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.1",
|
||||
"phpunit/phpunit": "^9 || ^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php",
|
||||
"src/ConcurrentIterator/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Sync\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Stephen Coakley",
|
||||
"email": "me@stephencoakley.com"
|
||||
}
|
||||
],
|
||||
"description": "Mutex, Semaphore, and other synchronization tools for Amp.",
|
||||
"homepage": "https://github.com/amphp/sync",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"mutex",
|
||||
"semaphore",
|
||||
"synchronization"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/sync/issues",
|
||||
"source": "https://github.com/amphp/sync/tree/v1.4.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-10-25T18:29:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
"version": "1.2.2",
|
||||
|
@ -280,6 +823,71 @@
|
|||
],
|
||||
"time": "2020-11-13T09:40:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "opis/closure",
|
||||
"version": "3.6.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opis/closure.git",
|
||||
"reference": "3d81e4309d2a927abbe66df935f4bb60082805ad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad",
|
||||
"reference": "3d81e4309d2a927abbe66df935f4bb60082805ad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"jeremeamia/superclosure": "^2.0",
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Opis\\Closure\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marius Sarca",
|
||||
"email": "marius.sarca@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Sorin Sarca",
|
||||
"email": "sarca_sorin@hotmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.",
|
||||
"homepage": "https://opis.io/closure",
|
||||
"keywords": [
|
||||
"anonymous functions",
|
||||
"closure",
|
||||
"function",
|
||||
"serializable",
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/opis/closure/issues",
|
||||
"source": "https://github.com/opis/closure/tree/3.6.3"
|
||||
},
|
||||
"time": "2022-01-27T09:35:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v9.99.100",
|
||||
|
|
|
@ -1665,3 +1665,4 @@ godmode/um_client/vendor/sebastian/object-enumerator/tests
|
|||
godmode/um_client/vendor/sebastian/object-enumerator
|
||||
godmode/um_client/vendor/sebastian
|
||||
godmode/um_client/vendor
|
||||
update_manager_client/resources/styles/pandora.css
|
||||
|
|
|
@ -1,7 +1,76 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` tinyint(1) NOT NULL default 0;
|
||||
ALTER TABLE `tuser_double_auth` DROP FOREIGN KEY `tuser_double_auth_ibfk_1`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_user` DROP FOREIGN KEY `tnotification_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_source_user` DROP FOREIGN KEY `tnotification_source_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_source_group_user` DROP FOREIGN KEY `tnotification_source_group_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tvisual_console_elements_cache` DROP FOREIGN KEY `tvisual_console_elements_cache_ibfk_3`, MODIFY COLUMN `user_id` VARCHAR(255) DEFAULT NULL;
|
||||
ALTER TABLE `tusuario` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tuser_double_auth` ADD CONSTRAINT `tuser_double_auth_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE;
|
||||
ALTER TABLE `tnotification_user` ADD CONSTRAINT `tnotification_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tnotification_source_user` ADD CONSTRAINT `tnotification_source_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tnotification_source_group_user` ADD CONSTRAINT `tnotification_source_group_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tvisual_console_elements_cache` ADD CONSTRAINT `tvisual_console_elements_cache_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tattachment` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tevento` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tincidencia` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tnota` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tsesion` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `ttrap` MODIFY COLUMN `id_usuario` VARCHAR(255) DEFAULT '';
|
||||
ALTER TABLE `tusuario_perfil` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treset_pass_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tmensajes` MODIFY COLUMN `id_usuario_origen` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tgraph` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treport` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tplanned_downtime` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tnetwork_map` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tpassword_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tupdate_journal` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tmap` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tdashboard` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treport_template` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tmetaconsole_event` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tmetaconsole_event_history` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `treset_pass` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tuser_task_scheduled` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tbackup` MODIFY COLUMN `id_user` VARCHAR(255) DEFAULT '';
|
||||
|
||||
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` TINYINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tservice` ADD COLUMN `asynchronous` TINYINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tservice` ADD COLUMN `rca` TEXT;
|
||||
|
||||
ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field1_recovery` TEXT AFTER `recovery_notify`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field4_recovery` TEXT AFTER `field3_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field5_recovery` TEXT AFTER `field4_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field6_recovery` TEXT AFTER `field5_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field7_recovery` TEXT AFTER `field6_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field8_recovery` TEXT AFTER `field7_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field9_recovery` TEXT AFTER `field8_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field10_recovery` TEXT AFTER `field9_recovery`;
|
||||
|
||||
ALTER TABLE `tagente` ADD COLUMN `satellite_server` INT NOT NULL default 0;
|
||||
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `satellite_server` INT NOT NULL default 0;
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` DROP COLUMN `last_event_replication`;
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'event_replication';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_interval';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_limit';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_mode';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'show_events_in_local';
|
||||
|
||||
UPDATE tconfig SET value='' WHERE token='lts_name';
|
||||
|
||||
SET @st_oum763 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tautoconfig' AND table_schema = DATABASE() AND column_name = 'disabled') > 0,
|
||||
"SELECT 1",
|
||||
"ALTER TABLE `tautoconfig` ADD COLUMN `disabled` TINYINT DEFAULT 0"
|
||||
));
|
||||
|
||||
PREPARE pr_oum763 FROM @st_oum763;
|
||||
EXECUTE pr_oum763;
|
||||
DEALLOCATE PREPARE pr_oum763;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
|
|
@ -412,8 +412,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_setup` (
|
|||
`auth_token` text default '',
|
||||
`id_group` int(10) unsigned NOT NULL default 0,
|
||||
`api_password` text NOT NULL,
|
||||
`disabled` tinyint(1) unsigned NOT NULL default '0',
|
||||
`last_event_replication` bigint(20) default '0'
|
||||
`disabled` tinyint(1) unsigned NOT NULL default '0'
|
||||
) ENGINE=InnoDB
|
||||
COMMENT = 'Table to store metaconsole sources'
|
||||
DEFAULT CHARSET=utf8;
|
||||
|
|
|
@ -288,7 +288,7 @@ foreach ($sessions as $session) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
$activity .= html_print_table($table, true);
|
||||
$activity = html_print_table($table, true);
|
||||
unset($table);
|
||||
|
||||
ui_toggle(
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
// Begin.
|
||||
if (isset($config['id_user']) === false) {
|
||||
include 'general/login_page.php';
|
||||
|
@ -57,52 +59,22 @@ if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_men
|
|||
// Start of full lateral menu.
|
||||
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
|
||||
|
||||
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
||||
|
||||
if (defined('PANDORA_ENTERPRISE') === false) {
|
||||
$logo_title = get_product_name().' Opensource';
|
||||
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
|
||||
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
|
||||
} else {
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
|
||||
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
|
||||
}
|
||||
|
||||
$logo_title = get_product_name().' Enterprise';
|
||||
}
|
||||
|
||||
echo '<div class="logo_green"><a href="index.php?sec=main">';
|
||||
|
||||
if (isset($config['custom_logo']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '215',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_full',
|
||||
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo_collapsed']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo_collapsed,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '60',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_icon',
|
||||
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
echo '</a></div>';
|
||||
// Header logo.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'logo_green',
|
||||
'content' => html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php'),
|
||||
'content' => html_print_header_logo_image(
|
||||
$menuCollapsed,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
require 'operation/menu.php';
|
||||
require 'godmode/menu.php';
|
||||
|
|
|
@ -245,8 +245,11 @@ if (!$new_agent && $alias != '') {
|
|||
}
|
||||
|
||||
// Remote configuration available.
|
||||
$remote_agent = false;
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$remote_agent = true;
|
||||
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5($agent_name, false);
|
||||
|
@ -427,6 +430,42 @@ $table_server .= html_print_select(
|
|||
true
|
||||
).'<div class="label_select_child_icons"></div></div></div>';
|
||||
|
||||
|
||||
$table_satellite = '';
|
||||
if ($remote_agent === true) {
|
||||
// Satellite server selector.
|
||||
$satellite_servers = db_get_all_rows_filter(
|
||||
'tserver',
|
||||
['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE],
|
||||
[
|
||||
'id_server',
|
||||
'name',
|
||||
]
|
||||
);
|
||||
|
||||
$satellite_names = [];
|
||||
if (empty($satellite_servers) === false) {
|
||||
foreach ($satellite_servers as $s_server) {
|
||||
$satellite_names[$s_server['id_server']] = $s_server['name'];
|
||||
}
|
||||
|
||||
$table_satellite = '<div class="label_select"><p class="input_label">'.__('Satellite').'</p>';
|
||||
$table_satellite .= '<div class="label_select_parent">';
|
||||
|
||||
$table_satellite .= html_print_input(
|
||||
[
|
||||
'type' => 'select',
|
||||
'fields' => $satellite_names,
|
||||
'name' => 'satellite_server',
|
||||
'selected' => $satellite_server,
|
||||
'nothing' => __('None'),
|
||||
'nothinf_value' => 0,
|
||||
'return' => true,
|
||||
]
|
||||
).'<div class="label_select_child_icons"></div></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Description.
|
||||
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').'</p>';
|
||||
$table_description .= html_print_textarea(
|
||||
|
@ -443,7 +482,7 @@ $table_description .= html_print_textarea(
|
|||
echo '<div class="first_row">
|
||||
<div class="box-shadow agent_options '.$agent_options_update.' white_box">
|
||||
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_satellite.$table_description.'</div>
|
||||
</div>';
|
||||
if (!$new_agent && $alias != '') {
|
||||
echo $table_qr_code;
|
||||
|
|
|
@ -155,6 +155,7 @@ $alert_d7 = 1;
|
|||
$alert_recovery = 0;
|
||||
$alert_priority = 0;
|
||||
$server_name = '';
|
||||
$satellite_server = 0;
|
||||
$grupo = 0;
|
||||
$id_os = 9;
|
||||
// Windows.
|
||||
|
@ -985,6 +986,7 @@ if ($update_agent) {
|
|||
$old_values = db_get_row('tagente', 'id_agente', $id_agente);
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
$secondary_groups = (string) get_parameter('secondary_hidden', '');
|
||||
$satellite_server = (int) get_parameter('satellite_server', 0);
|
||||
|
||||
if ($fields === false) {
|
||||
$fields = [];
|
||||
|
@ -1092,6 +1094,7 @@ if ($update_agent) {
|
|||
'quiet' => $quiet,
|
||||
'cps' => $cps,
|
||||
'safe_mode_module' => $safe_mode_module,
|
||||
'satellite_server' => $satellite_server,
|
||||
];
|
||||
|
||||
if ($config['metaconsole_agent_cache'] == 1) {
|
||||
|
@ -1230,6 +1233,7 @@ if ($id_agente) {
|
|||
$cps = $agent['cps'];
|
||||
$safe_mode_module = $agent['safe_mode_module'];
|
||||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||
$satellite_server = (int) $agent['satellite_server'];
|
||||
}
|
||||
|
||||
$update_module = (bool) get_parameter('update_module');
|
||||
|
|
|
@ -525,21 +525,21 @@ $menu_godmode['links']['sub'] = $sub;
|
|||
|
||||
// Update Manager
|
||||
if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) {
|
||||
$menu_godmode['messages']['text'] = __('Update manager');
|
||||
$menu_godmode['messages']['text'] = __('Warp Update');
|
||||
$menu_godmode['messages']['id'] = 'god-um_messages';
|
||||
$menu_godmode['messages']['sec2'] = '';
|
||||
|
||||
$sub = [];
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update online');
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Update Manager options');
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Options');
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['id'] = 'Options';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Update Manager journal');
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Warp journal');
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['id'] = 'Journal';
|
||||
|
||||
$menu_godmode['messages']['sub'] = $sub;
|
||||
|
|
|
@ -178,6 +178,7 @@ switch ($type) {
|
|||
break;
|
||||
}
|
||||
|
||||
$query_filter = [];
|
||||
if (empty($query_filter) === false) {
|
||||
$query_filter = json_decode($query_filter, true);
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ if (($create != '') || ($view != '')) {
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Name');
|
||||
$data[1] = '<input type="text" name="form_name" size=100 value="'.$form_name.'">';
|
||||
$data[1] = '<input type="text" class="text_input" name="form_name" size=100 value="'.$form_name.'">';
|
||||
$table->colspan['plugin_name'][1] = 3;
|
||||
$table->data['plugin_name'] = $data;
|
||||
|
||||
|
@ -399,7 +399,7 @@ if (($create != '') || ($view != '')) {
|
|||
|
||||
$data = [];
|
||||
$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" size=100 value="'.$form_execute.'" '.$disabled.'>';
|
||||
$data[1] = '<input type="text" name="form_execute" id="form_execute" class="command_component command_advanced_conf text_input" size=100 value="'.$form_execute.'" '.$disabled.'>';
|
||||
if ($locked) {
|
||||
$data[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_advanced_conf lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ if (($create != '') || ($view != '')) {
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Plug-in parameters');
|
||||
$data[1] = '<input type="text" name="form_parameters" id="form_parameters" class="command_component command_advanced_conf" size=100 value="'.$parameters.'" '.$disabled.'>';
|
||||
$data[1] = '<input type="text" name="form_parameters" id="form_parameters" class="command_component command_advanced_conf text_input" size=100 value="'.$parameters.'" '.$disabled.'>';
|
||||
if ($locked) {
|
||||
$data[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_advanced_conf lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
@ -484,13 +484,13 @@ if (($create != '') || ($view != '')) {
|
|||
$datam = [];
|
||||
$datam[0] = __('Description')."<span class='normal_weight'> ($macro_name)</span>";
|
||||
$datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true);
|
||||
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, $locked, '', "class='command_macro'", true);
|
||||
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, $locked, '', "class='command_macro text_input'", true);
|
||||
if ($locked) {
|
||||
$datam[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_macro lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
$datam[2] = __('Default value')."<span class='normal_weight'> ($macro_name)</span>";
|
||||
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, $locked, '', "class='command_component command_macro'", true);
|
||||
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, $locked, '', "class='command_component command_macro text_input'", true);
|
||||
if ($locked) {
|
||||
$datam[3] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_macro lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
|
|
@ -114,11 +114,11 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
|||
echo "'>";
|
||||
echo '<tr>
|
||||
<td class="datos">'.__('Link name').'</td>
|
||||
<td class="datos"><input type="text" name="name" size="35" value="'.$nombre.'"></td>';
|
||||
<td class="datos"><input type="text" class="text_input" name="name" size="50" value="'.$nombre.'"></td>';
|
||||
echo '</tr><tr>
|
||||
<td class="datos2">'.__('Link').'</td>
|
||||
<td class="datos2">
|
||||
<input type="text" name="link" size="50" value="'.$link.'"></td>';
|
||||
<input type="text" class="text_input" name="link" size="50" value="'.$link.'"></td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo "<table width='100%'>";
|
||||
|
|
|
@ -181,7 +181,7 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Subject').'<br>';
|
||||
$data[0] .= '<input type="text" name="subject" size="35" value="'.$subject.'" >';
|
||||
$data[0] .= '<input type="text" class="text_input" name="subject" size="35" value="'.$subject.'" >';
|
||||
|
||||
$data[1] = __('Group').'<br>';
|
||||
$data[1] .= '<div class="w250px">';
|
||||
|
|
|
@ -663,6 +663,16 @@ $tip = ui_print_help_tip(
|
|||
true
|
||||
);
|
||||
|
||||
$table_other->data[$i][0] = __('WMI binary');
|
||||
$table_other->data[$i++][1] = html_print_input_text(
|
||||
'wmiBinary',
|
||||
$config['wmiBinary'],
|
||||
'',
|
||||
50,
|
||||
50,
|
||||
true
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table_other->data[$i][0] = __('PhantomJS cache cleanup ').$tip;
|
||||
$table_other->data[$i++][1] = html_print_input(
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -181,7 +181,8 @@ $backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
|
|||
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
|
||||
asort($backgrounds_list);
|
||||
|
||||
if (!enterprise_installed()) {
|
||||
$open = false;
|
||||
if (enterprise_installed() === false) {
|
||||
$open = true;
|
||||
}
|
||||
|
||||
|
@ -953,7 +954,7 @@ $options_full_escale[2] = __('On Boolean graphs');
|
|||
$table_chars->data[$row][1] = html_print_select(
|
||||
$options_full_escale,
|
||||
'full_scale_option',
|
||||
$config['full_scale_option'],
|
||||
(isset($config['full_scale_option']) === true) ? $config['full_scale_option'] : 0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
|
@ -973,7 +974,7 @@ $options_soft_graphs[1] = __('Show MAX/AVG/MIN by default');
|
|||
$table_chars->data[$row][1] = html_print_select(
|
||||
$options_soft_graphs,
|
||||
'type_mode_graph',
|
||||
$config['type_mode_graph'],
|
||||
(isset($config['type_mode_graph']) === true) ? $config['type_mode_graph'] : 0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
|
@ -1053,13 +1054,31 @@ $table_vc->data[$row][1] = html_print_extended_select_for_time(
|
|||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Default interval for refresh on Visual Console');
|
||||
$table_vc->data[$row][1] = html_print_select($values, 'vc_refr', (int) $config['vc_refr'], '', 'N/A', 0, true, false, false);
|
||||
$table_vc->data[$row][1] = html_print_select(
|
||||
$values,
|
||||
'vc_refr',
|
||||
(int) $config['vc_refr'],
|
||||
'',
|
||||
'N/A',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$row++;
|
||||
|
||||
$vc_favourite_view_array[0] = __('Classic view');
|
||||
$vc_favourite_view_array[1] = __('View of favorites');
|
||||
$table_vc->data[$row][0] = __('Type of view of visual consoles');
|
||||
$table_vc->data[$row][1] = html_print_select($vc_favourite_view_array, 'vc_favourite_view', $config['vc_favourite_view'], '', '', 0, true);
|
||||
$table_vc->data[$row][1] = html_print_select(
|
||||
$vc_favourite_view_array,
|
||||
'vc_favourite_view',
|
||||
$config['vc_favourite_view'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu');
|
||||
|
@ -1067,7 +1086,23 @@ $table_vc->data[$row][1] = "<input type ='number' value=".$config['vc_menu_items
|
|||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Default line thickness for the Visual Console');
|
||||
$table_vc->data[$row][1] = html_print_input_text('vc_line_thickness', (int) $config['vc_line_thickness'], '', 5, 5, true);
|
||||
$table_vc->data[$row][1] = html_print_input_text(
|
||||
'vc_line_thickness',
|
||||
(int) $config['vc_line_thickness'],
|
||||
'',
|
||||
5,
|
||||
5,
|
||||
true
|
||||
);
|
||||
|
||||
$table_vc->data[$row][0] = __('Mobile view not allow visual console orientation');
|
||||
$table_vc->data[$row][1] = html_print_checkbox_switch(
|
||||
'mobile_view_orientation_vc',
|
||||
1,
|
||||
(bool) $config['mobile_view_orientation_vc'],
|
||||
true
|
||||
);
|
||||
$row++;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -1133,7 +1168,17 @@ $interval_description = [
|
|||
'tiny' => 'Short',
|
||||
];
|
||||
$table_report->data[$row][0] = __('Interval description');
|
||||
$table_report->data[$row][1] = html_print_select($interval_description, 'interval_description', $config['interval_description'], '', '', '', true, false, false);
|
||||
$table_report->data[$row][1] = html_print_select(
|
||||
$interval_description,
|
||||
'interval_description',
|
||||
(isset($config['interval_description']) === true) ? $config['interval_description'] : 'large',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -203,20 +203,22 @@ if (is_ajax() !== true) {
|
|||
var clientMode = '<?php echo $mode; ?>';
|
||||
</script>
|
||||
<?php
|
||||
$server_version = (string) db_get_value_sql(
|
||||
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
|
||||
);
|
||||
if ($server_version !== false
|
||||
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
|
||||
) {
|
||||
if ((float) $matches[1] !== (float) $current_package) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Master server version %s does not match console version %s.',
|
||||
(float) $matches[1],
|
||||
(float) $current_package
|
||||
)
|
||||
);
|
||||
if (function_exists('db_get_value_sql') === true) {
|
||||
$server_version = (string) db_get_value_sql(
|
||||
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
|
||||
);
|
||||
if ($server_version !== false
|
||||
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
|
||||
) {
|
||||
if ((float) $matches[1] !== floor((float) $current_package)) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Master server version %s does not match console version %s.',
|
||||
(float) $matches[1],
|
||||
(float) $current_package
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,7 +315,7 @@ if (is_array($config) === true) {
|
|||
if ($mode === Manager::MODE_ONLINE
|
||||
&& ($puid === null || $puid === 'OFFLINE')
|
||||
) {
|
||||
ui_print_error_message(__('Update manager online requires registration.'));
|
||||
ui_print_error_message(__('Update online requires registration.'));
|
||||
}
|
||||
|
||||
if ($mode === Manager::MODE_OFFLINE) {
|
||||
|
|
|
@ -1,21 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Update manager.
|
||||
*
|
||||
* @category Update Manager
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
// The ajax is in
|
||||
// include/ajax/update_manager.php
|
||||
// The ajax is in include/ajax/update_manager.php.
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -36,59 +51,65 @@ if ($php_version_array[0] < 7) {
|
|||
$tab = get_parameter('tab', 'online');
|
||||
|
||||
$buttons['setup'] = [
|
||||
'active' => ($tab == 'setup') ? true : false,
|
||||
'active' => ($tab === 'setup') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup'
|
||||
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
|
||||
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['history'] = [
|
||||
'active' => ($tab == 'history') ? true : false,
|
||||
'active' => ($tab === 'history') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=histo'
|
||||
).'ry">'.html_print_image('images/gm_db.png', true, ['title' => __('Journal'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['offline'] = [
|
||||
'active' => ($tab == 'offline') ? true : false,
|
||||
'active' => ($tab === 'offline') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offli'
|
||||
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['online'] = [
|
||||
'active' => ($tab == 'online') ? true : false,
|
||||
'active' => ($tab === 'online') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=onlin'
|
||||
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
switch ($tab) {
|
||||
case 'history':
|
||||
$title = __('Update manager » Journal');
|
||||
$title = __('Journal');
|
||||
break;
|
||||
|
||||
case 'setup':
|
||||
$title = __('Update manager » Setup');
|
||||
$title = __('Setup');
|
||||
break;
|
||||
|
||||
case 'offline':
|
||||
$title = __('Update manager » Offline');
|
||||
$title = __('Offline');
|
||||
break;
|
||||
|
||||
case 'online':
|
||||
default:
|
||||
$title = __('Update manager » Online');
|
||||
$title = __('Online');
|
||||
break;
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
$title,
|
||||
'images/gm_setup.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => 'Warp Update',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
switch ($tab) {
|
||||
|
@ -107,6 +128,39 @@ switch ($tab) {
|
|||
|
||||
case 'online':
|
||||
default:
|
||||
if (is_metaconsole() === false && has_metaconsole() === true) {
|
||||
$meta_puid = null;
|
||||
|
||||
$server_id = $config['metaconsole_node_id'];
|
||||
$dbh = (object) $config['dbconnection'];
|
||||
|
||||
// Connect to metaconsole.
|
||||
$result_code = metaconsole_load_external_db(
|
||||
[
|
||||
'dbhost' => $config['replication_dbhost'],
|
||||
'dbuser' => $config['replication_dbuser'],
|
||||
'dbpass' => io_output_password($config['replication_dbpass']),
|
||||
'dbname' => $config['replication_dbname'],
|
||||
]
|
||||
);
|
||||
|
||||
if ($result_code < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
$value = db_get_value('value', 'tconfig', 'token', 'pandora_uid');
|
||||
|
||||
$meta_puid = $value;
|
||||
|
||||
// Return connection to node.
|
||||
metaconsole_restore_db();
|
||||
|
||||
if ($meta_puid === false || $meta_puid === null) {
|
||||
ui_print_warning_message(__('Please register on metaconsole first.'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
|
||||
include $config['homedir'].'/godmode/um_client/index.php';
|
||||
break;
|
||||
|
|
|
@ -268,17 +268,18 @@ $table->style[$i] = 'font-weight: bolder;width:250px';
|
|||
|
||||
$url_update_manager = update_manager_get_url();
|
||||
|
||||
$table->data[$i][0] = __('URL update manager:');
|
||||
$table->data[$i][0] = __('Warp Update URL');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'url_update_manager',
|
||||
$url_update_manager,
|
||||
__('URL update manager'),
|
||||
80,
|
||||
255,
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Use secured update manager:');
|
||||
$table->data[$i][0] = __('Use secured Warp Update');
|
||||
$table->data[$i++][1] = html_print_input(
|
||||
[
|
||||
'type' => 'switch',
|
||||
|
@ -287,7 +288,7 @@ $table->data[$i++][1] = html_print_input(
|
|||
]
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy server:');
|
||||
$table->data[$i][0] = __('Proxy server');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_server',
|
||||
$update_manager_proxy_server,
|
||||
|
@ -297,7 +298,7 @@ $table->data[$i++][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy port:');
|
||||
$table->data[$i][0] = __('Proxy port');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_port',
|
||||
$update_manager_proxy_port,
|
||||
|
@ -307,7 +308,7 @@ $table->data[$i++][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy user:');
|
||||
$table->data[$i][0] = __('Proxy user');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_user',
|
||||
$update_manager_proxy_user,
|
||||
|
@ -317,7 +318,7 @@ $table->data[$i++][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy password:');
|
||||
$table->data[$i][0] = __('Proxy password');
|
||||
$table->data[$i++][1] = html_print_input_password(
|
||||
'update_manager_proxy_password',
|
||||
$update_manager_proxy_password,
|
||||
|
@ -327,7 +328,7 @@ $table->data[$i++][1] = html_print_input_password(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Allow no-consecutive patches:');
|
||||
$table->data[$i][0] = __('Allow no-consecutive patches');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'allow_offline_patches',
|
||||
|
@ -336,7 +337,7 @@ $table->data[$i++][1] = html_print_switch(
|
|||
]
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Limit to LTS updates:');
|
||||
$table->data[$i][0] = __('Limit to LTS updates');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'lts_updates',
|
||||
|
@ -346,11 +347,11 @@ $table->data[$i++][1] = html_print_switch(
|
|||
);
|
||||
|
||||
|
||||
$table->data[$i][0] = __('Registration ID:');
|
||||
$table->data[$i++][1] = '<i>'.$config['pandora_uid'].'</i>';
|
||||
$table->data[$i][0] = __('Registration ID');
|
||||
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>';
|
||||
|
||||
if (update_manager_verify_registration() === true && users_is_admin()) {
|
||||
$table->data[$i][0] = __('Cancel registration:');
|
||||
$table->data[$i][0] = __('Cancel registration');
|
||||
$table->data[$i][1] = '<a href="';
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
$table->data[$i][1] .= ui_get_full_url(
|
||||
|
@ -367,7 +368,7 @@ if (update_manager_verify_registration() === true && users_is_admin()) {
|
|||
|
||||
if (license_free()) {
|
||||
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
|
||||
$table->data[$i][0] = __('Pandora FMS community reminder').ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this Pandora instance'), true);
|
||||
$table->data[$i][0] = __('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true);
|
||||
$table->data[$i][1] = __('Yes').' '.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).' ';
|
||||
$table->data[$i++][1] .= __('No').' '.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
|
||||
}
|
||||
|
|
|
@ -860,7 +860,7 @@ if (!$new_user) {
|
|||
'',
|
||||
'',
|
||||
20,
|
||||
100,
|
||||
255,
|
||||
!$new_user || $view_mode,
|
||||
'',
|
||||
[
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -278,6 +278,13 @@ class AgentWizard extends HTML
|
|||
*/
|
||||
private $extraArguments = '';
|
||||
|
||||
/**
|
||||
* Binary of wmic.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $wmiBinary = '';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -291,7 +298,7 @@ class AgentWizard extends HTML
|
|||
// Check access.
|
||||
check_login();
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AR') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access event viewer'
|
||||
|
@ -311,6 +318,7 @@ class AgentWizard extends HTML
|
|||
$this->idAgent = get_parameter('id_agente', '');
|
||||
$this->idPolicy = get_parameter('id', '');
|
||||
$this->targetIp = get_parameter('targetIp', '');
|
||||
$this->wmiBinary = $config['wmiBinary'];
|
||||
|
||||
if (empty($this->idAgent) === false) {
|
||||
$array_aux = db_get_all_rows_sql(
|
||||
|
@ -1044,7 +1052,7 @@ class AgentWizard extends HTML
|
|||
$oidExplore = '.1.3.6.1.2.1.1.2.0';
|
||||
}
|
||||
|
||||
// Explore general or interfaces
|
||||
// Explore general or interfaces.
|
||||
$receivedOid = $this->snmpWalkValues(
|
||||
$oidExplore,
|
||||
false,
|
||||
|
@ -1080,7 +1088,7 @@ class AgentWizard extends HTML
|
|||
// Capture the parameters.
|
||||
// Call WMI Explorer function.
|
||||
$this->wmiCommand = wmi_compose_query(
|
||||
'wmic',
|
||||
$this->wmiBinary,
|
||||
$this->usernameWMI,
|
||||
$this->passwordWMI,
|
||||
$this->targetIp,
|
||||
|
@ -1090,19 +1098,26 @@ class AgentWizard extends HTML
|
|||
// the host is Windows (and allow WMI).
|
||||
$commandQuery = $this->wmiCommand;
|
||||
$commandQuery .= ' "SELECT Caption FROM Win32_ComputerSystem"';
|
||||
// Execute the wmic command.
|
||||
// Declare the vars.
|
||||
$result = [];
|
||||
exec($commandQuery, $result);
|
||||
$execCorrect = true;
|
||||
$returnVar = 0;
|
||||
$tmpError = '';
|
||||
|
||||
// Look for the response if we have ERROR messages.
|
||||
foreach ($result as $info) {
|
||||
if (preg_match('/ERROR:/', $info) !== 0) {
|
||||
$execCorrect = false;
|
||||
$tmpError = strrchr($info, 'ERROR:');
|
||||
break;
|
||||
$execCorrect = true;
|
||||
// Execute the command.
|
||||
exec($commandQuery, $result, $returnVar);
|
||||
// Only is valid if return code is 0.
|
||||
if ($returnVar === 0) {
|
||||
// Look for the response if we have ERROR messages.
|
||||
foreach ($result as $info) {
|
||||
if (preg_match('/ERROR:/', $info) !== 0) {
|
||||
$execCorrect = false;
|
||||
$tmpError = strrchr($info, 'ERROR:');
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tmpError = sprintf('Return Code %s', $returnVar);
|
||||
$execCorrect = false;
|
||||
}
|
||||
|
||||
// FOUND ERRORS: TIMEOUT.
|
||||
|
@ -2806,7 +2821,7 @@ class AgentWizard extends HTML
|
|||
// Unpack the query filters.
|
||||
$queryFilters = json_decode($module['query_filters'], true);
|
||||
// Name of query filter field.
|
||||
$fieldValueName = $fieldSet[$queryFilters['field']];
|
||||
$fieldValueName = (empty($fieldSet[$queryFilters['field']]) === false) ? $fieldSet[$queryFilters['field']] : '1';
|
||||
|
||||
// Evaluate type of scan and execution.
|
||||
if ($module['scan_type'] == SCAN_TYPE_FIXED) {
|
||||
|
@ -2841,13 +2856,13 @@ class AgentWizard extends HTML
|
|||
|
||||
// If name of the module have a macro.
|
||||
$moduleBlocks[$k]['name'] = $this->macroFilter(
|
||||
$module['name'],
|
||||
io_safe_output($module['name']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
// Description can have macros too.
|
||||
$moduleBlocks[$k]['description'] = $this->macroFilter(
|
||||
$module['description'],
|
||||
io_safe_output($module['description']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
|
@ -2859,7 +2874,7 @@ class AgentWizard extends HTML
|
|||
);
|
||||
|
||||
foreach ($columnsList as $columnKey => $columnValue) {
|
||||
$macros['macros']['_'.$columnValue.'_'] = $rowList[$columnKey];
|
||||
$macros['macros']['_'.trim($columnValue).'_'] = $rowList[trim($columnKey)];
|
||||
}
|
||||
|
||||
$moduleBlocks[$k]['macros'] = json_encode($macros);
|
||||
|
@ -2892,6 +2907,7 @@ class AgentWizard extends HTML
|
|||
$dataCombined = array_combine($columnsList, $rowList);
|
||||
// Change the macros for values.
|
||||
foreach ($dataCombined as $macroKey => $macroValue) {
|
||||
$macroKey = trim($macroKey);
|
||||
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
|
||||
$valueOperation = preg_replace(
|
||||
'/_'.$macroKey.'_/',
|
||||
|
@ -2937,19 +2953,19 @@ class AgentWizard extends HTML
|
|||
$rowList = explode('|', $rowContent);
|
||||
// If name of the module have a macro.
|
||||
$newModule['name'] = $this->macroFilter(
|
||||
$module['name'],
|
||||
io_safe_output($module['name']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
// Description can have macros too.
|
||||
$newModule['description'] = $this->macroFilter(
|
||||
$module['description'],
|
||||
io_safe_output($module['description']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
|
||||
$newModule['query_filters'] = $this->macroFilter(
|
||||
$module['query_filters'],
|
||||
io_safe_output($module['query_filters']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
|
@ -2995,6 +3011,7 @@ class AgentWizard extends HTML
|
|||
);
|
||||
// Change the macros for values.
|
||||
foreach ($dataCombined as $macroKey => $macroValue) {
|
||||
$macroKey = trim($macroKey);
|
||||
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
|
||||
$valueOperation = preg_replace(
|
||||
'/_'.$macroKey.'_/',
|
||||
|
@ -3022,39 +3039,48 @@ class AgentWizard extends HTML
|
|||
}
|
||||
}
|
||||
|
||||
// Create the final table with all of data received.
|
||||
foreach ($moduleBlocks as $module) {
|
||||
// Prepare the blocks. If its new, create a new index.
|
||||
if (key_exists($module['group'], $blockTables) === false) {
|
||||
$blockTables[$module['group']] = [
|
||||
'name' => $module['group_name'],
|
||||
'data' => [],
|
||||
];
|
||||
// If we not retrieve information (P.E. connection refused).
|
||||
if (empty($moduleBlocks) === true) {
|
||||
$this->message['type'][] = 'warning';
|
||||
$this->message['message'][] = __(
|
||||
'No information could be retrieved.'
|
||||
);
|
||||
$this->showMessage();
|
||||
} else {
|
||||
// Create the final table with all of data received.
|
||||
foreach ($moduleBlocks as $module) {
|
||||
// Prepare the blocks. If its new, create a new index.
|
||||
if (key_exists($module['group'], $blockTables) === false) {
|
||||
$blockTables[$module['group']] = [
|
||||
'name' => $module['group_name'],
|
||||
'data' => [],
|
||||
];
|
||||
}
|
||||
|
||||
// Add the module info in the block.
|
||||
$blockTables[$module['group']]['data'][] = $module;
|
||||
if (isset($blockTables[$module['group']]['activeModules']) === false
|
||||
&& (int) $module['module_enabled'] === 1
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 2;
|
||||
} else if (isset($blockTables[$module['group']]['activeModules']) === true
|
||||
&& (int) $module['module_enabled'] === 0
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the module info in the block.
|
||||
$blockTables[$module['group']]['data'][] = $module;
|
||||
if (isset($blockTables[$module['group']]['activeModules']) === false
|
||||
&& (int) $module['module_enabled'] === 1
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 2;
|
||||
} else if (isset($blockTables[$module['group']]['activeModules']) === true
|
||||
&& (int) $module['module_enabled'] === 0
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 1;
|
||||
}
|
||||
// General Default monitoring.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'wizard wizard-result',
|
||||
'style' => 'margin-top: 20px;',
|
||||
'content' => $this->toggleTableModules($blockTables),
|
||||
]
|
||||
);
|
||||
// Add Create Modules form.
|
||||
$this->createModulesForm();
|
||||
}
|
||||
|
||||
// General Default monitoring.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'wizard wizard-result',
|
||||
'style' => 'margin-top: 20px;',
|
||||
'content' => $this->toggleTableModules($blockTables),
|
||||
]
|
||||
);
|
||||
// Add Create Modules form.
|
||||
$this->createModulesForm();
|
||||
}
|
||||
|
||||
|
||||
|
@ -3559,7 +3585,8 @@ class AgentWizard extends HTML
|
|||
$this->targetPort,
|
||||
$this->server,
|
||||
$this->extraArguments,
|
||||
(($full_output === false) ? '-Oa -On' : '-Oa')
|
||||
(($full_output === false) ? '-On' : '-Oa'),
|
||||
''
|
||||
);
|
||||
|
||||
if ($pure === true) {
|
||||
|
@ -3572,7 +3599,12 @@ class AgentWizard extends HTML
|
|||
if ($full_output === true) {
|
||||
$output[] = $key.' = '.$oid_unit;
|
||||
} else {
|
||||
preg_match('/\.\d+$/', $key, $index);
|
||||
$index = [];
|
||||
$index[] = preg_replace('/^'.$oid.'/', '', $key);
|
||||
if (empty($index) === true) {
|
||||
preg_match('/\.\d+$/', $key, $index);
|
||||
}
|
||||
|
||||
$tmp = explode(': ', $oid_unit);
|
||||
$output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
|
||||
}
|
||||
|
@ -5536,13 +5568,13 @@ class AgentWizard extends HTML
|
|||
string $unit='',
|
||||
?int $type=0
|
||||
) {
|
||||
$output = '';
|
||||
try {
|
||||
// Avoid non-numeric or arithmetic chars for security reasons.
|
||||
if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) {
|
||||
throw new Exception(sprintf(__("The operation '%s' is not permitted. Review for remote components."), $operation));
|
||||
} else {
|
||||
// Get the result of the operation and set it.
|
||||
$output = '';
|
||||
eval('$output = '.$operation.';');
|
||||
// If this module has unit, attach to current value.
|
||||
$output = $this->replacementUnit(
|
||||
|
@ -5717,7 +5749,7 @@ class AgentWizard extends HTML
|
|||
$(this).removeClass('hidden');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (this.id.match(regex)) {
|
||||
$(this).removeClass('hidden');
|
||||
} else {
|
||||
|
@ -5729,7 +5761,7 @@ class AgentWizard extends HTML
|
|||
$(this).addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (filter_up == true) {
|
||||
if ($(this).attr('operstatus') != 1) {
|
||||
$(this).addClass('hidden');
|
||||
|
|
|
@ -1528,7 +1528,7 @@ class ConsoleSupervisor
|
|||
$this->cleanNotifications('NOTIF.PHP.UPLOAD_MAX_FILESIZE');
|
||||
}
|
||||
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && (int) $PHPmemory_limit !== -1) {
|
||||
$url = 'http://php.net/manual/en/ini.core.php#ini.memory-limit';
|
||||
if ($config['language'] == 'es') {
|
||||
$url = 'http://php.net/manual/es/ini.core.php#ini.memory-limit';
|
||||
|
@ -2145,8 +2145,8 @@ class ConsoleSupervisor
|
|||
[
|
||||
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||
'title' => __('This instance is not registered in the Update manager section'),
|
||||
'message' => __('Click <a class="bolder underline" href="javascript: force_run_register();"> here</a> to start the registration process'),
|
||||
'url' => 'javascript: force_run_register();',
|
||||
'message' => __('Click here to start the registration process'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2166,7 +2166,7 @@ class ConsoleSupervisor
|
|||
// Check default password for "admin".
|
||||
$admin_with_default_pass = db_get_value_sql(
|
||||
'SELECT count(*) FROM tusuario
|
||||
WHERE
|
||||
WHERE
|
||||
id_user="admin"
|
||||
AND password="1da7ee7d45b96d0e1f45ee4ee23da560"
|
||||
AND is_admin=1
|
||||
|
@ -2441,11 +2441,11 @@ class ConsoleSupervisor
|
|||
config_update_value('last_um_check', $future, true);
|
||||
|
||||
$messages = update_manager_get_messages();
|
||||
|
||||
if (is_array($messages) === true) {
|
||||
$source_id = get_notification_source_id(
|
||||
'Official communication'
|
||||
);
|
||||
|
||||
foreach ($messages as $message) {
|
||||
if (isset($message['url']) === false) {
|
||||
$message['url'] = '#';
|
||||
|
@ -2476,8 +2476,8 @@ class ConsoleSupervisor
|
|||
// List all servers except satellite server.
|
||||
$server_version_list = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT `name`, `version`
|
||||
FROM tserver
|
||||
'SELECT `name`, `version`
|
||||
FROM tserver
|
||||
WHERE server_type != %d
|
||||
GROUP BY `version`',
|
||||
SERVER_TYPE_ENTERPRISE_SATELLITE
|
||||
|
@ -2490,7 +2490,7 @@ class ConsoleSupervisor
|
|||
foreach ($server_version_list as $server) {
|
||||
if (strpos(
|
||||
$server['version'],
|
||||
$config['current_package']
|
||||
(string) floor($config['current_package'])
|
||||
) === false
|
||||
) {
|
||||
$missed++;
|
||||
|
@ -2511,6 +2511,8 @@ class ConsoleSupervisor
|
|||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2741,7 +2743,7 @@ class ConsoleSupervisor
|
|||
$this->cleanNotifications('NOTIF.SYNCQUEUE.LENGTH.%');
|
||||
}
|
||||
|
||||
$items_min = $config['sync_queue_items_max'];
|
||||
$items_min = (isset($config['sync_queue_items_max']) === true) ? $config['sync_queue_items_max'] : 0;
|
||||
if (is_numeric($items_min) !== true && $items_min <= 0) {
|
||||
$items_min = self::MIN_SYNC_QUEUE_LENGTH;
|
||||
}
|
||||
|
|
|
@ -851,6 +851,8 @@ class HTML
|
|||
|
||||
foreach ($inputs as $input) {
|
||||
if (is_array(($input['arguments'] ?? null)) === true
|
||||
&& isset($input['arguments']) === true
|
||||
&& isset($input['arguments']['type']) === true
|
||||
&& $input['arguments']['type'] === 'submit'
|
||||
) {
|
||||
$output_submit .= self::printBlock($input, true);
|
||||
|
|
|
@ -336,7 +336,7 @@ class OrderInterpreter extends Wizard
|
|||
),
|
||||
],
|
||||
[
|
||||
'name' => __('Update Manager'),
|
||||
'name' => __('Warp Update'),
|
||||
'icon' => ui_get_full_url(
|
||||
'images/menu/um_messages.menu_gray.png'
|
||||
),
|
||||
|
@ -404,10 +404,10 @@ class OrderInterpreter extends Wizard
|
|||
'.$value['name'].'</a><br>';
|
||||
}
|
||||
|
||||
$iterator ++;
|
||||
$iterator++;
|
||||
|
||||
if ($iterator > 10) {
|
||||
$more_results ++;
|
||||
$more_results++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ class WelcomeWindow extends Wizard
|
|||
{
|
||||
global $config;
|
||||
|
||||
return $config['welcome_id_agent'];
|
||||
return (isset($config['welcome_id_agent']) === true) ? $config['welcome_id_agent'] : '';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC220609';
|
||||
$pandora_version = 'v7.0NG.762';
|
||||
$build_version = 'PC220627';
|
||||
$pandora_version = 'v7.0NG.763';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
|
|
@ -294,7 +294,11 @@ define('SERVICE_ELEMENT_DYNAMIC', 'dynamic');
|
|||
define('SERVICE_MODE_MANUAL', 0);
|
||||
define('SERVICE_MODE_SMART', 1);
|
||||
|
||||
|
||||
// New installation Product Logo.
|
||||
define('HEADER_LOGO_DEFAULT_CLASSIC', 'logo-default-pandorafms.png');
|
||||
define('HEADER_LOGO_DEFAULT_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
|
||||
define('HEADER_LOGO_BLACK_CLASSIC', 'logo-black-pandorafms.png');
|
||||
define('HEADER_LOGO_BLACK_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
|
||||
|
||||
// Status images.
|
||||
// For modules.
|
||||
|
@ -802,7 +806,7 @@ define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management');
|
|||
define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
|
||||
define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
|
||||
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
|
||||
define('AUDIT_LOG_UMC', 'Update Manager');
|
||||
define('AUDIT_LOG_UMC', 'Warp Manager');
|
||||
|
||||
// MIMEs.
|
||||
define(
|
||||
|
|
|
@ -1993,7 +1993,8 @@ function get_snmpwalk(
|
|||
$snmp_port='',
|
||||
$server_to_exec=0,
|
||||
$extra_arguments='',
|
||||
$format='-Oa'
|
||||
$format='-Oa',
|
||||
$load_mibs='-m ALL'
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -2057,15 +2058,15 @@ function get_snmpwalk(
|
|||
case '3':
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -2074,7 +2075,7 @@ function get_snmpwalk(
|
|||
case '2c':
|
||||
case '1':
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4260,7 +4261,9 @@ function get_product_name()
|
|||
|
||||
$stored_name = enterprise_hook('enterprise_get_product_name');
|
||||
if (empty($stored_name) || $stored_name == ENTERPRISE_NOT_HOOK) {
|
||||
if ($config['rb_product_name_alt']) {
|
||||
if (isset($config['rb_product_name_alt']) === true
|
||||
&& empty($config['rb_product_name_alt']) === false
|
||||
) {
|
||||
return $config['rb_product_name_alt'];
|
||||
}
|
||||
|
||||
|
|
|
@ -2598,10 +2598,9 @@ function agents_delete_agent($id_agents, $disableACL=false)
|
|||
'tagente_modulo',
|
||||
$filter
|
||||
);
|
||||
|
||||
if (is_array($rows) === true) {
|
||||
foreach ($rows as $row) {
|
||||
$modules[] = PandoraFMS\Module::build($row);
|
||||
$modules[] = PandoraFMS\Module::build($row, '\PandoraFMS\Module', true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2876,9 +2876,6 @@ function alerts_get_alert_fired($filters=[], $groupsBy=[])
|
|||
global $config;
|
||||
|
||||
$table = 'tevento';
|
||||
if (is_metaconsole() === true) {
|
||||
$table = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
$filter_date = '';
|
||||
if (isset($filters['period']) === true
|
||||
|
|
|
@ -53,8 +53,10 @@ enterprise_include_once('include/functions_clusters.php');
|
|||
enterprise_include_once('include/functions_alerts.php');
|
||||
|
||||
// Clases.
|
||||
use PandoraFMS\Agent;
|
||||
use PandoraFMS\Module;
|
||||
use PandoraFMS\Enterprise\Cluster;
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
use PandoraFMS\SpecialDay;
|
||||
|
||||
|
||||
|
@ -386,23 +388,6 @@ function api_get_test_agent_cache()
|
|||
}
|
||||
|
||||
|
||||
// Returs the string OK if a connection to the event replication DB can be established.
|
||||
function api_get_test_event_replication_db()
|
||||
{
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$status = enterprise_hook('events_test_replication_db', []);
|
||||
if ($status === ENTERPRISE_NOT_HOOK) {
|
||||
echo 'ERR';
|
||||
return;
|
||||
}
|
||||
|
||||
echo $status;
|
||||
}
|
||||
|
||||
|
||||
// -------------------------DEFINED OPERATIONS FUNCTIONS-----------------
|
||||
|
||||
|
||||
|
@ -1842,18 +1827,18 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
|||
/**
|
||||
* Create a new agent, and print the id for new agent.
|
||||
*
|
||||
* @param $thrash1 Don't use.
|
||||
* @param $id_node Id_node target (if metaconsole)
|
||||
* @param $thrash2 Don't use.
|
||||
* @param array $other it's array, $other as param is <agent_name>;<ip>;<id_parent>;<id_group>;
|
||||
* <cascade_protection>;<interval_sec>;<id_os>;<id_server>;<custom_id>;<learning_mode>;<disabled>;<description> in this order
|
||||
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* example:
|
||||
* @param array $other it's array, $other as param is <agent_name>;<ip>;<id_parent>;<id_group>;
|
||||
* <cascade_protection>;<interval_sec>;<id_os>;<id_server>;<custom_id>;<learning_mode>;<disabled>;<description> in this order
|
||||
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* example:
|
||||
*
|
||||
* api.php?op=set&op2=new_agent&other=pepito|1.1.1.1|0|4|0|30|8|10||0|0|nose%20nose&other_mode=url_encode_separator_|
|
||||
* api.php?op=set&op2=new_agent&other=pepito|1.1.1.1|0|4|0|30|8|10||0|0|nose%20nose&other_mode=url_encode_separator_|
|
||||
*
|
||||
* @param $thrash3 Don't use.
|
||||
*/
|
||||
function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
||||
function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -1862,158 +1847,117 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
|||
return;
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int) $other['data'][3] == 0) {
|
||||
returnError('For security reasons, the agent was not created. Use a group other than 0.');
|
||||
return;
|
||||
}
|
||||
|
||||
$alias = io_safe_input(
|
||||
trim(
|
||||
preg_replace(
|
||||
'/[\/\\\|%#&$]/',
|
||||
'',
|
||||
preg_replace(
|
||||
'/x20;/',
|
||||
' ',
|
||||
$other['data'][0]
|
||||
try {
|
||||
$agent = new Agent();
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if ($id_node <= 0) {
|
||||
throw new Exception('No node id specified');
|
||||
}
|
||||
|
||||
$node = new Node($id_node);
|
||||
$id_agente = $node->callApi(
|
||||
'new_agent',
|
||||
'set',
|
||||
null,
|
||||
null,
|
||||
$other['data'],
|
||||
null
|
||||
);
|
||||
} else {
|
||||
$alias = io_safe_input(
|
||||
trim(
|
||||
preg_replace(
|
||||
'/[\/\\\|%#&$]/',
|
||||
'',
|
||||
preg_replace(
|
||||
'/x20;/',
|
||||
' ',
|
||||
$other['data'][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$direccion_agente = io_safe_input($other['data'][1]);
|
||||
$nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
|
||||
$id_parent = (int) $other['data'][2];
|
||||
$grupo = (int) $other['data'][3];
|
||||
$cascade_protection = (int) $other['data'][4];
|
||||
$cascade_protection_module = (int) $other['data'][5];
|
||||
$intervalo = (string) $other['data'][6];
|
||||
$id_os = (int) $other['data'][7];
|
||||
$server_name = (string) $other['data'][8];
|
||||
$custom_id = (string) $other['data'][9];
|
||||
$modo = (int) $other['data'][10];
|
||||
$disabled = (int) $other['data'][11];
|
||||
$comentarios = (string) $other['data'][12];
|
||||
$alias_as_name = (int) $other['data'][13];
|
||||
$update_module_count = (int) $config['metaconsole_agent_cache'] == 1;
|
||||
|
||||
if ($cascade_protection == 1) {
|
||||
if (($id_parent != 0) && (db_get_value_sql(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = '.$id_parent.' AND id_agente_modulo = '.$cascade_protection_module
|
||||
) === false)
|
||||
) {
|
||||
returnError('Cascade protection is not applied because it is not a parent module.');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$cascadeProtectionModule = 0;
|
||||
}
|
||||
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$server_name.'"');
|
||||
|
||||
// Check if agent exists (BUG WC-50518-2).
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('No agent alias specified');
|
||||
} else if (agents_get_agent_id($nombre_agente)) {
|
||||
returnError('The agent name already exists in DB.');
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
|
||||
returnError('The group does not exist.');
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
returnError('Agent cannot be created due to the maximum agent limit for this group');
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
|
||||
returnError('The OS does not exist.');
|
||||
} else if ($server_name === false) {
|
||||
returnError('The '.get_product_name().' Server does not exist.');
|
||||
} else {
|
||||
if ($alias_as_name === 1) {
|
||||
$exists_alias = db_get_row_sql('SELECT nombre FROM tagente WHERE nombre = "'.$alias.'"');
|
||||
$nombre_agente = $alias;
|
||||
}
|
||||
|
||||
$exists_ip = false;
|
||||
|
||||
if ($config['unique_ip'] && $direccion_agente != '') {
|
||||
$exists_ip = db_get_row_sql('SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"');
|
||||
}
|
||||
|
||||
if (!$exists_alias && !$exists_ip) {
|
||||
$id_agente = db_process_sql_insert(
|
||||
'tagente',
|
||||
[
|
||||
'nombre' => $nombre_agente,
|
||||
'alias' => $alias,
|
||||
'alias_as_name' => $alias_as_name,
|
||||
'direccion' => $direccion_agente,
|
||||
'id_grupo' => $grupo,
|
||||
'intervalo' => $intervalo,
|
||||
'comentarios' => $comentarios,
|
||||
'modo' => $modo,
|
||||
'id_os' => $id_os,
|
||||
'disabled' => $disabled,
|
||||
'cascade_protection' => $cascade_protection,
|
||||
'cascade_protection_module' => $cascade_protection_module,
|
||||
'server_name' => $server_name,
|
||||
'id_parent' => $id_parent,
|
||||
'custom_id' => $custom_id,
|
||||
'os_version' => '',
|
||||
'agent_version' => '',
|
||||
'timezone_offset' => 0,
|
||||
'icon_path' => '',
|
||||
'url_address' => '',
|
||||
'update_module_count' => $update_module_count,
|
||||
]
|
||||
);
|
||||
enterprise_hook('update_agent', [$id_agente]);
|
||||
} else {
|
||||
$id_agente = false;
|
||||
}
|
||||
|
||||
if ($id_agente !== false) {
|
||||
// Create address for this agent in taddress.
|
||||
if ($direccion_agente != '') {
|
||||
agents_add_address($id_agente, $direccion_agente);
|
||||
$direccion_agente = io_safe_input($other['data'][1]);
|
||||
$id_parent = (int) $other['data'][2];
|
||||
$grupo = (int) $other['data'][3];
|
||||
$cascade_protection = (int) $other['data'][4];
|
||||
$cascade_protection_module = (int) $other['data'][5];
|
||||
$intervalo = (string) $other['data'][6];
|
||||
$id_os = (int) $other['data'][7];
|
||||
$server_name = (string) $other['data'][8];
|
||||
$custom_id = (string) $other['data'][9];
|
||||
$modo = (int) $other['data'][10];
|
||||
$disabled = (int) $other['data'][11];
|
||||
$comentarios = (string) html_entity_decode($other['data'][12]);
|
||||
$alias_as_name = (int) $other['data'][13];
|
||||
$update_module_count = (int) $config['metaconsole_agent_cache'] == 1;
|
||||
|
||||
$agent->nombre($alias);
|
||||
$agent->alias($alias);
|
||||
$agent->alias_as_name($alias_as_name);
|
||||
$agent->direccion($direccion_agente);
|
||||
$agent->id_grupo($grupo);
|
||||
$agent->intervalo($intervalo);
|
||||
$agent->comentarios($comentarios);
|
||||
$agent->modo($modo);
|
||||
$agent->id_os($id_os);
|
||||
$agent->disabled($disabled);
|
||||
$agent->cascade_protection($cascade_protection);
|
||||
$agent->cascade_protection_module($cascade_protection_module);
|
||||
$agent->server_name($server_name);
|
||||
$agent->id_parent($id_parent);
|
||||
$agent->custom_id($custom_id);
|
||||
$agent->timezone_offset(0);
|
||||
$agent->update_module_count($update_module_count);
|
||||
|
||||
if ($cascade_protection == 1) {
|
||||
if ($id_parent != 0) {
|
||||
try {
|
||||
$parent = new Agent($id_parent);
|
||||
} catch (\Exception $e) {
|
||||
returnError('Cascade protection is not applied because it is not a parent module.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info = '{"Name":"'.$nombre_agente.'",
|
||||
"IP":"'.$direccion_agente.'",
|
||||
"Group":"'.$grupo.'",
|
||||
"Interval":"'.$intervalo.'",
|
||||
"Comments":"'.$comentarios.'",
|
||||
"Mode":"'.$modo.'",
|
||||
"ID_parent:":"'.$id_parent.'",
|
||||
"Server":"'.$server_name.'",
|
||||
"ID os":"'.$id_os.'",
|
||||
"Disabled":"'.$disabled.'",
|
||||
"Custom ID":"'.$custom_id.'",
|
||||
"Cascade protection":"'.$cascade_protection.'",
|
||||
"Cascade protection module":"'.$cascade_protection_module.'"}';
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$server_name.'"');
|
||||
|
||||
$unsafe_alias = io_safe_output($alias);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_AGENT_MANAGEMENT,
|
||||
'Created agent '.$unsafe_alias,
|
||||
false,
|
||||
true,
|
||||
$info
|
||||
);
|
||||
} else {
|
||||
$id_agente = 0;
|
||||
|
||||
if ($exists_alias) {
|
||||
$agent_creation_error = 'Could not be created because name already exists';
|
||||
} else if ($exists_ip) {
|
||||
$agent_creation_error = 'Could not be created because IP already exists';
|
||||
// Check if agent exists (BUG WC-50518-2).
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('No agent alias specified');
|
||||
} else if (agents_get_agent_id($nombre_agente)) {
|
||||
returnError('The agent name already exists in DB.');
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
|
||||
returnError('The group does not exist.');
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
returnError('Agent cannot be created due to the maximum agent limit for this group');
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
|
||||
returnError('The OS does not exist.');
|
||||
} else if ($server_name === false) {
|
||||
returnError('The '.get_product_name().' Server does not exist.');
|
||||
} else {
|
||||
$agent_creation_error = 'Could not be created for unknown reason';
|
||||
}
|
||||
if ($alias_as_name === 1) {
|
||||
$exists_alias = db_get_row_sql('SELECT nombre FROM tagente WHERE nombre = "'.$alias.'"');
|
||||
$nombre_agente = $alias;
|
||||
}
|
||||
|
||||
returnError($agent_creation_error);
|
||||
return;
|
||||
$exists_ip = false;
|
||||
|
||||
if ($config['unique_ip'] && $direccion_agente != '') {
|
||||
$exists_ip = db_get_row_sql('SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"');
|
||||
}
|
||||
|
||||
$agent->save((bool) $alias_as_name);
|
||||
$id_agente = $agent->id_agente();
|
||||
$agent->updateFromCache();
|
||||
}
|
||||
}
|
||||
|
||||
returnData(
|
||||
|
@ -2023,6 +1967,9 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
|||
'data' => $id_agente,
|
||||
]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
returnError($e->getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5116,7 +5063,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
|
|||
function api_set_new_network_component($id, $thrash1, $other, $thrash2)
|
||||
{
|
||||
global $config;
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5218,7 +5165,7 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2)
|
|||
{
|
||||
global $config;
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5498,7 +5445,7 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2)
|
|||
{
|
||||
global $config;
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -10928,11 +10875,6 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3)
|
|||
return;
|
||||
}
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
returnError('Parameter error.');
|
||||
|
@ -10998,7 +10940,7 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3)
|
|||
}
|
||||
|
||||
$count = db_process_sql_update(
|
||||
$table_events,
|
||||
'tevento',
|
||||
['estado' => 1],
|
||||
$filterString
|
||||
);
|
||||
|
@ -11024,12 +10966,6 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3)
|
|||
}
|
||||
|
||||
$simulate = false;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
returnError('Parameter error.');
|
||||
|
@ -11064,14 +11000,14 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3)
|
|||
}
|
||||
|
||||
if ($simulate) {
|
||||
$rows = db_get_all_rows_filter($table_events, $filterString);
|
||||
$rows = db_get_all_rows_filter('tevento', $filterString);
|
||||
if ($rows !== false) {
|
||||
returnData('string', count($rows));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$count = db_process_sql_update(
|
||||
$table_events,
|
||||
'tevento',
|
||||
['estado' => 1],
|
||||
$filterString
|
||||
);
|
||||
|
@ -11341,9 +11277,6 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
|||
global $config;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole() === true) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
// By default.
|
||||
$status = 3;
|
||||
|
@ -11561,21 +11494,19 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
|||
}
|
||||
|
||||
if ($group_rep == 0) {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
if ($filter['total']) {
|
||||
$sql = 'SELECT COUNT(*)
|
||||
if ($filter['total']) {
|
||||
$sql = 'SELECT COUNT(*)
|
||||
FROM '.$table_events.'
|
||||
WHERE 1=1 '.$sql_post;
|
||||
} else if ($filter['more_criticity']) {
|
||||
$sql = 'SELECT criticity
|
||||
} else if ($filter['more_criticity']) {
|
||||
$sql = 'SELECT criticity
|
||||
FROM '.$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY criticity DESC
|
||||
LIMIT 1';
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$sql = 'SELECT *,
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = '.$table_events.'.id_grupo) AS group_name,
|
||||
|
@ -11585,8 +11516,8 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
|||
FROM '.$table_events.$alert_join.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
} else {
|
||||
$sql = 'SELECT *,
|
||||
} else {
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
|
@ -11605,109 +11536,19 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
|||
FROM '.$table_events.$alert_join.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
// TODO TOTAL
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
WHERE id_module IN (
|
||||
SELECT tagente_modulo.id_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE tagente_modulo.id_agente_modulo=tevento.id_agentmodule)) AS module_name
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
// TODO TOTAL
|
||||
$set = [];
|
||||
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS alias,
|
||||
(SELECT t1.nombre
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
WHERE id_module IN (
|
||||
SELECT tagente_modulo.id_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE tagente_modulo.id_agente_modulo=tevento.id_agentmodule)) AS module_name
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.' ORDER BY utimestamp DESC';
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
db_process_sql('SET group_concat_max_len = 9999999');
|
||||
db_process_sql('SET group_concat_max_len = 9999999');
|
||||
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_rep DESC';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
array_to_string(array_agg(DISTINCT user_comment), '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_rep DESC';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$set = [];
|
||||
// TODO: Remove duplicate user comments
|
||||
$sql = 'SELECT a.*, b.event_rep, b.timestamp_rep
|
||||
FROM (SELECT *
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.") a,
|
||||
(SELECT MAX (id_evento) AS id_evento,
|
||||
to_char(evento) AS evento, id_agentmodule,
|
||||
COUNT(*) AS event_rep, MIN(estado) AS min_estado,
|
||||
MAX(estado) AS max_estado,
|
||||
LISTAGG(user_comment, '') AS user_comment,
|
||||
MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY to_char(evento), id_agentmodule) b
|
||||
WHERE a.id_evento=b.id_evento AND
|
||||
to_char(a.evento)=to_char(b.evento) AND
|
||||
a.id_agentmodule=b.id_agentmodule';
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
}
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_last
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_last DESC';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
|
@ -11838,17 +11679,9 @@ function api_set_event($id_event, $unused1, $params, $unused2, $unused3)
|
|||
}
|
||||
}
|
||||
|
||||
// In meta or node.
|
||||
if (is_metaconsole() === true) {
|
||||
$table = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table = 'tevento';
|
||||
}
|
||||
|
||||
// TODO. Stablish security for prevent sql injection?
|
||||
// Update the row
|
||||
$result = db_process_sql_update(
|
||||
$table,
|
||||
'tevento',
|
||||
$paramsSerialize,
|
||||
[ 'id_evento' => $id_event ]
|
||||
);
|
||||
|
@ -11919,15 +11752,7 @@ function api_get_events($node_id, $trash2, $other, $returnType, $user_in_db=null
|
|||
$filterString = otherParameter2Filter($other, false, $use_agent_name);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
if ((int) $node_id !== 0) {
|
||||
$filterString .= ' AND server_id = '.$node_id;
|
||||
}
|
||||
|
||||
$dataRows = db_get_all_rows_filter('tmetaconsole_event', $filterString);
|
||||
} else {
|
||||
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
||||
}
|
||||
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
||||
|
||||
$last_error = error_get_last();
|
||||
if (empty($dataRows)) {
|
||||
|
@ -13144,18 +12969,20 @@ function api_get_event_info($id_event, $trash1, $trash, $returnType)
|
|||
{
|
||||
global $config;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tevento
|
||||
WHERE id_evento= %d',
|
||||
$id_event
|
||||
);
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM '.$table_events."
|
||||
WHERE id_evento=$id_event";
|
||||
$event_data = db_get_row_sql($sql);
|
||||
|
||||
// Check the access to group
|
||||
if (!empty($event_data['id_grupo']) && $event_data['id_grupo'] > 0 && !$event_data['id_agente']) {
|
||||
if (!empty($event_data['id_grupo'])
|
||||
&& $event_data['id_grupo'] > 0
|
||||
&& !$event_data['id_agente']
|
||||
) {
|
||||
if (!check_acl($config['id_user'], $event_data['id_grupo'], 'ER')) {
|
||||
returnError('forbidden', $returnType);
|
||||
return;
|
||||
|
@ -13163,8 +12990,14 @@ function api_get_event_info($id_event, $trash1, $trash, $returnType)
|
|||
}
|
||||
|
||||
// Check the access to agent
|
||||
if (!empty($event_data['id_agente']) && $event_data['id_agente'] > 0) {
|
||||
if (!util_api_check_agent_and_print_error($event_data['id_agente'], $returnType)) {
|
||||
if (!empty($event_data['id_agente'])
|
||||
&& $event_data['id_agente'] > 0
|
||||
) {
|
||||
if (!util_api_check_agent_and_print_error(
|
||||
$event_data['id_agente'],
|
||||
$returnType
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -13452,13 +13285,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
|
||||
if ($other['data'][18] != '') {
|
||||
$values['id_extra'] = $other['data'][18];
|
||||
if (is_metaconsole()) {
|
||||
$table_event = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table_event = 'tevento';
|
||||
}
|
||||
|
||||
$sql_validation = 'SELECT id_evento FROM '.$table_event.' where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$validation = db_get_all_rows_sql($sql_validation);
|
||||
if ($validation) {
|
||||
foreach ($validation as $val) {
|
||||
|
@ -13500,9 +13327,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
$res = events_comment(
|
||||
$return,
|
||||
$user_comment,
|
||||
'Added comment',
|
||||
is_metaconsole(),
|
||||
$config['history_db_enabled']
|
||||
'Added comment'
|
||||
);
|
||||
if ($other['data'][13] != '') {
|
||||
// owner user
|
||||
|
@ -13512,9 +13337,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
events_change_owner(
|
||||
$return,
|
||||
$owner_user,
|
||||
true,
|
||||
is_metaconsole(),
|
||||
$config['history_db_enabled']
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -13570,9 +13393,7 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3)
|
|||
$status = events_comment(
|
||||
$id,
|
||||
$comment,
|
||||
'Added comment',
|
||||
$meta,
|
||||
$history
|
||||
'Added comment'
|
||||
);
|
||||
if (is_error($status)) {
|
||||
returnError(
|
||||
|
@ -13735,17 +13556,12 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy
|
|||
return;
|
||||
}
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
$data['type'] = 'string';
|
||||
$check_id = db_get_value('id_evento', $table_events, 'id_evento', $id);
|
||||
$check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id);
|
||||
|
||||
if ($check_id) {
|
||||
// event exists
|
||||
$status = db_get_value('estado', $table_events, 'id_evento', $id);
|
||||
$status = db_get_value('estado', 'tevento', 'id_evento', $id);
|
||||
if ($status == 1) {
|
||||
// event already validated
|
||||
$data['data'] = 'Event already validated.';
|
||||
|
@ -13759,7 +13575,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy
|
|||
'estado' => 1,
|
||||
];
|
||||
|
||||
$result = db_process_sql_update($table_events, $values, ['id_evento' => $id]);
|
||||
$result = db_process_sql_update('tevento', $values, ['id_evento' => $id]);
|
||||
|
||||
if ($result === false) {
|
||||
$data['data'] = 'The event could not be validated.';
|
||||
|
@ -17526,7 +17342,7 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access='A
|
|||
* Function for get event id and node id, then we get in return the Metaconsole event ID.
|
||||
*
|
||||
* @param [string] $server_id id server (Node)
|
||||
* @param [string] $console_event_id console Id node event in tmetaconsole_event
|
||||
* @param [string] $console_event_id console Id node event in tevent
|
||||
* @param [string] $trash2 don't use
|
||||
* @param [string] $returnType
|
||||
*
|
||||
|
@ -17537,19 +17353,54 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access='A
|
|||
*/
|
||||
function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType)
|
||||
{
|
||||
global $config;
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
// Get grouped comments.
|
||||
$mc_event_id = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT id_evento
|
||||
FROM tevento
|
||||
WHERE id_evento = %d
|
||||
',
|
||||
$console_event_id
|
||||
)
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$mc_event_id = db_get_all_rows_sql("SELECT id_evento FROM tmetaconsole_event WHERE id_source_event = $console_event_id AND server_id = $server_id ");
|
||||
if ($mc_event_id !== false) {
|
||||
returnData($returnType, ['type' => 'string', 'data' => $mc_event_id]);
|
||||
returnData(
|
||||
$returnType,
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => $mc_event_id,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
returnError('id_not_found', 'string');
|
||||
}
|
||||
} else {
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
returnError('forbidden', 'string');
|
||||
return;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -17597,20 +17448,14 @@ function api_get_is_centralized($server_id, $thrash1, $thrash2, $returnType)
|
|||
function api_set_event_in_progress($event_id, $trash2, $returnType)
|
||||
{
|
||||
global $config;
|
||||
if (is_metaconsole()) {
|
||||
$table = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table = 'tevento';
|
||||
}
|
||||
|
||||
$event = db_process_sql_update(
|
||||
$table,
|
||||
'tevento',
|
||||
['estado' => 2],
|
||||
['id_evento' => $event_id]
|
||||
);
|
||||
|
||||
if ($event !== false) {
|
||||
returnData('string', ['data' => $event]);
|
||||
returnData('string', ['data' => $event]);
|
||||
} else {
|
||||
returnError('id_not_found', 'string');
|
||||
}
|
||||
|
|
|
@ -409,32 +409,6 @@ function config_update_config()
|
|||
$error_update[] = __('Size of collection');
|
||||
}
|
||||
|
||||
if (config_update_value('event_replication', (int) get_parameter('event_replication'), true) === false) {
|
||||
$error_update[] = __('Events replication');
|
||||
}
|
||||
|
||||
if ((int) get_parameter('event_replication') === 1) {
|
||||
if (config_update_value('replication_interval', (int) get_parameter('replication_interval'), true) === false) {
|
||||
$error_update[] = __('Replication interval');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_limit', (int) get_parameter('replication_limit'), true) === false) {
|
||||
$error_update[] = __('Replication limit');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_mode', (string) get_parameter('replication_mode'), true) === false) {
|
||||
$error_update[] = __('Replication mode');
|
||||
}
|
||||
|
||||
if (config_update_value('show_events_in_local', (string) get_parameter('show_events_in_local'), true) === false) {
|
||||
$error_update[] = __('Show events list in local console (read only)');
|
||||
}
|
||||
}
|
||||
|
||||
if (config_update_value('replication_dbengine', (string) get_parameter('replication_dbengine'), true) === false) {
|
||||
$error_update[] = __('Replication DB engine');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_dbhost', (string) get_parameter('replication_dbhost'), true) === false) {
|
||||
$error_update[] = __('Replication DB host');
|
||||
}
|
||||
|
@ -928,6 +902,10 @@ function config_update_config()
|
|||
$error_update[] = __('SNMP walk binary path (fallback for v1)');
|
||||
}
|
||||
|
||||
if (config_update_value('wmiBinary', get_parameter('wmiBinary'), true) === false) {
|
||||
$error_update[] = __('Default WMI Binary');
|
||||
}
|
||||
|
||||
$pjs = get_parameter('phantomjs_cache_interval');
|
||||
switch ($pjs) {
|
||||
case $config['phantomjs_cache_interval']:
|
||||
|
@ -1183,6 +1161,10 @@ function config_update_config()
|
|||
$error_update[] = __('Default line thickness for the Visual Console');
|
||||
}
|
||||
|
||||
if (config_update_value('mobile_view_orientation_vc', (int) get_parameter('mobile_view_orientation_vc'), true) === false) {
|
||||
$error_update[] = __('Mobile view not allow visual console orientation');
|
||||
}
|
||||
|
||||
if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) {
|
||||
$error_update[] = __('Default line menu items for the Services');
|
||||
}
|
||||
|
@ -1607,7 +1589,7 @@ function config_update_config()
|
|||
'port' => $config['history_db_port'],
|
||||
'name' => $config['history_db_name'],
|
||||
'user' => $config['history_db_user'],
|
||||
'pass' => $config['history_db_pass'],
|
||||
'pass' => io_output_password($config['history_db_pass']),
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -1619,48 +1601,47 @@ function config_update_config()
|
|||
$dbm->process();
|
||||
} else if ($dbm->check() !== true) {
|
||||
$errors[] = $dbm->getLastError();
|
||||
config_update_value('history_db_enabled', false);
|
||||
}
|
||||
|
||||
if ($dbm->check() === true) {
|
||||
// Historical configuration tokens (stored in historical db).
|
||||
if ($dbm->setConfigToken(
|
||||
'days_purge',
|
||||
get_parameter('history_dbh_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database purge');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'history_partitions_auto',
|
||||
get_parameter_switch('history_partitions_auto', 0)
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database partitions');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'event_purge',
|
||||
get_parameter('history_dbh_events_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database events purge');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'string_purge',
|
||||
get_parameter('history_dbh_string_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database string purge');
|
||||
}
|
||||
|
||||
// Disable history db in history db.
|
||||
$dbm->setConfigToken('history_db_enabled', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Historical configuration tokens (stored in historical db).
|
||||
if (Config::set(
|
||||
'days_purge',
|
||||
get_parameter('history_dbh_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database purge');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'history_partitions_auto',
|
||||
get_parameter_switch('history_partitions_auto', 0),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database partitions');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'event_purge',
|
||||
get_parameter('history_dbh_events_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database events purge');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'string_purge',
|
||||
get_parameter('history_dbh_string_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database string purge');
|
||||
}
|
||||
|
||||
// Disable history db in history db.
|
||||
Config::set('history_db_enabled', 0, true);
|
||||
break;
|
||||
|
||||
case 'ehorus':
|
||||
|
@ -2054,6 +2035,10 @@ function config_process_config()
|
|||
config_update_value('max_execution_event_response', 10);
|
||||
}
|
||||
|
||||
if (!isset($config['max_number_of_events_per_node'])) {
|
||||
config_update_value('max_number_of_events_per_node', 100000);
|
||||
}
|
||||
|
||||
if (!isset($config['max_macro_fields'])) {
|
||||
config_update_value('max_macro_fields', 10);
|
||||
}
|
||||
|
@ -2088,6 +2073,10 @@ function config_process_config()
|
|||
config_update_value('snmpwalk_fallback', 'snmpwalk');
|
||||
}
|
||||
|
||||
if (isset($config['wmiBinary']) === false) {
|
||||
config_update_value('wmiBinary', 'pandorawmic');
|
||||
}
|
||||
|
||||
if (!isset($config['event_purge'])) {
|
||||
config_update_value('event_purge', 15);
|
||||
}
|
||||
|
@ -2132,22 +2121,6 @@ function config_process_config()
|
|||
config_update_value('policy_add_max_agents', 200);
|
||||
}
|
||||
|
||||
if (!isset($config['event_replication'])) {
|
||||
config_update_value('event_replication', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_interval'])) {
|
||||
config_update_value('replication_interval', 10);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_limit'])) {
|
||||
config_update_value('replication_limit', 50);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_dbengine'])) {
|
||||
config_update_value('replication_dbengine', 'mysql');
|
||||
}
|
||||
|
||||
if (!isset($config['replication_dbhost'])) {
|
||||
config_update_value('replication_dbhost', '');
|
||||
}
|
||||
|
@ -2168,18 +2141,10 @@ function config_process_config()
|
|||
config_update_value('replication_dbport', '');
|
||||
}
|
||||
|
||||
if (!isset($config['replication_mode'])) {
|
||||
config_update_value('replication_mode', 'only_validated');
|
||||
}
|
||||
|
||||
if (!isset($config['metaconsole_agent_cache'])) {
|
||||
config_update_value('metaconsole_agent_cache', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['show_events_in_local'])) {
|
||||
config_update_value('show_events_in_local', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['log_collector'])) {
|
||||
config_update_value('log_collector', 0);
|
||||
}
|
||||
|
@ -2357,12 +2322,12 @@ function config_process_config()
|
|||
config_update_value('custom_favicon', '');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_logo'])) {
|
||||
config_update_value('custom_logo', 'pandora_logo_head_4.png');
|
||||
if (isset($config['custom_logo']) === false) {
|
||||
config_update_value('custom_logo', HEADER_LOGO_DEFAULT_CLASSIC);
|
||||
}
|
||||
|
||||
if (!isset($config['custom_logo_collapsed'])) {
|
||||
config_update_value('custom_logo_collapsed', 'pandora_logo_green_collapsed.png');
|
||||
if (isset($config['custom_logo_collapsed']) === false) {
|
||||
config_update_value('custom_logo_collapsed', HEADER_LOGO_DEFAULT_COLLAPSED);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
|
@ -3066,6 +3031,10 @@ function config_process_config()
|
|||
config_update_value('vc_line_thickness', 2);
|
||||
}
|
||||
|
||||
if (isset($config['mobile_view_orientation_vc']) === false) {
|
||||
config_update_value('mobile_view_orientation_vc', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_size_text_small'])) {
|
||||
config_update_value('agent_size_text_small', 18);
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info
|
|||
if (isset($config['remote_addr']) === true) {
|
||||
$ip = $config['remote_addr'];
|
||||
} else {
|
||||
if ($_SERVER['REMOTE_ADDR']) {
|
||||
if (isset($_SERVER['REMOTE_ADDR']) === true) {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
} else {
|
||||
$ip = __('N/A');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3286,73 +3286,6 @@ function series_suffix_leyend($series_name, $series_suffix, $id_agent, $data_mod
|
|||
}
|
||||
|
||||
|
||||
function graph_events_validated($width=300, $height=200, $extra_filters=[], $meta=false, $history=false)
|
||||
{
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
$event_type = false;
|
||||
if (array_key_exists('event_type', $extra_filters)) {
|
||||
$event_type = $extra_filters['event_type'];
|
||||
}
|
||||
|
||||
$event_severity = false;
|
||||
if (array_key_exists('event_severity', $extra_filters)) {
|
||||
$event_severity = $extra_filters['event_severity'];
|
||||
}
|
||||
|
||||
$event_status = false;
|
||||
if (array_key_exists('event_status', $extra_filters)) {
|
||||
$event_status = $extra_filters['event_status'];
|
||||
}
|
||||
|
||||
$event_filter_search = false;
|
||||
if (array_key_exists('event_filter_search', $extra_filters)) {
|
||||
$event_filter_search = $extra_filters['event_filter_search'];
|
||||
}
|
||||
|
||||
$data_graph = events_get_count_events_validated(
|
||||
['id_group' => array_keys(users_get_groups())],
|
||||
null,
|
||||
null,
|
||||
$event_severity,
|
||||
$event_type,
|
||||
$event_status,
|
||||
$event_filter_search
|
||||
);
|
||||
|
||||
$colors = [];
|
||||
foreach ($data_graph as $k => $v) {
|
||||
if ($k == __('Validated')) {
|
||||
$colors[$k] = COL_NORMAL;
|
||||
} else {
|
||||
$colors[$k] = COL_CRITICAL;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config['fixed_graph'] == false) {
|
||||
$water_mark = [
|
||||
'file' => $config['homedir'].'/images/logo_vertical_water.png',
|
||||
'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false),
|
||||
];
|
||||
}
|
||||
|
||||
echo pie_graph(
|
||||
$data_graph,
|
||||
$width,
|
||||
$height,
|
||||
__('other'),
|
||||
'',
|
||||
$water_mark,
|
||||
$config['fontpath'],
|
||||
$config['font_size'],
|
||||
1,
|
||||
'bottom',
|
||||
$colors
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print a pie graph with events data of group
|
||||
*
|
||||
|
@ -3365,13 +3298,13 @@ function grafico_eventos_grupo($width=300, $height=200, $url='', $noWaterMark=tr
|
|||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
// It was urlencoded, so we urldecode it
|
||||
// It was urlencoded, so we urldecode it.
|
||||
$url = html_entity_decode(rawurldecode($url), ENT_QUOTES);
|
||||
$data = [];
|
||||
$loop = 0;
|
||||
define('NUM_PIECES_PIE', 6);
|
||||
|
||||
// Hotfix for the id_agente_modulo
|
||||
// Hotfix for the id_agente_modulo.
|
||||
$url = str_replace(
|
||||
'SELECT id_agente_modulo',
|
||||
'SELECT_id_agente_modulo',
|
||||
|
@ -3386,22 +3319,24 @@ function grafico_eventos_grupo($width=300, $height=200, $url='', $noWaterMark=tr
|
|||
'INSERT ',
|
||||
'EXEC',
|
||||
];
|
||||
// remove bad strings from the query so queries like ; DELETE FROM don't pass
|
||||
// remove bad strings from the query so queries like ; DELETE FROM don't pass.
|
||||
$url = str_ireplace($badstrings, '', $url);
|
||||
|
||||
// Hotfix for the id_agente_modulo
|
||||
// Hotfix for the id_agente_modulo.
|
||||
$url = str_replace(
|
||||
'SELECT_id_agente_modulo',
|
||||
'SELECT id_agente_modulo',
|
||||
$url
|
||||
);
|
||||
|
||||
$event_table = 'tevento';
|
||||
$field_extra = '';
|
||||
$groupby_extra = '';
|
||||
|
||||
// Add tags condition to filter
|
||||
$tags_condition = tags_get_acl_tags($config['id_user'], 0, 'ER', 'event_condition', 'AND');
|
||||
// Add tags condition to filter.
|
||||
$tags_condition = tags_get_acl_tags(
|
||||
$config['id_user'],
|
||||
0,
|
||||
'ER',
|
||||
'event_condition',
|
||||
'AND'
|
||||
);
|
||||
|
||||
if ($time_limit && $config['event_view_hr']) {
|
||||
$tags_condition .= ' AND utimestamp > (UNIX_TIMESTAMP(NOW()) - '.($config['event_view_hr'] * SECONDS_1HOUR).')';
|
||||
|
@ -3409,14 +3344,14 @@ function grafico_eventos_grupo($width=300, $height=200, $url='', $noWaterMark=tr
|
|||
|
||||
// This will give the distinct id_agente, give the id_grupo that goes
|
||||
// with it and then the number of times it occured. GROUP BY statement
|
||||
// is required if both DISTINCT() and COUNT() are in the statement
|
||||
// is required if both DISTINCT() and COUNT() are in the statement.
|
||||
$sql = sprintf(
|
||||
'SELECT DISTINCT(id_agente) AS id_agente,
|
||||
COUNT(id_agente) AS count'.$field_extra.'
|
||||
FROM '.$event_table.' te LEFT JOIN tagent_secondary_group tasg
|
||||
COUNT(id_agente) AS count
|
||||
FROM tevento te LEFT JOIN tagent_secondary_group tasg
|
||||
ON te.id_grupo = tasg.id_group
|
||||
WHERE 1=1 %s %s
|
||||
GROUP BY id_agente'.$groupby_extra.'
|
||||
GROUP BY id_agente
|
||||
ORDER BY count DESC LIMIT 8',
|
||||
$url,
|
||||
$tags_condition
|
||||
|
@ -3456,7 +3391,7 @@ function grafico_eventos_grupo($width=300, $height=200, $url='', $noWaterMark=tr
|
|||
$data[$name] = $system_events;
|
||||
}
|
||||
|
||||
// Sort the data
|
||||
// Sort the data.
|
||||
arsort($data);
|
||||
if ($noWaterMark) {
|
||||
$water_mark = [
|
||||
|
|
|
@ -2690,7 +2690,9 @@ function html_print_input_password(
|
|||
}
|
||||
|
||||
if ($class) {
|
||||
$attr['class'] = $class;
|
||||
$attr['class'] = $class.' '.'password_input';
|
||||
} else {
|
||||
$attr['class'] = 'password_input';
|
||||
}
|
||||
|
||||
if ($disabled === false) {
|
||||
|
@ -2761,7 +2763,9 @@ function html_print_input_text(
|
|||
}
|
||||
|
||||
if ($class != '') {
|
||||
$attr['class'] = $class;
|
||||
$attr['class'] = $class.' '.'text_input';
|
||||
} else {
|
||||
$attr['class'] = 'text_input';
|
||||
}
|
||||
|
||||
if ($onChange != '') {
|
||||
|
@ -4237,6 +4241,82 @@ function html_print_image(
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function for print the logo in menu header.
|
||||
*
|
||||
* @param boolean $menuCollapsed If true, the menu is collapsed.
|
||||
* @param boolean $return If true, the formed element is returned.
|
||||
*
|
||||
* @return mixed.
|
||||
*/
|
||||
function html_print_header_logo_image(bool $menuCollapsed, bool $return=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (defined('PANDORA_ENTERPRISE') === false) {
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
$custom_logo = 'images/custom_logo/'.HEADER_LOGO_BLACK_CLASSIC;
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_COLLAPSED;
|
||||
} else if ($config['style'] === 'pandora') {
|
||||
$custom_logo = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_CLASSIC;
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.HEADER_LOGO_DEFAULT_COLLAPSED;
|
||||
}
|
||||
|
||||
$logo_title = get_product_name().' Opensource';
|
||||
} else {
|
||||
// Handle default logos when change theme.
|
||||
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;
|
||||
}
|
||||
|
||||
$logo_title = get_product_name().' Enterprise';
|
||||
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
|
||||
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
||||
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
|
||||
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo']) === true) {
|
||||
$output = html_print_image(
|
||||
$custom_logo,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '215',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_full',
|
||||
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo_collapsed']) === true) {
|
||||
$output .= html_print_image(
|
||||
$custom_logo_collapsed,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '60',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_icon',
|
||||
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($return === false) {
|
||||
echo $output;
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render an input text element. Extended version, use html_print_input_text() to simplify.
|
||||
*
|
||||
|
@ -4478,7 +4558,7 @@ function html_print_autocomplete_modules(
|
|||
100,
|
||||
false,
|
||||
'',
|
||||
['style' => 'background: url('.$module_icon.') no-repeat right; '.$text_color.'']
|
||||
['style' => 'border: none; padding: 2px 5px; margin-bottom: 4px; border-bottom: 1px solid #ccc; border-radius: 0; background: url('.$module_icon.') no-repeat right; '.$text_color.'']
|
||||
);
|
||||
html_print_input_hidden($name.'_hidden', $id_agent_module);
|
||||
|
||||
|
@ -4844,7 +4924,7 @@ function html_print_input($data, $wrapper='div', $input_only=false)
|
|||
|
||||
case 'image':
|
||||
$output .= html_print_input_image(
|
||||
$data['name'],
|
||||
((isset($data['name']) === true) ? $data['name'] : ''),
|
||||
$data['src'],
|
||||
$data['value'],
|
||||
((isset($data['style']) === true) ? $data['style'] : ''),
|
||||
|
|
|
@ -84,10 +84,7 @@ function get_notification_targets(int $id_message)
|
|||
|
||||
if (is_array($ret)) {
|
||||
foreach ($ret as $row) {
|
||||
array_push(
|
||||
$targets['users'],
|
||||
get_user_fullname($row['id_user'])
|
||||
);
|
||||
array_push($targets['users'], get_user_fullname($row['id_user']));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,8 +224,10 @@ function check_notification_readable(int $id_message)
|
|||
*
|
||||
* @return array [users] and [groups] with the targets.
|
||||
*/
|
||||
function get_notification_source_targets(int $id_source, ?string $subtype=null)
|
||||
{
|
||||
function get_notification_source_targets(
|
||||
int $id_source,
|
||||
?string $subtype=null
|
||||
) {
|
||||
$ret = [];
|
||||
|
||||
$filter = '';
|
||||
|
@ -484,7 +483,8 @@ function notifications_add_group_to_source($source_id, $groups)
|
|||
continue;
|
||||
}
|
||||
|
||||
$res = $res && db_process_sql_insert(
|
||||
$res = $res &&
|
||||
db_process_sql_insert(
|
||||
'tnotification_source_group',
|
||||
[
|
||||
'id_group' => $group,
|
||||
|
@ -525,7 +525,8 @@ function notifications_add_users_to_source($source_id, $users)
|
|||
continue;
|
||||
}
|
||||
|
||||
$res = $res && db_process_sql_insert(
|
||||
$res = $res &&
|
||||
db_process_sql_insert(
|
||||
'tnotification_source_user',
|
||||
[
|
||||
'id_user' => $user,
|
||||
|
@ -551,7 +552,13 @@ function notifications_add_users_to_source($source_id, $users)
|
|||
function notifications_get_group_source_not_configured($source_id)
|
||||
{
|
||||
$groups_selected = notifications_get_group_sources_for_select($source_id);
|
||||
$all_groups = users_get_groups_for_select(false, 'AR', false, true, $groups_selected);
|
||||
$all_groups = users_get_groups_for_select(
|
||||
false,
|
||||
'AR',
|
||||
false,
|
||||
true,
|
||||
$groups_selected
|
||||
);
|
||||
return array_diff($all_groups, $groups_selected);
|
||||
}
|
||||
|
||||
|
@ -566,12 +573,10 @@ function notifications_get_group_source_not_configured($source_id)
|
|||
*/
|
||||
function notifications_get_user_source_not_configured($source_id)
|
||||
{
|
||||
$users_selected = array_keys(notifications_get_user_sources_for_select($source_id));
|
||||
$users = get_users(
|
||||
'id_user',
|
||||
['!id_user' => $users_selected],
|
||||
['id_user']
|
||||
$users_selected = array_keys(
|
||||
notifications_get_user_sources_for_select($source_id)
|
||||
);
|
||||
$users = get_users('id_user', ['!id_user' => $users_selected], ['id_user']);
|
||||
return index_array($users, 'id_user', 'id_user');
|
||||
}
|
||||
|
||||
|
@ -587,8 +592,8 @@ function notifications_get_user_source_not_configured($source_id)
|
|||
function notifications_build_user_enable_return($status, $enabled)
|
||||
{
|
||||
return [
|
||||
'status' => ((bool) $status === true) ? 1 : 0,
|
||||
'enabled' => ((bool) $enabled === true) ? 1 : 0,
|
||||
'status' => (bool) $status === true ? 1 : 0,
|
||||
'enabled' => (bool) $enabled === true ? 1 : 0,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -625,16 +630,11 @@ function notifications_get_user_label_status($source, $user, $label)
|
|||
|
||||
$common_groups = array_intersect(
|
||||
array_keys(users_get_groups($user)),
|
||||
array_keys(
|
||||
notifications_get_group_sources_for_select($source['id'])
|
||||
)
|
||||
array_keys(notifications_get_group_sources_for_select($source['id']))
|
||||
);
|
||||
// No group found, return no permissions.
|
||||
$value = empty($common_groups) ? false : $source[$label];
|
||||
return notifications_build_user_enable_return(
|
||||
$value,
|
||||
false
|
||||
);
|
||||
return notifications_build_user_enable_return($value, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -681,13 +681,7 @@ function notifications_get_counters()
|
|||
{
|
||||
$num_notifications = 0;
|
||||
$last_id = 0;
|
||||
$last_message = messages_get_overview(
|
||||
'timestamp',
|
||||
'DESC',
|
||||
false,
|
||||
false,
|
||||
1
|
||||
);
|
||||
$last_message = messages_get_overview('timestamp', 'DESC', false, false, 1);
|
||||
if (!empty($last_message)) {
|
||||
$num_notifications = messages_get_count();
|
||||
$last_id = $last_message[0]['id_mensaje'];
|
||||
|
@ -718,7 +712,9 @@ function notifications_get_counters()
|
|||
function notifications_print_ball($num_notifications, $last_id)
|
||||
{
|
||||
$no_notifications = (int) $num_notifications === 0;
|
||||
$class_status = ($no_notifications) ? 'notification-ball-no-messages' : 'notification-ball-new-messages';
|
||||
$class_status = $no_notifications
|
||||
? 'notification-ball-no-messages'
|
||||
: 'notification-ball-new-messages';
|
||||
return sprintf(
|
||||
'<div
|
||||
%s
|
||||
|
@ -728,7 +724,7 @@ function notifications_print_ball($num_notifications, $last_id)
|
|||
>
|
||||
%s
|
||||
</div>',
|
||||
($no_notifications) ? '' : 'onclick="addNotifications(event)"',
|
||||
$no_notifications ? '' : 'onclick="addNotifications(event)"',
|
||||
$class_status,
|
||||
$last_id,
|
||||
$num_notifications
|
||||
|
@ -799,7 +795,7 @@ function notifications_print_global_source_configuration($source)
|
|||
'type' => 'switch',
|
||||
'id' => 'nt-'.$source['id'].'.'.$type.'-subtype',
|
||||
'class' => 'elem-clickable',
|
||||
'value' => (isset($blacklist[$type]) === false),
|
||||
'value' => isset($blacklist[$type]) === false,
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
@ -833,14 +829,11 @@ function notifications_print_global_source_configuration($source)
|
|||
*
|
||||
* @return string HTML with the generated selector
|
||||
*/
|
||||
function notifications_print_source_select_box(
|
||||
$info_selec,
|
||||
$id,
|
||||
$source_id
|
||||
) {
|
||||
$title = ($id === 'users') ? __('Notified users') : __('Notified groups');
|
||||
$add_title = ($id === 'users') ? __('Add users') : __('Add groups');
|
||||
$delete_title = ($id === 'users') ? __('Delete users') : __('Delete groups');
|
||||
function notifications_print_source_select_box($info_selec, $id, $source_id)
|
||||
{
|
||||
$title = $id === 'users' ? __('Notified users') : __('Notified groups');
|
||||
$add_title = $id === 'users' ? __('Add users') : __('Add groups');
|
||||
$delete_title = $id === 'users' ? __('Delete users') : __('Delete groups');
|
||||
|
||||
// Generate the HTML.
|
||||
return sprintf(
|
||||
|
@ -873,11 +866,7 @@ function notifications_print_source_select_box(
|
|||
true,
|
||||
[
|
||||
'title' => $add_title,
|
||||
'onclick' => sprintf(
|
||||
"add_source_dialog('%s', '%s')",
|
||||
$id,
|
||||
$source_id
|
||||
),
|
||||
'onclick' => sprintf("add_source_dialog('%s', '%s')", $id, $source_id),
|
||||
]
|
||||
),
|
||||
html_print_image(
|
||||
|
@ -1062,7 +1051,6 @@ function notifications_print_dropdown()
|
|||
function notifications_print_dropdown_element($message_info)
|
||||
{
|
||||
$action = '';
|
||||
|
||||
switch ($message_info['description']) {
|
||||
case 'Official communication':
|
||||
$action = 'show_modal(this.id);';
|
||||
|
|
|
@ -67,6 +67,7 @@ define('REPORT_STATUS_DOWNTIME', 4);
|
|||
define('REPORT_STATUS_IGNORED', 5);
|
||||
|
||||
// Clases.
|
||||
use PandoraFMS\Event;
|
||||
use PandoraFMS\Module;
|
||||
|
||||
|
||||
|
@ -1959,7 +1960,10 @@ function reporting_event_report_group(
|
|||
$event_graph_by_criticity = $event_filter['event_graph_by_criticity'];
|
||||
$event_graph_validated_vs_unvalidated = $event_filter['event_graph_validated_vs_unvalidated'];
|
||||
|
||||
if (isset($content['recursion']) && $content['recursion'] == 1 && $content['id_group'] != 0) {
|
||||
if (isset($content['recursion'])
|
||||
&& $content['recursion'] == 1
|
||||
&& $content['id_group'] != 0
|
||||
) {
|
||||
$propagate = db_get_value(
|
||||
'propagate',
|
||||
'tgrupo',
|
||||
|
@ -1980,6 +1984,10 @@ function reporting_event_report_group(
|
|||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$data = events_get_agent(
|
||||
false,
|
||||
$content['period'],
|
||||
|
@ -2025,27 +2033,26 @@ function reporting_event_report_group(
|
|||
$return['chart']['by_user_validator'] = null;
|
||||
$return['chart']['by_criticity'] = null;
|
||||
$return['chart']['validated_vs_unvalidated'] = null;
|
||||
$server_name = $content['server_name'];
|
||||
$metaconsole_dbtable = false;
|
||||
if (is_metaconsole() === true && empty($server_name) === true) {
|
||||
$metaconsole_dbtable = true;
|
||||
}
|
||||
|
||||
if ($event_graph_by_agent) {
|
||||
$data_graph = events_get_count_events_by_agent(
|
||||
$content['id_group'],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_agent = [];
|
||||
if (empty($data) === false) {
|
||||
foreach ($data as $value) {
|
||||
$k = $value['alias'];
|
||||
if (is_metaconsole() === true) {
|
||||
$k = '('.$value['server_name'].') '.$value['alias'];
|
||||
}
|
||||
|
||||
if (isset($data_graph_by_agent[$k]) === true) {
|
||||
$data_graph_by_agent[$k]++;
|
||||
} else {
|
||||
$data_graph_by_agent[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return['chart']['by_agent'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_agent,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -2058,20 +2065,9 @@ function reporting_event_report_group(
|
|||
}
|
||||
|
||||
if ($event_graph_by_user_validator) {
|
||||
$data_graph = events_get_count_events_validated_by_user(
|
||||
['id_group' => $content['id_group']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
|
||||
$data_graph_by_user = events_get_count_events_validated_by_user($data);
|
||||
$return['chart']['by_user_validator'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_user,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -2084,21 +2080,22 @@ function reporting_event_report_group(
|
|||
}
|
||||
|
||||
if ($event_graph_by_criticity) {
|
||||
$data_graph = events_get_count_events_by_criticity(
|
||||
['id_group' => $content['id_group']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable
|
||||
);
|
||||
$data_graph_by_criticity = [];
|
||||
if (empty($data) === false) {
|
||||
foreach ($data as $value) {
|
||||
$k = get_priority_name($value['criticity']);
|
||||
if (isset($data_graph_by_criticity[$k]) === true) {
|
||||
$data_graph_by_criticity[$k]++;
|
||||
} else {
|
||||
$data_graph_by_criticity[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$colors = get_criticity_pie_colors($data_graph);
|
||||
$colors = get_criticity_pie_colors($data_graph_by_criticity);
|
||||
|
||||
$return['chart']['by_criticity'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_criticity,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -2113,20 +2110,24 @@ function reporting_event_report_group(
|
|||
}
|
||||
|
||||
if ($event_graph_validated_vs_unvalidated) {
|
||||
$data_graph = events_get_count_events_validated(
|
||||
['id_group' => $content['id_group']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_status = [];
|
||||
if (empty($data) === false) {
|
||||
$status = [
|
||||
1 => __('Validated'),
|
||||
0 => __('Not validated'),
|
||||
];
|
||||
foreach ($data as $value) {
|
||||
$k = $status[$value['estado']];
|
||||
if (isset($data_graph_by_status[$k]) === true) {
|
||||
$data_graph_by_status[$k]++;
|
||||
} else {
|
||||
$data_graph_by_status[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return['chart']['validated_vs_unvalidated'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_status,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -2138,10 +2139,6 @@ function reporting_event_report_group(
|
|||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
// Total events.
|
||||
if ($return['data'] != '') {
|
||||
$return['total_events'] = count($return['data']);
|
||||
|
@ -3666,15 +3663,29 @@ function reporting_groups_nodes($content)
|
|||
if (empty($id_group)) {
|
||||
$events = [];
|
||||
} else {
|
||||
$sql_where = sprintf(
|
||||
' WHERE id_grupo IN (%s) AND estado<>1 ',
|
||||
implode(',', $id_group)
|
||||
);
|
||||
$events = events_get_events_grouped(
|
||||
$sql_where,
|
||||
// ID group.
|
||||
if (empty($id_group) === false) {
|
||||
$filters['id_group_filter'] = $id_group;
|
||||
}
|
||||
|
||||
// Status.
|
||||
if (empty($filter_event_status) === false) {
|
||||
$filters['status'] = EVENT_NO_VALIDATED;
|
||||
}
|
||||
|
||||
// Grouped.
|
||||
$filters['group_rep'] = 1;
|
||||
|
||||
$events = Event::search(
|
||||
[
|
||||
'te.*',
|
||||
'ta.alias',
|
||||
],
|
||||
$filters,
|
||||
0,
|
||||
1000,
|
||||
false
|
||||
'desc',
|
||||
'te.utimestamp'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -3791,12 +3802,14 @@ function reporting_event_report_agent(
|
|||
$event_graph_by_criticity = $style['event_graph_by_criticity'];
|
||||
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
$return['data'] = reporting_get_agents_detailed_event(
|
||||
$content['id_agent'],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
true,
|
||||
true,
|
||||
$history,
|
||||
$show_summary_group,
|
||||
$filter_event_severity,
|
||||
|
@ -3808,10 +3821,6 @@ function reporting_event_report_agent(
|
|||
$show_custom_data
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
reporting_set_conf_charts(
|
||||
$width,
|
||||
$height,
|
||||
|
@ -3833,28 +3842,10 @@ function reporting_event_report_agent(
|
|||
$return['chart']['by_criticity'] = null;
|
||||
$return['chart']['validated_vs_unvalidated'] = null;
|
||||
|
||||
$server_name = $content['server_name'];
|
||||
if (is_metaconsole() && $server_name != '') {
|
||||
$metaconsole_dbtable = true;
|
||||
} else {
|
||||
$metaconsole_dbtable = false;
|
||||
}
|
||||
|
||||
if ($event_graph_by_user_validator) {
|
||||
$data_graph = events_get_count_events_validated_by_user(
|
||||
['id_agent' => $content['id_agent']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
|
||||
$data_graph_by_user = events_get_count_events_validated_by_user($return['data']);
|
||||
$return['chart']['by_user_validator'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_user,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -3867,22 +3858,22 @@ function reporting_event_report_agent(
|
|||
}
|
||||
|
||||
if ($event_graph_by_criticity) {
|
||||
$data_graph = events_get_count_events_by_criticity(
|
||||
['id_agent' => $content['id_agent']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_criticity = [];
|
||||
if (empty($return['data']) === false) {
|
||||
foreach ($return['data'] as $value) {
|
||||
$k = get_priority_name($value['criticity']);
|
||||
if (isset($data_graph_by_criticity[$k]) === true) {
|
||||
$data_graph_by_criticity[$k]++;
|
||||
} else {
|
||||
$data_graph_by_criticity[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$colors = get_criticity_pie_colors($data_graph);
|
||||
$colors = get_criticity_pie_colors($data_graph_by_criticity);
|
||||
|
||||
$return['chart']['by_criticity'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_criticity,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -3897,20 +3888,24 @@ function reporting_event_report_agent(
|
|||
}
|
||||
|
||||
if ($event_graph_validated_vs_unvalidated) {
|
||||
$data_graph = events_get_count_events_validated(
|
||||
['id_agent' => $content['id_agent']],
|
||||
$content['period'],
|
||||
$report['datetime'],
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_status = [];
|
||||
if (empty($return['data']) === false) {
|
||||
$status = [
|
||||
1 => __('Validated'),
|
||||
0 => __('Not validated'),
|
||||
];
|
||||
foreach ($return['data'] as $value) {
|
||||
$k = $status[$value['estado']];
|
||||
if (isset($data_graph_by_status[$k]) === true) {
|
||||
$data_graph_by_status[$k]++;
|
||||
} else {
|
||||
$data_graph_by_status[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return['chart']['validated_vs_unvalidated'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_status,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -10459,14 +10454,14 @@ function reporting_get_module_detailed_event(
|
|||
$event['data'] = [];
|
||||
}
|
||||
|
||||
// total_events
|
||||
// Total events.
|
||||
if (isset($event['data'])) {
|
||||
$event['total_events'] = count($event['data']);
|
||||
} else {
|
||||
$event['total_events'] = 0;
|
||||
}
|
||||
|
||||
// graphs
|
||||
// Graphs.
|
||||
if (!empty($force_width_chart)) {
|
||||
$width = $force_width_chart;
|
||||
}
|
||||
|
@ -10476,20 +10471,9 @@ function reporting_get_module_detailed_event(
|
|||
}
|
||||
|
||||
if ($event_graph_by_user_validator) {
|
||||
$data_graph = events_get_count_events_validated_by_user(
|
||||
['id_agentmodule' => $id_module],
|
||||
$period,
|
||||
$date,
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
|
||||
$data_graph_by_user = events_get_count_events_validated_by_user($event['data']);
|
||||
$event['chart']['by_user_validator'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_user,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -10502,22 +10486,22 @@ function reporting_get_module_detailed_event(
|
|||
}
|
||||
|
||||
if ($event_graph_by_criticity) {
|
||||
$data_graph = events_get_count_events_by_criticity(
|
||||
['id_agentmodule' => $id_module],
|
||||
$period,
|
||||
$date,
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_criticity = [];
|
||||
if (empty($event['data']) === false) {
|
||||
foreach ($event['data'] as $value) {
|
||||
$k = get_priority_name($value['criticity']);
|
||||
if (isset($data_graph_by_criticity[$k]) === true) {
|
||||
$data_graph_by_criticity[$k]++;
|
||||
} else {
|
||||
$data_graph_by_criticity[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$colors = get_criticity_pie_colors($data_graph);
|
||||
$colors = get_criticity_pie_colors($data_graph_by_criticity);
|
||||
|
||||
$event['chart']['by_criticity'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_criticity,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -10532,20 +10516,24 @@ function reporting_get_module_detailed_event(
|
|||
}
|
||||
|
||||
if ($event_graph_validated_vs_unvalidated) {
|
||||
$data_graph = events_get_count_events_validated(
|
||||
['id_agentmodule' => $id_module],
|
||||
$period,
|
||||
$date,
|
||||
$filter_event_severity,
|
||||
$filter_event_type,
|
||||
$filter_event_status,
|
||||
$filter_event_filter_search,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
);
|
||||
$data_graph_by_status = [];
|
||||
if (empty($event['data']) === false) {
|
||||
$status = [
|
||||
1 => __('Validated'),
|
||||
0 => __('Not validated'),
|
||||
];
|
||||
foreach ($event['data'] as $value) {
|
||||
$k = $status[$value['estado']];
|
||||
if (isset($data_graph_by_status[$k]) === true) {
|
||||
$data_graph_by_status[$k]++;
|
||||
} else {
|
||||
$data_graph_by_status[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$event['chart']['validated_vs_unvalidated'] = pie_graph(
|
||||
$data_graph,
|
||||
$data_graph_by_status,
|
||||
500,
|
||||
150,
|
||||
__('other'),
|
||||
|
@ -10592,8 +10580,6 @@ function reporting_get_agents_detailed_event(
|
|||
$id_agents,
|
||||
$period=0,
|
||||
$date=0,
|
||||
$return=false,
|
||||
$only_data=false,
|
||||
$history=false,
|
||||
$show_summary_group=false,
|
||||
$filter_event_severity=false,
|
||||
|
@ -10606,10 +10592,7 @@ function reporting_get_agents_detailed_event(
|
|||
) {
|
||||
global $config;
|
||||
|
||||
if ($only_data) {
|
||||
$return_data = [];
|
||||
}
|
||||
|
||||
$return_data = [];
|
||||
$id_agents = (array) safe_int($id_agents, 1);
|
||||
|
||||
if (!is_numeric($date)) {
|
||||
|
@ -10620,8 +10603,6 @@ function reporting_get_agents_detailed_event(
|
|||
$date = get_system_time();
|
||||
}
|
||||
|
||||
$events = [];
|
||||
|
||||
foreach ($id_agents as $id_agent) {
|
||||
$event = events_get_agent(
|
||||
$id_agent,
|
||||
|
@ -10645,114 +10626,38 @@ function reporting_get_agents_detailed_event(
|
|||
$event = [];
|
||||
}
|
||||
|
||||
if ($only_data) {
|
||||
$nevents = count($event);
|
||||
for ($i = ($nevents - 1); $i >= 0; $i--) {
|
||||
$e = $event[$i];
|
||||
if ($show_summary_group) {
|
||||
$return_data[] = [
|
||||
'status' => $e['estado'],
|
||||
'count' => $e['event_rep'],
|
||||
'name' => $e['evento'],
|
||||
'type' => $e['event_type'],
|
||||
'criticity' => $e['criticity'],
|
||||
'validated_by' => $e['id_usuario'],
|
||||
'timestamp' => $e['timestamp_rep'],
|
||||
'id_evento' => $e['id_evento'],
|
||||
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
|
||||
];
|
||||
} else {
|
||||
$return_data[] = [
|
||||
'status' => $e['estado'],
|
||||
'name' => $e['evento'],
|
||||
'type' => $e['event_type'],
|
||||
'criticity' => $e['criticity'],
|
||||
'validated_by' => $e['id_usuario'],
|
||||
'timestamp' => $e['timestamp'],
|
||||
'id_evento' => $e['id_evento'],
|
||||
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($event)) {
|
||||
array_push($events, $event);
|
||||
$nevents = count($event);
|
||||
for ($i = ($nevents - 1); $i >= 0; $i--) {
|
||||
$e = $event[$i];
|
||||
if ($show_summary_group) {
|
||||
$return_data[] = [
|
||||
'status' => $e['estado'],
|
||||
'count' => $e['event_rep'],
|
||||
'name' => $e['evento'],
|
||||
'type' => $e['event_type'],
|
||||
'criticity' => $e['criticity'],
|
||||
'validated_by' => $e['id_usuario'],
|
||||
'timestamp' => $e['timestamp_last'],
|
||||
'id_evento' => $e['id_evento'],
|
||||
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
|
||||
];
|
||||
} else {
|
||||
$return_data[] = [
|
||||
'status' => $e['estado'],
|
||||
'name' => $e['evento'],
|
||||
'type' => $e['event_type'],
|
||||
'criticity' => $e['criticity'],
|
||||
'validated_by' => $e['id_usuario'],
|
||||
'timestamp' => $e['timestamp'],
|
||||
'id_evento' => $e['id_evento'],
|
||||
'id_usuario' => $e['id_usuario'],
|
||||
'custom_data' => ($show_custom_data === true) ? $e['custom_data'] : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($only_data) {
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
if ($events) {
|
||||
$note = '';
|
||||
if (count($events) >= 1000) {
|
||||
$note .= '* '.__('Maximum of events shown').' (1000)<br>';
|
||||
}
|
||||
|
||||
foreach ($events as $eventRow) {
|
||||
foreach ($eventRow as $k => $event) {
|
||||
// First pass along the class of this row.
|
||||
$table->cellclass[$k][1] = $table->cellclass[$k][2] = $table->cellclass[$k][4] = $table->cellclass[$k][5] = $table->cellclass[$k][6] = get_priority_class($event['criticity']);
|
||||
|
||||
$data = [];
|
||||
// Colored box.
|
||||
switch ($event['estado']) {
|
||||
case 0:
|
||||
$img_st = 'images/star.png';
|
||||
$title_st = __('New event');
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$img_st = 'images/tick.png';
|
||||
$title_st = __('Event validated');
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$img_st = 'images/hourglass.png';
|
||||
$title_st = __('Event in process');
|
||||
break;
|
||||
}
|
||||
|
||||
$data[] = html_print_image(
|
||||
$img_st,
|
||||
true,
|
||||
[
|
||||
'class' => 'image_status invert filter',
|
||||
'width' => 16,
|
||||
'title' => $title_st,
|
||||
]
|
||||
);
|
||||
|
||||
$data[] = $event['event_rep'];
|
||||
|
||||
$data[] = ui_print_truncate_text(
|
||||
io_safe_output($event['evento']),
|
||||
140,
|
||||
false,
|
||||
true
|
||||
);
|
||||
// $data[] = $event['event_type'];
|
||||
$data[] = events_print_type_img($event['event_type'], true);
|
||||
|
||||
$data[] = get_priority_name($event['criticity']);
|
||||
if (empty($event['id_usuario']) && $event['estado'] == EVENT_VALIDATE) {
|
||||
$data[] = '<i>'.__('System').'</i>';
|
||||
} else {
|
||||
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
|
||||
$data[] = io_safe_output($user_name);
|
||||
}
|
||||
|
||||
$data[] = '<font style="font-size: 6pt;">'.date($config['date_format'], $event['timestamp_rep']).'</font>';
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($events) {
|
||||
return html_print_table($table, $return).$note;
|
||||
}
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1068,20 +1068,26 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||
foreach ($item['data'] as $k => $event) {
|
||||
// First pass along the class of this row.
|
||||
if ($item['show_summary_group']) {
|
||||
$table1->cellclass[$k][1] = $table1->cellclass[$k][2] = $table1->cellclass[$k][4] = $table1->cellclass[$k][5] = $table1->cellclass[$k][6] = $table1->cellclass[$k][7] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][2] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][8] = get_priority_class($event['criticity']);
|
||||
} else {
|
||||
$table1->cellclass[$k][1] = $table1->cellclass[$k][3] = $table1->cellclass[$k][4] = $table1->cellclass[$k][5] = $table1->cellclass[$k][6] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][3] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][6] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$k][7] = get_priority_class($event['criticity']);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
// Colored box.
|
||||
switch ($event['estado']) {
|
||||
case 0:
|
||||
$img_st = 'images/star.png';
|
||||
$title_st = __('New event');
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$img_st = 'images/tick.png';
|
||||
$title_st = __('Event validated');
|
||||
|
@ -1091,6 +1097,12 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||
$img_st = 'images/hourglass.png';
|
||||
$title_st = __('Event in process');
|
||||
break;
|
||||
|
||||
default:
|
||||
case 0:
|
||||
$img_st = 'images/star.png';
|
||||
$title_st = __('New event');
|
||||
break;
|
||||
}
|
||||
|
||||
$data[] = html_print_image(
|
||||
|
@ -1117,31 +1129,47 @@ function reporting_html_event_report_group($table, $item, $pdf=0)
|
|||
|
||||
$data[] = events_print_type_img($event['event_type'], true);
|
||||
|
||||
if (!empty($event['id_agente'])) {
|
||||
$data[] = agents_get_alias($event['id_agente']);
|
||||
if (empty($event['alias']) === false) {
|
||||
$alias = $event['alias'];
|
||||
if (is_metaconsole() === true) {
|
||||
$alias = '('.$event['server_name'].') '.$event['alias'];
|
||||
}
|
||||
|
||||
$data[] = $alias;
|
||||
} else {
|
||||
$data[] = __('%s System', get_product_name());
|
||||
}
|
||||
|
||||
$data[] = get_priority_name($event['criticity']);
|
||||
if (empty($event['id_usuario']) && $event['estado'] == EVENT_VALIDATE) {
|
||||
if (empty($event['id_usuario']) === true
|
||||
&& $event['estado'] == EVENT_VALIDATE
|
||||
) {
|
||||
$data[] = '<i>'.__('System').'</i>';
|
||||
} else {
|
||||
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
|
||||
$user_name = db_get_value(
|
||||
'fullname',
|
||||
'tusuario',
|
||||
'id_user',
|
||||
$event['id_usuario']
|
||||
);
|
||||
$data[] = io_safe_output($user_name);
|
||||
}
|
||||
|
||||
if ($item['show_summary_group']) {
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], $event['timestamp_rep']).'</font>';
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], $event['timestamp_last']).'</font>';
|
||||
} else {
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
|
||||
}
|
||||
|
||||
if ($show_custom_data === true) {
|
||||
$custom_data = json_decode($event['custom_data'], true);
|
||||
$custom_data_text = '';
|
||||
foreach ($custom_data as $key => $value) {
|
||||
$custom_data_text .= $key.' = '.$value.'<br>';
|
||||
if (empty($event['custom_data']) === false) {
|
||||
$custom_data = json_decode($event['custom_data'], true);
|
||||
if (empty($custom_data) === false) {
|
||||
foreach ($custom_data as $key => $value) {
|
||||
$custom_data_text .= $key.' = '.$value.'<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[] = $custom_data_text;
|
||||
|
@ -1306,9 +1334,17 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
|||
foreach ($item_data as $i => $event) {
|
||||
$data = [];
|
||||
if ($show_summary_group) {
|
||||
$table1->cellclass[$i][1] = $table1->cellclass[$i][2] = $table1->cellclass[$i][3] = $table1->cellclass[$i][4] = $table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||
} else {
|
||||
$table1->cellclass[$i][1] = $table1->cellclass[$i][3] = $table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||
}
|
||||
|
||||
// Colored box.
|
||||
|
@ -1345,7 +1381,7 @@ function reporting_html_event_report_module($table, $item, $pdf=0)
|
|||
$data[3] = get_priority_name($event['criticity']);
|
||||
if ($show_summary_group) {
|
||||
$data[4] = $event['event_rep'];
|
||||
$data[5] = date($config['date_format'], $event['timestamp_rep']);
|
||||
$data[5] = date($config['date_format'], $event['timestamp_last']);
|
||||
} else {
|
||||
$data[4] = date($config['date_format'], strtotime($event['timestamp']));
|
||||
}
|
||||
|
@ -2397,9 +2433,18 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||
|
||||
foreach ($item['data'] as $i => $event) {
|
||||
if ($item['show_summary_group']) {
|
||||
$table1->cellclass[$i][1] = $table1->cellclass[$i][2] = $table1->cellclass[$i][4] = $table1->cellclass[$i][5] = $table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][2] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][7] = get_priority_class($event['criticity']);
|
||||
} else {
|
||||
$table1->cellclass[$i][1] = $table1->cellclass[$i][3] = $table1->cellclass[$i][4] = $table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][1] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][3] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][4] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][5] = get_priority_class($event['criticity']);
|
||||
$table1->cellclass[$i][6] = get_priority_class($event['criticity']);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
@ -2454,7 +2499,7 @@ function reporting_html_event_report_agent($table, $item, $pdf=0)
|
|||
}
|
||||
|
||||
if ($item['show_summary_group']) {
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], $event['timestamp']).'</font>';
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
|
||||
} else {
|
||||
$data[] = '<font class="font_6pt">'.date($config['date_format'], strtotime($event['timestamp'])).'</font>';
|
||||
}
|
||||
|
@ -5947,7 +5992,7 @@ function reporting_get_event_histogram($events, $text_header_event=false)
|
|||
}
|
||||
|
||||
|
||||
function reporting_get_event_histogram_meta($width)
|
||||
function reporting_get_event_histogram_meta($width, $events)
|
||||
{
|
||||
global $config;
|
||||
if (!defined('METACONSOLE')) {
|
||||
|
@ -5990,21 +6035,6 @@ function reporting_get_event_histogram_meta($width)
|
|||
EVENT_CRIT_CRITICAL => COL_CRITICAL,
|
||||
];
|
||||
|
||||
$user_groups = users_get_groups($config['id_user'], 'ER');
|
||||
$user_groups_ids = array_keys($user_groups);
|
||||
|
||||
if (empty($user_groups)) {
|
||||
$groups_condition = ' AND 1 = 0 ';
|
||||
} else {
|
||||
$groups_condition = ' AND id_grupo IN ('.implode(',', $user_groups_ids).') ';
|
||||
}
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'PM')) {
|
||||
$groups_condition .= ' AND id_grupo != 0';
|
||||
}
|
||||
|
||||
$status_condition = ' AND estado = 0 ';
|
||||
|
||||
$cont = 0;
|
||||
for ($i = 0; $i < $interval; $i++) {
|
||||
$bottom = ($datelimit + ($periodtime * $i));
|
||||
|
@ -6028,23 +6058,12 @@ function reporting_get_event_histogram_meta($width)
|
|||
|
||||
$top = ($datelimit + ($periodtime * ($i + 1)));
|
||||
|
||||
$time_condition = 'utimestamp > '.$bottom.' AND utimestamp < '.$top;
|
||||
$sql = sprintf(
|
||||
'SELECT criticity,utimestamp
|
||||
FROM tmetaconsole_event
|
||||
WHERE %s %s %s
|
||||
ORDER BY criticity DESC',
|
||||
$time_condition,
|
||||
$groups_condition,
|
||||
$status_condition
|
||||
);
|
||||
|
||||
$events = db_get_all_rows_sql($sql);
|
||||
|
||||
$events_criticity = [];
|
||||
if (is_array($events)) {
|
||||
foreach ($events as $key => $value) {
|
||||
array_push($events_criticity, $value['criticity']);
|
||||
foreach ($events as $value) {
|
||||
if ($value['utimestamp'] >= $bottom && $value['utimestamp'] < $top) {
|
||||
array_push($events_criticity, $value['criticity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,15 +34,22 @@
|
|||
*
|
||||
* @param boolean $id_user
|
||||
* @param boolean $user_strict
|
||||
* @param [type] $acltags
|
||||
* @param array $acltags
|
||||
* @param boolean $returnAllGroup
|
||||
* @param string $mode
|
||||
* @param array $agent_filter
|
||||
* @param array $module_filter
|
||||
* @return void
|
||||
*/
|
||||
function tactical_get_data($id_user=false, $user_strict=false, $acltags, $returnAllGroup=false, $mode='group', $agent_filter=[], $module_filter=[])
|
||||
{
|
||||
function tactical_get_data(
|
||||
$id_user=false,
|
||||
$user_strict=false,
|
||||
$acltags=[],
|
||||
$returnAllGroup=false,
|
||||
$mode='group',
|
||||
$agent_filter=[],
|
||||
$module_filter=[]
|
||||
) {
|
||||
global $config;
|
||||
if ($id_user == false) {
|
||||
$id_user = $config['id_user'];
|
||||
|
@ -504,10 +511,12 @@ function tactical_status_modules_agents($id_user=false, $user_strict=false, $acc
|
|||
|
||||
function tactical_monitor_alerts($strict_user=false)
|
||||
{
|
||||
global $config;
|
||||
$groups = users_get_groups($config['id_user'], 'AR', false);
|
||||
$id_groups = array_keys($groups);
|
||||
|
||||
if (empty($id_groups)) {
|
||||
$where_clause = '';
|
||||
if (empty($id_groups) === true) {
|
||||
$where_clause .= ' AND (1 = 0) ';
|
||||
} else {
|
||||
$where_clause .= sprintf(
|
||||
|
|
|
@ -3254,7 +3254,7 @@ function ui_print_datatable(array $parameters)
|
|||
$parameters['paging'] = true;
|
||||
}
|
||||
|
||||
$no_sortable_columns = [];
|
||||
$no_sortable_columns = json_encode([]);
|
||||
if (isset($parameters['no_sortable_columns'])) {
|
||||
$no_sortable_columns = json_encode($parameters['no_sortable_columns']);
|
||||
}
|
||||
|
@ -3326,6 +3326,11 @@ function ui_print_datatable(array $parameters)
|
|||
$parameters['datacolumns'] = $parameters['columns'];
|
||||
}
|
||||
|
||||
if (isset($parameters['csv']) === false) {
|
||||
$parameters['csv'] = 1;
|
||||
}
|
||||
|
||||
$filter = '';
|
||||
// Datatable filter.
|
||||
if (isset($parameters['form']) && is_array($parameters['form'])) {
|
||||
if (isset($parameters['form']['id'])) {
|
||||
|
@ -3377,7 +3382,7 @@ function ui_print_datatable(array $parameters)
|
|||
foreach ($parameters['form']['extra_buttons'] as $button) {
|
||||
$filter .= '<button id="'.$button['id'].'" ';
|
||||
$filter .= ' class="'.$button['class'].'" ';
|
||||
$filter .= ' style="'.$button['style'].'" ';
|
||||
$filter .= ' style="'.($button['style'] ?? '').'" ';
|
||||
$filter .= ' onclick="'.$button['onclick'].'" >';
|
||||
$filter .= $button['text'];
|
||||
$filter .= '</button>';
|
||||
|
@ -3496,7 +3501,7 @@ function ui_print_datatable(array $parameters)
|
|||
language: {
|
||||
processing:"'.$processing.'"
|
||||
},
|
||||
buttons: [
|
||||
buttons: '.$parameters['csv'].'== 1 ? [
|
||||
{
|
||||
extend: "csv",
|
||||
text : "'.__('Export current page to CSV').'",
|
||||
|
@ -3512,14 +3517,14 @@ function ui_print_datatable(array $parameters)
|
|||
}'.$export_columns.'
|
||||
}
|
||||
}
|
||||
],
|
||||
] : [],
|
||||
lengthMenu: '.json_encode($pagination_options).',
|
||||
ajax: {
|
||||
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
|
||||
type: "POST",
|
||||
dataSrc: function (json) {
|
||||
if (json.error) {
|
||||
console.log(json.error);
|
||||
console.error(json.error);
|
||||
$("#error-'.$table_id.'").html(json.error);
|
||||
$("#error-'.$table_id.'").dialog({
|
||||
title: "Filter failed",
|
||||
|
@ -3535,6 +3540,19 @@ function ui_print_datatable(array $parameters)
|
|||
}
|
||||
}).parent().addClass("ui-state-error");
|
||||
} else {';
|
||||
|
||||
if (isset($parameters['ajax_return_operation']) === true
|
||||
&& empty($parameters['ajax_return_operation']) === false
|
||||
&& isset($parameters['ajax_return_operation_function']) === true
|
||||
&& empty($parameters['ajax_return_operation_function']) === false
|
||||
) {
|
||||
$js .= '
|
||||
if (json.'.$parameters['ajax_return_operation'].' !== undefined) {
|
||||
'.$parameters['ajax_return_operation_function'].'(json.'.$parameters['ajax_return_operation'].');
|
||||
}
|
||||
';
|
||||
}
|
||||
|
||||
if (isset($parameters['ajax_postprocess'])) {
|
||||
$js .= '
|
||||
if (json.data) {
|
||||
|
@ -5882,7 +5900,7 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
}
|
||||
|
||||
$attrs = [];
|
||||
$attrs['style'] = 'padding-right: 20px; background: url('.$icon_image.') no-repeat right; '.$text_color.'';
|
||||
$attrs['style'] = 'padding-right: 20px; padding: 2px 5px; margin-bottom: 4px; border: none; border-bottom: 1px solid #ccc; border-radius: 0; background: url('.$icon_image.') no-repeat right; '.$text_color.'';
|
||||
|
||||
if (!$disabled_javascript_on_blur_function) {
|
||||
$attrs['onblur'] = $javascript_on_blur_function_name.'()';
|
||||
|
|
|
@ -82,7 +82,7 @@ function visual_map_print_user_line_handles($layoutData)
|
|||
|
||||
function visual_map_print_item(
|
||||
$mode='read',
|
||||
$layoutData,
|
||||
$layoutData=[],
|
||||
$proportion=null,
|
||||
$show_links=true,
|
||||
$isExternalLink=false,
|
||||
|
@ -2554,13 +2554,13 @@ function visual_map_process_wizard_add(
|
|||
$range,
|
||||
$width=0,
|
||||
$height=0,
|
||||
$period,
|
||||
$process_value,
|
||||
$percentileitem_width,
|
||||
$max_value,
|
||||
$type_percentile,
|
||||
$value_show,
|
||||
$type
|
||||
$period='',
|
||||
$process_value='',
|
||||
$percentileitem_width='',
|
||||
$max_value=0,
|
||||
$type_percentile='',
|
||||
$value_show='',
|
||||
$type=''
|
||||
) {
|
||||
if (empty($id_agents)) {
|
||||
print_error_message(__('No agents selected'));
|
||||
|
@ -3956,7 +3956,15 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
|
|||
sort_by_column($valid_layout_items, 'id_metaconsole');
|
||||
}
|
||||
|
||||
$num_elements_by_status = [];
|
||||
$num_elements_by_status = [
|
||||
VISUAL_MAP_STATUS_CRITICAL_BAD => 0,
|
||||
VISUAL_MAP_STATUS_CRITICAL_ALERT => 0,
|
||||
VISUAL_MAP_STATUS_NORMAL => 0,
|
||||
VISUAL_MAP_STATUS_WARNING => 0,
|
||||
VISUAL_MAP_STATUS_UNKNOWN => 0,
|
||||
VISUAL_MAP_STATUS_WARNING_ALERT => 0,
|
||||
];
|
||||
|
||||
$meta_connected_to = null;
|
||||
|
||||
foreach ($valid_layout_items as $layout_item_data) {
|
||||
|
@ -3993,7 +4001,7 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
|
|||
|
||||
$ent_element_status = enterprise_hook(
|
||||
'enterprise_visual_map_get_status_element',
|
||||
[$layoutData]
|
||||
[$layout_item_data]
|
||||
);
|
||||
if ($ent_element_status === ENTERPRISE_NOT_HOOK) {
|
||||
$ent_element_status = false;
|
||||
|
@ -4558,7 +4566,7 @@ function css_label_styles_visual_console($uniq, $ratio=1)
|
|||
$output .= '.c-'.$uniq.' a {color: #3f3f3f } ';
|
||||
$output .= '.c-'.$uniq.' .label p strong span {display: inline-block !important; line-height: normal !important} ';
|
||||
$output .= '.c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio).'pt; line-height:'.(8 * ($ratio)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; white-space: pre-wrap; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio).'pt !important; line-height:'.(4 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio).'pt !important; line-height:'.(6 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio).'pt !important; line-height:'.(8 * ($ratio)).'pt !important; }';
|
||||
|
|
|
@ -32,13 +32,13 @@ function wmi_compose_query($wmi_client, $user, $password, $host, $namespace='')
|
|||
{
|
||||
$wmi_command = '';
|
||||
|
||||
if (!empty($password)) {
|
||||
$wmi_command = $wmi_client.' -U "'.$user.'"%"'.$password.'"';
|
||||
if (empty($password) === false) {
|
||||
$wmi_command = $wmi_client.' -U \''.$user.'\'%\''.$password.'\'';
|
||||
} else {
|
||||
$wmi_command = $wmi_client.' -U "'.$user.'"';
|
||||
}
|
||||
|
||||
if (!empty($namespace)) {
|
||||
if (empty($namespace) === false) {
|
||||
$namespace = str_replace('"', "'", $namespace);
|
||||
$wmi_command .= ' --namespace="'.$namespace.'"';
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
global $config;
|
||||
|
||||
require_once __DIR__.'/config.php';
|
|
@ -2945,39 +2945,6 @@ function set_watermark(graph_id, plot, watermark_src) {
|
|||
);
|
||||
}
|
||||
|
||||
function get_event_details(event_ids) {
|
||||
table = "";
|
||||
if (typeof event_ids != "undefined") {
|
||||
var inputs = [];
|
||||
var table;
|
||||
inputs.push("get_events_details=1");
|
||||
inputs.push("event_ids=" + event_ids);
|
||||
inputs.push("page=include/ajax/events");
|
||||
|
||||
// Autologin
|
||||
if ($("#hidden-loginhash").val() != undefined) {
|
||||
inputs.push("loginhash=" + $("#hidden-loginhash").val());
|
||||
inputs.push("loginhash_data=" + $("#hidden-loginhash_data").val());
|
||||
inputs.push("loginhash_user=" + $("#hidden-loginhash_user").val());
|
||||
}
|
||||
|
||||
jQuery.ajax({
|
||||
data: inputs.join("&"),
|
||||
type: "GET",
|
||||
url: (action = "../../ajax.php"),
|
||||
timeout: 10000,
|
||||
dataType: "html",
|
||||
async: false,
|
||||
success: function(data) {
|
||||
table = data;
|
||||
//forced_title_callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
//Ajusta la grafica pequenña con el desplazamiento del eje y
|
||||
function adjust_left_width_canvas(adapter_id, adapted_id) {
|
||||
var adapter_left_margin = $("#" + adapter_id + " .yAxis .tickLabel").width();
|
||||
|
|
|
@ -29,6 +29,12 @@ function chordDiagram(recipient, elements, matrix, width) {
|
|||
var width = 700;
|
||||
var margin = 150;
|
||||
var padding = 0.02;
|
||||
var consoleStyle = document.getElementById("hidden-selected_style_theme")
|
||||
.value;
|
||||
var textColor =
|
||||
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)";
|
||||
var tooltipColor =
|
||||
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)";
|
||||
|
||||
function chart(selection) {
|
||||
selection.each(function(data) {
|
||||
|
@ -103,7 +109,6 @@ function chordDiagram(recipient, elements, matrix, width) {
|
|||
const chords = chord.chords();
|
||||
let aux = 0;
|
||||
$.each(chords, function(key, value) {
|
||||
console.log(aux);
|
||||
if (aux < 5) {
|
||||
if (
|
||||
(value.source.index == i && value.target.subindex == i) ||
|
||||
|
@ -159,6 +164,7 @@ function chordDiagram(recipient, elements, matrix, width) {
|
|||
.attr("text-anchor", function(d) {
|
||||
return d.angle > Math.PI ? "end" : null;
|
||||
})
|
||||
.attr("style", "fill: " + textColor)
|
||||
.attr("transform", function(d) {
|
||||
return (
|
||||
"rotate(" +
|
||||
|
@ -266,7 +272,12 @@ function chordDiagram(recipient, elements, matrix, width) {
|
|||
|
||||
$("#tooltip").attr(
|
||||
"style",
|
||||
"background: #fff;" +
|
||||
"background: " +
|
||||
tooltipColor +
|
||||
";" +
|
||||
"color: " +
|
||||
textColor +
|
||||
";" +
|
||||
"position: absolute;" +
|
||||
"display: inline-block;" +
|
||||
"width: auto;" +
|
||||
|
@ -393,6 +404,16 @@ function treeMap(recipient, data, width, height) {
|
|||
var isIE = true;
|
||||
var chartWidth = width;
|
||||
var chartHeight = height;
|
||||
var consoleStyle = document.getElementById("hidden-selected_style_theme")
|
||||
.value;
|
||||
$("#tooltip").css(
|
||||
"color",
|
||||
consoleStyle === "pandora_black" ? "rgb(240, 240, 240)" : "rgb(0, 0, 0)"
|
||||
);
|
||||
$("#tooltip").css(
|
||||
"background-color",
|
||||
consoleStyle === "pandora_black" ? "rgb(0, 0, 0)" : "rgb(240, 240, 240)"
|
||||
);
|
||||
if (width === "auto") {
|
||||
chartWidth = $(recipient).innerWidth();
|
||||
}
|
||||
|
@ -761,6 +782,7 @@ function treeMap(recipient, data, width, height) {
|
|||
$("#tooltip").attr(
|
||||
"style",
|
||||
"background: #fff;" +
|
||||
"color: #111;" +
|
||||
"position: absolute;" +
|
||||
"display: block;" +
|
||||
"width: 200px;" +
|
||||
|
@ -1023,6 +1045,7 @@ function sunburst(recipient, data, width, height, tooltip = true) {
|
|||
$("#tooltip").attr(
|
||||
"style",
|
||||
"background: #fff;" +
|
||||
"color: #111;" +
|
||||
"position: absolute;" +
|
||||
"display: block;" +
|
||||
"width: 200px;" +
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
Include package help/en
|
||||
*/
|
||||
?>
|
||||
|
||||
<p> If the event replication is activated, all the events will be copied to the remote metaconsole's database.
|
||||
<br><br>
|
||||
It is necessary to configure the credentials of the metaconsole's database, the replication mode (all events or only validated events) and the replication interval, specified in seconds.
|
||||
<br><br>
|
||||
<b>NOTES:</b>
|
||||
<br><br>
|
||||
The event viewer will be disabled if this option is enabled.
|
||||
<br><br>
|
||||
To apply the changes made on the event replication setup, it is necessary to restart the server.
|
||||
<br><br>
|
||||
The token "event_replication" must be set to 1 in the server's configuration file.
|
||||
</p>
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
Include package help/es
|
||||
*/
|
||||
?>
|
||||
|
||||
<p> Cuando la replicación de eventos está activada, los eventos recibidos se copiarán a la base de datos remota de una metaconsola.
|
||||
<br><br>
|
||||
Es necesario configurar las credenciales de la base de datos de la metaconsola, así como el modo de replicación (todos los eventos o solo los validados) y el intervalo de replicación en segundos.
|
||||
<br><br>
|
||||
<b>NOTAS:</b>
|
||||
<br><br>
|
||||
El visor de eventos se deshabilita cuando se activa esta opción.
|
||||
<br><br>
|
||||
Para que los cambios en la configuración de replicación de eventos se hagan efectivos será necesario reiniciar el servidor.
|
||||
<br><br>
|
||||
El fichero de configuración del servidor deberá tener el token:
|
||||
|
||||
<i>event_replication 1</i>
|
||||
|
||||
</p>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
Include package help/ja
|
||||
*/
|
||||
?>
|
||||
|
||||
<p> イベントの複製が有効の場合、受け取ったイベントは、メタコンソールのリモートデータベースにコピーされます。
|
||||
<br><br>
|
||||
メタコンソールのデータベースへのアクセス権、複製モード(全イベントまたは承諾済のみ)、複製間隔(秒)を設定する必要があります。
|
||||
<br><br>
|
||||
<b>注意:</b>
|
||||
<br><br>
|
||||
このオプションが有効の場合は、イベントビューワは無効になります。
|
||||
<br><br>
|
||||
イベントの複製の設定変更を反映させるには、サーバを再起動する必要があります。
|
||||
<br><br>
|
||||
サーバの設定ファイルに、次の設定を行う必要があります。
|
||||
|
||||
<i>event_replication 1</i>
|
||||
|
||||
</p>
|
|
@ -1223,6 +1223,8 @@ function dashboardLoadVC(settings) {
|
|||
var ratio_visualconsole = props.height / props.width;
|
||||
var ratio_w = size.width / props.width;
|
||||
var ratio_h = size.height / props.height;
|
||||
var acum_height = props.height;
|
||||
var acum_width = props.width;
|
||||
|
||||
props.width = size.width;
|
||||
props.height = size.width * ratio_visualconsole;
|
||||
|
@ -1235,6 +1237,11 @@ function dashboardLoadVC(settings) {
|
|||
props.height = size.height;
|
||||
props.width = size.height / ratio_visualconsole;
|
||||
}
|
||||
} else {
|
||||
ratio = ratio_w;
|
||||
var height = (acum_height * size.width) / acum_width;
|
||||
props.height = height;
|
||||
props.width = height / ratio_visualconsole;
|
||||
}
|
||||
} else {
|
||||
if (props.height > size.height) {
|
||||
|
@ -1290,22 +1297,30 @@ function dashboardLoadVC(settings) {
|
|||
var regex_hash = /(hash=)[^&]+(&?)/gi;
|
||||
var replacement_hash = "$1" + props.hash + "$2";
|
||||
|
||||
/*
|
||||
var regex_width = /(width=)[^&]+(&?)/gi;
|
||||
var replacement_width = "$1" + size.width + "$2";
|
||||
|
||||
var regex_height = /(height=)[^&]+(&?)/gi;
|
||||
var replacement_height =
|
||||
"$1" + (size.height + headerMobileFix) + "$2";
|
||||
*/
|
||||
|
||||
// Change the URL (if the browser has support).
|
||||
if ("history" in window) {
|
||||
var href = window.location.href.replace(regex, replacement);
|
||||
href = href.replace(regex_hash, replacement_hash);
|
||||
href = href.replace(regex_width, replacement_width);
|
||||
href = href.replace(regex_height, replacement_height);
|
||||
//href = href.replace(regex_width, replacement_width);
|
||||
//href = href.replace(regex_height, replacement_height);
|
||||
window.history.replaceState({}, document.title, href);
|
||||
}
|
||||
|
||||
if (props.height > props.width) {
|
||||
$(".container-center").css("overflow", "auto");
|
||||
} else {
|
||||
$(".container-center").css("overflow", "inherit");
|
||||
}
|
||||
|
||||
container.classList.remove("cv-overflow");
|
||||
|
||||
// View title.
|
||||
|
@ -1351,180 +1366,42 @@ function dashboardLoadVC(settings) {
|
|||
: "dashboard"
|
||||
);
|
||||
|
||||
$(window).on("orientationchange", function() {
|
||||
$(container).width($(window).height());
|
||||
$(container).height($(window).width() - headerMobileFix);
|
||||
//Remove spinner change VC.
|
||||
container.classList.remove("is-updating");
|
||||
container.classList.remove("cv-overflow");
|
||||
if (settings.mobile_view_orientation_vc === true) {
|
||||
$(window).on("orientationchange", function() {
|
||||
$(container).width($(window).height());
|
||||
$(container).height($(window).width() - headerMobileFix);
|
||||
//Remove spinner change VC.
|
||||
container.classList.remove("is-updating");
|
||||
container.classList.remove("cv-overflow");
|
||||
|
||||
var div = container.querySelector(".div-visual-console-spinner");
|
||||
var div = container.querySelector(".div-visual-console-spinner");
|
||||
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
container.classList.add("is-updating");
|
||||
container.classList.add("cv-overflow");
|
||||
const divParent = document.createElement("div");
|
||||
divParent.className = "div-visual-console-spinner";
|
||||
|
||||
const divSpinner = document.createElement("div");
|
||||
divSpinner.className = "visual-console-spinner";
|
||||
|
||||
divParent.appendChild(divSpinner);
|
||||
container.appendChild(divParent);
|
||||
|
||||
var dimensions = {
|
||||
width: $(window).height(),
|
||||
height: $(window).width() - 40
|
||||
};
|
||||
|
||||
visualConsoleManager.changeDimensionsVc(dimensions, interval);
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function dashboardShowEventDialog(settings) {
|
||||
settings = JSON.parse(atob(settings));
|
||||
var dialog_exist = $("div[aria-describedby='event_details_window']");
|
||||
if (dialog_exist.length == 1) {
|
||||
$("div[aria-describedby='event_details_window']").remove();
|
||||
}
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.ajaxUrl,
|
||||
data: {
|
||||
page: settings.page,
|
||||
get_extended_event: 1,
|
||||
event: settings.event,
|
||||
dialog_page: "",
|
||||
meta: 0,
|
||||
history: 0,
|
||||
filter: [],
|
||||
node_id: settings.node_id
|
||||
},
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#event_details_window")
|
||||
.hide()
|
||||
.empty()
|
||||
.append(data)
|
||||
.dialog({
|
||||
title: settings.event.evento,
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
create: function() {
|
||||
$("#button-delete_button").removeAttr("onclick");
|
||||
$("#button-delete_button").click(function() {
|
||||
var confirm_message = $("#hidden-delete_confirm_message").val();
|
||||
if (confirm(confirm_message) == false) {
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.ajaxUrl,
|
||||
data: {
|
||||
page: "include/ajax/events",
|
||||
delete_event: 1,
|
||||
node_id: settings.node_id,
|
||||
id_evento: settings.event.id_evento,
|
||||
filter: []
|
||||
},
|
||||
success: function() {
|
||||
$("#notification_delete_error").show();
|
||||
$("#event_details_window").dialog("close");
|
||||
},
|
||||
error: function(error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
close: function() {
|
||||
//$("#refrcounter").countdown("resume");
|
||||
//$("div.vc-countdown").countdown("resume");
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.ajaxUrl,
|
||||
data: {
|
||||
page: "operation/dashboard/dashboard",
|
||||
method: "drawWidget",
|
||||
dashboardId: settings.dashboardId,
|
||||
cellId: settings.cellId,
|
||||
widgetId: settings.widgetId,
|
||||
redraw: 1
|
||||
},
|
||||
success: function(dataWidget) {
|
||||
// Widget empty and reload.
|
||||
$("#widget-" + settings.cellId + " .content-widget").empty();
|
||||
$("#widget-" + settings.cellId + " .content-widget").append(
|
||||
dataWidget
|
||||
);
|
||||
},
|
||||
error: function(error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
width: 710,
|
||||
height: 600
|
||||
})
|
||||
.show();
|
||||
|
||||
$.post({
|
||||
url: settings.ajaxUrl,
|
||||
data: {
|
||||
page: "include/ajax/events",
|
||||
get_comments: 1,
|
||||
event: settings.event,
|
||||
filter: []
|
||||
},
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#extended_event_comments_page").empty();
|
||||
$("#extended_event_comments_page").html(data);
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
}
|
||||
});
|
||||
|
||||
//$("#refrcounter").countdown("pause");
|
||||
//$("div.vc-countdown").countdown("pause");
|
||||
|
||||
switch (settings.result) {
|
||||
case "comment_ok":
|
||||
$("#notification_comment_success").show();
|
||||
break;
|
||||
case "comment_error":
|
||||
$("#notification_comment_error").show();
|
||||
break;
|
||||
case "status_ok":
|
||||
$("#notification_status_success").show();
|
||||
break;
|
||||
case "status_error":
|
||||
$("#notification_status_error").show();
|
||||
break;
|
||||
case "owner_ok":
|
||||
$("#notification_owner_success").show();
|
||||
break;
|
||||
case "owner_error":
|
||||
$("#notification_owner_error").show();
|
||||
break;
|
||||
}
|
||||
|
||||
forced_title_callback();
|
||||
},
|
||||
error: function(error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
container.classList.add("is-updating");
|
||||
container.classList.add("cv-overflow");
|
||||
const divParent = document.createElement("div");
|
||||
divParent.className = "div-visual-console-spinner";
|
||||
|
||||
const divSpinner = document.createElement("div");
|
||||
divSpinner.className = "visual-console-spinner";
|
||||
|
||||
divParent.appendChild(divSpinner);
|
||||
container.appendChild(divParent);
|
||||
|
||||
var dimensions = {
|
||||
width: $(window).height(),
|
||||
height: $(window).width() - 40
|
||||
};
|
||||
|
||||
visualConsoleManager.changeDimensionsVc(dimensions, interval);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*global jQuery,$,forced_title_callback,Base64, dt_events*/
|
||||
/*global jQuery, $, forced_title_callback, confirmDialog*/
|
||||
|
||||
// Show the modal window of an event
|
||||
function show_event_dialog(event, dialog_page, result) {
|
||||
function show_event_dialog(event, dialog_page) {
|
||||
var ajax_file = $("#hidden-ajax_file").val();
|
||||
|
||||
if (dialog_page == undefined) {
|
||||
|
@ -81,24 +81,11 @@ function show_event_dialog(event, dialog_page, result) {
|
|||
}
|
||||
})
|
||||
.show();
|
||||
$.post({
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
page: "include/ajax/events",
|
||||
get_comments: 1,
|
||||
event: event,
|
||||
filter: values
|
||||
},
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#extended_event_comments_page").empty();
|
||||
$("#extended_event_comments_page").html(data);
|
||||
}
|
||||
});
|
||||
|
||||
$("#refrcounter").countdown("pause");
|
||||
$("div.vc-countdown").countdown("pause");
|
||||
|
||||
/*
|
||||
switch (result) {
|
||||
case "comment_ok":
|
||||
$("#notification_comment_success").show();
|
||||
|
@ -119,6 +106,7 @@ function show_event_dialog(event, dialog_page, result) {
|
|||
$("#notification_owner_error").show();
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
forced_title_callback();
|
||||
},
|
||||
|
@ -131,7 +119,7 @@ function show_event_dialog(event, dialog_page, result) {
|
|||
function execute_response(event_id, server_id) {
|
||||
var response_id = $("#select_custom_response option:selected").val();
|
||||
|
||||
var response = get_response(response_id);
|
||||
var response = get_response(response_id, server_id);
|
||||
|
||||
// If cannot get response abort it
|
||||
if (response == null) {
|
||||
|
@ -246,13 +234,14 @@ function show_massive_response_dialog(
|
|||
}
|
||||
|
||||
// Get an event response from db
|
||||
function get_response(response_id) {
|
||||
function get_response(response_id, server_id) {
|
||||
var response = "";
|
||||
|
||||
var params = [];
|
||||
params.push("page=include/ajax/events");
|
||||
params.push("get_response=1");
|
||||
params.push("response_id=" + response_id);
|
||||
params.push("server_id=" + server_id);
|
||||
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
|
@ -314,31 +303,6 @@ function get_response_description(response_id) {
|
|||
return response_description;
|
||||
}
|
||||
|
||||
// Get an event response description from db
|
||||
function get_event_name(event_id, meta, history) {
|
||||
var name = "";
|
||||
|
||||
var params = [];
|
||||
params.push("page=include/ajax/events");
|
||||
params.push("get_event_name=1");
|
||||
params.push("event_id=" + event_id);
|
||||
params.push("meta=" + meta);
|
||||
params.push("history=" + history);
|
||||
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
async: false,
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
name = data;
|
||||
}
|
||||
});
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function add_row_param(id_table, param) {
|
||||
$("#" + id_table).append(
|
||||
'<tr class="params_rows"><td style="text-align:left; padding-left:40px; font-weight: normal; font-style: italic;">' +
|
||||
|
@ -472,11 +436,8 @@ function perform_response_massive(response, response_id, out_iterator) {
|
|||
}
|
||||
|
||||
// Change the status of an event to new, in process or validated.
|
||||
function event_change_status(event_ids) {
|
||||
function event_change_status(event_ids, server_id) {
|
||||
var new_status = $("#estado").val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var history = $("#hidden-history").val();
|
||||
var node_id = $("#hidden-node_id").val();
|
||||
|
||||
$("#button-status_button").attr("disabled", "disabled");
|
||||
$("#response_loading").show();
|
||||
|
@ -487,13 +448,10 @@ function event_change_status(event_ids) {
|
|||
change_status: 1,
|
||||
event_ids: event_ids,
|
||||
new_status: new_status,
|
||||
meta: meta,
|
||||
node_id: node_id,
|
||||
history: history
|
||||
server_id: server_id
|
||||
},
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
async: true,
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#button-status_button").removeAttr("disabled");
|
||||
|
@ -537,12 +495,8 @@ function event_change_status(event_ids) {
|
|||
}
|
||||
|
||||
// Change te owner of an event to one user of empty
|
||||
function event_change_owner() {
|
||||
var event_id = $("#hidden-id_event").val();
|
||||
function event_change_owner(event_id, server_id) {
|
||||
var new_owner = $("#id_owner").val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var history = $("#hidden-history").val();
|
||||
var node_id = $("#hidden-node_id").val();
|
||||
|
||||
$("#button-owner_button").attr("disabled", "disabled");
|
||||
$("#response_loading").show();
|
||||
|
@ -552,10 +506,8 @@ function event_change_owner() {
|
|||
page: "include/ajax/events",
|
||||
change_owner: 1,
|
||||
event_id: event_id,
|
||||
new_owner: new_owner,
|
||||
meta: meta,
|
||||
node_id: node_id,
|
||||
history: history
|
||||
server_id: server_id,
|
||||
new_owner: new_owner
|
||||
},
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
|
@ -607,15 +559,6 @@ function event_comment(current_event) {
|
|||
}
|
||||
|
||||
var comment = $("#textarea_comment").val();
|
||||
var meta = 0;
|
||||
if ($("#hidden-meta").val() != undefined) {
|
||||
meta = $("#hidden-meta").val();
|
||||
}
|
||||
|
||||
var history = 0;
|
||||
if ($("#hidden-history").val() != undefined) {
|
||||
history = $("#hidden-history").val();
|
||||
}
|
||||
|
||||
if (comment == "") {
|
||||
show_event_dialog(current_event, "comments", "comment_error");
|
||||
|
@ -631,8 +574,7 @@ function event_comment(current_event) {
|
|||
params.push("event_id=" + event.id_evento);
|
||||
}
|
||||
params.push("comment=" + comment);
|
||||
params.push("meta=" + meta);
|
||||
params.push("history=" + history);
|
||||
params.push("server_id=" + event.server_id);
|
||||
|
||||
$("#button-comment_button").attr("disabled", "disabled");
|
||||
$("#response_loading").show();
|
||||
|
@ -641,9 +583,8 @@ function event_comment(current_event) {
|
|||
data: params.join("&"),
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
async: true,
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
success: function() {
|
||||
$("#button-comment_button").removeAttr("disabled");
|
||||
$("#response_loading").hide();
|
||||
$("#link_comments").click();
|
||||
|
@ -653,60 +594,6 @@ function event_comment(current_event) {
|
|||
return false;
|
||||
}
|
||||
|
||||
//Show event list when fielter repetead is Group agents
|
||||
function show_events_group_agent(id_insert, id_agent, server_id) {
|
||||
var parameter = [];
|
||||
parameter.push({ name: "id_agent", value: id_agent });
|
||||
parameter.push({ name: "server_id", value: server_id });
|
||||
parameter.push({ name: "event_type", value: $("#event_type").val() });
|
||||
parameter.push({ name: "severity", value: $("#severity").val() });
|
||||
parameter.push({ name: "status", value: $("#status").val() });
|
||||
parameter.push({ name: "search", value: $("#text-search").val() });
|
||||
parameter.push({
|
||||
name: "id_agent_module",
|
||||
value: $("input:hidden[name=module_search_hidden]").val()
|
||||
});
|
||||
parameter.push({
|
||||
name: "event_view_hr",
|
||||
value: $("#text-event_view_hr").val()
|
||||
});
|
||||
parameter.push({ name: "id_user_ack", value: $("#id_user_ack").val() });
|
||||
parameter.push({
|
||||
name: "tag_with",
|
||||
value: Base64.decode($("#hidden-tag_with").val())
|
||||
});
|
||||
parameter.push({
|
||||
name: "tag_without",
|
||||
value: Base64.decode($("#hidden-tag_without").val())
|
||||
});
|
||||
parameter.push({
|
||||
name: "filter_only_alert",
|
||||
value: $("#filter_only_alert").val()
|
||||
});
|
||||
parameter.push({ name: "date_from", value: $("#text-date_from").val() });
|
||||
parameter.push({ name: "date_to", value: $("#text-date_to").val() });
|
||||
parameter.push({ name: "server_id_search", value: $("#server_id").val() });
|
||||
parameter.push({
|
||||
name: "page",
|
||||
value: "include/ajax/events"
|
||||
});
|
||||
parameter.push({
|
||||
name: "get_list_events_agents",
|
||||
value: 1
|
||||
});
|
||||
|
||||
jQuery.ajax({
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
data: parameter,
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#" + id_insert).html(data);
|
||||
$("#" + id_insert).toggle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function show_event_response_command_dialog(id, response, total_checked) {
|
||||
var params = [];
|
||||
params.push("page=include/ajax/events");
|
||||
|
@ -756,7 +643,7 @@ function show_event_response_command_dialog(id, response, total_checked) {
|
|||
}
|
||||
|
||||
var processed = 0;
|
||||
function update_event(table, id_evento, type, event_rep, row) {
|
||||
function update_event(table, id_evento, type, event_rep, row, server_id) {
|
||||
var inputs = $("#events_form :input");
|
||||
var values = {};
|
||||
var redraw = false;
|
||||
|
@ -775,6 +662,7 @@ function update_event(table, id_evento, type, event_rep, row) {
|
|||
in_process_event: type.in_process_event,
|
||||
delete_event: type.delete_event,
|
||||
id_evento: id_evento,
|
||||
server_id: server_id,
|
||||
event_rep: event_rep,
|
||||
filter: values
|
||||
},
|
||||
|
@ -789,7 +677,9 @@ function update_event(table, id_evento, type, event_rep, row) {
|
|||
redraw = true;
|
||||
}
|
||||
if (redraw) {
|
||||
table.draw(false);
|
||||
$("#" + table)
|
||||
.DataTable()
|
||||
.draw(false);
|
||||
} else {
|
||||
$(row)
|
||||
.closest("tr")
|
||||
|
@ -804,8 +694,13 @@ function update_event(table, id_evento, type, event_rep, row) {
|
|||
}
|
||||
// Update events matching current filters and id_evento selected.
|
||||
|
||||
function validate_event(table, id_evento, event_rep, row) {
|
||||
function validate_event(table, id_evento, event_rep, row, server_id) {
|
||||
var button = document.getElementById("val-" + id_evento);
|
||||
var meta = $("#hidden-meta").val();
|
||||
if (meta != 0) {
|
||||
button = document.getElementById("val-" + id_evento + "-" + server_id);
|
||||
}
|
||||
|
||||
if (!button) {
|
||||
// Button does not exist. Ignore.
|
||||
processed += 1;
|
||||
|
@ -814,11 +709,23 @@ function validate_event(table, id_evento, event_rep, row) {
|
|||
|
||||
button.children[0];
|
||||
button.children[0].src = "images/spinner.gif";
|
||||
return update_event(table, id_evento, { validate_event: 1 }, event_rep, row);
|
||||
return update_event(
|
||||
table,
|
||||
id_evento,
|
||||
{ validate_event: 1 },
|
||||
event_rep,
|
||||
row,
|
||||
server_id
|
||||
);
|
||||
}
|
||||
|
||||
function in_process_event(table, id_evento, event_rep, row) {
|
||||
function in_process_event(table, id_evento, event_rep, row, server_id) {
|
||||
var button = document.getElementById("proc-" + id_evento);
|
||||
var meta = $("#hidden-meta").val();
|
||||
if (meta != 0) {
|
||||
button = document.getElementById("proc-" + id_evento + "-" + server_id);
|
||||
}
|
||||
|
||||
if (!button) {
|
||||
// Button does not exist. Ignore.
|
||||
processed += 1;
|
||||
|
@ -832,18 +739,24 @@ function in_process_event(table, id_evento, event_rep, row) {
|
|||
id_evento,
|
||||
{ in_process_event: 1 },
|
||||
event_rep,
|
||||
row
|
||||
row,
|
||||
server_id
|
||||
);
|
||||
}
|
||||
|
||||
function delete_event(table, id_evento, event_rep, row) {
|
||||
function delete_event(table, id_evento, event_rep, row, server_id) {
|
||||
var button = document.getElementById("del-" + id_evento);
|
||||
var meta = $("#hidden-meta").val();
|
||||
if (meta != 0) {
|
||||
button = document.getElementById("del-" + id_evento + "-" + server_id);
|
||||
}
|
||||
|
||||
if (!button) {
|
||||
// Button does not exist. Ignore.
|
||||
processed += 1;
|
||||
return;
|
||||
}
|
||||
var message = "<h4 style = 'text-align: center;' > Are you sure?</h4> ";
|
||||
var message = "<h3 style = 'text-align: center;' > Are you sure?</h3> ";
|
||||
confirmDialog({
|
||||
title: "ATTENTION",
|
||||
message: message,
|
||||
|
@ -857,7 +770,8 @@ function delete_event(table, id_evento, event_rep, row) {
|
|||
id_evento,
|
||||
{ delete_event: 1 },
|
||||
event_rep,
|
||||
row
|
||||
row,
|
||||
server_id
|
||||
);
|
||||
},
|
||||
onDeny: function() {
|
||||
|
@ -868,8 +782,19 @@ function delete_event(table, id_evento, event_rep, row) {
|
|||
});
|
||||
}
|
||||
|
||||
function execute_delete_event_reponse(table, id_evento, event_rep, row) {
|
||||
function execute_delete_event_reponse(
|
||||
table,
|
||||
id_evento,
|
||||
event_rep,
|
||||
row,
|
||||
server_id
|
||||
) {
|
||||
var button = document.getElementById("del-" + id_evento);
|
||||
var meta = $("#hidden-meta").val();
|
||||
if (meta != 0) {
|
||||
button = document.getElementById("del-" + id_evento + "-" + server_id);
|
||||
}
|
||||
|
||||
if (!button) {
|
||||
// Button does not exist. Ignore.
|
||||
processed += 1;
|
||||
|
@ -877,7 +802,14 @@ function execute_delete_event_reponse(table, id_evento, event_rep, row) {
|
|||
}
|
||||
button.children[0];
|
||||
button.children[0].src = "images/spinner.gif";
|
||||
return update_event(table, id_evento, { delete_event: 1 }, event_rep, row);
|
||||
return update_event(
|
||||
table,
|
||||
id_evento,
|
||||
{ delete_event: 1 },
|
||||
event_rep,
|
||||
row,
|
||||
server_id
|
||||
);
|
||||
}
|
||||
|
||||
// Imported from old files.
|
||||
|
@ -964,32 +896,61 @@ function execute_event_response(event_list_btn) {
|
|||
switch (response_id) {
|
||||
case "in_progress_selected":
|
||||
$(".chk_val:checked").each(function() {
|
||||
// Parent: TD. GrandParent: TR.
|
||||
var event_id = $(this).val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var server_id = 0;
|
||||
if (meta != 0) {
|
||||
var split_id = event_id.split("|");
|
||||
event_id = split_id[0];
|
||||
server_id = split_id[1];
|
||||
}
|
||||
|
||||
in_process_event(
|
||||
dt_events,
|
||||
$(this).val(),
|
||||
"events",
|
||||
event_id,
|
||||
$(this).attr("event_rep"),
|
||||
this.parentElement.parentElement
|
||||
this.parentElement.parentElement,
|
||||
server_id
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "validate_selected":
|
||||
$(".chk_val:checked").each(function() {
|
||||
var event_id = $(this).val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var server_id = 0;
|
||||
if (meta != 0) {
|
||||
var split_id = event_id.split("|");
|
||||
event_id = split_id[0];
|
||||
server_id = split_id[1];
|
||||
}
|
||||
|
||||
validate_event(
|
||||
dt_events,
|
||||
$(this).val(),
|
||||
"events",
|
||||
event_id,
|
||||
$(this).attr("event_rep"),
|
||||
this.parentElement.parentElement
|
||||
this.parentElement.parentElement,
|
||||
server_id
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "delete_selected":
|
||||
$(".chk_val:checked").each(function() {
|
||||
var event_id = $(this).val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var server_id = 0;
|
||||
if (meta != 0) {
|
||||
var split_id = event_id.split("|");
|
||||
event_id = split_id[0];
|
||||
server_id = split_id[1];
|
||||
}
|
||||
|
||||
execute_delete_event_reponse(
|
||||
dt_events,
|
||||
$(this).val(),
|
||||
"events",
|
||||
event_id,
|
||||
$(this).attr("event_rep"),
|
||||
this.parentElement.parentElement
|
||||
this.parentElement.parentElement,
|
||||
server_id
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
@ -1016,8 +977,10 @@ function check_massive_response_event(
|
|||
var event_id = $(this).val();
|
||||
var meta = $("#hidden-meta").val();
|
||||
var server_id = 0;
|
||||
if (meta) {
|
||||
server_id = $("#hidden-server_id_" + event_id).val();
|
||||
if (meta != 0) {
|
||||
var split_id = event_id.split("|");
|
||||
event_id = split_id[0];
|
||||
server_id = split_id[1];
|
||||
}
|
||||
|
||||
response["target"] = get_response_target(
|
||||
|
@ -1044,3 +1007,24 @@ function event_widget_options() {
|
|||
$(".event-widget-input").enable();
|
||||
}
|
||||
}
|
||||
|
||||
function process_buffers(buffers) {
|
||||
$("#events_buffers_display").empty();
|
||||
if (buffers != null && buffers.settings != undefined && buffers.data) {
|
||||
var params = [];
|
||||
params.push("page=include/ajax/events");
|
||||
params.push("process_buffers=1");
|
||||
params.push("buffers=" + JSON.stringify(buffers));
|
||||
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
type: "POST",
|
||||
url: $("#hidden-ajax_file").val(),
|
||||
async: true,
|
||||
dataType: "html",
|
||||
success: function(data) {
|
||||
$("#events_buffers_display").html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue