Merge branch 'develop' into ent-12101-cambiar-script-de-instalacion-para-apuntar-al-paquete-x64-de-la-consola-open
|
@ -0,0 +1 @@
|
|||
src/pandora_gotty filter=lfs diff=lfs merge=lfs -text
|
|
@ -0,0 +1,2 @@
|
|||
*.rpm
|
||||
*.deb
|
|
@ -0,0 +1,8 @@
|
|||
FROM rockylinux:8
|
||||
|
||||
RUN dnf install -y rpm-build rpmdevtools
|
||||
RUN rpmdev-setuptree
|
||||
RUN mkdir /root/pandora_gotty
|
||||
WORKDIR /root/pandora_gotty
|
||||
|
||||
#CMD bash build.sh
|
|
@ -0,0 +1,6 @@
|
|||
FROM ubuntu:22.04
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y dh-make debhelper build-essential
|
||||
RUN mkdir /root/pandora_gotty
|
||||
WORKDIR /root/pandora_gotty
|
|
@ -0,0 +1 @@
|
|||
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`
|
|
@ -0,0 +1,11 @@
|
|||
#Build RPM
|
||||
docker build -t pandora_gotty_builder_rpm -f Dockerfile-RPM . || exit 1
|
||||
docker run --rm -it -v `pwd`:/root/pandora_gotty pandora_gotty_builder_rpm /root/pandora_gotty/build_rpm.sh || exit 1
|
||||
|
||||
#Buikd DEB
|
||||
docker build -t pandora_gotty_builder_deb -f Dockerfile-deb . || exit 1
|
||||
docker run --rm -it -v `pwd`:/root/pandora_gotty pandora_gotty_builder_deb /root/pandora_gotty/build_deb.sh || exit 1
|
||||
|
||||
echo " - Done"
|
||||
pwd
|
||||
ls -l | grep -E "(\.deb|\.rpm)"
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
#DEB
|
||||
cd deb
|
||||
VERSION=$(grep 'Version:' pandora_gotty/DEBIAN/control | awk '{print $2}')
|
||||
mkdir -p pandora_gotty/usr/bin
|
||||
mkdir -p pandora_gotty/etc/pandora_gotty
|
||||
cp -a ../src/pandora_gotty pandora_gotty/usr/bin
|
||||
cp -a ../src/pandora_gotty.conf pandora_gotty/etc/pandora_gotty
|
||||
curl -SsL --output pandora_gotty/usr/bin/pandora_gotty_exec http://192.168.50.31/installers/installers/Linux/x86_64/pandora_gotty_exec
|
||||
chmod +x pandora_gotty/usr/bin/pandora_gotty_exec
|
||||
dpkg-deb --build pandora_gotty
|
||||
mv pandora_gotty.deb ../
|
||||
rm -rf pandora_gotty/usr/
|
||||
rm -rf pandora_gotty/etc/
|
||||
cd ..
|
||||
mv pandora_gotty.deb pandora_gotty_${VERSION}.deb
|
||||
chmod 777 pandora_gotty_${VERSION}.deb
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
#RPM
|
||||
VERSION=$(grep '%define version' pandora_gotty.spec | awk '{print $3}')
|
||||
mkdir -p pandora_gotty-${VERSION}
|
||||
cp src/pandora_gotty pandora_gotty-${VERSION}/
|
||||
cp src/pandora_gotty.conf pandora_gotty-${VERSION}/
|
||||
curl -SsL --output pandora_gotty-${VERSION}/pandora_gotty_exec http://192.168.50.31/installers/installers/Linux/x86_64/pandora_gotty_exec
|
||||
chmod +x pandora_gotty-${VERSION}/pandora_gotty_exec
|
||||
tar -cvzf pandora_gotty-${VERSION}.tar.gz pandora_gotty-${VERSION}/*
|
||||
mv pandora_gotty-${VERSION}.tar.gz ${HOME}/rpmbuild/SOURCES/
|
||||
rm -rf ${HOME}/rpmbuild/RPMS/x86_64/pandora_gotty*
|
||||
rpmbuild -ba pandora_gotty.spec
|
||||
rm -rf pandora_gotty-${VERSION}
|
||||
mv ${HOME}/rpmbuild/RPMS/x86_64/pandora_gotty* .
|
||||
chmod 777 *.rpm
|
|
@ -0,0 +1,3 @@
|
|||
*.deb
|
||||
**/usr
|
||||
**/etc
|
|
@ -0,0 +1,5 @@
|
|||
pandora_gotty (1.0-1) stable; urgency=low
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- PandoraFMS Mon, 18 Sep 2023 00:00:00 +0000
|
|
@ -0,0 +1,9 @@
|
|||
Source: pandora_gotty
|
||||
Section: utils
|
||||
Version: 1.0.0
|
||||
Priority: optional
|
||||
Maintainer: PandoraFMS
|
||||
Build-Depends: debhelper (>= 12)
|
||||
Package: pandora-gotty
|
||||
Architecture: amd64
|
||||
Description: pandora_gotty for Pandora FMS.
|
|
@ -0,0 +1,41 @@
|
|||
%define name pandora_gotty
|
||||
%define version 1.0
|
||||
%define release 1%{?dist}
|
||||
Summary: pandora_gptty for Pandora FMS
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
License: GPL
|
||||
Vendor: PandoraFMS
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: https://pandorafms.com
|
||||
Group: System/Monitoring
|
||||
Packager: PandoraFMS
|
||||
BuildArch: x86_64
|
||||
Provides: %{name}-%{version}
|
||||
|
||||
%description
|
||||
pandora_gotty for Pandora FMS.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
|
||||
mkdir -p %{buildroot}/etc/pandora_gotty/
|
||||
cp %{name} $RPM_BUILD_ROOT/%{_bindir}
|
||||
cp pandora_gotty_exec $RPM_BUILD_ROOT/%{_bindir}
|
||||
cp pandora_gotty.conf %{buildroot}/etc/pandora_gotty/
|
||||
%clean
|
||||
rm -Rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%config(noreplace) /etc/pandora_gotty/pandora_gotty.conf
|
||||
%{_bindir}/%{name}
|
||||
%{_bindir}/pandora_gotty_exec
|
||||
|
||||
%changelog
|
||||
* Mon Sep 18 2023 PandoraFMS - 1.0-1
|
||||
- Initial RPM release
|
|
@ -0,0 +1,2 @@
|
|||
*rpm
|
||||
bin/*
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3758eddb64db79c6ea1dac4cb200ee8ec86ef3f51723dad5be4365a1315b952b
|
||||
size 13642854
|
|
@ -0,0 +1,29 @@
|
|||
//Pandora Gotty config file
|
||||
|
||||
// [bool] Permit clients to write to the TTY
|
||||
permit_write = true
|
||||
|
||||
// [bool] Permit clients to send command line arguments in URL (e.g. http://example.com:8080/?arg=AAA&arg=BBB)
|
||||
permit_arguments = true
|
||||
|
||||
// [bool] Enable random URL generation
|
||||
enable_random_url = true
|
||||
|
||||
// [int] Default length of random strings appended to URL
|
||||
// To enable random URL generation, set `true` to `enable_random_url`
|
||||
random_url_length = 32
|
||||
|
||||
// [bool] Enable TLS/SSL
|
||||
// enable_tls = false
|
||||
|
||||
// [string] Default TLS certificate file path
|
||||
// tls_crt_file = "~/.gotty.crt"
|
||||
|
||||
// [string] Default TLS key file path
|
||||
// tls_key_file = "~/.gotty.key"
|
||||
|
||||
// [bool] Enable client certificate authentication
|
||||
// enable_tls_client_auth = false
|
||||
|
||||
// [string] Certificate file of CA for client certificates
|
||||
// tls_ca_crt_file = "~/.gotty.ca.crt"
|
|
@ -0,0 +1,110 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
__author__ = "PandoraFMS Team"
|
||||
__copyright__ = "Copyright 2023, PandoraFMS"
|
||||
#__credits__ = ["Rob Knight", "Peter Maxwell", "Gavin Huttley", "Matthew Wakefield"]
|
||||
__maintainer__ = "Projects/QA department"
|
||||
__status__ = "Prod"
|
||||
__version__ = "1.0"
|
||||
|
||||
import sys, argparse, signal, re, datetime, subprocess
|
||||
|
||||
info= f"""
|
||||
SSH and TELNET helper for pandora_gotty.
|
||||
Version: {__version__}
|
||||
"""
|
||||
|
||||
parser = argparse.ArgumentParser(description= info, formatter_class=argparse.RawTextHelpFormatter)
|
||||
parser.add_argument('exec_cmd',
|
||||
help='Aplication to be executed, avalibles: ssh or telnet',type=str, choices=['ssh', 'telnet'])
|
||||
parser.add_argument('address',
|
||||
help='IP addres or dns name to connect', type=str, default="")
|
||||
parser.add_argument('port',
|
||||
help='Port to connect', type=int, default=23)
|
||||
parser.add_argument('user',
|
||||
help='Username, only requiered for ssh connection', type=str, default="", nargs='?')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Define a function to handle the SIGINT signal
|
||||
def sigint_handler(signal, frame):
|
||||
print ('\nInterrupted by user', file=sys.stderr)
|
||||
sys.exit(0)
|
||||
signal.signal(signal.SIGINT, sigint_handler)
|
||||
|
||||
# Define a function to handle the SIGTERM signal
|
||||
def sigterm_handler(signum, frame):
|
||||
print("Received SIGTERM signal.", file=sys.stderr)
|
||||
sys.exit(0)
|
||||
signal.signal(signal.SIGTERM, sigterm_handler)
|
||||
|
||||
# Functions
|
||||
def is_valid_add(add:str):
|
||||
# Regular expression to match an IP address
|
||||
ip_pattern = r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'
|
||||
|
||||
# Regular expression to match a DNS name (domain name)
|
||||
dns_pattern = r'^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
|
||||
|
||||
if re.match(ip_pattern, add) or re.match(dns_pattern, add):
|
||||
return True
|
||||
else:
|
||||
print(f"Error not valid address: {add}", file=sys.stderr)
|
||||
return False
|
||||
|
||||
def is_valid_username(username:str):
|
||||
# Regular expression to match a valid Linux username
|
||||
username_pattern = r'^[a-zA-Z_][a-zA-Z0-9_]{0,31}$'
|
||||
if re.match(username_pattern, username) is not None:
|
||||
return True
|
||||
else:
|
||||
print(f"Error not valid username: {username}", file=sys.stderr)
|
||||
return False
|
||||
|
||||
def exec_ssh (user:str, add:str, port:int):
|
||||
# Previus checks
|
||||
if is_valid_username(user) == False:
|
||||
return False
|
||||
if is_valid_add(add) == False:
|
||||
return False
|
||||
if port == 0 :
|
||||
return False
|
||||
|
||||
try:
|
||||
print("> Starting SSH connection...")
|
||||
ssh_command = f"ssh {user}@{add} -p {port}"
|
||||
subprocess.run(ssh_command, shell=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise SystemExit(e)
|
||||
return True
|
||||
|
||||
def exec_telnet (add:str, port:int):
|
||||
# Previus checks
|
||||
if is_valid_add(add) == False:
|
||||
return False
|
||||
|
||||
try:
|
||||
print("> Starting Telnet connection...")
|
||||
ssh_command = f"telnet -E {add} {port}"
|
||||
subprocess.run(ssh_command, shell=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise SystemExit(e)
|
||||
return True
|
||||
|
||||
|
||||
# Main
|
||||
if __name__ == "__main__":
|
||||
if args.exec_cmd == "ssh":
|
||||
exec_ssh(args.user, args.address, args.port)
|
||||
print ("> ssh session finished")
|
||||
sys.exit(0)
|
||||
|
||||
if args.exec_cmd == "telnet":
|
||||
exec_telnet(args.address, args.port)
|
||||
print ("> telnet session finished")
|
||||
sys.exit(0)
|
||||
|
||||
sys.exit(0)
|
|
@ -1,2 +1,3 @@
|
|||
@at 00:00 /every:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 "%CD%\restart_pandora_agent.bat"
|
||||
@at 00:00 /every:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 "'%CD%\restart_pandora_agent.bat'"
|
||||
|
||||
schtasks /change /tn pandora_agent_restart /tr "'%CD%\restart_pandora_agent.bat'"
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.773.3-230926
|
||||
Version: 7.0NG.773.3-231011
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-230926"
|
||||
pandora_version="7.0NG.773.3-231011"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -239,8 +239,34 @@ module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
|
|||
module_max 100
|
||||
module_min 0
|
||||
module_description Free disk Percentage of root partition
|
||||
module_min_warning 70
|
||||
module_max_warning 90
|
||||
module_min_critical 91
|
||||
module_max_critical 100
|
||||
module_min_warning 10
|
||||
module_max_warning 20
|
||||
module_min_critical 0
|
||||
module_max_critical 10
|
||||
module_end
|
||||
|
||||
# Sample modules to check connectivity from your mac
|
||||
#module_begin
|
||||
#module_name Packet_loss
|
||||
#module_type generic_data
|
||||
#module_exec ping 8.8.8.8 -c 5 | grep "packet loss" | cut -d " " -f 7 | grep -o "[0-9\.]*"
|
||||
#module_end
|
||||
|
||||
#module_begin
|
||||
#module_name Internet_Latency
|
||||
#module_type generic_data
|
||||
#module_exec ping -c 1 8.8.8.8 | grep "time"| cut -f 4 -d "=" | grep -o "[0-9\.]*"
|
||||
#module_end
|
||||
|
||||
#module_begin
|
||||
#module_name Internet_check
|
||||
#module_type generic_proc
|
||||
#module_exec ping 8.8.8.8 -c 2 | grep "2 packets received" | wc -l
|
||||
#module_end
|
||||
|
||||
# Check a running process
|
||||
#module_begin
|
||||
#module_name Cyberduck
|
||||
#module_type generic_proc
|
||||
#module_exec ps aux | grep cyberduck | grep -v grep | wc -l
|
||||
#module_end
|
||||
|
|
|
@ -1031,7 +1031,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.773.3';
|
||||
use constant AGENT_BUILD => '230926';
|
||||
use constant AGENT_BUILD => '231011';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230926
|
||||
%define release 231011
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230926
|
||||
%define release 231011
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230926
|
||||
%define release 231011
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.773.3"
|
||||
PI_BUILD="230926"
|
||||
PI_BUILD="231011"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230926}
|
||||
{231011}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
@at 00:00 /every:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 "%CD%\restart_pandora_agent.bat"
|
||||
@at 00:00 /every:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 "'%CD%\restart_pandora_agent.bat'"
|
||||
|
||||
schtasks /change /tn pandora_agent_restart /tr "'%CD%\restart_pandora_agent.bat'"
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 230926")
|
||||
#define PANDORA_VERSION ("7.0NG.773.3 Build 231011")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 230926))"
|
||||
VALUE "ProductVersion", "(7.0NG.773.3(Build 231011))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.773.3-230926
|
||||
Version: 7.0NG.773.3-231011
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.773.3-230926"
|
||||
pandora_version="7.0NG.773.3-231011"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
require_once 'include/config.php';
|
||||
require_once 'include/auth/mysql.php';
|
||||
require_once 'include/functions.php';
|
||||
require_once 'include/functions_db.php';
|
||||
|
||||
global $config;
|
||||
|
||||
if ((bool) $config['enterprise_installed'] === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load classes.
|
||||
require_once 'include/class/DiscoveryConsoleTask.php';
|
||||
require_once 'include/class/ConsoleSupervisor.php';
|
||||
|
||||
db_process_sql_update(
|
||||
'tconfig',
|
||||
['value' => get_system_time()],
|
||||
['token' => 'cron_last_run']
|
||||
);
|
||||
|
||||
$tasks = new DiscoveryConsoleTask();
|
||||
|
||||
$tasks->run();
|
||||
|
||||
if (is_reporting_console_node() === true) {
|
||||
$supervisor = new ConsoleSupervisor();
|
||||
$supervisor->run();
|
||||
}
|
|
@ -31,6 +31,7 @@ global $config;
|
|||
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once $config['homedir'].'/godmode/wizards/Wizard.main.php';
|
||||
require_once $config['homedir'].'/include/functions_cron_task.php';
|
||||
|
||||
|
||||
/**
|
||||
|
@ -78,91 +79,78 @@ function quickShell()
|
|||
return;
|
||||
}
|
||||
|
||||
$form_sent = get_parameter('form-sent', false);
|
||||
$method = get_parameter('method', null);
|
||||
|
||||
$setup_anchor = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gsetup&sec2=godmode/setup/setup§ion=quickshell',
|
||||
'content' => __('GoTTY setup'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ((bool) $config['gotty_ssh_enabled'] === false
|
||||
&& (bool) $config['gotty_telnet_enabled'] === false
|
||||
) {
|
||||
ui_print_warning_message(__('Please, enable GoTTY in %s', $setup_anchor));
|
||||
return;
|
||||
}
|
||||
|
||||
$agent_id = get_parameter('id_agente', 0);
|
||||
$username = get_parameter('username', null);
|
||||
$method = get_parameter('method', null);
|
||||
$method_port = get_parameter('port', null);
|
||||
|
||||
// Retrieve main IP Address.
|
||||
$address = agents_get_address($agent_id);
|
||||
$agent_address = agents_get_address($agent_id);
|
||||
|
||||
ui_require_css_file('wizard');
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
// Settings.
|
||||
// WebSocket host, where client should connect.
|
||||
if (isset($config['ws_port']) === false) {
|
||||
config_update_value('ws_port', 8080);
|
||||
// Build URL args.
|
||||
if ($method === 'ssh') {
|
||||
// SSH.
|
||||
$args .= '&arg='.$agent_address.'&arg='.$method_port.'&arg='.$username;
|
||||
} else if ($method == 'telnet') {
|
||||
// Telnet.
|
||||
$args .= '&arg='.$agent_address.'&arg='.$method_port;
|
||||
}
|
||||
|
||||
if (empty($config['ws_proxy_url']) === true) {
|
||||
$ws_url = 'http://'.$_SERVER['SERVER_ADDR'].':'.$config['ws_port'];
|
||||
} else {
|
||||
preg_match('/\/\/(.*)/', $config['ws_proxy_url'], $matches);
|
||||
if (isset($_SERVER['HTTPS']) === true) {
|
||||
$ws_url = 'https://'.$matches[1];
|
||||
} else {
|
||||
$ws_url = 'http://'.$matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
// Gotty settings. Internal communication (WS).
|
||||
if (isset($config['gotty_host']) === false) {
|
||||
config_update_value('gotty_host', '127.0.0.1');
|
||||
}
|
||||
|
||||
if (isset($config['gotty_telnet_port']) === false) {
|
||||
config_update_value('gotty_telnet_port', 8082);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_ssh_port']) === false) {
|
||||
config_update_value('gotty_ssh_port', 8081);
|
||||
}
|
||||
|
||||
// Context to allow self-signed certs.
|
||||
$context = stream_context_create(
|
||||
[
|
||||
'http' => [ 'method' => 'GET'],
|
||||
'ssl' => [
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$connectionURL = buildConnectionURL($method);
|
||||
$gotty_addr = $connectionURL.$args;
|
||||
|
||||
// Username. Retrieve from form.
|
||||
if (empty($username) === true) {
|
||||
if ($form_sent === false) {
|
||||
// No username provided, ask for it.
|
||||
$wiz = new Wizard();
|
||||
|
||||
$test = curl($ws_url, []);
|
||||
if ($test === false) {
|
||||
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
'method' => 'POST',
|
||||
'action' => '#',
|
||||
'id' => 'retry_form',
|
||||
],
|
||||
]
|
||||
);
|
||||
$method_fields = [];
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Retry'),
|
||||
'submit',
|
||||
false,
|
||||
[
|
||||
'icon' => 'next',
|
||||
'form' => 'retry_form',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
return;
|
||||
if ($config['gotty_telnet_enabled']) {
|
||||
$method_fields['telnet'] = __('Telnet');
|
||||
$port_value = 23;
|
||||
}
|
||||
|
||||
if ($config['gotty_ssh_enabled']) {
|
||||
$method_fields['ssh'] = __('SSH');
|
||||
$port_value = 22;
|
||||
}
|
||||
|
||||
$method_script = "
|
||||
var wizard = document.querySelector('.wizard');
|
||||
p=22;
|
||||
wizard.querySelector('ul > li').classList.remove('invisible_important');
|
||||
wizard.querySelector('ul > li').classList.add('visible');
|
||||
if(this.value == 'telnet') {
|
||||
p=23;
|
||||
wizard.querySelector('ul > li').classList.remove('visible');
|
||||
wizard.querySelector('ul > li').classList.add('invisible_important');
|
||||
$('#text-username').prop('required', false);
|
||||
} else {
|
||||
$('#text-username').prop('required', true);
|
||||
}
|
||||
$('#text-port').val(p);";
|
||||
|
||||
$wiz->printForm(
|
||||
[
|
||||
'form' => [
|
||||
|
@ -175,8 +163,9 @@ function quickShell()
|
|||
[
|
||||
'label' => __('Username'),
|
||||
'arguments' => [
|
||||
'type' => 'text',
|
||||
'name' => 'username',
|
||||
'type' => 'text',
|
||||
'name' => 'username',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
@ -185,7 +174,7 @@ function quickShell()
|
|||
'type' => 'text',
|
||||
'id' => 'port',
|
||||
'name' => 'port',
|
||||
'value' => 22,
|
||||
'value' => $port_value,
|
||||
],
|
||||
],
|
||||
[
|
||||
|
@ -193,13 +182,17 @@ function quickShell()
|
|||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'name' => 'method',
|
||||
'fields' => [
|
||||
'ssh' => __('SSH'),
|
||||
'telnet' => __('Telnet'),
|
||||
],
|
||||
'script' => "p=22; if(this.value == 'telnet') { p=23; } $('#text-port').val(p);",
|
||||
'fields' => $method_fields,
|
||||
'script' => $method_script,
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'type' => 'hidden',
|
||||
'name' => 'form-sent',
|
||||
'value' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
],
|
||||
false,
|
||||
|
@ -221,119 +214,71 @@ function quickShell()
|
|||
return;
|
||||
}
|
||||
|
||||
// Initialize Gotty Client.
|
||||
$host = $config['gotty_host'];
|
||||
if ($method == 'ssh') {
|
||||
// SSH.
|
||||
$port = $config['gotty_ssh_port'];
|
||||
$command_arguments = "var args = '?arg=".$username.'@'.$address;
|
||||
$command_arguments .= '&arg=-p '.$method_port."';";
|
||||
} else if ($method == 'telnet') {
|
||||
// Telnet.
|
||||
$port = $config['gotty_telnet_port'];
|
||||
$username = preg_replace('/[^a-zA-Z0-9\-\.]/', '', $username);
|
||||
$command_arguments = "var args = '?arg=-l ".$username;
|
||||
$command_arguments .= '&arg='.$address;
|
||||
$command_arguments .= '&arg='.$method_port."&arg=-E';";
|
||||
} else {
|
||||
ui_print_error_message(__('Please use SSH or Telnet.'));
|
||||
return;
|
||||
// Check gotty connection before trying to load iframe.
|
||||
$ch = curl_init($gotty_addr);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
// Maximum time for the entire request.
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
|
||||
// Maximum time to establish a connection.
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
$finalUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
if ($responseCode !== 200) {
|
||||
ui_print_error_message(__('Connection error. Please check your settings at %s', $setup_anchor));
|
||||
exit;
|
||||
}
|
||||
|
||||
// If rediretion is enabled, we will try to connect using
|
||||
// http:// or https:// endpoint.
|
||||
$test = get_headers($ws_url, false, $context);
|
||||
if ($test === false) {
|
||||
if (empty($wiz) === true) {
|
||||
$wiz = new Wizard();
|
||||
}
|
||||
|
||||
ui_print_error_message(__('WebService engine has not been started, please check documentation.'));
|
||||
echo $wiz->printGoBackButton('#');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check credentials.
|
||||
$auth_str = '';
|
||||
$gotty_url = $host.':'.$port;
|
||||
if (empty($config['gotty_user']) === false
|
||||
&& empty($config['gotty_pass']) === false
|
||||
) {
|
||||
$auth_str = io_safe_output($config['gotty_user']);
|
||||
$auth_str .= ':'.io_output_password($config['gotty_pass']);
|
||||
$gotty_url = $auth_str.'@'.$host.':'.$port;
|
||||
}
|
||||
|
||||
$r = file_get_contents('http://'.$gotty_url.'/js/hterm.js');
|
||||
if (empty($r) === true) {
|
||||
if (empty($wiz) === true) {
|
||||
$wiz = new Wizard();
|
||||
}
|
||||
|
||||
ui_print_error_message(__('WebService engine is not working properly, please check documentation.'));
|
||||
echo $wiz->printGoBackButton('#');
|
||||
return;
|
||||
}
|
||||
|
||||
// Override gotty client settings.
|
||||
if (empty($auth_str) === true) {
|
||||
$r .= "var gotty_auth_token = '';";
|
||||
} else {
|
||||
$r .= "var gotty_auth_token = '";
|
||||
$r .= $auth_str."';";
|
||||
}
|
||||
|
||||
// Set websocket target and method.
|
||||
$gotty = file_get_contents('http://'.$gotty_url.'/js/gotty.js');
|
||||
$url = "var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';";
|
||||
if (empty($config['ws_proxy_url']) === true) {
|
||||
$new = "var url = (httpsEnabled ? 'wss://' : 'ws://')";
|
||||
$new .= " + window.location.host + ':";
|
||||
$new .= $config['ws_port'].'/'.$method."';";
|
||||
} else {
|
||||
$new = "var url = '";
|
||||
$new .= $config['ws_proxy_url'].'/'.$method."';";
|
||||
}
|
||||
|
||||
// Update firefox issue.
|
||||
$original = ' this.iframe_.src = \'#\';';
|
||||
$trick = 'this.iframe_.src = \'javascript:\';';
|
||||
|
||||
$r = str_replace($original, $trick, $r);
|
||||
|
||||
// Update url.
|
||||
$gotty = str_replace($url, $new, $gotty);
|
||||
|
||||
// Update websocket arguments.
|
||||
$args = 'var args = window.location.search;';
|
||||
$new = $command_arguments;
|
||||
|
||||
// Update arguments.
|
||||
$gotty = str_replace($args, $new, $gotty);
|
||||
|
||||
?>
|
||||
<style>#terminal {
|
||||
height: 650px;
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: calc(100vh - 205px);
|
||||
}
|
||||
#terminal > iframe {
|
||||
width:100%;
|
||||
height:100%;
|
||||
position: relative!important;
|
||||
flex-grow: 1;
|
||||
border: 0px;
|
||||
}
|
||||
</style>
|
||||
<div id="terminal"></div>
|
||||
<script type="text/javascript">
|
||||
<?php echo $r; ?>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
<?php echo $gotty; ?>
|
||||
</script>
|
||||
|
||||
<div id="terminal"><iframe id="gotty-iframe" src="<?php echo $gotty_addr; ?>"></iframe></div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build Connection URL based on provided connection method.
|
||||
*
|
||||
* @param string $method Connection method (SSH/Telnet).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function buildConnectionURL($method)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$address = (empty($config['gotty_addr']) === true) ? $_SERVER['SERVER_ADDR'] : $config['gotty_addr'];
|
||||
$use_ssl = ($method === 'ssh') ? $config['gotty_ssh_use_ssl'] : $config['gotty_telnet_use_ssl'];
|
||||
$protocol = ((bool) $use_ssl === true) ? 'https://' : 'http://';
|
||||
|
||||
return $protocol.$address.':'.$config['gotty_port'].'/'.$config['gotty_connection_hash'].'/?arg='.$method;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Provide an interface where configure all settings.
|
||||
*
|
||||
|
@ -347,116 +292,108 @@ function quickShellSettings()
|
|||
ui_require_css_file('discovery');
|
||||
|
||||
// Gotty settings. Internal communication (WS).
|
||||
|
||||
if (isset($config['gotty_ssh_enabled']) === false) {
|
||||
config_update_value('gotty_ssh_enabled', 1);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_telnet_enabled']) === false) {
|
||||
config_update_value('gotty_telnet_enabled', 0);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_host']) === false) {
|
||||
config_update_value('gotty_host', '127.0.0.1');
|
||||
}
|
||||
|
||||
if (isset($config['gotty_telnet_port']) === false) {
|
||||
config_update_value('gotty_telnet_port', 8082);
|
||||
if (isset($config['gotty_port']) === false) {
|
||||
config_update_value('gotty_port', 8080);
|
||||
}
|
||||
|
||||
if (isset($config['gotty_ssh_port']) === false) {
|
||||
config_update_value('gotty_ssh_port', 8081);
|
||||
}
|
||||
$changes = 0;
|
||||
$critical = 0;
|
||||
|
||||
// Parser.
|
||||
if (get_parameter('update_config', false) !== false) {
|
||||
// Gotty settings. Internal communication (WS).
|
||||
$gotty = get_parameter(
|
||||
'gotty',
|
||||
''
|
||||
$gotty_ssh_enabled = get_parameter(
|
||||
'gotty_ssh_enabled',
|
||||
0
|
||||
);
|
||||
$gotty_host = get_parameter(
|
||||
'gotty_host',
|
||||
''
|
||||
|
||||
$gotty_telnet_enabled = get_parameter(
|
||||
'gotty_telnet_enabled',
|
||||
0
|
||||
);
|
||||
$gotty_ssh_port = get_parameter(
|
||||
'gotty_ssh_port',
|
||||
''
|
||||
);
|
||||
$gotty_telnet_port = get_parameter(
|
||||
'gotty_telnet_port',
|
||||
|
||||
$gotty_addr = get_parameter(
|
||||
'gotty_addr',
|
||||
''
|
||||
);
|
||||
|
||||
$gotty_user = get_parameter(
|
||||
'gotty_user',
|
||||
$gotty_port = get_parameter(
|
||||
'gotty_port',
|
||||
''
|
||||
);
|
||||
|
||||
$gotty_pass = get_parameter(
|
||||
'gotty_pass',
|
||||
''
|
||||
$gotty_ssh_use_ssl = get_parameter(
|
||||
'gotty_ssh_use_ssl',
|
||||
false
|
||||
);
|
||||
|
||||
$gotty_pass = io_input_password($gotty_pass);
|
||||
$gotty_telnet_use_ssl = get_parameter(
|
||||
'gotty_telnet_use_ssl',
|
||||
false
|
||||
);
|
||||
|
||||
$changes = 0;
|
||||
$critical = 0;
|
||||
if ($config['gotty'] != $gotty) {
|
||||
config_update_value('gotty', $gotty);
|
||||
$changes++;
|
||||
$critical++;
|
||||
if ($config['gotty_ssh_enabled'] != $gotty_ssh_enabled) {
|
||||
config_update_value('gotty_ssh_enabled', $gotty_ssh_enabled);
|
||||
}
|
||||
|
||||
if ($config['gotty_host'] != $gotty_host) {
|
||||
config_update_value('gotty_host', $gotty_host);
|
||||
$changes++;
|
||||
if ($config['gotty_telnet_enabled'] != $gotty_telnet_enabled) {
|
||||
config_update_value('gotty_telnet_enabled', $gotty_telnet_enabled);
|
||||
}
|
||||
|
||||
if ($config['gotty_telnet_port'] != $gotty_telnet_port) {
|
||||
config_update_value('gotty_telnet_port', $gotty_telnet_port);
|
||||
$changes++;
|
||||
if ($config['gotty_addr'] != $gotty_addr) {
|
||||
config_update_value('gotty_addr', $gotty_addr);
|
||||
}
|
||||
|
||||
if ($config['gotty_ssh_port'] != $gotty_ssh_port) {
|
||||
config_update_value('gotty_ssh_port', $gotty_ssh_port);
|
||||
$changes++;
|
||||
if ($config['gotty_port'] != $gotty_port) {
|
||||
// Mark gotty for restart (should kill the process in the current port).
|
||||
if ($config['restart_gotty_next_cron_port'] === ''
|
||||
|| $config['restart_gotty_next_cron_port'] === null
|
||||
) {
|
||||
config_update_value('restart_gotty_next_cron_port', $config['gotty_port']);
|
||||
}
|
||||
|
||||
config_update_value('gotty_port', $gotty_port);
|
||||
}
|
||||
|
||||
if ($config['gotty_user'] != $gotty_user) {
|
||||
config_update_value('gotty_user', $gotty_user);
|
||||
$changes++;
|
||||
$critical++;
|
||||
if ($config['gotty_ssh_use_ssl'] != $gotty_ssh_use_ssl) {
|
||||
config_update_value('gotty_ssh_use_ssl', $gotty_ssh_use_ssl);
|
||||
}
|
||||
|
||||
if ($config['gotty_pass'] != $gotty_pass) {
|
||||
$gotty_pass = io_input_password($gotty_pass);
|
||||
config_update_value('gotty_pass', $gotty_pass);
|
||||
$changes++;
|
||||
$critical++;
|
||||
if ($config['gotty_telnet_use_ssl'] != $gotty_telnet_use_ssl) {
|
||||
config_update_value('gotty_telnet_use_ssl', $gotty_telnet_use_ssl);
|
||||
}
|
||||
|
||||
cron_task_start_gotty();
|
||||
}
|
||||
|
||||
if ($changes > 0) {
|
||||
$msg = __('%d Updated', $changes);
|
||||
if ($critical > 0) {
|
||||
$msg = __(
|
||||
'%d Updated, please restart WebSocket engine service',
|
||||
$changes
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_success_message($msg);
|
||||
}
|
||||
|
||||
// Form. Using old style.
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
echo '<legend>'.__('Quickshell').'</legend>';
|
||||
echo '<legend>'.__('GoTTY general parameters').'</legend>';
|
||||
|
||||
$t = new StdClass();
|
||||
$t->data = [];
|
||||
$t->width = '100%';
|
||||
$t->class = 'filter-table-adv';
|
||||
$t->data = [];
|
||||
$t->style = [];
|
||||
$t->style[0] = 'width: 50%;';
|
||||
$general_table = new StdClass();
|
||||
$general_table->data = [];
|
||||
$general_table->width = '100%';
|
||||
$general_table->class = 'filter-table-adv';
|
||||
$general_table->data = [];
|
||||
$general_table->style = [];
|
||||
$general_table->style[0] = 'width: 50%;';
|
||||
|
||||
$t->data[0][] = html_print_label_input_block(
|
||||
__('Gotty path'),
|
||||
$general_table->data[0][] = html_print_label_input_block(
|
||||
__('Address'),
|
||||
html_print_input_text(
|
||||
'gotty',
|
||||
$config['gotty'],
|
||||
'gotty_addr',
|
||||
$config['gotty_addr'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
|
@ -464,11 +401,11 @@ function quickShellSettings()
|
|||
)
|
||||
);
|
||||
|
||||
$t->data[0][] = html_print_label_input_block(
|
||||
__('Gotty host'),
|
||||
$general_table->data[0][] = html_print_label_input_block(
|
||||
__('Port'),
|
||||
html_print_input_text(
|
||||
'gotty_host',
|
||||
$config['gotty_host'],
|
||||
'gotty_port',
|
||||
$config['gotty_port'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
|
@ -476,79 +413,154 @@ function quickShellSettings()
|
|||
)
|
||||
);
|
||||
|
||||
$t->data[1][] = html_print_label_input_block(
|
||||
__('Gotty ssh port'),
|
||||
html_print_input_text(
|
||||
'gotty_ssh_port',
|
||||
$config['gotty_ssh_port'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
html_print_table($general_table);
|
||||
echo '</fieldset>';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
echo '<legend>'.__('GoTTY SSH connection parameters').'</legend>';
|
||||
|
||||
$ssh_table = new StdClass();
|
||||
$ssh_table->data = [];
|
||||
$ssh_table->width = '100%';
|
||||
$ssh_table->class = 'filter-table-adv';
|
||||
$ssh_table->data = [];
|
||||
$ssh_table->style = [];
|
||||
$ssh_table->style[0] = 'width: 50%;';
|
||||
|
||||
$ssh_table->data[0][] = html_print_label_input_block(
|
||||
__('Enable SSH method'),
|
||||
html_print_checkbox_switch(
|
||||
'gotty_ssh_enabled',
|
||||
1,
|
||||
$config['gotty_ssh_enabled'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$t->data[1][] = html_print_label_input_block(
|
||||
__('Gotty telnet port'),
|
||||
html_print_input_text(
|
||||
'gotty_telnet_port',
|
||||
$config['gotty_telnet_port'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
$ssh_table->data[1][] = html_print_label_input_block(
|
||||
__('Use SSL'),
|
||||
html_print_checkbox_switch(
|
||||
'gotty_ssh_use_ssl',
|
||||
1,
|
||||
$config['gotty_ssh_use_ssl'],
|
||||
true,
|
||||
$disable_agentaccess
|
||||
)
|
||||
);
|
||||
|
||||
$hidden = new stdClass();
|
||||
$hidden->data = [];
|
||||
$hidden->width = '100%';
|
||||
$hidden->class = 'filter-table-adv';
|
||||
$hidden->data = [];
|
||||
$hidden->style[0] = 'width: 50%;';
|
||||
// Test.
|
||||
$row = [];
|
||||
$test_start = '<span id="test-gotty-spinner-ssh" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$test_start .= ' <span id="test-gotty-message-ssh" class="invisible"></span>';
|
||||
|
||||
$hidden->data[0][] = html_print_label_input_block(
|
||||
__('Gotty user'),
|
||||
html_print_input_text(
|
||||
'gotty_user',
|
||||
$config['gotty_user'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$hidden->data[0][] = html_print_label_input_block(
|
||||
__('Gotty password'),
|
||||
html_print_input_password(
|
||||
'gotty_pass',
|
||||
io_output_password($config['gotty_pass']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
html_print_table($t);
|
||||
|
||||
ui_print_toggle(
|
||||
$ssh_table->data[3][] = html_print_button(
|
||||
__('Test'),
|
||||
'test-gotty-ssh',
|
||||
false,
|
||||
'handleTestSSH()',
|
||||
[
|
||||
'content' => html_print_table($hidden, true),
|
||||
'name' => __('Advanced options'),
|
||||
'clean' => false,
|
||||
'main_class' => 'no-border-imp',
|
||||
'container_class' => 'no-border-imp',
|
||||
]
|
||||
);
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary',
|
||||
'style' => 'width: 115px;',
|
||||
],
|
||||
true
|
||||
).$test_start;
|
||||
|
||||
html_print_table($ssh_table);
|
||||
|
||||
echo '</fieldset>';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
echo '<legend>'.__('GoTTY telnet connection parameters').'</legend>';
|
||||
|
||||
$telnet_table = new StdClass();
|
||||
$telnet_table->data = [];
|
||||
$telnet_table->width = '100%';
|
||||
$telnet_table->class = 'filter-table-adv';
|
||||
$telnet_table->data = [];
|
||||
$telnet_table->style = [];
|
||||
$telnet_table->style[0] = 'width: 50%;';
|
||||
|
||||
$telnet_table->data[0][] = html_print_label_input_block(
|
||||
__('Enable telnet method'),
|
||||
html_print_checkbox_switch(
|
||||
'gotty_telnet_enabled',
|
||||
1,
|
||||
$config['gotty_telnet_enabled'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$telnet_table->data[1][] = html_print_label_input_block(
|
||||
__('Use SSL'),
|
||||
html_print_checkbox_switch(
|
||||
'gotty_telnet_use_ssl',
|
||||
1,
|
||||
$config['gotty_telnet_use_ssl'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$test_start = '<span id="test-gotty-spinner-telnet" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$test_start .= ' <span id="test-gotty-message-telnet" class="invisible"></span>';
|
||||
|
||||
$telnet_table->data[3][] = html_print_button(
|
||||
__('Test'),
|
||||
'test-gotty-telnet',
|
||||
false,
|
||||
'handleTestTelnet()',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary',
|
||||
'style' => 'width: 115px;',
|
||||
],
|
||||
true
|
||||
).$test_start;
|
||||
|
||||
html_print_table($telnet_table);
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
|
||||
// This extension is usefull only if the agent has associated IP.
|
||||
if (is_ajax() === true) {
|
||||
$method = (string) get_parameter('method', '');
|
||||
|
||||
if (empty($method) === false) {
|
||||
$address = buildConnectionURL($method);
|
||||
|
||||
$ch = curl_init($address);
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Maximum time for the entire request.
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
|
||||
|
||||
// Maximum time to establish a connection.
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
|
||||
curl_exec($ch);
|
||||
$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
||||
if ($response_code === 200) {
|
||||
$result = ['status' => 'success'];
|
||||
} else {
|
||||
$result = ['status' => 'error'];
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = ['status' => 'error'];
|
||||
return;
|
||||
}
|
||||
|
||||
// This extension is useful only if the agent has associated IP.
|
||||
$agent_id = get_parameter('id_agente');
|
||||
if (empty($agent_id) === false
|
||||
&& get_parameter('sec2', '') == 'operation/agentes/ver_agente'
|
||||
|
@ -573,4 +585,136 @@ if (empty($agent_id) === false
|
|||
}
|
||||
}
|
||||
|
||||
echo '<script>';
|
||||
|
||||
echo 'var server_addr = "'.$_SERVER['SERVER_ADDR'].'";';
|
||||
echo "function checkAddressReachability(method, callback) {
|
||||
$.ajax({
|
||||
url: 'ajax.php',
|
||||
data: {
|
||||
page: 'extensions/quick_shell',
|
||||
method
|
||||
},
|
||||
type: 'GET',
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.status === 'success') {
|
||||
callback(true);
|
||||
} else {
|
||||
callback(false);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
callback(false);
|
||||
}
|
||||
});
|
||||
}";
|
||||
|
||||
$handle_test_telnet = "var handleTestTelnet = function (event) {
|
||||
var gotty_addr = $('input#text-gotty_addr').val();
|
||||
var gotty_port = $('input#text-gotty_port').val();
|
||||
var gotty_telnet_use_ssl = $('input#checkbox-gotty_telnet_use_ssl').is(':checked');
|
||||
|
||||
if (gotty_addr === '') {
|
||||
url = (gotty_telnet_use_ssl ? 'https://' : 'http://') + server_addr + ':' + gotty_port;
|
||||
} else {
|
||||
url = (gotty_telnet_use_ssl ? 'https://' : 'http://') + gotty_addr + ':' + gotty_port;
|
||||
}
|
||||
|
||||
var showLoadingImage = function () {
|
||||
$('#button-test-gotty-telnet').children('div').attr('class', 'subIcon cog rotation secondary mini');
|
||||
}
|
||||
|
||||
var showSuccessImage = function () {
|
||||
$('#button-test-gotty-telnet').children('div').attr('class', 'subIcon tick secondary mini');
|
||||
}
|
||||
|
||||
var showFailureImage = function () {
|
||||
$('#button-test-gotty-telnet').children('div').attr('class', 'subIcon fail secondary mini');
|
||||
}
|
||||
|
||||
var hideMessage = function () {
|
||||
$('span#test-gotty-message-telnet').hide();
|
||||
}
|
||||
var showMessage = function () {
|
||||
$('span#test-gotty-message-telnet').show();
|
||||
}
|
||||
var changeTestMessage = function (message) {
|
||||
$('span#test-gotty-message-telnet').text(message);
|
||||
}
|
||||
|
||||
var errorMessage = '".__('Unable to connect.')."';
|
||||
|
||||
hideMessage();
|
||||
showLoadingImage();
|
||||
|
||||
checkAddressReachability('telnet', function(isReachable) {
|
||||
if (isReachable) {
|
||||
showSuccessImage();
|
||||
hideMessage();
|
||||
} else {
|
||||
showFailureImage();
|
||||
changeTestMessage(errorMessage);
|
||||
showMessage();
|
||||
}
|
||||
});
|
||||
|
||||
};";
|
||||
|
||||
$handle_test_ssh = "var handleTestSSH = function (event) {
|
||||
var gotty_addr = $('input#text-gotty_addr').val();
|
||||
var gotty_port = $('input#text-gotty_port').val();
|
||||
var gotty_ssh_use_ssl = $('input#checkbox-gotty_ssh_use_ssl').is(':checked');
|
||||
|
||||
if (gotty_addr === '') {
|
||||
url = (gotty_ssh_use_ssl ? 'https://' : 'http://') + server_addr + ':' + gotty_port;
|
||||
} else {
|
||||
url = (gotty_ssh_use_ssl ? 'https://' : 'http://') + gotty_addr + ':' + gotty_port;
|
||||
}
|
||||
|
||||
var showLoadingImage = function () {
|
||||
$('#button-test-gotty-ssh').children('div').attr('class', 'subIcon cog rotation secondary mini');
|
||||
}
|
||||
|
||||
var showSuccessImage = function () {
|
||||
$('#button-test-gotty-ssh').children('div').attr('class', 'subIcon tick secondary mini');
|
||||
}
|
||||
|
||||
var showFailureImage = function () {
|
||||
$('#button-test-gotty-ssh').children('div').attr('class', 'subIcon fail secondary mini');
|
||||
}
|
||||
|
||||
var hideMessage = function () {
|
||||
$('span#test-gotty-message-ssh').hide();
|
||||
}
|
||||
var showMessage = function () {
|
||||
$('span#test-gotty-message-ssh').show();
|
||||
}
|
||||
var changeTestMessage = function (message) {
|
||||
$('span#test-gotty-message-ssh').text(message);
|
||||
}
|
||||
|
||||
var errorMessage = '".__('Unable to connect.')."';
|
||||
|
||||
|
||||
hideMessage();
|
||||
showLoadingImage();
|
||||
|
||||
checkAddressReachability('ssh', function(isReachable) {
|
||||
if (isReachable) {
|
||||
showSuccessImage();
|
||||
hideMessage();
|
||||
} else {
|
||||
showFailureImage();
|
||||
changeTestMessage(errorMessage);
|
||||
showMessage();
|
||||
}
|
||||
});
|
||||
};";
|
||||
|
||||
echo $handle_test_ssh;
|
||||
echo $handle_test_telnet;
|
||||
echo '</script>';
|
||||
|
||||
extensions_add_godmode_function('quickShellSettings');
|
||||
|
|
|
@ -1707,4 +1707,13 @@ enterprise/godmode/wizards/Applications.class.php
|
|||
enterprise/godmode/wizards/Cloud.class.php
|
||||
enterprise/images/wizard/applications.png
|
||||
enterprise/images/wizard/cloud.png
|
||||
enterprise/images/wizard/consoletasks.png
|
||||
enterprise/images/wizard/consoletasks.png
|
||||
pandora_websocket_engine
|
||||
operation/incidents/configure_integriaims_incident.php
|
||||
operation/incidents/dashboard_detail_integriaims_incident.php
|
||||
operation/incidents/incident_statistics.php
|
||||
operation/incidents/integriaims_export_csv.php
|
||||
operation/incidents/list_integriaims_incidents.php
|
||||
include/functions_incidents.php
|
||||
include/functions_integriaims.php
|
||||
include/ajax/integria_incidents.ajax.php
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
pandorafms.vmware=459175dce8ab811e874ce2e7216f0db4
|
||||
pandorafms.mysql=fadb4750d18285c0eca34f47c6aa3cfe
|
||||
pandorafms.mssql=1cc215409741d19080269ffba112810e
|
||||
pandorafms.oracle=2d9320a514d1e48a0b2804e1653c31c6
|
||||
pandorafms.db2=122f2abff0ec1d668c35ee0911483021
|
||||
pandorafms.sap.deset=9bb72b7f7497a8b543f25cd71f96878f
|
||||
pandorafms.gcp.ce=6743d39452f8e1ad85d0d56a30843973
|
||||
pandorafms.aws.ec2=07416081f11d92a7d5d9441dabb5c5cb
|
||||
pandorafms.aws.s3=eff053a212ea112e2a37efd9debbe6a0
|
||||
pandorafms.aws.rds=47d7b02019329e1698f96db4959f9516
|
||||
pandorafms.azure.mc=04a1072d1ece8583645ad88204fbeed3
|
|
@ -0,0 +1,600 @@
|
|||
-- Insert new RDS APP
|
||||
SET @current_app_type = 7;
|
||||
SET @short_name = 'pandorafms.aws.rds';
|
||||
SET @name = 'Amazon RDS';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor AWS RDS instances';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_aws_rds');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/aws_rds');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileRDS_'');
|
||||
|
||||
-- Insert new MySQL APP
|
||||
SET @short_name = 'pandorafms.mysql';
|
||||
SET @name = 'MySQL';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor MySQL databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app_mysql := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mysql');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES ('', @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Insert new Oracle APP
|
||||
SET @short_name = 'pandorafms.oracle';
|
||||
SET @name = 'Oracle';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor Oracle databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app_oracle := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_oracle');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES ('', @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Migrate current RDS tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleIP_', 'custom', '127.0.0.1', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentaclePort_', 'custom', '41121', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleExtraOpt_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_credentials_', 'credentials.aws', `auth_strings`, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `trecon_task`.`type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_useProxy_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_proxyUrl_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_sslCheck_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsInstance_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbtargets')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsZones_', 'custom', '[]', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsZonesInstance_', 'custom', '[]', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsInstanceSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsCpuPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsIopsPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsDiskPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_rdsNetworkPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileRDS_', 'custom', 'interval=__taskInterval__
agents_group_name=__taskGroup__
advance_monitoring=_rdsInstanceSummary_
cpu_summary=_rdsCpuPerfSummary_
iops_summary=_rdsIopsPerfSummary_
disk_summary=_rdsDiskPerfSummary_
network_summary=_rdsNetworkPerfSummary_
aws_instances=_rdsInstance_
aws_regions=_rdsZones_
creds_b64=_credentials_
temporal=__temp__
transfer_mode=tentacle
tentacle_ip=_tentacleIP_
tentacle_port=_tentaclePort_
tentacle_opts=_tentacleExtraOpt_
threads=_threads_
stats_agent=_statsAgent_
stats_agent_name=_statsAgentName_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgent_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgentName_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Migrate current RDS tasks to MySQL tasks
|
||||
INSERT IGNORE INTO `trecon_task`
|
||||
(
|
||||
`id_rt`,
|
||||
`name`,
|
||||
`description`,
|
||||
`id_group`,
|
||||
`utimestamp`,
|
||||
`status`,
|
||||
`interval_sweep`,
|
||||
`id_recon_server`,
|
||||
`disabled`,
|
||||
`summary`,
|
||||
`type`,
|
||||
`id_app`,
|
||||
`setup_complete`,
|
||||
`field1`
|
||||
)
|
||||
SELECT
|
||||
'',
|
||||
CONCAT('MySQL - ', `name`),
|
||||
CONCAT('Migrated from - ', `name`),
|
||||
`id_group`,
|
||||
`utimestamp`,
|
||||
`status`,
|
||||
`interval_sweep`,
|
||||
`id_recon_server`,
|
||||
`disabled`,
|
||||
`summary`,
|
||||
`type`,
|
||||
@id_app_mysql,
|
||||
0,
|
||||
`field1`
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbengine')) = 'mysql'
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbstrings_', 'custom', REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbtargets')),'","',','),'["',''),'"]',''),'[',''),']',''), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', '1', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_scanDatabases_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.scan_databases')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_agentPerDatabase_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.agent_per_database')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkUptime_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_uptime')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_queryStats_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.query_stats')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkInnodb_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_innodb')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkCache_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_cache')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
scan_databases = _scanDatabases_
agent_per_database = _agentPerDatabase_
db_agent_prefix = _prefixAgent_
innodb_stats = _checkInnodb_
engine_uptime = _checkUptime_
query_stats = _queryStats_
cache_stats = _checkCache_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
-- Migrate current RDS tasks to Oracle tasks
|
||||
INSERT IGNORE INTO `trecon_task`
|
||||
(
|
||||
`id_rt`,
|
||||
`name`,
|
||||
`description`,
|
||||
`id_group`,
|
||||
`utimestamp`,
|
||||
`status`,
|
||||
`interval_sweep`,
|
||||
`id_recon_server`,
|
||||
`disabled`,
|
||||
`summary`,
|
||||
`type`,
|
||||
`id_app`,
|
||||
`setup_complete`,
|
||||
`field1`
|
||||
)
|
||||
SELECT
|
||||
'',
|
||||
CONCAT('Oracle - ', `name`),
|
||||
CONCAT('Migrated from - ', `name`),
|
||||
`id_group`,
|
||||
`utimestamp`,
|
||||
`status`,
|
||||
`interval_sweep`,
|
||||
`id_recon_server`,
|
||||
`disabled`,
|
||||
`summary`,
|
||||
`type`,
|
||||
@id_app_oracle,
|
||||
0,
|
||||
`field1`
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbengine')) = 'oracle'
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbstrings_', 'custom', REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbtargets')),'","',','),'["',''),'"]',''),'[',''),']',''), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', '1', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkUptime_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_uptime')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_queryStats_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.query_stats')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkFragmentation_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_fragmentation')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkTablespaces_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_tablespaces')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkCache_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_cache')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
engine_uptime = _checkUptime_
query_stats = _queryStats_
cache_stats = _checkCache_
fragmentation_ratio = _checkFragmentation_
check_tablescpaces = _checkTablespaces_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
-- Migrate current RDS tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_mysql
|
||||
;
|
||||
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type AND `id_app` = @id_app_oracle
|
||||
;
|
||||
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type AND `id_app` IS NULL
|
||||
;
|
|
@ -0,0 +1,442 @@
|
|||
-- Insert new S3 APP
|
||||
SET @current_app_type = 14;
|
||||
SET @short_name = 'pandorafms.aws.s3';
|
||||
SET @name = 'Amazon S3';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor AWS S3 buckets';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_aws_s3');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/aws_s3');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileS3_'');
|
||||
|
||||
-- Migrate current S3 tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleIP_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_ip')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentaclePort_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_port')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleExtraOpt_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_opts')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_credentials_', 'credentials.aws', `auth_strings`, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `trecon_task`.`type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_useProxy_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_proxyUrl_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_sslCheck_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 3;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
'_s3Monitoring_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
'_s3Size_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
'_s3Items_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 4;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
'_s3Monitoring_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
'_s3Size_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
'_s3Items_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 5;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
'_s3Monitoring_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
'_s3Size_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
'_s3Items_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_monitoring',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_size',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 's3_items',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"s3_zone ",-1),"\n",1),"\n"),"")),"s3_bucket ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgent_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgentName_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_s3Monitoring_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_s3Size_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_s3Items_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 's3_bucket';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_s3Bucket_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 's3_zone';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_s3Zone_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileS3_', 'custom', 'interval=__taskInterval__
agents_group_name=__taskGroup__
aws_regions=_s3Zone_
aws_buckets=_s3Bucket_
s3_monitoring=_s3Monitoring_
size_monitoring=_s3Size_
items_monitoring=_s3Items_
creds_b64=_credentials_
temporal=__temp__
transfer_mode=tentacle
tentacle_ip=_tentacleIP_
tentacle_port=_tentaclePort_
tentacle_opts=_tentacleExtraOpt_
threads=_threads_
stats_agent=_statsAgent_
stats_agent_name=_statsAgentName_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Delete NULL macros
|
||||
DELETE FROM `tdiscovery_apps_tasks_macros` WHERE `macro` = '';
|
||||
|
||||
-- Migrate current S3 tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,716 @@
|
|||
-- Insert new Azure APP
|
||||
SET @current_app_type = 8;
|
||||
SET @short_name = 'pandorafms.azure.mc';
|
||||
SET @name = 'Azure Microsoft Compute';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor Azure Microsoft Compute VMs';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_azure_mc');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/azure_vm');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileAzureMC_'');
|
||||
|
||||
-- Migrate current Azure tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleIP_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_ip')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentaclePort_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_port')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleExtraOpt_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(`field2`, '$.tentacle_opts')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_credentials_', 'credentials.azure', `auth_strings`, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `trecon_task`.`type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 4;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_azureMCInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_azureMCCpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_azureMCIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_azureMCDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_azureMCNetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 5;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_azureMCInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_azureMCCpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_azureMCIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_azureMCDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_azureMCNetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 6;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_azureMCInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_azureMCCpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_azureMCIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_azureMCDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_azureMCNetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 7;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_azureMCInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_azureMCCpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_azureMCIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_azureMCDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_azureMCNetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 8;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_azureMCInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_azureMCCpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_azureMCIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_azureMCDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_azureMCNetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgent_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgentName_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_useProxy_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_proxyUrl_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_sslCheck_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCInstanceSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCCpuPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCIopsPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCDiskPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCNetworkPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 'ec2_instance';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_azureMCInstance_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 'ec2_zones';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_azureMCZones_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_azureMCZonesInstance_', 'custom', '[]', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileAzureMC_', 'custom', 'agents_group_name=__taskGroup__
threads=_threads_
interval=__taskInterval__
transfer_mode=tentacle
tentacle_ip=_tentacleIP_
tentacle_port=_tentaclePort_
tentacle_opts=_tentacleExtraOpt_
advance_monitoring=_azureMCInstanceSummary_
cpu_summary=_azureMCCpuPerfSummary_
iops_summary=_azureMCIopsPerfSummary_
disk_summary=_azureMCDiskPerfSummary_
network_summary=_azureMCNetworkPerfSummary_
azure_zones=_azureMCZones_
azure_instances=_azureMCInstance_
creds_b64=_credentials_
stats_agent=_statsAgent_
stats_agent_name=_statsAgentName_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Delete NULL macros
|
||||
DELETE FROM `tdiscovery_apps_tasks_macros` WHERE `macro` = '';
|
||||
|
||||
-- Migrate current Azure tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,161 @@
|
|||
-- Insert new DB2 APP
|
||||
SET @current_app_type = 11;
|
||||
SET @short_name = 'pandorafms.db2';
|
||||
SET @name = 'DB2';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor DB2 databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_db2');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Migrate current DB2 tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbstrings_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbstrings')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.engine_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkDbSummary_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_db_summary')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkTransactionalLogUtilization_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_transactional_log_utilization')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkDbSize_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_db_size')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkCache_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_cache')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
cache_stats = _checkCache_
database_summary = _checkDbSummary_
transactional_log = _checkTransactionalLogUtilization_
db_size = _checkDbSize_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Migrate current DB2 tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,716 @@
|
|||
-- Insert new Google APP
|
||||
SET @current_app_type = 13;
|
||||
SET @short_name = 'pandorafms.gcp.ce';
|
||||
SET @name = 'Google Cloud Compute Engine';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor Google Cloud Platform Compute Engine VMs';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_gcp_ce');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/google_instances');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileGoogleCE_'');
|
||||
|
||||
-- Migrate current Google tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleIP_', 'custom', '127.0.0.1', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentaclePort_', 'custom', '41121', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tentacleExtraOpt_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_credentials_', 'credentials.gcp', `auth_strings`, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `trecon_task`.`type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 4;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_googleCEInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_googleCECpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_googleCEIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_googleCEDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_googleCENetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 5;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_googleCEInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_googleCECpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_googleCEIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_googleCEDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_googleCENetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 6;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_googleCEInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_googleCECpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_googleCEIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_googleCEDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_googleCENetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 7;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_googleCEInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_googleCECpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_googleCEIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_googleCEDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_googleCENetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @position = 8;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
'_googleCEInstanceSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
'_googleCECpuPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
'_googleCEIopsPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
'_googleCEDiskPerfSummary_',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
'_googleCENetworkPerfSummary_',
|
||||
NULL
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
'custom',
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_instance_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_cpu_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_iops_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_disk_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
IF(
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", 1) = 'ec2_network_perf_summary',
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
CONCAT(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",1),REPLACE(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",1),REPLACE(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(CONVERT(FROM_BASE64(field1) USING UTF8MB4),"ec2_zones ",-1),"\n",1),"\n"),"")),"ec2_instance ",-1),"\n",1),"\n"),""))
|
||||
, "\n", @position), "\n", -1), " ", -1),
|
||||
"0"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgent_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_statsAgentName_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCEInstanceSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCECpuPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCEIopsPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCEDiskPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCENetworkPerfSummary_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 'ec2_instance';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_googleCEInstance_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
SET @param = 'ec2_zones';
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`,
|
||||
'_googleCEZones_',
|
||||
'custom',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONCAT(
|
||||
'["',
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
REPLACE(
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
),
|
||||
SUBSTRING_INDEX(SUBSTRING_INDEX(
|
||||
REPLACE(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
SUBSTRING_INDEX(
|
||||
CONVERT(FROM_BASE64(`field1`) USING UTF8MB4),
|
||||
CONCAT(@param, " "), 1
|
||||
),
|
||||
""
|
||||
),
|
||||
CONCAT(@param, " "), -1
|
||||
), "\n", 1),
|
||||
""
|
||||
),
|
||||
"\n"
|
||||
),
|
||||
CONCAT(@param, " "),
|
||||
""
|
||||
),
|
||||
"\n",
|
||||
'","'
|
||||
),
|
||||
'"]'
|
||||
),
|
||||
',""]',
|
||||
']'
|
||||
),
|
||||
'[""]',
|
||||
'[]'
|
||||
),
|
||||
0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_googleCEZonesInstance_', 'custom', '[]', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_useProxy_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_proxyUrl_', 'custom', '', 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_sslCheck_', 'custom', 0, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileGoogleCE_', 'custom', 'agents_group_name=__taskGroup__
interval=__taskInterval__
threads=_threads_
temporal=__temp__
transfer_mode=tentacle
tentacle_ip=_tentacleIP_
tentacle_port=_tentaclePort_
tentacle_opts=_tentacleExtraOpt_
advance_monitoring=_googleCEInstanceSummary_
cpu_summary=_googleCECpuPerfSummary_
iops_summary=_googleCEIopsPerfSummary_
disk_summary=_googleCEDiskPerfSummary_
network_summary=_googleCENetworkPerfSummary_
creds_b64=_credentials_
gcp_zones=_googleCEZones_
gcp_instances=_googleCEInstances_
stats_agent=_statsAgent_
stats_agent_name=_statsAgentName_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Delete NULL macros
|
||||
DELETE FROM `tdiscovery_apps_tasks_macros` WHERE `macro` = '';
|
||||
|
||||
-- Migrate current Google tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,145 @@
|
|||
-- Insert new MSSQL APP
|
||||
SET @current_app_type = 12;
|
||||
SET @short_name = 'pandorafms.mssql';
|
||||
SET @name = 'Microsoft SQL Server';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor Microsoft SQL Server databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mssql');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Migrate current MSSQL tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbstrings_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbstrings')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.engine_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkUptime_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_uptime')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_queryStats_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.query_stats')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
engine_uptime = _checkUptime_
query_stats = _queryStats_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Migrate current MSSQL tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,206 @@
|
|||
-- Insert new MySQL APP
|
||||
SET @current_app_type = 4;
|
||||
SET @short_name = 'pandorafms.mysql';
|
||||
SET @name = 'MySQL';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor MySQL databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_mysql');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Migrate current MySQL tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
WITH RECURSIVE `cte` AS (
|
||||
SELECT
|
||||
`id_rt`,
|
||||
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbport')), ' ', '') AS `port`,
|
||||
1 AS `pos`,
|
||||
SUBSTRING_INDEX(
|
||||
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), ' ', ''),
|
||||
',', 1
|
||||
) AS `host`,
|
||||
SUBSTRING(
|
||||
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), ' ', ''),
|
||||
LENGTH(SUBSTRING_INDEX(
|
||||
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), ' ', ''),
|
||||
',', 1
|
||||
)) + 2
|
||||
) AS `remaining`
|
||||
FROM `trecon_task` WHERE `type` = @current_app_type
|
||||
UNION ALL
|
||||
SELECT `id_rt`, `port`, `pos` + 1, SUBSTRING_INDEX(`remaining`, ',', 1) AS `host`, SUBSTRING(`remaining`, LENGTH(SUBSTRING_INDEX(`remaining`, ',', 1)) + 2)
|
||||
FROM `cte`
|
||||
WHERE `remaining` != ''
|
||||
)
|
||||
SELECT `id_rt`, '_dbstrings_', 'custom', GROUP_CONCAT(CONCAT(`host`, ':', `port`) SEPARATOR ','), 0
|
||||
FROM `cte`
|
||||
GROUP BY `id_rt`
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.engine_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_scanDatabases_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.scan_databases')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_agentPerDatabase_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.agent_per_database')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkUptime_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_uptime')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_queryStats_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.query_stats')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkInnodb_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_innodb')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkCache_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_cache')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
scan_databases = _scanDatabases_
agent_per_database = _agentPerDatabase_
db_agent_prefix = _prefixAgent_
innodb_stats = _checkInnodb_
engine_uptime = _checkUptime_
query_stats = _queryStats_
cache_stats = _checkCache_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Migrate current MySQL tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -0,0 +1,169 @@
|
|||
-- Insert new Oracle APP
|
||||
SET @current_app_type = 5;
|
||||
SET @short_name = 'pandorafms.oracle';
|
||||
SET @name = 'Oracle';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor Oracle databases';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_oracle');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --target_databases '_tempfileTargetDatabases_' --target_agents '_tempfileTargetAgents_' --custom_queries '_tempfileCustomQueries_'');
|
||||
|
||||
-- Migrate current Oracle tasks configurations
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbstrings_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbstrings')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbuser_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbuser')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_dbpass_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbpass')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_threads_', 'custom', 1, 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_engineAgent_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.engine_agent')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_prefixModuleName_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.prefix_module_name')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkUptime_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_uptime')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_queryStats_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.query_stats')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkConnections_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_connections')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkFragmentation_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_fragmentation')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkTablespaces_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_tablespaces')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_checkCache_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.check_cache')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_executeCustomQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.execute_custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_customQueries_', 'custom', JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.custom_queries')), 0
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileConf_', 'custom', 'agents_group_id = __taskGroupID__
interval = __taskInterval__
user = _dbuser_
password = _dbpass_
threads = _threads_
modules_prefix = _prefixModuleName_
execute_custom_queries = _executeCustomQueries_
analyze_connections = _checkConnections_
engine_uptime = _checkUptime_
query_stats = _queryStats_
cache_stats = _checkCache_
fragmentation_ratio = _checkFragmentation_
check_tablescpaces = _checkTablespaces_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetDatabases_', 'custom', '_dbstrings_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileTargetAgents_', 'custom', '_engineAgent_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros`
|
||||
(`id_task`, `macro`, `type`, `value`, `temp_conf`)
|
||||
SELECT
|
||||
`id_rt`, '_tempfileCustomQueries_', 'custom', '_customQueries_', 1
|
||||
FROM `trecon_task`
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
||||
|
||||
-- Migrate current Oracle tasks
|
||||
UPDATE `trecon_task`
|
||||
SET
|
||||
`id_app` = @id_app,
|
||||
`setup_complete` = 1,
|
||||
`type` = 15
|
||||
WHERE `type` = @current_app_type
|
||||
;
|
|
@ -14,6 +14,51 @@ CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
|
|||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tconfig_os_version` (
|
||||
`id_os_version` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`product` TEXT,
|
||||
`version` TEXT,
|
||||
`end_of_support` VARCHAR(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`id_os_version`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
ALTER TABLE `tusuario` MODIFY COLUMN `integria_user_level_pass` TEXT;
|
||||
|
||||
DROP TABLE `tincidencia`;
|
||||
DROP TABLE `tnota`;
|
||||
DROP TABLE `tattachment`;
|
||||
|
||||
ALTER TABLE `talert_commands` ADD CONSTRAINT UNIQUE (`name`);
|
||||
|
||||
ALTER TABLE `talert_actions` MODIFY COLUMN `name` VARCHAR(500);
|
||||
ALTER TABLE `talert_actions` ADD CONSTRAINT UNIQUE (`name`);
|
||||
|
||||
SET @command_name = 'Pandora ITSM Ticket';
|
||||
SET @command_description = 'Create a ticket in Pandora ITSM';
|
||||
SET @action_name = 'Create Pandora ITSM ticket';
|
||||
|
||||
UPDATE `talert_commands` SET `name` = @command_name, `description` = @command_description WHERE `name` = 'Integria IMS Ticket' AND `internal` = 1;
|
||||
INSERT IGNORE INTO `talert_commands` (`name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@command_name,'Internal type',@command_description,1,'["Ticket title","Ticket group ID","Ticket priority","Ticket owner","Ticket type","Ticket status","Ticket description","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]','["", "_ITSM_groups_", "_ITSM_priorities_","_ITSM_users_","_ITSM_types_","_ITSM_status_","_html_editor_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_","_custom_field_ITSM_"]');
|
||||
|
||||
SELECT @id_alert_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
|
||||
UPDATE `talert_actions` SET `name` = @action_name WHERE `name` = 'Create Integria IMS ticket' AND `id_alert_command` = @id_alert_command;
|
||||
INSERT IGNORE INTO `talert_actions` (`name`, `id_alert_command`) VALUES (@action_name,@id_alert_command);
|
||||
|
||||
SET @event_response_name = 'Create ticket in Pandora ITSM from event';
|
||||
SET @event_response_description = 'Create a ticket in Pandora ITSM from an event';
|
||||
SET @event_response_target = 'index.php?sec=manageTickets&sec2=operation/ITSM/itsm&operation=edit&from_event=_event_id_';
|
||||
SET @event_response_type = 'url';
|
||||
SET @event_response_id_group = 0;
|
||||
SET @event_response_modal_width = 0;
|
||||
SET @event_response_modal_height = 0;
|
||||
SET @event_response_new_window = 1;
|
||||
SET @event_response_params = '';
|
||||
SET @event_response_server_to_exec = 0;
|
||||
SET @event_response_command_timeout = 90;
|
||||
SET @event_response_display_command = 1;
|
||||
UPDATE `tevent_response` SET `name` = @event_response_name, `description` = @event_response_description, `target` = @event_response_target, `display_command` = @event_response_display_command WHERE `name` = 'Create ticket in IntegriaIMS from event';
|
||||
INSERT IGNORE INTO `tevent_response` (`name`, `description`, `target`,`type`,`id_group`,`modal_width`,`modal_height`,`new_window`,`params`,`server_to_exec`,`command_timeout`,`display_command`) VALUES (@event_response_name, @event_response_description, @event_response_target, @event_response_type, @event_response_id_group, @event_response_modal_width, @event_response_modal_height, @event_response_new_window, @event_response_params, @event_response_server_to_exec, @event_response_command_timeout, @event_response_display_command);
|
||||
|
||||
UPDATE `twelcome_tip`
|
||||
SET title = 'Scheduled downtimes',
|
||||
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
|
||||
|
@ -51,6 +96,10 @@ ADD COLUMN `time_init` VARCHAR(45) NULL AFTER `date_init`,
|
|||
ADD COLUMN `date_end` VARCHAR(45) NULL AFTER `time_init`,
|
||||
ADD COLUMN `time_end` VARCHAR(45) NULL AFTER `date_end`;
|
||||
|
||||
INSERT INTO `tconfig_os_version` (`id_os_version`, `product`, `version`, `end_of_support`) VALUES (1,'Windows.*','7.*','2020/01/14');
|
||||
INSERT INTO `tconfig_os_version` (`id_os_version`, `product`, `version`, `end_of_support`) VALUES (2,'Cisco.*','IOS 3.4.3','2017/05/12');
|
||||
INSERT INTO `tconfig_os_version` (`id_os_version`, `product`, `version`, `end_of_support`) VALUES (3,'Linux.*','Centos 7.*','2022/01/01');
|
||||
|
||||
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.vmware';
|
||||
|
||||
-- Insert new Proxmox APP
|
||||
|
@ -68,6 +117,102 @@ INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES
|
|||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' -g '__taskGroup__' --host '_host_' --port '_port_' --user '_user_' --password '_password_' --vm '_scanVM_' --lxc '_scanLXC_' --backups '_scanBackups_' --nodes '_scanNodes_' --transfer_mode tentacle --tentacle_address '_tentacleIP_' --tentacle_port '_tentaclePort_' --as_discovery_plugin 1');
|
||||
|
||||
-- Insert new SAP APP
|
||||
SET @short_name = 'pandorafms.sap.deset';
|
||||
SET @name = 'SAP R3 - Deset';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor SAP R3 environments';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_sap_deset');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_java_', 'bin/lib/jre/bin/java');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileConf_' --custom_modules '_tempfileCustomModules_'');
|
||||
|
||||
-- Insert new EC2 APP
|
||||
SET @short_name = 'pandorafms.aws.ec2';
|
||||
SET @name = 'Amazon EC2';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor AWS EC2 instances';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_aws_ec2');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/aws_ec2');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileEC2_'');
|
||||
|
||||
-- Insert new RDS APP
|
||||
SET @short_name = 'pandorafms.aws.rds';
|
||||
SET @name = 'Amazon RDS';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor AWS RDS instances';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_aws_rds');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/aws_rds');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileRDS_'');
|
||||
|
||||
-- Insert new S3 APP
|
||||
SET @short_name = 'pandorafms.aws.s3';
|
||||
SET @name = 'Amazon S3';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor AWS S3 buckets';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_aws_s3');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/aws_s3');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileS3_'');
|
||||
|
||||
-- Insert new Azure APP
|
||||
SET @short_name = 'pandorafms.azure.mc';
|
||||
SET @name = 'Azure Microsoft Compute';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor Azure Microsoft Compute VMs';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_azure_mc');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/azure_vm');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileAzureMC_'');
|
||||
|
||||
-- Insert new Google APP
|
||||
SET @short_name = 'pandorafms.gcp.ce';
|
||||
SET @name = 'Google Cloud Compute Engine';
|
||||
SET @section = 'cloud';
|
||||
SET @description = 'Monitor Google Cloud Platform Compute Engine VMs';
|
||||
SET @version = '1.0';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
-- Insert into tdiscovery_apps_scripts
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_gcp_ce');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec2_', 'bin/google_instances');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileGoogleCE_'');
|
||||
|
||||
ALTER TABLE `treport_content` ADD COLUMN `cat_security_hardening` INT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;
|
||||
|
|
|
@ -1,31 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* ITSM.
|
||||
*
|
||||
* @category ITSM view
|
||||
* @package Pandora FMS
|
||||
* @subpackage Opensource
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
|
||||
// Pandora FMS - https://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2023 Pandora FMS
|
||||
// Please see https://pandorafms.com/community/ for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars
|
||||
global $config;
|
||||
|
||||
require_once 'include/functions_incidents.php';
|
||||
|
||||
check_login();
|
||||
|
||||
if (!$config['integria_enabled']) {
|
||||
ui_print_error_message(__('In order to access ticket management system, integration with Integria IMS must be enabled and properly configured'));
|
||||
if (!$config['ITSM_enabled']) {
|
||||
ui_print_error_message(__('In order to access ticket management system, integration with ITSM must be enabled and properly configured'));
|
||||
return;
|
||||
}
|
||||
|
||||
$group = $id_grupo;
|
||||
|
||||
if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) {
|
||||
if (! check_acl($config['id_user'], $id_grupo, 'AW', $id_agente)) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access agent manager'
|
||||
|
@ -34,104 +46,11 @@ if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) {
|
|||
return;
|
||||
}
|
||||
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
|
||||
|
||||
// See if id_agente is set (either POST or GET, otherwise -1
|
||||
$id_agent = (int) get_parameter('id_agente');
|
||||
$groups = users_get_groups($config['id_user'], 'AR');
|
||||
$filter = ' AND id_agent = '.$id_agent;
|
||||
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent;
|
||||
|
||||
$params = [
|
||||
'',
|
||||
'-10',
|
||||
'1',
|
||||
'-1',
|
||||
'0',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
agents_get_name($id_agent),
|
||||
];
|
||||
|
||||
$result = integria_api_call(null, null, null, null, 'get_incidents', $params, false, 'json', ',');
|
||||
|
||||
$result = json_decode($result, true);
|
||||
|
||||
if (empty($result) === true) {
|
||||
$result = [];
|
||||
$count = 0;
|
||||
echo '<div class="nf">'.__('No incidents associated to this agent').'</div><br />';
|
||||
return;
|
||||
} else {
|
||||
$count = count($result);
|
||||
$result = array_slice($result, $offset, $config['block_size']);
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
echo $ITSM->getTableIncidencesForAgent($id_agente);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
// Show pagination.
|
||||
ui_pagination($count, $url, $offset, 0, false, 'offset');
|
||||
// ($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
|
||||
echo '<br />';
|
||||
|
||||
// Show headers.
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
$table->cellpadding = 4;
|
||||
$table->cellspacing = 4;
|
||||
$table->head = [];
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
$table->align = [];
|
||||
|
||||
$table->head[0] = __('ID');
|
||||
$table->head[1] = __('Status');
|
||||
$table->head[2] = __('Incident');
|
||||
$table->head[3] = __('Priority');
|
||||
$table->head[4] = __('Group');
|
||||
$table->head[5] = __('Updated');
|
||||
|
||||
$table->size[0] = 43;
|
||||
$table->size[7] = 50;
|
||||
|
||||
$table->align[1] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
$table->align[4] = 'center';
|
||||
|
||||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
foreach ($result as $row) {
|
||||
if ($rowPair) {
|
||||
$table->rowclass[$iterator] = 'rowPair';
|
||||
} else {
|
||||
$table->rowclass[$iterator] = 'rowOdd';
|
||||
}
|
||||
|
||||
$rowPair = !$rowPair;
|
||||
$iterator++;
|
||||
|
||||
$data = [];
|
||||
|
||||
$data[0] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.$row['id_incidencia'].'</a>';
|
||||
$attach = incidents_get_attach($row['id_incidencia']);
|
||||
|
||||
if (!empty($attach)) {
|
||||
$data[0] .= ' '.html_print_image('images/attachment.png', true, ['style' => 'align:middle;']);
|
||||
}
|
||||
|
||||
$data[1] = incidents_print_status_img($row['estado'], true);
|
||||
$data[2] = '<a href="index.php?sec=incident&sec2=operation/incidents/dashboard_detail_integriaims_incident&incident_id='.$row['id_incidencia'].'">'.substr(io_safe_output($row['titulo']), 0, 45).'</a>';
|
||||
$data[3] = incidents_print_priority_img($row['prioridad'], true);
|
||||
$data[4] = $row['id_grupo'];
|
||||
$data[5] = ui_print_timestamp($row['actualizacion'], true);
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo '</div>';
|
||||
unset($table);
|
||||
echo '<br><br>';
|
||||
|
||||
echo '<div id="both"> </div>';
|
||||
html_print_action_buttons('');
|
||||
|
|
|
@ -548,6 +548,21 @@ $tableAgent->data['os'][0] .= html_print_div(
|
|||
true
|
||||
);
|
||||
|
||||
$tableAgent->data['caption_os_version'][0] = __('OS version');
|
||||
$tableAgent->rowclass['os_version'] = 'w540px';
|
||||
$tableAgent->data['os_version'][0] = html_print_input_text(
|
||||
'os_version',
|
||||
$os_version,
|
||||
'',
|
||||
16,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w540px'
|
||||
);
|
||||
|
||||
$tableAgent->data['caption_server'][0] = __('Server');
|
||||
$tableAgent->rowclass['server'] = 'w540px';
|
||||
$tableAgent->data['server'][0] = html_print_select(
|
||||
|
|
|
@ -39,6 +39,7 @@ ui_require_javascript_file('encode_decode_base64');
|
|||
ui_require_css_file('agent_manager');
|
||||
|
||||
use PandoraFMS\Event;
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
|
||||
check_login();
|
||||
|
||||
|
@ -215,6 +216,7 @@ if ($create_agent) {
|
|||
$id_parent = (int) get_parameter_post('id_agent_parent');
|
||||
$server_name = (string) get_parameter_post('server_name');
|
||||
$id_os = (int) get_parameter_post('id_os');
|
||||
$os_version = (string) get_parameter_post('os_version');
|
||||
$disabled = (int) get_parameter_post('disabled');
|
||||
$custom_id_safe_output = strip_tags(io_safe_output(get_parameter('custom_id', '')));
|
||||
$custom_id = io_safe_input(trim(preg_replace('/[\/\\\|%#&$]/', '', $custom_id_safe_output)));
|
||||
|
@ -283,6 +285,7 @@ if ($create_agent) {
|
|||
'comentarios' => $comentarios,
|
||||
'modo' => $modo,
|
||||
'id_os' => $id_os,
|
||||
'os_version' => $os_version,
|
||||
'disabled' => $disabled,
|
||||
'cascade_protection' => $cascade_protection,
|
||||
'cascade_protection_module' => $cascade_protection_module,
|
||||
|
@ -607,23 +610,6 @@ if ($id_agente) {
|
|||
$agent_wizard['active'] = false;
|
||||
}
|
||||
|
||||
|
||||
$total_incidents = agents_get_count_incidents($id_agente);
|
||||
|
||||
// Incident tab.
|
||||
if ($total_incidents > 0) {
|
||||
$incidenttab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agente,
|
||||
'image' => 'images/logs@svg.svg',
|
||||
'title' => __('Incidents'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$incidenttab['active'] = ($tab === 'incident');
|
||||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
|
||||
if ($has_remote_conf !== false) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
|
@ -998,6 +984,7 @@ if ($update_agent) {
|
|||
$modo = (int) get_parameter_post('modo', 0);
|
||||
// Mode: Learning, Normal or Autodisabled.
|
||||
$id_os = (int) get_parameter_post('id_os');
|
||||
$os_version = (string) get_parameter_post('os_version');
|
||||
$disabled = (bool) get_parameter_post('disabled');
|
||||
$server_name = (string) get_parameter_post('server_name', '');
|
||||
$id_parent = (int) get_parameter_post('id_agent_parent');
|
||||
|
@ -1123,6 +1110,7 @@ if ($update_agent) {
|
|||
'disabled' => $disabled,
|
||||
'id_parent' => $id_parent,
|
||||
'id_os' => $id_os,
|
||||
'os_version' => $os_version,
|
||||
'modo' => $modo,
|
||||
'alias' => $alias,
|
||||
'alias_as_name' => $alias_as_name,
|
||||
|
@ -1284,6 +1272,7 @@ if ($id_agente) {
|
|||
$server_name = $agent['server_name'];
|
||||
$modo = $agent['modo'];
|
||||
$id_os = $agent['id_os'];
|
||||
$os_version = $agent['os_version'];
|
||||
$disabled = $agent['disabled'];
|
||||
$id_parent = $agent['id_parent'];
|
||||
$custom_id = $agent['custom_id'];
|
||||
|
@ -2092,7 +2081,6 @@ if ($create_module) {
|
|||
|
||||
if ($disable_module) {
|
||||
|
||||
hd($disable_module, true);
|
||||
$result = modules_change_disabled($disable_module, 1);
|
||||
$module_name = modules_get_agentmodule_name($disable_module);
|
||||
|
||||
|
@ -2116,13 +2104,11 @@ if ($create_module) {
|
|||
|
||||
|
||||
if ($result === NOERR) {
|
||||
hd($disable_module, true);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||
);
|
||||
} else {
|
||||
hd($disable_module, true);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_MODULE_MANAGEMENT,
|
||||
'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias'])
|
||||
|
|
|
@ -751,6 +751,10 @@ if ($agents !== false) {
|
|||
'index.php?sec=reporting&sec2=operation/cluster/cluster&op=view&id=%s',
|
||||
$cluster->id()
|
||||
);
|
||||
$agentAlertUrl = sprintf(
|
||||
'index.php?sec=estado&sec2=operation/cluster/cluster&op=update&id=%s&page=6',
|
||||
$cluster->id()
|
||||
);
|
||||
} else {
|
||||
$main_tab = ($check_aw === true) ? 'main' : 'module';
|
||||
$agentNameUrl = sprintf(
|
||||
|
@ -762,6 +766,10 @@ if ($agents !== false) {
|
|||
'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=%s',
|
||||
$agent['id_agente']
|
||||
);
|
||||
$agentAlertUrl = sprintf(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=%s',
|
||||
$agent['id_agente']
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($agent['alias']) === true) {
|
||||
|
@ -825,7 +833,7 @@ if ($agents !== false) {
|
|||
);
|
||||
}
|
||||
|
||||
if ((int) $agent['id_os'] !== 100) {
|
||||
if ((int) $agent['id_os'] != CLUSTER_OS_ID) {
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$agent['id_agente']),
|
||||
|
@ -837,7 +845,7 @@ if ($agents !== false) {
|
|||
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$agent['id_agente']),
|
||||
'href' => ui_get_full_url($agentAlertUrl),
|
||||
'content' => __('Alerts'),
|
||||
],
|
||||
true
|
||||
|
@ -942,7 +950,7 @@ if ($agents !== false) {
|
|||
$os
|
||||
)
|
||||
),
|
||||
'onClick' => ($agent['id_os'] === CLUSTER_OS_ID) ? sprintf('if (!confirm(\'%s\')) return false', $agentDisableEnableCaption) : 'return true;',
|
||||
'onClick' => ($agent['id_os'] == CLUSTER_OS_ID) ? sprintf('if (!confirm(\'%s\')) return false', $agentDisableEnableCaption) : 'return true;',
|
||||
'image' => sprintf('images/%s', $agentDisableEnableIcon),
|
||||
'title' => $agentDisableEnableTitle,
|
||||
],
|
||||
|
@ -950,7 +958,7 @@ if ($agents !== false) {
|
|||
);
|
||||
|
||||
if ($check_aw === true && is_management_allowed() === true) {
|
||||
if ($agent['id_os'] !== CLUSTER_OS_ID) {
|
||||
if ($agent['id_os'] != CLUSTER_OS_ID) {
|
||||
$onClickActionDeleteAgent = 'if (!confirm(\' '.__('Are you sure?').'\')) return false;';
|
||||
} else {
|
||||
$onClickActionDeleteAgent = 'if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;';
|
||||
|
|
|
@ -405,6 +405,12 @@ $actions = array_slice($actions, $offset, $limit);
|
|||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
foreach ($actions as $action) {
|
||||
if ((isset($config['ITSM_enabled']) === false || (bool) $config['ITSM_enabled'] === false)
|
||||
&& $action['name'] === 'Create Pandora ITSM ticket'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($rowPair) {
|
||||
$table->rowclass[$iterator] = 'rowPair';
|
||||
} else {
|
||||
|
|
|
@ -1,16 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Alerts commands.
|
||||
*
|
||||
* @category Alerts
|
||||
* @package Pandora FMS
|
||||
* @subpackage Opensource
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
|
||||
// Pandora FMS - https://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2023 Pandora FMS
|
||||
// Please see https://pandorafms.com/community/ for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation for version 2.
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
|
@ -51,9 +68,9 @@ if (is_ajax()) {
|
|||
$get_recovery_fields = (int) get_parameter('get_recovery_fields', 1);
|
||||
|
||||
// Snmp alerts are not in the metaconsole so they cannot be centralized.
|
||||
$is_management_allowed = false;
|
||||
$management_is_not_allowed = false;
|
||||
if ($get_recovery_fields !== 0) {
|
||||
$is_management_allowed = !is_management_allowed();
|
||||
$management_is_not_allowed = !is_management_allowed();
|
||||
}
|
||||
|
||||
// If command ID is not provided, check for action id.
|
||||
|
@ -135,6 +152,17 @@ if (is_ajax()) {
|
|||
|
||||
$style = ((int) $field_hidden === 1) ? '-webkit-text-security: disc; font-family: text-security-disc;' : '';
|
||||
|
||||
$recovery_disabled = 0;
|
||||
if (empty($command) === false && $command['name'] === io_safe_input('Pandora ITSM Ticket')) {
|
||||
if ($management_is_not_allowed == 0) {
|
||||
if (preg_match('/^_html_editor_$/i', $field_value) || $field_description === 'Ticket status') {
|
||||
$recovery_disabled = 0;
|
||||
} else {
|
||||
$recovery_disabled = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($field_value)) {
|
||||
$field_value = io_safe_output($field_value);
|
||||
// HTML type.
|
||||
|
@ -150,7 +178,7 @@ if (is_ajax()) {
|
|||
0,
|
||||
'',
|
||||
false,
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
"UndefineTinyMCE('#textarea_field".$i."_value')",
|
||||
'',
|
||||
true
|
||||
|
@ -162,7 +190,7 @@ if (is_ajax()) {
|
|||
0,
|
||||
'',
|
||||
true,
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
"defineTinyMCE('#textarea_field".$i."_value')",
|
||||
'',
|
||||
true
|
||||
|
@ -177,7 +205,7 @@ if (is_ajax()) {
|
|||
'class="fields w100p"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed
|
||||
);
|
||||
|
||||
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
||||
|
@ -187,7 +215,7 @@ if (is_ajax()) {
|
|||
0,
|
||||
'',
|
||||
false,
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
"UndefineTinyMCE('#textarea_field".$i."_recovery_value')",
|
||||
'',
|
||||
true
|
||||
|
@ -199,7 +227,7 @@ if (is_ajax()) {
|
|||
0,
|
||||
'',
|
||||
true,
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
"defineTinyMCE('#textarea_field".$i."_recovery_value')",
|
||||
'',
|
||||
true
|
||||
|
@ -214,7 +242,7 @@ if (is_ajax()) {
|
|||
'class="fields_recovery"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
} else if (preg_match('/^_content_type_$/i', $field_value)) {
|
||||
$editor_type_chkbx = '<div id="command_div"><b><small>';
|
||||
|
@ -228,7 +256,7 @@ if (is_ajax()) {
|
|||
'text/plain',
|
||||
'',
|
||||
'',
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
|
@ -240,7 +268,7 @@ if (is_ajax()) {
|
|||
'text/html',
|
||||
'',
|
||||
'text/html',
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
|
@ -259,7 +287,7 @@ if (is_ajax()) {
|
|||
'text/plain',
|
||||
'',
|
||||
'',
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
|
@ -271,7 +299,7 @@ if (is_ajax()) {
|
|||
'text/html',
|
||||
'',
|
||||
'text/html',
|
||||
$is_management_allowed,
|
||||
$management_is_not_allowed,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
|
@ -279,78 +307,304 @@ if (is_ajax()) {
|
|||
$editor_type_chkbx .= '</small></b></div>';
|
||||
$rfield = $editor_type_chkbx;
|
||||
// Select type.
|
||||
} else if (preg_match('/^_integria_type_custom_field_$/i', $field_value)) {
|
||||
$ffield = '';
|
||||
$rfield = '';
|
||||
} else if (preg_match('/^_custom_field_ITSM_$/i', $field_value)) {
|
||||
$ffield = '';
|
||||
$rfield = '';
|
||||
|
||||
$ffield .= '<div name="field'.$i.'_value_container">'.html_print_switch(
|
||||
[
|
||||
'name' => 'field'.$i.'_value[]',
|
||||
'value' => '',
|
||||
]
|
||||
).'</div>';
|
||||
$rfield .= '<div name="field'.$i.'_recovery_value_container">'.html_print_switch(
|
||||
[
|
||||
'name' => 'field'.$i.'_recovery_value[]',
|
||||
'value' => '',
|
||||
]
|
||||
).'</div>';
|
||||
$ffield .= '<div name="field'.$i.'_value_container">'.html_print_switch(
|
||||
[
|
||||
'name' => 'field'.$i.'_value[]',
|
||||
'value' => '',
|
||||
]
|
||||
).'</div>';
|
||||
$rfield .= '<div name="field'.$i.'_recovery_value_container">'.html_print_switch(
|
||||
[
|
||||
'name' => 'field'.$i.'_recovery_value[]',
|
||||
'value' => '',
|
||||
'disabled' => $management_is_not_allowed || $recovery_disabled,
|
||||
]
|
||||
).'</div>';
|
||||
|
||||
$ffield .= html_print_select(
|
||||
'',
|
||||
'field'.$i.'_value[]',
|
||||
$ffield .= html_print_select(
|
||||
'',
|
||||
'field'.$i.'_value[]',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'fields',
|
||||
$management_is_not_allowed,
|
||||
'width: 100%;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$rfield .= html_print_select(
|
||||
'',
|
||||
'field'.$i.'_recovery_value[]',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'fields',
|
||||
$management_is_not_allowed || $recovery_disabled,
|
||||
'width: 100%;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$ffield .= html_print_input_text(
|
||||
'field'.$i.'_value[]',
|
||||
'',
|
||||
'',
|
||||
50,
|
||||
50,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'datepicker',
|
||||
'',
|
||||
'off',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
$management_is_not_allowed
|
||||
);
|
||||
$rfield .= html_print_input_text(
|
||||
'field'.$i.'_recovery_value[]',
|
||||
'',
|
||||
'',
|
||||
50,
|
||||
50,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'datepicker',
|
||||
'',
|
||||
'off',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
|
||||
$ffield .= html_print_textarea(
|
||||
'field'.$i.'_value[]',
|
||||
5,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true,
|
||||
'',
|
||||
$management_is_not_allowed
|
||||
);
|
||||
|
||||
$rfield .= html_print_textarea(
|
||||
'field'.$i.'_recovery_value[]',
|
||||
5,
|
||||
1,
|
||||
'',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery',
|
||||
true,
|
||||
'',
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
|
||||
$values_input_number = [
|
||||
'name' => 'field'.$i.'_value[]',
|
||||
'value' => 0,
|
||||
'id' => 'field'.$i.'_value',
|
||||
'return' => true,
|
||||
];
|
||||
|
||||
if ($management_is_not_allowed === true) {
|
||||
$values_input_number['disabled'] = true;
|
||||
}
|
||||
|
||||
$ffield .= html_print_input_number($values_input_number);
|
||||
|
||||
$values_input_number_recovery = [
|
||||
'name' => 'field'.$i.'_recovery_value[]',
|
||||
'value' => 0,
|
||||
'id' => 'field'.$i.'_recovery_value',
|
||||
'return' => true,
|
||||
];
|
||||
|
||||
if ($management_is_not_allowed || $recovery_disabled) {
|
||||
$values_input_number_recovery['disabled'] = true;
|
||||
}
|
||||
|
||||
$rfield .= html_print_input_number($values_input_number_recovery);
|
||||
|
||||
$ffield .= html_print_input_text(
|
||||
'field'.$i.'_value[]',
|
||||
'',
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'normal w98p',
|
||||
'',
|
||||
'off',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
$management_is_not_allowed
|
||||
);
|
||||
$rfield .= html_print_input_text(
|
||||
'field'.$i.'_recovery_value[]',
|
||||
'',
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'normal w98p',
|
||||
'',
|
||||
'off',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
} else if (str_starts_with($field_value, '_ITSM_')) {
|
||||
$nothing = '';
|
||||
$nothing_value = 0;
|
||||
$mode = 'select';
|
||||
switch ($field_value) {
|
||||
case '_ITSM_groups_':
|
||||
$fields_array = [];
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$fields_array = $ITSM->getGroups();
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
$fields_array = [];
|
||||
}
|
||||
break;
|
||||
|
||||
case '_ITSM_priorities_':
|
||||
$fields_array = [];
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$fields_array = $ITSM->getPriorities();
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
$fields_array = [];
|
||||
}
|
||||
break;
|
||||
|
||||
case '_ITSM_types_':
|
||||
$fields_array = [];
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$fields_array = $ITSM->getObjectypes();
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
$fields_array = [];
|
||||
}
|
||||
|
||||
$nothing = __('None');
|
||||
$nothing_value = 0;
|
||||
break;
|
||||
|
||||
case '_ITSM_status_':
|
||||
$fields_array = [];
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$fields_array = $ITSM->getStatus();
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
$fields_array = [];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing.
|
||||
$mode = '';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($mode === 'select') {
|
||||
$ffield = html_print_select(
|
||||
$fields_array,
|
||||
'field'.$i.'_value',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
$nothing,
|
||||
$nothing_value,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'fields',
|
||||
$is_management_allowed,
|
||||
'width: 100%;'
|
||||
$management_is_not_allowed
|
||||
);
|
||||
|
||||
$rfield .= html_print_select(
|
||||
'',
|
||||
'field'.$i.'_recovery_value[]',
|
||||
$rfield = html_print_select(
|
||||
$fields_array,
|
||||
'field'.$i.'_recovery_value',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
$nothing,
|
||||
$nothing_value,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'fields',
|
||||
$is_management_allowed,
|
||||
'width: 100%;'
|
||||
'fields_recovery',
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
|
||||
$ffield .= html_print_input_text('field'.$i.'_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
|
||||
$rfield .= html_print_input_text('field'.$i.'_recovery_value[]', '', '', 10, 10, true, false, false, '', 'datepicker');
|
||||
|
||||
$ffield .= html_print_textarea(
|
||||
'field'.$i.'_value[]',
|
||||
5,
|
||||
1,
|
||||
} else {
|
||||
$ffield = html_print_autocomplete_users_from_pandora_itsm(
|
||||
'field'.$i.'_value',
|
||||
'',
|
||||
'style="min-height:40px; '.$style.'" class="fields"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
0,
|
||||
$management_is_not_allowed,
|
||||
false,
|
||||
'ITSM_users'
|
||||
);
|
||||
|
||||
|
||||
$rfield .= html_print_textarea(
|
||||
'field'.$i.'_recovery_value[]',
|
||||
5,
|
||||
1,
|
||||
$rfield = html_print_autocomplete_users_from_pandora_itsm(
|
||||
'field'.$i.'_recovery_value',
|
||||
'',
|
||||
'style="min-height:40px; '.$style.'" class="fields_recovery',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
0,
|
||||
$management_is_not_allowed || $recovery_disabled,
|
||||
false,
|
||||
'ITSM_users'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$fields_value_select = [];
|
||||
$force_print_select = false;
|
||||
|
@ -468,7 +722,7 @@ if (is_ajax()) {
|
|||
false,
|
||||
false,
|
||||
'fields',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed
|
||||
);
|
||||
$rfield = html_print_select(
|
||||
$fields_value_select,
|
||||
|
@ -481,7 +735,7 @@ if (is_ajax()) {
|
|||
false,
|
||||
false,
|
||||
'fields_recovery',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
} else {
|
||||
$ffield = html_print_textarea(
|
||||
|
@ -492,7 +746,7 @@ if (is_ajax()) {
|
|||
'style="'.$style.'" class="fields min-height-40px w100p"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
'field'.$i.'_recovery_value',
|
||||
|
@ -502,7 +756,7 @@ if (is_ajax()) {
|
|||
'style="'.$style.'" class="fields_recovery min-height-40px w100p',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -515,7 +769,7 @@ if (is_ajax()) {
|
|||
'style="'.$style.'" class="fields min-height-40px w100p"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed
|
||||
);
|
||||
$rfield = html_print_textarea(
|
||||
'field'.$i.'_recovery_value',
|
||||
|
@ -525,7 +779,7 @@ if (is_ajax()) {
|
|||
'style="'.$style.'" class="fields_recovery min-height-40px w100p"',
|
||||
true,
|
||||
'',
|
||||
$is_management_allowed
|
||||
$management_is_not_allowed || $recovery_disabled
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -684,9 +938,7 @@ if ($delete_command) {
|
|||
|
||||
$result = alerts_delete_alert_command($id);
|
||||
|
||||
$auditMessage = ((bool) $result === true)
|
||||
? sprintf('Delete alert command #%s', $id)
|
||||
: sprintf('Fail try to delete alert command #%s', $id);
|
||||
$auditMessage = ((bool) $result === true) ? sprintf('Delete alert command #%s', $id) : sprintf('Fail try to delete alert command #%s', $id);
|
||||
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ALERT_MANAGEMENT,
|
||||
|
@ -775,6 +1027,12 @@ $commands = array_slice($commands, $offset, $limit);
|
|||
foreach ($commands as $command) {
|
||||
$data = [];
|
||||
|
||||
if ((isset($config['ITSM_enabled']) === false || (bool) $config['ITSM_enabled'] === false)
|
||||
&& $command['name'] === 'Pandora ITSM Ticket'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data['name'] = '<span>';
|
||||
|
||||
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
||||
|
|
|
@ -105,8 +105,8 @@ $groups_user = users_get_groups($config['id_user']);
|
|||
if (!empty($groups_user)) {
|
||||
$groups = implode(',', array_keys($groups_user));
|
||||
|
||||
if ($config['integria_enabled'] == 0) {
|
||||
$integria_command = 'Integria IMS Ticket';
|
||||
if ($config['ITSM_enabled'] == 0) {
|
||||
$integria_command = 'Pandora ITSM Ticket';
|
||||
$sql = sprintf('SELECT taa.id, taa.name FROM talert_actions taa INNER JOIN talert_commands tac ON taa.id_alert_command = tac.id WHERE tac.name <> "%s" AND taa.id_group IN (%s)', $integria_command, $groups);
|
||||
} else {
|
||||
$sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)";
|
||||
|
@ -206,9 +206,10 @@ $table->data[2][0] = html_print_label_input_block(
|
|||
|
||||
if (isset($step) === false) {
|
||||
echo '<form id="form_alerts" class="add_alert_form max_floating_element_size" method="post">';
|
||||
html_print_table($table);
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
if (isset($step) === false) {
|
||||
$output = '';
|
||||
|
||||
|
|
|
@ -620,7 +620,21 @@ foreach ($simple_alerts as $alert) {
|
|||
$main_tab = 'module';
|
||||
}
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab='.$main_tab.'&id_agente='.$id_agent.'">';
|
||||
if ((int) agents_get_os($id_agent) === CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId($id_agent);
|
||||
$agentAlertUrl = sprintf(
|
||||
'index.php?sec=estado&sec2=operation/cluster/cluster&op=update&id=%s&page=6',
|
||||
$cluster->id()
|
||||
);
|
||||
} else {
|
||||
$agentAlertUrl = sprintf(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=%s&id_agente=%s',
|
||||
$main_tab,
|
||||
$id_agent
|
||||
);
|
||||
}
|
||||
|
||||
$data[0] = '<a href="'.$agentAlertUrl.'">';
|
||||
|
||||
if ($alert['disabled']) {
|
||||
$data[0] .= '<span class="italic_a">';
|
||||
|
|
|
@ -650,6 +650,11 @@ if ($id_agente) {
|
|||
echo $messageAction;
|
||||
|
||||
include_once 'godmode/alerts/alert_list.list.php';
|
||||
|
||||
if (isset($step) === true && $step === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
$all_groups = agents_get_all_groups_agent($id_agente, $agent['id_grupo']);
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW') || check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
|
||||
include_once 'godmode/alerts/alert_list.builder.php';
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
// 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
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_alerts.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_integriaims.php';
|
||||
enterprise_include_once('meta/include/functions_alerts_meta.php');
|
||||
|
||||
check_login();
|
||||
|
@ -39,11 +39,19 @@ if (is_ajax()) {
|
|||
$get_integria_ticket_custom_types = (bool) get_parameter('get_integria_ticket_custom_types');
|
||||
|
||||
if ($get_integria_ticket_custom_types) {
|
||||
$ticket_type_id = get_parameter('ticket_type_id');
|
||||
$ticket_type_id = (int) get_parameter('ticket_type_id', 0);
|
||||
if (empty($ticket_type_id) === false) {
|
||||
$error = '';
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$fields = $ITSM->getObjecTypesFields($ticket_type_id);
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
}
|
||||
|
||||
$api_call = integria_api_call(null, null, null, null, 'get_incident_fields', $ticket_type_id, false, 'json');
|
||||
echo json_encode($fields);
|
||||
}
|
||||
|
||||
echo $api_call;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -150,6 +158,22 @@ if ($id) {
|
|||
$action = alerts_get_alert_action($id);
|
||||
$name = $action['name'];
|
||||
$id_command = $action['id_alert_command'];
|
||||
$command = alerts_get_alert_command($id_command);
|
||||
if (empty($command) === false && $command['name'] === io_safe_input('Pandora ITSM Ticket')) {
|
||||
$action['field1'] = io_safe_output(($action['field1'] ?? $config['incident_title']));
|
||||
$action['field2'] = io_safe_output(($action['field2'] ?? $config['default_group']));
|
||||
$action['field3'] = io_safe_output(($action['field3'] ?? $config['default_criticity']));
|
||||
$action['field4'] = io_safe_output(($action['field4'] ?? $config['default_owner']));
|
||||
$action['field5'] = io_safe_output(($action['field5'] ?? $config['incident_type']));
|
||||
$action['field6'] = io_safe_output(($action['field6'] ?? $config['incident_status']));
|
||||
$action['field7'] = io_safe_output(($action['field7'] ?? $config['incident_content']));
|
||||
$action['field2_recovery'] = io_safe_output(($action['field2'] ?? $config['default_group']));
|
||||
$action['field3_recovery'] = io_safe_output(($action['field3'] ?? $config['default_criticity']));
|
||||
$action['field4_recovery'] = io_safe_output(($action['field4'] ?? $config['default_owner']));
|
||||
$action['field5_recovery'] = io_safe_output(($action['field5'] ?? $config['incident_type']));
|
||||
$action['field6_recovery'] = io_safe_output(($action['field6_recovery'] ?? $config['incident_status']));
|
||||
$action['field7_recovery'] = io_safe_output(($action['field7_recovery'] ?? $config['incident_content']));
|
||||
}
|
||||
|
||||
$group = $action['id_group'];
|
||||
$action_threshold = $action['action_threshold'];
|
||||
|
@ -235,11 +259,11 @@ $table->data[0][1] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
$create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_safe_input('Integria IMS Ticket'));
|
||||
$create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_safe_input('Pandora ITSM Ticket'));
|
||||
|
||||
$sql_exclude_command_id = '';
|
||||
|
||||
if (!is_metaconsole() && $config['integria_enabled'] == 0 && $create_ticket_command_id !== false) {
|
||||
if (!is_metaconsole() && $config['ITSM_enabled'] == 0 && $create_ticket_command_id !== false) {
|
||||
$sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id;
|
||||
}
|
||||
|
||||
|
@ -355,24 +379,26 @@ $table_macros->data[1][2] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
// Selector will work only with Integria activated.
|
||||
$integriaIdName = 'integria_wu';
|
||||
$table_macros->colspan[$integriaIdName][0] = 3;
|
||||
$table_macros->data[$integriaIdName][0] = html_print_label_input_block(
|
||||
__('Create workunit on recovery').ui_print_help_tip(
|
||||
__('If closed status is set on recovery, a workunit will be added to the ticket in Integria IMS rather that closing the ticket.'),
|
||||
true
|
||||
),
|
||||
html_print_checkbox_switch_extended(
|
||||
'create_wu_integria',
|
||||
1,
|
||||
$create_wu_integria,
|
||||
false,
|
||||
'',
|
||||
$disabled_attr,
|
||||
true
|
||||
)
|
||||
);
|
||||
if (empty($command) === false && $command['name'] === io_safe_input('Pandora ITSM Ticket')) {
|
||||
// Selector will work only with Integria activated.
|
||||
$integriaIdName = 'integria_wu';
|
||||
$table_macros->colspan[$integriaIdName][0] = 3;
|
||||
$table_macros->data[$integriaIdName][0] = html_print_label_input_block(
|
||||
__('Create workunit on recovery').ui_print_help_tip(
|
||||
__('If closed status is set on recovery, a workunit will be added to the ticket in Pandora ITSM rather that closing the ticket.'),
|
||||
true
|
||||
),
|
||||
html_print_checkbox_switch_extended(
|
||||
'create_wu_integria',
|
||||
1,
|
||||
$create_wu_integria,
|
||||
false,
|
||||
'',
|
||||
$disabled_attr,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
$table_macros->data['field'.$i][0] = html_print_image(
|
||||
|
@ -504,7 +530,6 @@ $(document).ready (function () {
|
|||
},
|
||||
function(data) {
|
||||
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
|
||||
|
||||
data.forEach(function(custom_field, key) {
|
||||
var custom_field_key = key+8; // Custom fields start from field 8.
|
||||
|
||||
|
@ -523,9 +548,9 @@ $(document).ready (function () {
|
|||
custom_field_row.html(new_html_content);
|
||||
|
||||
switch (custom_field.type) {
|
||||
case 'checkbox':
|
||||
var checkbox_selector = $('input:not(.datepicker)[name=field'+custom_field_key+'_value\\[\\]]');
|
||||
var checkbox_recovery_selector = $('input:not(.datepicker)[name=field'+custom_field_key+'_recovery_value\\[\\]]');
|
||||
case 'CHECKBOX':
|
||||
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
|
||||
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
|
||||
|
||||
checkbox_selector.on('change', function() {
|
||||
if (checkbox_selector.prop('checked')) {
|
||||
|
@ -565,17 +590,17 @@ $(document).ready (function () {
|
|||
|
||||
$('[name=field'+custom_field_key+'_value_container]').show();
|
||||
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
|
||||
$('input:not(.datepicker)[name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input:not(.datepicker)[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'combo':
|
||||
case 'COMBO':
|
||||
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
|
||||
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
|
||||
|
||||
combo_input.find('option').remove();
|
||||
combo_input_recovery.find('option').remove();
|
||||
|
||||
var combo_values_array = custom_field.combo_value.split(',');
|
||||
var combo_values_array = custom_field.comboValue.split(',');
|
||||
|
||||
combo_values_array.forEach(function(value) {
|
||||
combo_input.append($('<option>', {
|
||||
|
@ -600,16 +625,15 @@ $(document).ready (function () {
|
|||
combo_input.show();
|
||||
combo_input_recovery.show();
|
||||
break;
|
||||
case 'date':
|
||||
case 'DATE':
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
|
||||
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
|
||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||
|
||||
if (typeof values[key] !== "undefined") {
|
||||
|
@ -620,9 +644,32 @@ $(document).ready (function () {
|
|||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
break;
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
case 'numeric':
|
||||
case 'NUMERIC':
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
|
||||
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'TEXT':
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'TEXTAREA':
|
||||
default:
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
@ -646,13 +693,20 @@ $(document).ready (function () {
|
|||
// No se envia el valor del commando.
|
||||
values.push({
|
||||
name: "page",
|
||||
value: "godmode/alerts/alert_commands"});
|
||||
value: "godmode/alerts/alert_commands"
|
||||
});
|
||||
values.push({
|
||||
name: "get_alert_command",
|
||||
value: "1"});
|
||||
value: "1"
|
||||
});
|
||||
values.push({
|
||||
name: "id",
|
||||
value: this.value});
|
||||
value: this.value
|
||||
});
|
||||
values.push({
|
||||
name: "id_action",
|
||||
value: "<?php echo (int) $id; ?>"
|
||||
});
|
||||
|
||||
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
||||
values,
|
||||
|
@ -664,14 +718,6 @@ $(document).ready (function () {
|
|||
render_command_description(command_description);
|
||||
} else {
|
||||
render_command_description('');
|
||||
|
||||
}
|
||||
|
||||
// Allow create workunit if Integria IMS Ticket is selected.
|
||||
if (data['id'] == '14') {
|
||||
$("#table_macros-"+integriaWorkUnitName).css('display', 'table-row');
|
||||
} else {
|
||||
$("#table_macros-"+integriaWorkUnitName).css('display', 'none');
|
||||
}
|
||||
|
||||
var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>');
|
||||
|
@ -699,12 +745,73 @@ $(document).ready (function () {
|
|||
old_value = '';
|
||||
old_recovery_value = '';
|
||||
// Only keep the value if is provided from hidden (first time)
|
||||
if (($("[name=field" + i + "_value]").attr('id'))
|
||||
== ("hidden-field" + i + "_value")) {
|
||||
|
||||
if (($("[name=field" + i + "_value]").attr('id')) == ("hidden-field" + i + "_value")) {
|
||||
old_value = $("[name=field" + i + "_value]").val();
|
||||
disabled = $("[name=field" + i + "_value]").attr('disabled');
|
||||
}
|
||||
|
||||
if ($("#id_command option:selected").text() === "Pandora ITSM Ticket" && (!old_value || !old_recovery_value) ) {
|
||||
if (i === 1) {
|
||||
if(!old_value) {
|
||||
old_value = '<?php echo io_safe_output($config['incident_title']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['incident_title']); ?>';
|
||||
}
|
||||
} else if (i === 2) {
|
||||
if(!old_value || old_value == 0) {
|
||||
old_value = '<?php echo io_safe_output($config['default_group']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['default_group']); ?>';
|
||||
}
|
||||
} else if (i === 3) {
|
||||
if(!old_value) {
|
||||
old_value = '<?php echo io_safe_output($config['default_criticity']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['default_criticity']); ?>';
|
||||
}
|
||||
} else if (i === 4) {
|
||||
if(!old_value) {
|
||||
old_value = '<?php echo io_safe_output($config['default_owner']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['default_owner']); ?>';
|
||||
}
|
||||
} else if (i === 5) {
|
||||
if(!old_value) {
|
||||
old_value = '<?php echo io_safe_output($config['incident_type']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['incident_type']); ?>';
|
||||
}
|
||||
} else if (i === 6) {
|
||||
if(!old_value) {
|
||||
old_value = '<?php echo io_safe_output($config['incident_status']); ?>';
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = '<?php echo io_safe_output($config['incident_status']); ?>';
|
||||
}
|
||||
} else if (i === 7) {
|
||||
var text = '<?php echo $config['incident_content']; ?>';
|
||||
if(!old_value) {
|
||||
old_value = text;
|
||||
}
|
||||
|
||||
if(!old_recovery_value) {
|
||||
old_recovery_value = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (($("[name=field" + i + "_recovery_value]").attr('id'))
|
||||
== ("hidden-field" + i + "_recovery_value")) {
|
||||
|
@ -742,17 +849,20 @@ $(document).ready (function () {
|
|||
}
|
||||
else {
|
||||
var is_element_select = $("[name=field" + i + "_value]").is("select");
|
||||
var is_element_autocomplete_users_itsm = $("[name=field" + i + "_value]").hasClass("ITSM_users");
|
||||
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
if (is_element_select === true) {
|
||||
$("[name=field" + i + "_value]").trigger('change');
|
||||
} else if (is_element_autocomplete_users_itsm === true) {
|
||||
$("[name=field" + i + "_value_hidden]").val(old_value);
|
||||
}
|
||||
|
||||
|
||||
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
||||
|
||||
if (is_element_select === true) {
|
||||
$("[name=field" + i + "_recovery_value]").trigger('change');
|
||||
} else if (is_element_autocomplete_users_itsm === true) {
|
||||
$("[name=field" + i + "_recovery_value_hidden]").val(old_recovery_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -767,7 +877,7 @@ $(document).ready (function () {
|
|||
}
|
||||
}
|
||||
|
||||
if ($("#id_command option:selected").text() === "Integria IMS Ticket" && i > 7) {
|
||||
if ($("#id_command option:selected").text() === "Pandora ITSM Ticket" && i > 7) {
|
||||
integria_custom_fields_values.push(old_value);
|
||||
integria_custom_fields_rvalues.push(old_recovery_value);
|
||||
}
|
||||
|
@ -789,9 +899,9 @@ $(document).ready (function () {
|
|||
$table_macros_field.show();
|
||||
}
|
||||
|
||||
// Ad-hoc solution for Integria IMS command: get Integia IMS Ticket custom fields only when this command is selected and we selected a ticket type to retrieve fields from.
|
||||
// Ad-hoc solution for Pandora ITSM command: get Integia IMS Ticket custom fields only when this command is selected and we selected a ticket type to retrieve fields from.
|
||||
// Check command by name since it is unvariable in any case, unlike its ID.
|
||||
if ($("#id_command option:selected").text() === "Integria IMS Ticket") {
|
||||
if ($("#id_command option:selected").text() === "Pandora ITSM Ticket") {
|
||||
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
|
||||
|
||||
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
|
||||
|
|
|
@ -75,6 +75,12 @@ foreach ($event_responses as $response) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ((isset($config['ITSM_enabled']) === false || (bool) $config['ITSM_enabled'] === false)
|
||||
&& $response['name'] === 'Create ticket in Pandora ITSM from event'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=editor&id_response='.$response['id'].'&pure='.$config['pure'].'">'.$response['name'].'</a>';
|
||||
$data[1] = $response['description'];
|
||||
|
|
|
@ -81,13 +81,14 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
|||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
// Applications.
|
||||
$sub2 = [];
|
||||
// Check if app has been migrated.
|
||||
if (enterprise_installed() === true) {
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)');
|
||||
(ManageExtensions::isMigrated('pandorafms.mssql') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.mysql') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.oracle') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.vmware') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.sap.desert') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.db2') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)'));
|
||||
}
|
||||
|
||||
$extensions = ManageExtensions::getExtensionBySection('app');
|
||||
|
@ -112,9 +113,9 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
|||
// Cloud.
|
||||
$sub2 = [];
|
||||
if (enterprise_installed() === true) {
|
||||
$sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)');
|
||||
$sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)');
|
||||
(ManageExtensions::isMigrated('pandorafms.aws.ec2') === true) ?: (ManageExtensions::isMigrated('pandorafms.aws.s3') === true) ?: (ManageExtensions::isMigrated('pandorafms.aws.rds') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.azure.mc') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)'));
|
||||
(ManageExtensions::isMigrated('pandorafms.azure.gcp.ce') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -474,19 +475,19 @@ if ($access_console_node === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$sub2['godmode/setup/setup§ion=ehorus']['text'] = __('eHorus');
|
||||
$sub2['godmode/setup/setup§ion=ehorus']['text'] = __('Pandora RC');
|
||||
$sub2['godmode/setup/setup§ion=ehorus']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup§ion=integria']['text'] = __('Integria IMS');
|
||||
$sub2['godmode/setup/setup§ion=integria']['refr'] = 0;
|
||||
$sub2['godmode/setup/setup§ion=ITSM']['text'] = __('ITSM');
|
||||
$sub2['godmode/setup/setup§ion=ITSM']['refr'] = 0;
|
||||
|
||||
enterprise_hook('module_library_submenu');
|
||||
|
||||
$sub2['godmode/setup/setup§ion=notifications']['text'] = __('Notifications');
|
||||
$sub2['godmode/setup/setup§ion=notifications']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup§ion=websocket_engine']['text'] = __('Websocket Engine');
|
||||
$sub2['godmode/setup/setup§ion=websocket_engine']['refr'] = 0;
|
||||
$sub2['godmode/setup/setup§ion=quickshell']['text'] = __('QuickShell');
|
||||
$sub2['godmode/setup/setup§ion=quickshell']['refr'] = 0;
|
||||
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['text'] = __('External Tools');
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['refr'] = 0;
|
||||
|
|
|
@ -880,6 +880,16 @@ switch ($action) {
|
|||
$idAgentModule = $module;
|
||||
break;
|
||||
|
||||
case 'end_of_life':
|
||||
$es = json_decode($item['external_source'], true);
|
||||
|
||||
$text_os_version = $es['os_version'];
|
||||
$end_of_life_date = $es['end_of_life_date'];
|
||||
$os_selector = $es['os_selector'];
|
||||
$group = $es['group'];
|
||||
$recursion = $es['recursion'];
|
||||
break;
|
||||
|
||||
case 'alert_report_actions':
|
||||
$description = $item['description'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
|
@ -1238,6 +1248,88 @@ $class = 'databox filters';
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_os_selector" class="datos">
|
||||
<td class="bolder"><?php echo __('Operating system'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
$os_list = db_get_all_rows_filter('tconfig_os', [], ['id_os', 'name']);
|
||||
|
||||
if ($os === false) {
|
||||
$os = [];
|
||||
}
|
||||
|
||||
$result_select = [];
|
||||
|
||||
foreach ($os as $item) {
|
||||
$result_select[$item['id_os']] = $item['name'];
|
||||
}
|
||||
|
||||
html_print_select(
|
||||
$os_list,
|
||||
'os_selector',
|
||||
$os_selector,
|
||||
''
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_os_version_regexp" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Operating system version').ui_print_help_tip(
|
||||
__('Case insensitive regular expression for OS version. For example: Centos.* will match with the following OS versions: Centos 6.4, Centos 7. Important: OS version must be registered in Operating Systems editor.'),
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_input_text(
|
||||
'text_os_version',
|
||||
$text_os_version,
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
false
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_os_end_of_life" class="datos">
|
||||
<td class="bolder"><?php echo __('End of life'); ?></td>
|
||||
<td colspan="6">
|
||||
<?php
|
||||
$timeInputs = [];
|
||||
|
||||
$timeInputs[] = html_print_div(
|
||||
[
|
||||
'id' => 'end_of_life_date',
|
||||
'style' => '',
|
||||
'content' => html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_input_text(
|
||||
'end_of_life_date',
|
||||
$end_of_life_date,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo implode('', $timeInputs);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_agent_regexp" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
|
@ -4282,6 +4374,8 @@ html_print_action_buttons($actionButtons, ['type' => 'form_action']);
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
ui_require_css_file('datepicker');
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_include_time_picker();
|
||||
ui_require_javascript_file('pandora');
|
||||
|
||||
|
@ -5216,6 +5310,8 @@ $(document).ready (function () {
|
|||
chooseType();
|
||||
chooseSQLquery();
|
||||
|
||||
$("#text-end_of_life_date").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>", showButtonPanel: true});
|
||||
|
||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||
|
||||
// Load selected modules by default
|
||||
|
@ -6529,7 +6625,11 @@ function addGeneralRow() {
|
|||
function loadGeneralAgents(agent_group) {
|
||||
var params = [];
|
||||
|
||||
var group = <?php echo $group; ?>;
|
||||
var group = <?php echo $group ?? -1; ?>;
|
||||
if (group < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
group = agent_group || group;
|
||||
|
||||
params.push("get_agents=1");
|
||||
|
@ -6796,6 +6896,9 @@ function chooseType() {
|
|||
$("#row_group_by").hide();
|
||||
$("#row_type_show").hide();
|
||||
$("#row_use_prefix_notation").hide();
|
||||
$("#row_os_selector").hide();
|
||||
$("#row_os_version_regexp").hide();
|
||||
$("#row_os_end_of_life").hide();
|
||||
$("#row_cat_security_hardening").hide();
|
||||
$("#row_ignore_skipped").hide();
|
||||
$("#row_status_check").hide();
|
||||
|
@ -7379,6 +7482,13 @@ function chooseType() {
|
|||
});
|
||||
break;
|
||||
|
||||
case 'end_of_life':
|
||||
$("#row_os_selector").show();
|
||||
$("#row_os_version_regexp").show();
|
||||
$("#row_group").show();
|
||||
$("#row_os_end_of_life").show();
|
||||
break;
|
||||
|
||||
case 'inventory_changes':
|
||||
$("#row_description").show();
|
||||
$("#row_period").show();
|
||||
|
|
|
@ -1759,6 +1759,17 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'end_of_life':
|
||||
$es['end_of_life_date'] = get_parameter('end_of_life_date');
|
||||
$es['os_selector'] = get_parameter('os_selector');
|
||||
$es['os_version'] = get_parameter('text_os_version', '');
|
||||
$es['group'] = get_parameter('combo_group', '');
|
||||
$es['recursion'] = get_parameter('recursion', 0);
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'alert_report_actions':
|
||||
$alert_templates_to_report = get_parameter('alert_templates');
|
||||
$alert_actions_to_report = get_parameter('alert_actions');
|
||||
|
@ -2747,6 +2758,17 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'end_of_life':
|
||||
$es['end_of_life_date'] = get_parameter('end_of_life_date');
|
||||
$es['os_selector'] = get_parameter('os_selector');
|
||||
$es['os_version'] = get_parameter('text_os_version', '');
|
||||
$es['group'] = get_parameter('combo_group', '');
|
||||
$es['recursion'] = get_parameter('recursion', 0);
|
||||
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'alert_report_actions':
|
||||
$alert_templates_to_report = get_parameter('alert_templates');
|
||||
$alert_actions_to_report = get_parameter('alert_actions');
|
||||
|
|
|
@ -312,7 +312,7 @@ if ($mapConnectionData != null) {
|
|||
$mapConnectionDataUrl,
|
||||
'',
|
||||
45,
|
||||
90,
|
||||
false,
|
||||
true
|
||||
).'</td></tr></table>';
|
||||
|
||||
|
|
|
@ -40,6 +40,191 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
|
|||
return;
|
||||
}
|
||||
|
||||
if ($idOS > 0) {
|
||||
$os = db_get_row_filter('tconfig_os', ['id_os' => $idOS]);
|
||||
$name = $os['name'];
|
||||
$description = $os['description'];
|
||||
$icon = $os['icon_name'];
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
}
|
||||
|
||||
$icon_upload = get_parameter('icon_upload', null);
|
||||
|
||||
$message = '';
|
||||
if ($is_management_allowed === true) {
|
||||
switch ($action) {
|
||||
case 'edit':
|
||||
if ($idOS > 0) {
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
} else {
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
if ($icon_upload !== null && $icon_upload['name'] !== '') {
|
||||
if (isset($_FILES['icon_upload']) === true) {
|
||||
$file_name = $_FILES['icon_upload']['name'];
|
||||
$file_tmp = $_FILES['icon_upload']['tmp_name'];
|
||||
$file_type = $_FILES['icon_upload']['type'];
|
||||
$file_ext = strtolower(end(explode('.', $_FILES['icon_upload']['name'])));
|
||||
|
||||
$allowed_extensions = [
|
||||
'jpeg',
|
||||
'jpg',
|
||||
'png',
|
||||
'svg',
|
||||
];
|
||||
|
||||
$tab = 'manage_os';
|
||||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['description'] = $description;
|
||||
|
||||
if (($icon !== 0) && ($icon != '')) {
|
||||
$values['icon_name'] = $icon;
|
||||
}
|
||||
|
||||
$resultOrId = false;
|
||||
if ($name != '') {
|
||||
$resultOrId = db_process_sql_insert('tconfig_os', $values);
|
||||
}
|
||||
|
||||
if ($resultOrId === false) {
|
||||
$message = 2;
|
||||
$tab = 'builder';
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
} else {
|
||||
$tab = 'manage_os';
|
||||
$message = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=list&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
if ($icon_upload !== null && $icon_upload['name'] !== '') {
|
||||
if (isset($_FILES['icon_upload']) === true) {
|
||||
$file_name = $_FILES['icon_upload']['name'];
|
||||
$file_tmp = $_FILES['icon_upload']['tmp_name'];
|
||||
$file_type = $_FILES['icon_upload']['type'];
|
||||
$file_ext = strtolower(end(explode('.', $_FILES['icon_upload']['name'])));
|
||||
|
||||
$allowed_extensions = [
|
||||
'jpeg',
|
||||
'jpg',
|
||||
'png',
|
||||
'svg',
|
||||
];
|
||||
|
||||
$tab = 'manage_os';
|
||||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['description'] = $description;
|
||||
// Only for Metaconsole. Save the previous name for synchronizing.
|
||||
if (is_metaconsole() === true) {
|
||||
$values['previous_name'] = db_get_value('name', 'tconfig_os', 'id_os', $idOS);
|
||||
}
|
||||
|
||||
if (($icon !== 0) && ($icon != '')) {
|
||||
$values['icon_name'] = $icon;
|
||||
}
|
||||
|
||||
$result = false;
|
||||
if ($name != '') {
|
||||
$result = db_process_sql_update('tconfig_os', $values, ['id_os' => $idOS]);
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
$message = 3;
|
||||
$tab = 'manage_os';
|
||||
} else {
|
||||
$message = 4;
|
||||
$tab = 'builder';
|
||||
$os = db_get_row_filter('tconfig_os', ['id_os' => $idOS]);
|
||||
$name = $os['name'];
|
||||
}
|
||||
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$sql = 'SELECT COUNT(id_os) AS count FROM tagente WHERE id_os = '.$idOS;
|
||||
$count = db_get_all_rows_sql($sql);
|
||||
$count = $count[0]['count'];
|
||||
|
||||
if ($count > 0) {
|
||||
$message = 5;
|
||||
} else {
|
||||
$result = (bool) db_process_sql_delete('tconfig_os', ['id_os' => $idOS]);
|
||||
if ($result) {
|
||||
$message = 6;
|
||||
} else {
|
||||
$message = 7;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=list&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'new':
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$icons = get_list_os_icons_dir();
|
||||
|
||||
$iconData = [];
|
||||
|
@ -62,12 +247,11 @@ $iconData[] = html_print_div(
|
|||
true
|
||||
);
|
||||
|
||||
echo '<form id="form_setup" method="post">';
|
||||
echo '<form id="form_setup" method="post" enctype="multipart/form-data">';
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
|
||||
// $table->style[0] = 'width: 15%';
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
|
||||
|
@ -89,6 +273,11 @@ $table->data[1][] = html_print_label_input_block(
|
|||
html_print_textarea('description', 5, 20, $description, '', true, 'w250px')
|
||||
);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
'',
|
||||
html_print_input_file('icon_upload', true, ['caption' => __('Upload icon')], 'form_setup')
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
html_print_input_hidden('id_os', $idOS);
|
||||
|
@ -101,7 +290,6 @@ html_print_action_buttons(
|
|||
|
||||
echo '</form>';
|
||||
|
||||
|
||||
function get_list_os_icons_dir()
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -45,7 +45,7 @@ if (is_management_allowed() === false) {
|
|||
$is_management_allowed = false;
|
||||
if (is_metaconsole() === false) {
|
||||
$url = '<a target="_blank" href="'.ui_get_meta_url(
|
||||
'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2=list&pure='.(int) $config['pure']
|
||||
'index.php?sec=advanced&sec2=advanced/component_management&tab=list&tab2=list&pure='.(int) $config['pure']
|
||||
).'">'.__('metaconsole').'</a>';
|
||||
} else {
|
||||
$url = __('any node');
|
||||
|
@ -59,115 +59,68 @@ if (is_management_allowed() === false) {
|
|||
);
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->class = 'info_table';
|
||||
$table->head[0] = __('ID');
|
||||
$table->head[1] = __('Icon');
|
||||
$table->head[2] = __('Name');
|
||||
$table->head[3] = __('Description');
|
||||
if ($is_management_allowed === true) {
|
||||
$table->head[4] = __('Actions');
|
||||
}
|
||||
// Datatables list.
|
||||
try {
|
||||
$columns = [
|
||||
'id_os',
|
||||
'icon_img',
|
||||
'name',
|
||||
'description',
|
||||
'options',
|
||||
];
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->align[4] = 'center';
|
||||
}
|
||||
$column_names = [
|
||||
[
|
||||
'text' => __('ID'),
|
||||
'class' => 'w50px table_action_buttons',
|
||||
],
|
||||
[
|
||||
'text' => __('Icon'),
|
||||
'class' => 'w10px table_action_buttons',
|
||||
],
|
||||
__('Name'),
|
||||
__('Description'),
|
||||
[
|
||||
'text' => __('Options'),
|
||||
'class' => 'w20px table_action_buttons',
|
||||
],
|
||||
];
|
||||
|
||||
$table->size[0] = '5%';
|
||||
if ($is_management_allowed === true) {
|
||||
$table->size[4] = '20px';
|
||||
}
|
||||
|
||||
// Prepare pagination.
|
||||
$offset = (int) get_parameter('offset');
|
||||
$limit = $config['block_size'];
|
||||
$count_osList = db_get_value('count(*)', 'tconfig_os');
|
||||
|
||||
$osList = db_get_all_rows_filter(
|
||||
'tconfig_os',
|
||||
[
|
||||
'offset' => $offset,
|
||||
'limit' => $limit,
|
||||
]
|
||||
);
|
||||
|
||||
if ($osList === false) {
|
||||
$osList = [];
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
foreach ($osList as $os) {
|
||||
$data = [];
|
||||
$data[] = $os['id_os'];
|
||||
$data[] = ui_print_os_icon($os['id_os'], false, true);
|
||||
if ($is_management_allowed === true) {
|
||||
if (is_metaconsole() === true) {
|
||||
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=builder&id_os='.$os['id_os'];
|
||||
} else {
|
||||
$osNameUrl = 'index.php?sec=gsetup&sec2=godmode/setup/os&action=edit&tab=builder&id_os='.$os['id_os'];
|
||||
}
|
||||
|
||||
$data[] = html_print_anchor(
|
||||
[
|
||||
'href' => $osNameUrl,
|
||||
'content' => io_safe_output($os['name']),
|
||||
$tableId = 'os_table';
|
||||
// Load datatables user interface.
|
||||
ui_print_datatable(
|
||||
[
|
||||
'id' => $tableId,
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/os',
|
||||
'ajax_data' => ['method' => 'drawOSTable'],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'no_sortable_columns' => [-1, 1],
|
||||
'order' => [
|
||||
'field' => 'id',
|
||||
'direction' => 'asc',
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$data[] = io_safe_output($os['name']);
|
||||
}
|
||||
|
||||
$data[] = ui_print_truncate_text(io_safe_output($os['description']), 'description', true, true);
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[][4] = 'table_action_buttons';
|
||||
if ($os['id_os'] > 16) {
|
||||
if (is_metaconsole() === true) {
|
||||
$hrefDelete = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=delete&tab2=list&id_os='.$os['id_os'];
|
||||
} else {
|
||||
$hrefDelete = 'index.php?sec=gsetup&sec2=godmode/setup/os&action=delete&tab=list&id_os='.$os['id_os'];
|
||||
}
|
||||
|
||||
$data[] = html_print_anchor(
|
||||
[
|
||||
'href' => $hrefDelete,
|
||||
'content' => html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
'search_button_class' => 'sub filter float-right',
|
||||
'form' => [
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Free search'),
|
||||
'type' => 'text',
|
||||
'class' => 'w25p',
|
||||
'id' => 'free_search',
|
||||
'name' => 'free_search',
|
||||
],
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
// The original icons of pandora don't delete.
|
||||
$data[] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[] = $data;
|
||||
}
|
||||
|
||||
$tablePagination = '';
|
||||
if (isset($data) === true) {
|
||||
html_print_table($table);
|
||||
$tablePagination = ui_pagination(
|
||||
$count_osList,
|
||||
ui_get_url_refresh(['message' => false]),
|
||||
$offset,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
''
|
||||
],
|
||||
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
|
||||
'dom_elements' => 'lftpB',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined operating systems') ]);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
$buttons = '';
|
||||
|
@ -191,3 +144,76 @@ html_print_action_buttons(
|
|||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div id="aux" class="invisible"></div>';
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function process_datatables_item(item) {
|
||||
item.options = '<div class="table_action_buttons">';
|
||||
if (item.enable_delete === true) {
|
||||
var delete_id = item.id_os;
|
||||
item.options += '<a href="javascript:" onclick="delete_os(\'';
|
||||
item.options += delete_id;
|
||||
item.options += '\')" ><?php echo html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']); ?></a>';
|
||||
}
|
||||
item.options += '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete selected OS
|
||||
*/
|
||||
function delete_os(id) {
|
||||
$('#aux').empty();
|
||||
$('#aux').text('<?php echo __('Are you sure?'); ?>');
|
||||
$('#aux').dialog({
|
||||
title: '<?php echo __('Delete'); ?> ' + id,
|
||||
buttons: [
|
||||
{
|
||||
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
|
||||
text: '<?php echo __('Cancel'); ?>',
|
||||
click: function(e) {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Delete',
|
||||
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
|
||||
click: function(e) {
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/os',
|
||||
method: 'deleteOS',
|
||||
id_os: id
|
||||
},
|
||||
datatype: "json",
|
||||
success: function (data) {
|
||||
var r = JSON.parse(data);
|
||||
if (r.deleted === false) {
|
||||
$('#aux').text('<?php echo __('Not deleted. Error deleting data'); ?>');
|
||||
} else {
|
||||
$('#aux').dialog('close');
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
$('#aux').text('<?php echo __('Not deleted. Error deleting data'); ?>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -40,24 +40,13 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
|
|||
return;
|
||||
}
|
||||
|
||||
$action = get_parameter('action', 'new');
|
||||
$action = get_parameter('action', '');
|
||||
$idOS = get_parameter('id_os', 0);
|
||||
$id_message = get_parameter('message', 0);
|
||||
if (is_metaconsole() === true) {
|
||||
$tab = get_parameter('tab2', 'list');
|
||||
} else {
|
||||
$tab = get_parameter('tab', 'list');
|
||||
}
|
||||
|
||||
if ($idOS) {
|
||||
$os = db_get_row_filter('tconfig_os', ['id_os' => $idOS]);
|
||||
$name = $os['name'];
|
||||
$description = $os['description'];
|
||||
$icon = $os['icon_name'];
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
$tab = get_parameter('tab', 'manage_os');
|
||||
}
|
||||
|
||||
$is_management_allowed = true;
|
||||
|
@ -65,150 +54,60 @@ if (is_management_allowed() === false) {
|
|||
$is_management_allowed = false;
|
||||
}
|
||||
|
||||
$message = '';
|
||||
if ($is_management_allowed === true) {
|
||||
switch ($action) {
|
||||
case 'edit':
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['description'] = $description;
|
||||
|
||||
if (($icon !== 0) && ($icon != '')) {
|
||||
$values['icon_name'] = $icon;
|
||||
}
|
||||
|
||||
$resultOrId = false;
|
||||
if ($name != '') {
|
||||
$resultOrId = db_process_sql_insert('tconfig_os', $values);
|
||||
}
|
||||
|
||||
if ($resultOrId === false) {
|
||||
$message = 2;
|
||||
$tab = 'builder';
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
} else {
|
||||
$tab = 'list';
|
||||
$message = 1;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
|
||||
$values = [];
|
||||
$values['name'] = $name;
|
||||
$values['description'] = $description;
|
||||
// Only for Metaconsole. Save the previous name for synchronizing.
|
||||
if (is_metaconsole() === true) {
|
||||
$values['previous_name'] = db_get_value('name', 'tconfig_os', 'id_os', $idOS);
|
||||
}
|
||||
|
||||
if (($icon !== 0) && ($icon != '')) {
|
||||
$values['icon_name'] = $icon;
|
||||
}
|
||||
|
||||
$result = false;
|
||||
if ($name != '') {
|
||||
$result = db_process_sql_update('tconfig_os', $values, ['id_os' => $idOS]);
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
$message = 3;
|
||||
$tab = 'list';
|
||||
} else {
|
||||
$message = 4;
|
||||
$tab = 'builder';
|
||||
$os = db_get_row_filter('tconfig_os', ['id_os' => $idOS]);
|
||||
$name = $os['name'];
|
||||
}
|
||||
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$sql = 'SELECT COUNT(id_os) AS count FROM tagente WHERE id_os = '.$idOS;
|
||||
$count = db_get_all_rows_sql($sql);
|
||||
$count = $count[0]['count'];
|
||||
|
||||
if ($count > 0) {
|
||||
$message = 5;
|
||||
} else {
|
||||
$result = (bool) db_process_sql_delete('tconfig_os', ['id_os' => $idOS]);
|
||||
if ($result) {
|
||||
$message = 6;
|
||||
} else {
|
||||
$message = 7;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'new':
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$buttons = [];
|
||||
$buttons['list'] = [
|
||||
|
||||
$buttons['manage_os'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=list">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=manage_os">'.html_print_image(
|
||||
'images/os@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('List OS'),
|
||||
'title' => __('Manage OS types'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
||||
$buttons['manage_version'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=manage_version">'.html_print_image(
|
||||
'images/os_version@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Manage version expiration dates'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
if ($is_management_allowed === true) {
|
||||
$buttons['builder'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=builder">'.html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Builder OS'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of Operating Systems');
|
||||
switch ($tab) {
|
||||
case 'builder':
|
||||
$headerTitle = __('Edit OS');
|
||||
break;
|
||||
|
||||
case 'manage_os':
|
||||
case 'list':
|
||||
if ($action === 'edit') {
|
||||
$headerTitle = __('Edit OS');
|
||||
} else {
|
||||
$headerTitle = __('List of Operating Systems');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'manage_version':
|
||||
if ($action === 'edit') {
|
||||
$headerTitle = __('Edit OS version expiration date');
|
||||
} else {
|
||||
$headerTitle = __('List of version expiration dates');
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
// Header.
|
||||
|
@ -262,6 +161,14 @@ if (empty($id_message) === false) {
|
|||
echo ui_print_error_message(__('Error deleting'), '', true);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
|
@ -269,12 +176,21 @@ if (empty($id_message) === false) {
|
|||
}
|
||||
|
||||
switch ($tab) {
|
||||
case 'manage_os':
|
||||
case 'list':
|
||||
include_once $config['homedir'].'/godmode/setup/os.list.php';
|
||||
if (in_array($action, ['edit', 'save', 'update']) && is_management_allowed() === true) {
|
||||
include_once $config['homedir'].'/godmode/setup/os.builder.php';
|
||||
} else {
|
||||
include_once $config['homedir'].'/godmode/setup/os.list.php';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'builder':
|
||||
include_once $config['homedir'].'/godmode/setup/os.builder.php';
|
||||
case 'manage_version':
|
||||
if (in_array($action, ['edit', 'save', 'update']) && is_management_allowed() === true) {
|
||||
include_once $config['homedir'].'/godmode/setup/os_version.builder.php';
|
||||
} else {
|
||||
include_once $config['homedir'].'/godmode/setup/os_version.list.php';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -0,0 +1,211 @@
|
|||
<?php
|
||||
/**
|
||||
* OS Builder
|
||||
*
|
||||
* @category Os
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
ui_require_css_file('datepicker');
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_include_time_picker();
|
||||
ui_require_javascript_file('pandora');
|
||||
|
||||
if ($idOS > 0) {
|
||||
$os_version = db_get_row_filter('tconfig_os_version', ['id_os_version' => $idOS]);
|
||||
$product = $os_version['product'];
|
||||
$version = $os_version['version'];
|
||||
$end_of_life_date = $os_version['end_of_support'];
|
||||
} else {
|
||||
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
|
||||
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', date("Y/m/d"));
|
||||
}
|
||||
|
||||
$message = '';
|
||||
if ($is_management_allowed === true) {
|
||||
switch ($action) {
|
||||
case 'edit':
|
||||
if ($idOS > 0) {
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
} else {
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
$values = [];
|
||||
// Product and version must be stored with no entities to be able to use REGEXP in queries.
|
||||
// CAREFUL! output of these fields must be encoded to avoid scripting vulnerabilities.
|
||||
$values['product'] = io_safe_output($product);
|
||||
$values['version'] = io_safe_output($version);
|
||||
$values['end_of_support'] = $end_of_life_date;
|
||||
|
||||
$result = db_process_sql_insert('tconfig_os_version', $values);
|
||||
|
||||
if ($result === false) {
|
||||
$message = 2;
|
||||
} else {
|
||||
$message = 1;
|
||||
}
|
||||
|
||||
$tab = 'manage_version';
|
||||
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
$product = io_safe_output(get_parameter('product'));
|
||||
$version = io_safe_output(get_parameter('version'));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', 0);
|
||||
$values = [];
|
||||
$values['product'] = $product;
|
||||
$values['version'] = $version;
|
||||
$values['end_of_support'] = $end_of_life_date;
|
||||
$result = db_process_sql_update('tconfig_os_version', $values, ['id_os_version' => $idOS]);
|
||||
|
||||
if ($result === false) {
|
||||
$message = 4;
|
||||
} else {
|
||||
$message = 3;
|
||||
}
|
||||
|
||||
$tab = 'manage_version';
|
||||
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$sql = 'SELECT COUNT(id_os) AS count FROM tagente WHERE id_os = '.$idOS;
|
||||
$count = db_get_all_rows_sql($sql);
|
||||
$count = $count[0]['count'];
|
||||
|
||||
if ($count > 0) {
|
||||
$message = 5;
|
||||
} else {
|
||||
$result = (bool) db_process_sql_delete('tconfig_os', ['id_os' => $idOS]);
|
||||
if ($result) {
|
||||
$message = 6;
|
||||
} else {
|
||||
$message = 7;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=list&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'new':
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo '<form id="form_setup" method="post">';
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
|
||||
// $table->style[0] = 'width: 15%';
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Product'),
|
||||
html_print_input_text('product', io_safe_input($product), __('Product'), 20, 300, true, false, false, '', 'w250px')
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Version'),
|
||||
html_print_input_text('version', io_safe_input($version), __('Version'), 20, 300, true, false, false, '', 'w250px')
|
||||
);
|
||||
|
||||
$timeInputs = [];
|
||||
|
||||
$timeInputs[] = html_print_div(
|
||||
[
|
||||
'id' => 'end_of_life_date',
|
||||
'style' => '',
|
||||
'content' => html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_input_text(
|
||||
'end_of_life_date',
|
||||
$end_of_life_date,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('End of life date'),
|
||||
implode('', $timeInputs)
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
html_print_input_hidden('id_os', $idOS);
|
||||
html_print_input_hidden('action', $actionHidden);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button($textButton, 'update_button', false, $classButton, true),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#text-end_of_life_date").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>", showButtonPanel: true});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,198 @@
|
|||
<?php
|
||||
/**
|
||||
* Version expiration date editor
|
||||
*
|
||||
* @category Os
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
// Datatables list.
|
||||
try {
|
||||
$columns = [
|
||||
'product',
|
||||
'version',
|
||||
'end_of_support',
|
||||
'options',
|
||||
];
|
||||
|
||||
$column_names = [
|
||||
__('Product'),
|
||||
__('Version'),
|
||||
__('End of support date'),
|
||||
[
|
||||
'text' => __('Options'),
|
||||
'class' => 'w100px table_action_buttons',
|
||||
],
|
||||
];
|
||||
|
||||
$tableId = 'os_version_table';
|
||||
// Load datatables user interface.
|
||||
ui_print_datatable(
|
||||
[
|
||||
'id' => $tableId,
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/os',
|
||||
'ajax_data' => ['method' => 'drawOSVersionTable'],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'no_sortable_columns' => [-1],
|
||||
'order' => [
|
||||
'field' => 'id',
|
||||
'direction' => 'asc',
|
||||
],
|
||||
'search_button_class' => 'sub filter float-right',
|
||||
'form' => [
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Free search'),
|
||||
'type' => 'text',
|
||||
'class' => 'w25p',
|
||||
'id' => 'free_search',
|
||||
'name' => 'free_search',
|
||||
],
|
||||
],
|
||||
],
|
||||
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
|
||||
'dom_elements' => 'lftpB',
|
||||
]
|
||||
);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
echo '<div id="aux" class="invisible"></div>';
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_version&action=edit">';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(__('Create OS version'), 'update_button', false, ['icon' => 'next'], true),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
echo '<form id="redirect-form" method="post" action="index.php?sec=view&sec2=operation/agentes/estado_agente">';
|
||||
html_print_input_hidden('os_type_regex', '');
|
||||
html_print_input_hidden('os_version_regex', '');
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
function process_datatables_item(item) {
|
||||
id = item.id_os_version;
|
||||
|
||||
idrow = '<b><a href="javascript:" onclick="show_form(\'';
|
||||
idrow += item.id_os_version;
|
||||
idrow += '\')" >'+item.id_os_version+'</a></b>';
|
||||
item.id_os_version = idrow;
|
||||
item.options = '<div class="table_action_buttons">';
|
||||
item.options += '<a href="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_version&action=edit&id_os=';
|
||||
item.options += id;
|
||||
item.options += '" ><?php echo html_print_image('images/edit.svg', true, ['title' => __('Edit'), 'class' => 'main_menu_icon invert_filter']); ?></a>';
|
||||
|
||||
item.options += '<a href="javascript:" onclick="redirect_to_agents_by_version(\'';
|
||||
item.options += item.product;
|
||||
item.options += '\',\'';
|
||||
item.options += item.version;
|
||||
item.options += '\')" ><?php echo html_print_image('images/agents.svg', true, ['title' => __('Show agents'), 'class' => 'main_menu_icon invert_filter']); ?></a>';
|
||||
|
||||
item.options += '<a href="javascript:" onclick="delete_os_version(\'';
|
||||
item.options += id;
|
||||
item.options += '\')" ><?php echo html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']); ?></a>';
|
||||
item.options += '</div>';
|
||||
|
||||
item.options += '<form method="post" action="?sec=view&sec2=operation/agentes/estado_agente"></form>';
|
||||
}
|
||||
|
||||
function redirect_to_agents_by_version(product, version) {
|
||||
$('#hidden-os_type_regex').val(product);
|
||||
$('#hidden-os_version_regex').val(version);
|
||||
$('#redirect-form').submit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete selected OS version
|
||||
*/
|
||||
function delete_os_version(id) {
|
||||
$('#aux').empty();
|
||||
$('#aux').text('<?php echo __('Are you sure?'); ?>');
|
||||
$('#aux').dialog({
|
||||
title: '<?php echo __('Delete'); ?> ' + id,
|
||||
buttons: [
|
||||
{
|
||||
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
|
||||
text: '<?php echo __('Cancel'); ?>',
|
||||
click: function(e) {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Delete',
|
||||
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
|
||||
click: function(e) {
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
data: {
|
||||
page: 'include/ajax/os',
|
||||
method: 'deleteOSVersion',
|
||||
id_os_version: id
|
||||
},
|
||||
datatype: "json",
|
||||
success: function (data) {
|
||||
var r = JSON.parse(data);
|
||||
if (r.deleted === false) {
|
||||
$('#aux').text('<?php echo __('Not deleted. Error deleting data'); ?>');
|
||||
} else {
|
||||
$('#aux').dialog('close');
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
$('#aux').text('<?php echo __('Not deleted. Error deleting data'); ?>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,285 @@
|
|||
<?php
|
||||
/**
|
||||
* Os version.
|
||||
*
|
||||
* @category Os version
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$action = get_parameter('action', 'new');
|
||||
$id_os_version = get_parameter('id_os_version', 0);
|
||||
if (is_metaconsole() === true) {
|
||||
$tab = get_parameter('tab2', 'list');
|
||||
} else {
|
||||
$tab = get_parameter('tab', 'list');
|
||||
}
|
||||
|
||||
if ($id_os_version) {
|
||||
$os_version = db_get_row_filter('tconfig_os_version', ['id_os_version' => $id_os_version]);
|
||||
$product = $os_version['product'];
|
||||
$version = $os_version['version'];
|
||||
$end_of_life_date = $os_version['end_of_life_date'];
|
||||
} else {
|
||||
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
|
||||
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', 0);
|
||||
}
|
||||
|
||||
$is_management_allowed = true;
|
||||
if (is_management_allowed() === false) {
|
||||
$is_management_allowed = false;
|
||||
}
|
||||
|
||||
$message = '';
|
||||
if ($is_management_allowed === true) {
|
||||
switch ($action) {
|
||||
case 'edit':
|
||||
$action_hidden = 'update';
|
||||
$text_button = __('Update');
|
||||
$class_button = ['icon' => 'wand'];
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
$values = [];
|
||||
$values['product'] = $product;
|
||||
$values['version'] = $version;
|
||||
$values['end_of_life_date'] = $end_of_life_date;
|
||||
|
||||
$result_or_id = false;
|
||||
if ($product !== '') {
|
||||
$result_or_id = db_process_sql_insert('tconfig_os_version', $values);
|
||||
}
|
||||
|
||||
if ($result_or_id === false) {
|
||||
$message = 2;
|
||||
$tab = 'builder';
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
} else {
|
||||
$tab = 'list';
|
||||
$message = 1;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
|
||||
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
|
||||
$end_of_life_date = get_parameter('end_of_life_date', 0);
|
||||
|
||||
$values = [];
|
||||
$values['product'] = $product;
|
||||
$values['version'] = $version;
|
||||
|
||||
$result = false;
|
||||
$result = db_process_sql_update('tconfig_os_version', $values, ['id_os' => $id_os_version]);
|
||||
|
||||
if ($result !== false) {
|
||||
$message = 3;
|
||||
$tab = 'list';
|
||||
} else {
|
||||
$message = 4;
|
||||
$tab = 'builder';
|
||||
$os = db_get_row_filter('tconfig_os', ['id_os' => $idOS]);
|
||||
$name = $os['name'];
|
||||
}
|
||||
|
||||
$actionHidden = 'update';
|
||||
$textButton = __('Update');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os_version&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$sql = 'SELECT COUNT(id_os) AS count FROM tagente WHERE id_os = '.$idOS;
|
||||
$count = db_get_all_rows_sql($sql);
|
||||
$count = $count[0]['count'];
|
||||
|
||||
if ($count > 0) {
|
||||
$message = 5;
|
||||
} else {
|
||||
$result = (bool) db_process_sql_delete('tconfig_os', ['id_os' => $idOS]);
|
||||
if ($result) {
|
||||
$message = 6;
|
||||
} else {
|
||||
$message = 7;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&tab2='.$tab.'&message='.$message);
|
||||
} else {
|
||||
header('Location:'.$config['homeurl'].'index.php?sec=gsetup&sec2=godmode/setup/os&tab='.$tab.'&message='.$message);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'new':
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'next'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$buttons = [];
|
||||
$buttons['list'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=list">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('List OS'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
if ($is_management_allowed === true) {
|
||||
$buttons['builder'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=builder">'.html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Builder OS'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
||||
$buttons['version_exp_date_editor'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/setup/os&tab=manage_version">'.html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Version expiration date editor'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
switch ($tab) {
|
||||
case 'builder':
|
||||
$headerTitle = __('Edit OS');
|
||||
break;
|
||||
|
||||
case 'manage_version':
|
||||
$headerTitle = __('Version expiration date editor');
|
||||
break;
|
||||
|
||||
case 'list':
|
||||
$headerTitle = __('List of Operating Systems');
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$headerTitle,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Servers'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Edit OS'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($id_message) === false) {
|
||||
switch ($id_message) {
|
||||
case 1:
|
||||
echo ui_print_success_message(__('Success creating OS'), '', true);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
echo ui_print_error_message(__('Fail creating OS'), '', true);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
echo ui_print_success_message(__('Success updating OS'), '', true);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
echo ui_print_error_message(__('Error updating OS'), '', true);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
echo ui_print_error_message(__('There are agents with this OS.'), '', true);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
echo ui_print_success_message(__('Success deleting'), '', true);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
echo ui_print_error_message(__('Error deleting'), '', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/godmode/setup/os_version.list.php';
|
|
@ -170,13 +170,13 @@ if (check_acl($config['id_user'], 0, 'AW')) {
|
|||
}
|
||||
}
|
||||
|
||||
$buttons['integria'] = [
|
||||
$buttons['ITSM'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=integria').'">'.html_print_image(
|
||||
'images/integria.png',
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=ITSM').'">'.html_print_image(
|
||||
'images/itsm.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Integria IMS'),
|
||||
'title' => __('ITSM'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
|
@ -185,10 +185,10 @@ $buttons['integria'] = [
|
|||
$buttons['ehorus'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=ehorus').'">'.html_print_image(
|
||||
'images/ehorus/ehorus.png',
|
||||
'images/RC.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('eHorus'),
|
||||
'title' => __('Pandora RC'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
|
@ -221,13 +221,13 @@ $buttons['notifications'] = [
|
|||
).'</a>',
|
||||
];
|
||||
|
||||
$buttons['websocket_engine'] = [
|
||||
$buttons['quickshell'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=websocket_engine').'">'.html_print_image(
|
||||
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=quickshell').'">'.html_print_image(
|
||||
'images/websocket_small.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Websocket engine'),
|
||||
'title' => __('QuickShell'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
|
@ -299,14 +299,14 @@ switch ($section) {
|
|||
|
||||
case 'ehorus':
|
||||
$buttons['ehorus']['active'] = true;
|
||||
$subpage = __('eHorus');
|
||||
$subpage = __('Pandora RC');
|
||||
$help_header = 'setup_ehorus_tab';
|
||||
break;
|
||||
|
||||
case 'integria':
|
||||
$buttons['integria']['active'] = true;
|
||||
$subpage = __('Integria IMS');
|
||||
$help_header = 'setup_integria_tab';
|
||||
case 'ITSM':
|
||||
$buttons['ITSM']['active'] = true;
|
||||
$subpage = __('Pandora ITSM');
|
||||
$help_header = 'setup_ITSM_tab';
|
||||
break;
|
||||
|
||||
case 'module_library':
|
||||
|
@ -325,9 +325,9 @@ switch ($section) {
|
|||
$subpage = __('Notifications');
|
||||
break;
|
||||
|
||||
case 'websocket_engine':
|
||||
$buttons['websocket_engine']['active'] = true;
|
||||
$subpage = __('Pandora Websocket Engine');
|
||||
case 'quickshell':
|
||||
$buttons['quickshell']['active'] = true;
|
||||
$subpage = __('QuickShell');
|
||||
$help_header = 'quickshell_settings';
|
||||
break;
|
||||
|
||||
|
@ -442,8 +442,8 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/setup/setup_ehorus.php';
|
||||
break;
|
||||
|
||||
case 'integria':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_integria.php';
|
||||
case 'ITSM':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_ITSM.php';
|
||||
break;
|
||||
|
||||
case 'gis':
|
||||
|
@ -454,8 +454,8 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/setup/setup_notifications.php';
|
||||
break;
|
||||
|
||||
case 'websocket_engine':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_websocket_engine.php';
|
||||
case 'quickshell':
|
||||
include_once $config['homedir'].'/godmode/setup/setup_quickshell.php';
|
||||
break;
|
||||
|
||||
case 'external_tools':
|
||||
|
|
|
@ -0,0 +1,716 @@
|
|||
<?php
|
||||
/**
|
||||
* ITSM setup.
|
||||
*
|
||||
* @category Setup
|
||||
* @package Pandora FMS
|
||||
* @subpackage Opensource
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\ITSM\ITSM;
|
||||
|
||||
// Load globals.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$error = '';
|
||||
$group_values = [];
|
||||
$priority_values = [];
|
||||
$object_types_values = [];
|
||||
$status_values = [];
|
||||
$node = [];
|
||||
try {
|
||||
$ITSM = new ITSM();
|
||||
$has_connection = $ITSM->ping();
|
||||
$group_values = $ITSM->getGroups();
|
||||
$priority_values = $ITSM->getPriorities();
|
||||
$status_values = $ITSM->getStatus();
|
||||
$object_types_values = $ITSM->getObjectypes();
|
||||
if ((bool) get_parameter('update_config', 0) === true) {
|
||||
$set_config_inventories = $ITSM->createNode(
|
||||
[
|
||||
'serverAuth' => $config['server_unique_identifier'],
|
||||
'apiPass' => $config['api_password'],
|
||||
'agentsForExecution' => $config['ITSM_agents_sync'],
|
||||
'path' => $config['ITSM_public_url'],
|
||||
'label' => array_keys(servers_get_names())[0],
|
||||
'nodeId' => $config['metaconsole_node_id'],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$node = $ITSM->getNode($config['server_unique_identifier']);
|
||||
} catch (\Throwable $th) {
|
||||
$node = [];
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
$error = $th->getMessage();
|
||||
$has_connection = false;
|
||||
}
|
||||
|
||||
if ($has_connection === false && $config['ITSM_enabled']) {
|
||||
ui_print_error_message(__('ITSM API is not reachable, %s', $error));
|
||||
}
|
||||
|
||||
$table_enable = new StdClass();
|
||||
$table_enable->data = [];
|
||||
$table_enable->width = '100%';
|
||||
$table_enable->id = 'itsm-enable-setup';
|
||||
$table_enable->class = 'databox filters';
|
||||
$table_enable->size['name'] = '30%';
|
||||
$table_enable->style['name'] = 'font-weight: bold';
|
||||
|
||||
// Enable Pandora ITSM.
|
||||
$row = [];
|
||||
$row['name'] = __('Enable Pandora ITSM');
|
||||
$row['control'] = html_print_checkbox_switch('ITSM_enabled', 1, $config['ITSM_enabled'], true);
|
||||
$table_enable->data['ITSM_enabled'] = $row;
|
||||
|
||||
// Remote config table.
|
||||
$table_remote = new StdClass();
|
||||
$table_remote->data = [];
|
||||
$table_remote->width = '100%';
|
||||
$table_remote->styleTable = 'margin-bottom: 10px;';
|
||||
$table_remote->id = 'ITSM-remote-setup';
|
||||
$table_remote->class = 'databox filters filter-table-adv';
|
||||
$table_remote->size['hostname'] = '50%';
|
||||
$table_remote->size['api_pass'] = '50%';
|
||||
|
||||
// Enable ITSM user configuration.
|
||||
$row = [];
|
||||
$row['user_level'] = html_print_label_input_block(
|
||||
__('Pandora ITSM configuration at user level'),
|
||||
html_print_checkbox_switch(
|
||||
'ITSM_user_level_conf',
|
||||
1,
|
||||
$config['ITSM_user_level_conf'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_remote->data['ITSM_user_level_conf'] = $row;
|
||||
|
||||
// ITSM hostname.
|
||||
$row = [];
|
||||
$row['hostname'] = html_print_label_input_block(
|
||||
__('URL to Pandora ITSM setup').ui_print_help_tip(
|
||||
__('Full URL to your Pandora ITSM setup (e.g., http://192.168.1.20/integria/api/v1).'),
|
||||
true
|
||||
),
|
||||
html_print_input_text(
|
||||
'ITSM_hostname',
|
||||
$config['ITSM_hostname'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'ITSM-remote-setup-ITSM_hostname']
|
||||
);
|
||||
|
||||
// ITSM token.
|
||||
$row['password'] = html_print_label_input_block(
|
||||
__('Token'),
|
||||
html_print_input_password(
|
||||
'ITSM_token',
|
||||
io_output_password($config['ITSM_token']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'ITSM-remote-setup-ITSM_token']
|
||||
);
|
||||
$table_remote->data['ITSM_token'] = $row;
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$button_test = html_print_button(
|
||||
__('Test'),
|
||||
'ITSM',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$button_test .= '<span id="ITSM-spinner" class="invisible"> ';
|
||||
$button_test .= html_print_image(
|
||||
'images/spinner.gif',
|
||||
true
|
||||
);
|
||||
$button_test .= '</span>';
|
||||
$button_test .= '<span id="ITSM-success" class="invisible"> ';
|
||||
$button_test .= html_print_image(
|
||||
'images/status_sets/default/severity_normal.png',
|
||||
true
|
||||
);
|
||||
$button_test .= ' '.__('Connection its OK').'</span>';
|
||||
$button_test .= '<span id="ITSM-failure" class="invisible"> ';
|
||||
$button_test .= html_print_image(
|
||||
'images/status_sets/default/severity_critical.png',
|
||||
true
|
||||
);
|
||||
$button_test .= ' '.__('Connection failed').'</span>';
|
||||
$button_test .= ' <span id="ITSM-message" class="invisible"></span>';
|
||||
|
||||
$row['control'] = html_print_label_input_block(
|
||||
__('Test connection pandora to ITSM'),
|
||||
$button_test
|
||||
);
|
||||
$table_remote->data['ITSM_test'] = $row;
|
||||
|
||||
$row = [];
|
||||
$itsm_public_url = $config['ITSM_public_url'];
|
||||
if (empty($itsm_public_url) === true) {
|
||||
$itsm_public_url = $config['homeurl'];
|
||||
if (isset($config['public_url']) === true && empty($config['public_url']) === false) {
|
||||
$itsm_public_url = $config['public_url'];
|
||||
}
|
||||
}
|
||||
|
||||
$row['publicUrl'] = html_print_label_input_block(
|
||||
__('URL conect to API %s', get_product_name()).ui_print_help_tip(
|
||||
__('Full URL to your Pandora (e.g., http://192.168.1.20).'),
|
||||
true
|
||||
),
|
||||
html_print_input_text(
|
||||
'ITSM_public_url',
|
||||
$itsm_public_url,
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$row['agentsSync'] = html_print_label_input_block(
|
||||
__('Number Agents to synchronize').ui_print_help_tip(
|
||||
__('Number of agents that will synchronize at the same time, minimum 10 max 1000'),
|
||||
true
|
||||
),
|
||||
html_print_input_number(
|
||||
[
|
||||
'name' => 'ITSM_agents_sync',
|
||||
'min' => 10,
|
||||
'max' => 1000,
|
||||
'value' => ($config['ITSM_agents_sync'] ?? 20),
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$table_remote->data['ITSM_sync_inventory'] = $row;
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$button_test_pandora = html_print_button(
|
||||
__('Test'),
|
||||
'ITSM-pandora',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$button_test_pandora .= '<span id="ITSM-spinner-pandora" class="invisible"> ';
|
||||
$button_test_pandora .= html_print_image(
|
||||
'images/spinner.gif',
|
||||
true
|
||||
);
|
||||
$button_test_pandora .= '</span>';
|
||||
$button_test_pandora .= '<span id="ITSM-success-pandora" class="invisible"> ';
|
||||
$button_test_pandora .= html_print_image(
|
||||
'images/status_sets/default/severity_normal.png',
|
||||
true
|
||||
);
|
||||
$button_test_pandora .= ' '.__('Connection its OK').'</span>';
|
||||
$button_test_pandora .= '<span id="ITSM-failure-pandora" class="invisible"> ';
|
||||
$button_test_pandora .= html_print_image(
|
||||
'images/status_sets/default/severity_critical.png',
|
||||
true
|
||||
);
|
||||
$button_test_pandora .= ' '.__('Connection failed').'</span>';
|
||||
$button_test_pandora .= ' <span id="ITSM-message-pandora" class="invisible"></span>';
|
||||
|
||||
$row['control-test'] = html_print_label_input_block(
|
||||
__('Test conection ITSM to pandora'),
|
||||
$button_test_pandora
|
||||
);
|
||||
|
||||
if (empty($node) === false) {
|
||||
$progressbar = '';
|
||||
|
||||
$progress = 0;
|
||||
if (empty($node['total']) === false) {
|
||||
if (empty($node['accumulate']) === true) {
|
||||
$node['accumulate'] = 0;
|
||||
}
|
||||
|
||||
$progress = round(($node['accumulate'] * 100 / $node['total']));
|
||||
}
|
||||
|
||||
if (empty($node['error']) === false) {
|
||||
$progressbar = $node['error'];
|
||||
} else if (empty($node['total']) === false) {
|
||||
$progressbar = '<div class="flex mrgn_5px">';
|
||||
$progressbar .= ui_progress($progress, '150px', '1.3', '#14524f', true, '', false, 'margin-right:5px; color:#c0ccdc');
|
||||
$progressbar .= ' ( '.$node['accumulate'].' / '.$node['total'].' ) '.__('Agents');
|
||||
$progressbar .= '</div>';
|
||||
} else {
|
||||
$progressbar = '--';
|
||||
}
|
||||
|
||||
// $progressbar .= (empty($node['dateStart']) === false) ? human_time_comparation($node['dateStart']) : __('Never');
|
||||
$row['control-test-pandora'] = html_print_label_input_block(
|
||||
__('Progress agents to synch'),
|
||||
$progressbar
|
||||
);
|
||||
}
|
||||
|
||||
$table_remote->data['ITSM_test_pandora'] = $row;
|
||||
|
||||
// Alert settings.
|
||||
$table_alert_settings = new StdClass();
|
||||
$table_alert_settings->data = [];
|
||||
$table_alert_settings->rowspan = [];
|
||||
$table_alert_settings->width = '100%';
|
||||
$table_alert_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_alert_settings->id = 'ITSM-settings-setup';
|
||||
$table_alert_settings->class = 'databox filters filter-table-adv';
|
||||
$table_alert_settings->size[0] = '50%';
|
||||
$table_alert_settings->size[1] = '50%';
|
||||
|
||||
// Alert incident title.
|
||||
$table_alert_settings->data[0][0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'incident_title',
|
||||
$config['incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert incident description.
|
||||
$table_alert_settings->rowspan[0][1] = 3;
|
||||
$table_alert_settings->data[0][1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'incident_content',
|
||||
9,
|
||||
25,
|
||||
$config['incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
// Alert default group.
|
||||
$table_alert_settings->data[1][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$group_values,
|
||||
'default_group',
|
||||
$config['default_group'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert default owner.
|
||||
$table_alert_settings->data[2][0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_pandora_itsm(
|
||||
'default_owner',
|
||||
$config['default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
// Alert default incident status.
|
||||
$table_alert_settings->data[3][0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_values,
|
||||
'incident_status',
|
||||
$config['incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert default criticity.
|
||||
$table_alert_settings->data[3][1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$priority_values,
|
||||
'default_criticity',
|
||||
$config['default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert default incident type.
|
||||
$table_alert_settings->data[4][0] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$object_types_values,
|
||||
'incident_type',
|
||||
$config['incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response settings.
|
||||
$table_cr_settings = new StdClass();
|
||||
$table_cr_settings->data = [];
|
||||
$table_cr_settings->width = '100%';
|
||||
$table_cr_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_cr_settings->id = 'ITSM-cr-settings-setup';
|
||||
$table_cr_settings->class = 'databox filters filter-table-adv';
|
||||
$table_cr_settings->size[0] = '50%';
|
||||
$table_cr_settings->size[1] = '50%';
|
||||
|
||||
// Custom response incident title.
|
||||
$table_cr_settings->data[0][0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'cr_incident_title',
|
||||
$config['cr_incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response incident description.
|
||||
$table_cr_settings->rowspan[0][1] = 3;
|
||||
$table_cr_settings->data[0][1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'cr_incident_content',
|
||||
9,
|
||||
25,
|
||||
$config['cr_incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response default group.
|
||||
$table_cr_settings->data[1][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$group_values,
|
||||
'cr_default_group',
|
||||
$config['cr_default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response default owner.
|
||||
$table_cr_settings->data[2][0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_pandora_itsm(
|
||||
'cr_default_owner',
|
||||
$config['cr_default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
// Custom response default incident status.
|
||||
$row = [];
|
||||
$table_cr_settings->data[3][0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$status_values,
|
||||
'cr_incident_status',
|
||||
$config['cr_incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response default criticity.
|
||||
$table_cr_settings->data[3][1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$priority_values,
|
||||
'cr_default_criticity',
|
||||
$config['cr_default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response default incident type.
|
||||
$table_cr_settings->data[4][0] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$object_types_values,
|
||||
'cr_incident_type',
|
||||
$config['cr_incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Print.
|
||||
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://pandorafms.com/es/itsm/">';
|
||||
html_print_image(
|
||||
'images/pandoraITSM_logo.png',
|
||||
false,
|
||||
['class' => 'w600px mrgn_top_15px']
|
||||
);
|
||||
echo '</a>';
|
||||
echo '<br />';
|
||||
echo '<div class="ITSM_title">';
|
||||
echo __('Pandora ITSM');
|
||||
echo '</div>';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://pandorafms.com/es/itsm/">';
|
||||
echo 'https://pandorafms.com/es/itsm/';
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
|
||||
echo "<form method='post' class='max_floating_element_size'>";
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
// Form enable.
|
||||
echo '<div id="form_enable">';
|
||||
html_print_table($table_enable);
|
||||
echo '</div>';
|
||||
|
||||
// Form remote.
|
||||
echo '<div id="form_remote">';
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Pandora ITSM API settings').'</legend>';
|
||||
|
||||
html_print_table($table_remote);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
if ($has_connection !== false) {
|
||||
// Form alert default settings.
|
||||
echo '<div id="form_alert_settings">';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Alert default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_alert_settings);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
// Form custom response default settings.
|
||||
echo '<div id="form_custom_response_settings">';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Event custom response default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_cr_settings);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update and continue'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
html_print_action_buttons($update_button);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
ui_require_javascript_file('ITSM');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
if($('input:checkbox[name="ITSM_user_level_conf"]').is(':checked'))
|
||||
{
|
||||
$('.ITSM-remote-setup-ITSM_token').hide()
|
||||
}
|
||||
|
||||
var handleUserLevel = function(event) {
|
||||
var is_checked = $('input:checkbox[name="ITSM_enabled"]').is(':checked');
|
||||
var is_checked_userlevel = $('input:checkbox[name="ITSM_user_level_conf"]').is(':checked');
|
||||
|
||||
if (event.target.value == '1' && is_checked && !is_checked_userlevel) {
|
||||
showUserPass();
|
||||
$('input:checkbox[name="ITSM_user_level_conf"]').attr('checked', true);
|
||||
}
|
||||
else {
|
||||
hideUserPass();
|
||||
$('input:checkbox[name="ITSM_user_level_conf"]').attr('checked', false);
|
||||
};
|
||||
}
|
||||
|
||||
$('input:checkbox[name="ITSM_enabled"]').change(handleEnable);
|
||||
$('input:checkbox[name="ITSM_user_level_conf"]').change(handleUserLevel);
|
||||
|
||||
if(!$('input:checkbox[name="ITSM_enabled"]').is(':checked')) {
|
||||
$('#form_remote').hide();
|
||||
$('#form_custom_response_settings').hide();
|
||||
} else {
|
||||
$('#form_remote').show();
|
||||
$('#form_custom_response_settings').show();
|
||||
}
|
||||
|
||||
$('#form_enable').css('margin-bottom','20px');
|
||||
var showFields = function () {
|
||||
$('#form_remote').show();
|
||||
$('#form_custom_response_settings').show();
|
||||
}
|
||||
var hideFields = function () {
|
||||
$('#form_remote').hide();
|
||||
$('#form_custom_response_settings').hide();
|
||||
}
|
||||
|
||||
var hideUserPass = function () {
|
||||
$('.ITSM-remote-setup-ITSM_token').hide();
|
||||
}
|
||||
|
||||
var showUserPass = function () {
|
||||
$('.ITSM-remote-setup-ITSM_token').show();
|
||||
}
|
||||
|
||||
var handleEnable = function (event) {
|
||||
var is_checked = $('input:checkbox[name="ITSM_enabled"]').is(':checked');
|
||||
|
||||
if (event.target.value == '1' && is_checked) {
|
||||
showFields();
|
||||
$('input:checkbox[name="ITSM_enabled"]').attr('checked', true);
|
||||
}
|
||||
else {
|
||||
hideFields();
|
||||
$('input:checkbox[name="ITSM_enabled"]').attr('checked', false);
|
||||
};
|
||||
}
|
||||
|
||||
$('input:checkbox[name="ITSM_enabled"]').change(handleEnable);
|
||||
|
||||
$('#button-ITSM').click(function() {
|
||||
var pass = $('input#password-ITSM_token').val();
|
||||
var host = $('input#text-ITSM_hostname').val();
|
||||
testConectionApi(pass, host);
|
||||
});
|
||||
|
||||
$('#button-ITSM-pandora').click(function() {
|
||||
var path = $('input#text-ITSM_public_url').val();
|
||||
testConectionApiItsmToPandora(path);
|
||||
});
|
||||
|
||||
</script>
|
|
@ -371,7 +371,7 @@ if (is_ajax() === true) {
|
|||
case 'pandora':
|
||||
case 'ad':
|
||||
case 'saml':
|
||||
case 'integria':
|
||||
case 'ITSM':
|
||||
// Add enterprise authentication options.
|
||||
if (enterprise_installed() === true) {
|
||||
add_enterprise_auth_options($table, $type_auth);
|
||||
|
|
|
@ -64,7 +64,7 @@ $table_enable->style['name'] = 'font-weight: bold';
|
|||
|
||||
// Enable eHorus.
|
||||
$row = [];
|
||||
$row['name'] = __('Enable eHorus');
|
||||
$row['name'] = __('Enable Pandora RC');
|
||||
$row['control'] = html_print_checkbox_switch('ehorus_enabled', 1, $config['ehorus_enabled'], true);
|
||||
$table_enable->data['ehorus_enabled'] = $row;
|
||||
|
||||
|
@ -81,7 +81,7 @@ $table_remote->size['ehorus_port'] = '50%';
|
|||
// Enable eHorus user configuration.
|
||||
$row = [];
|
||||
$row['ehorus_user_level_conf'] = html_print_label_input_block(
|
||||
__('eHorus configuration at user level'),
|
||||
__('Pandora RC configuration at user level'),
|
||||
html_print_checkbox_switch(
|
||||
'ehorus_user_level_conf',
|
||||
1,
|
||||
|
@ -154,16 +154,16 @@ $table_remote->data['ehorus_test'] = $row;
|
|||
|
||||
// Print.
|
||||
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="http://ehorus.com">';
|
||||
if ($config['style'] === 'pandora_black' && is_metaconsole() === true) {
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://pandorafms.com/es/control-remoto/">';
|
||||
if ($config['style'] === 'pandora_black' || is_metaconsole() === true) {
|
||||
html_print_image(
|
||||
'include/ehorus/images/ehorus-logo.png',
|
||||
'include/ehorus/images/Pandora RC blanco@2x.png',
|
||||
false,
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
} else {
|
||||
html_print_image(
|
||||
'include/ehorus/images/ehorus-logo-grey.png',
|
||||
'include/ehorus/images/Pandora RC@2x.png',
|
||||
false,
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
|
@ -174,19 +174,19 @@ echo '<br />';
|
|||
echo '<div class="ehorus_title">';
|
||||
echo __('Remote Management System');
|
||||
echo '</div>';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://ehorus.com">';
|
||||
echo 'https://ehorus.com';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://pandorafms.com/es/control-remoto/">';
|
||||
echo 'https://pandorafms.com/es/control-remoto/';
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
|
||||
if ($custom_field_created !== null) {
|
||||
ui_print_result_message($custom_field_created, __('Custom field eHorusID created'), __('Error creating custom field'));
|
||||
ui_print_result_message($custom_field_created, __('Custom field Pandora RC ID created'), __('Error creating custom field'));
|
||||
}
|
||||
|
||||
if ($custom_field_created) {
|
||||
$info_messsage = __('eHorus has his own agent identifiers');
|
||||
$info_messsage = __('Pandora RC has his own agent identifiers');
|
||||
$info_messsage .= '. '.__('To store them, it will be necessary to use an agent custom field');
|
||||
$info_messsage .= '.<br />'.__('Possibly the eHorus id will have to be filled in by hand for every agent').'.';
|
||||
$info_messsage .= '.<br />'.__('Possibly the Pandora RC id will have to be filled in by hand for every agent').'.';
|
||||
ui_print_info_message($info_messsage);
|
||||
}
|
||||
|
||||
|
@ -205,7 +205,7 @@ echo '</div>';
|
|||
// Form remote.
|
||||
echo '<div id="form_remote">';
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('eHorus API').'</legend>';
|
||||
echo '<legend>'.__('Pandora RC API').'</legend>';
|
||||
html_print_input_hidden('update_config', 1);
|
||||
html_print_table($table_remote);
|
||||
|
||||
|
|
|
@ -1,997 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Integria setup.
|
||||
*
|
||||
* @category Setup
|
||||
* @package Pandora FMS
|
||||
* @subpackage Opensource
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Load globals.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
require_once $config['homedir'].'/include/functions_integriaims.php';
|
||||
|
||||
if (is_ajax() === true) {
|
||||
$operation = (string) get_parameter('operation', '');
|
||||
|
||||
$integria_user = get_parameter('integria_user', '');
|
||||
$integria_pass = get_parameter('integria_pass', '');
|
||||
$integria_api_hostname = get_parameter('api_hostname', '');
|
||||
$integria_api_pass = get_parameter('api_pass', '');
|
||||
$user_level_conf = get_parameter('user_level_conf', 0);
|
||||
$user_level_conf_bool = ((bool) $user_level_conf === true);
|
||||
|
||||
$login_result = integria_api_call($integria_api_hostname, $integria_user, $integria_pass, $integria_api_pass, 'get_login', [], false, '', '', $user_level_conf_bool);
|
||||
|
||||
echo json_encode(['login' => ($login_result !== false) ? 1 : 0]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$has_connection = integria_api_call(null, null, null, null, 'get_login', []);
|
||||
|
||||
if ($has_connection === false && $config['integria_enabled']) {
|
||||
ui_print_error_message(__('Integria IMS API is not reachable'));
|
||||
}
|
||||
|
||||
if (get_parameter('update_config', 0) == 1) {
|
||||
// Try to retrieve event response 'Create incident in IntegriaIMS from event' to check if it exists.
|
||||
$event_response_exists = db_get_row_filter('tevent_response', ['name' => io_safe_input('Create ticket in IntegriaIMS from event')]);
|
||||
|
||||
// Try to retrieve command 'Integia IMS Ticket' to check if it exists.
|
||||
$command_exists = db_get_row_filter('talert_commands', ['name' => io_safe_input('Integria IMS Ticket')]);
|
||||
|
||||
if ($config['integria_enabled'] == 1) {
|
||||
if ($event_response_exists === false) {
|
||||
// Create 'Create incident in IntegriaIMS from event' event response only when user enables IntegriaIMS integration and it does not exist in database.
|
||||
db_process_sql_insert(
|
||||
'tevent_response',
|
||||
[
|
||||
'name' => io_safe_input('Create ticket in IntegriaIMS from event'),
|
||||
'description' => io_safe_input('Create a ticket in Integria IMS from an event'),
|
||||
'target' => io_safe_input('index.php?sec=incident&sec2=operation/incidents/configure_integriaims_incident&from_event=_event_id_'),
|
||||
'type' => 'url',
|
||||
'id_group' => '0',
|
||||
'modal_width' => '0',
|
||||
'modal_height' => '0',
|
||||
'new_window' => '1',
|
||||
'params' => '',
|
||||
'server_to_exec' => '0',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$ticket_types = integria_api_call(null, null, null, null, 'get_types', '', false, 'json');
|
||||
|
||||
$types_string = '';
|
||||
|
||||
if ($ticket_types !== '') {
|
||||
foreach (json_decode($ticket_types, true) as $key => $value) {
|
||||
$types_string .= $value['id'].','.$value['name'].';';
|
||||
}
|
||||
}
|
||||
|
||||
if ($command_exists === false) {
|
||||
// Create 'Integria IMS Ticket' command only when user enables IntegriaIMS integration and it does not exist in database.
|
||||
$id_command_inserted = db_process_sql_insert(
|
||||
'talert_commands',
|
||||
[
|
||||
'name' => io_safe_input('Integria IMS Ticket'),
|
||||
'command' => io_safe_input('Internal type'),
|
||||
'internal' => 1,
|
||||
'description' => io_safe_input('Create a ticket in Integria IMS'),
|
||||
'fields_descriptions' => '["'.io_safe_input('Ticket title').'","'.io_safe_input('Ticket group ID').'","'.io_safe_input('Ticket priority').'","'.io_safe_input('Ticket owner').'","'.io_safe_input('Ticket type').'","'.io_safe_input('Ticket status').'","'.io_safe_input('Ticket description').'","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_"]',
|
||||
'fields_values' => '["", "", "","","'.$types_string.'","","","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_"]',
|
||||
]
|
||||
);
|
||||
|
||||
// Create 'Create Integria IMS Ticket' action only when user enables IntegriaIMS integration and command exists in database.
|
||||
$action_values = [
|
||||
'field1' => io_safe_input($config['incident_title']),
|
||||
'field1_recovery' => io_safe_input($config['incident_title']),
|
||||
'field2' => io_safe_input($config['default_group']),
|
||||
'field2_recovery' => io_safe_input($config['default_group']),
|
||||
'field3' => io_safe_input($config['default_criticity']),
|
||||
'field3_recovery' => io_safe_input($config['default_criticity']),
|
||||
'field4' => io_safe_input($config['default_owner']),
|
||||
'field4_recovery' => io_safe_input($config['default_owner']),
|
||||
'field5' => io_safe_input($config['incident_type']),
|
||||
'field5_recovery' => io_safe_input($config['incident_type']),
|
||||
'field6' => io_safe_input($config['incident_status']),
|
||||
'field6_recovery' => io_safe_input($config['incident_status']),
|
||||
'field7' => io_safe_input($config['incident_content']),
|
||||
'field7_recovery' => io_safe_input($config['incident_content']),
|
||||
'id_group' => 0,
|
||||
'action_threshold' => 0,
|
||||
];
|
||||
|
||||
alerts_create_alert_action(io_safe_input('Create Integria IMS ticket'), $id_command_inserted, $action_values);
|
||||
} else {
|
||||
// Update 'Integria IMS Ticket' command with ticket types retrieved from Integria IMS.
|
||||
$sql_update_command_values = sprintf(
|
||||
'
|
||||
UPDATE talert_commands
|
||||
SET fields_values = \'["","","","","%s","","","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_","_integria_type_custom_field_"]\'
|
||||
WHERE name="%s"',
|
||||
$types_string,
|
||||
io_safe_input('Integria IMS Ticket')
|
||||
);
|
||||
|
||||
db_process_sql($sql_update_command_values);
|
||||
|
||||
// Update those actions that make use of 'Integria IMS Ticket' command when setup default fields are updated. Empty fields in actions will be filled in with default values.
|
||||
$update_action_values = [
|
||||
$config['incident_title'],
|
||||
$config['default_group'],
|
||||
$config['default_criticity'],
|
||||
$config['default_owner'],
|
||||
$config['incident_type'],
|
||||
$config['incident_status'],
|
||||
$config['incident_content'],
|
||||
];
|
||||
|
||||
foreach ($update_action_values as $key => $value) {
|
||||
$field_key = ($key + 1);
|
||||
|
||||
$sql_update_action_field = sprintf(
|
||||
'
|
||||
UPDATE talert_actions taa
|
||||
INNER JOIN talert_commands tac
|
||||
ON taa.id_alert_command=tac.id
|
||||
SET field%s= "%s"
|
||||
WHERE tac.name="Integria IMS Ticket"
|
||||
AND (
|
||||
taa.field%s IS NULL OR taa.field%s=""
|
||||
)',
|
||||
$field_key,
|
||||
$value,
|
||||
$field_key,
|
||||
$field_key,
|
||||
$field_key
|
||||
);
|
||||
|
||||
db_process_sql($sql_update_action_field);
|
||||
}
|
||||
|
||||
foreach ($update_action_values as $key => $value) {
|
||||
$field_key = ($key + 1);
|
||||
|
||||
$sql_update_action_recovery_field = sprintf(
|
||||
'
|
||||
UPDATE talert_actions taa
|
||||
INNER JOIN talert_commands tac
|
||||
ON taa.id_alert_command=tac.id
|
||||
SET field%s_recovery = "%s"
|
||||
WHERE tac.name="Integria IMS Ticket"
|
||||
AND (
|
||||
taa.field%s_recovery IS NULL OR taa.field%s_recovery=""
|
||||
)',
|
||||
$field_key,
|
||||
$value,
|
||||
$field_key,
|
||||
$field_key,
|
||||
$field_key
|
||||
);
|
||||
|
||||
db_process_sql($sql_update_action_recovery_field);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($event_response_exists !== false) {
|
||||
// Delete 'Create incident in IntegriaIMS from event' event response if it does exist and IntegriaIMS integration is disabled.
|
||||
db_process_sql_delete('tevent_response', ['name' => io_safe_input('Create ticket in IntegriaIMS from event')]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get parameters from Integria IMS API.
|
||||
$integria_group_values = [];
|
||||
$integria_criticity_values = [];
|
||||
$integria_users_values = [];
|
||||
$integria_types_values = [];
|
||||
$integria_status_values = [];
|
||||
|
||||
$integria_groups_csv = integria_api_call(null, null, null, null, 'get_groups', []);
|
||||
|
||||
get_array_from_csv_data_pair($integria_groups_csv, $integria_group_values);
|
||||
|
||||
$integria_status_csv = integria_api_call(null, null, null, null, 'get_incidents_status', []);
|
||||
|
||||
get_array_from_csv_data_pair($integria_status_csv, $integria_status_values);
|
||||
|
||||
$integria_criticity_levels_csv = integria_api_call(null, null, null, null, 'get_incident_priorities', []);
|
||||
|
||||
get_array_from_csv_data_pair($integria_criticity_levels_csv, $integria_criticity_values);
|
||||
|
||||
$integria_users_csv = integria_api_call(null, null, null, null, 'get_users', []);
|
||||
|
||||
$csv_array = explode("\n", $integria_users_csv);
|
||||
|
||||
foreach ($csv_array as $csv_line) {
|
||||
if (empty($csv_line) === false) {
|
||||
$integria_users_values[$csv_line] = $csv_line;
|
||||
}
|
||||
}
|
||||
|
||||
$integria_types_csv = integria_api_call(null, null, null, null, 'get_types', []);
|
||||
|
||||
get_array_from_csv_data_pair($integria_types_csv, $integria_types_values);
|
||||
|
||||
// Enable table.
|
||||
$table_enable = new StdClass();
|
||||
$table_enable->data = [];
|
||||
$table_enable->width = '100%';
|
||||
$table_enable->id = 'integria-enable-setup';
|
||||
$table_enable->class = 'databox filters';
|
||||
$table_enable->size['name'] = '30%';
|
||||
$table_enable->style['name'] = 'font-weight: bold';
|
||||
|
||||
// Enable Integria.
|
||||
$row = [];
|
||||
$row['name'] = __('Enable Integria IMS');
|
||||
$row['control'] = html_print_checkbox_switch('integria_enabled', 1, $config['integria_enabled'], true);
|
||||
$table_enable->data['integria_enabled'] = $row;
|
||||
|
||||
// Remote config table.
|
||||
$table_remote = new StdClass();
|
||||
$table_remote->data = [];
|
||||
$table_remote->width = '100%';
|
||||
$table_remote->styleTable = 'margin-bottom: 10px;';
|
||||
$table_remote->id = 'integria-remote-setup';
|
||||
$table_remote->class = 'databox filters filter-table-adv';
|
||||
$table_remote->size['hostname'] = '50%';
|
||||
$table_remote->size['api_pass'] = '50%';
|
||||
|
||||
// Enable Integria user configuration.
|
||||
$row = [];
|
||||
$row['user_level'] = html_print_label_input_block(
|
||||
__('Integria configuration at user level'),
|
||||
html_print_checkbox_switch(
|
||||
'integria_user_level_conf',
|
||||
1,
|
||||
$config['integria_user_level_conf'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_remote->data['integria_user_level_conf'] = $row;
|
||||
|
||||
// Integria user.
|
||||
$row = [];
|
||||
$row['user'] = html_print_label_input_block(
|
||||
__('User'),
|
||||
html_print_input_text(
|
||||
'integria_user',
|
||||
$config['integria_user'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_user']
|
||||
);
|
||||
|
||||
// Integria password.
|
||||
$row['password'] = html_print_label_input_block(
|
||||
__('Password'),
|
||||
html_print_input_password(
|
||||
'integria_pass',
|
||||
io_output_password($config['integria_pass']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_pass']
|
||||
);
|
||||
$table_remote->data['integria_pass'] = $row;
|
||||
|
||||
// Integria hostname.
|
||||
$row = [];
|
||||
$row['hostname'] = html_print_label_input_block(
|
||||
__('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true),
|
||||
html_print_input_text(
|
||||
'integria_hostname',
|
||||
$config['integria_hostname'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_hostname']
|
||||
);
|
||||
|
||||
// API password.
|
||||
$row['api_pass'] = html_print_label_input_block(
|
||||
__('API Password'),
|
||||
html_print_input_password(
|
||||
'integria_api_pass',
|
||||
io_output_password($config['integria_api_pass']),
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_api_pass']
|
||||
);
|
||||
$table_remote->data['integria_api_pass'] = $row;
|
||||
|
||||
// Request timeout.
|
||||
$row = [];
|
||||
$row['req_timeout'] = html_print_label_input_block(
|
||||
__('Request timeout'),
|
||||
html_print_input_text(
|
||||
'integria_req_timeout',
|
||||
$config['integria_req_timeout'],
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
true
|
||||
),
|
||||
['div_class' => 'integria-remote-setup-integria_req_timeout']
|
||||
);
|
||||
$table_remote->data['integria_req_timeout'] = $row;
|
||||
|
||||
$row = [];
|
||||
$row['control'] = __('Inventory');
|
||||
$row['control'] .= html_print_button(
|
||||
__('Sync inventory'),
|
||||
'sync-inventory',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$row['control'] .= '<span id="test-integria-spinner-sync" style="display:none;"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$row['control'] .= '<span id="test-integria-success-sync" style="display:none;"> '.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
|
||||
$row['control'] .= '<span id="test-integria-failure-sync" style="display:none;"> '.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
|
||||
$table_remote->data['integria_sync_inventory'] = $row;
|
||||
|
||||
// Alert settings.
|
||||
$table_alert_settings = new StdClass();
|
||||
$table_alert_settings->data = [];
|
||||
$table_alert_settings->width = '100%';
|
||||
$table_alert_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_alert_settings->id = 'integria-cr-settings-setup';
|
||||
$table_alert_settings->class = 'databox filters filter-table-adv';
|
||||
$table_alert_settings->size[0] = '50%';
|
||||
$table_alert_settings->size[1] = '50%';
|
||||
|
||||
// Alert incident title.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'incident_title',
|
||||
$config['incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert incident description.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'incident_content',
|
||||
3,
|
||||
25,
|
||||
$config['incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data[0] = $row;
|
||||
|
||||
// Alert default group.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$integria_group_values,
|
||||
'default_group',
|
||||
$config['default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Alert default criticity.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$integria_criticity_values,
|
||||
'default_criticity',
|
||||
$config['default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data[1] = $row;
|
||||
|
||||
// Alert default owner.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'default_owner',
|
||||
$config['default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
// Alert default incident type.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$integria_types_values,
|
||||
'incident_type',
|
||||
$config['incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data[2] = $row;
|
||||
|
||||
// Alert default incident status.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$integria_status_values,
|
||||
'incident_status',
|
||||
$config['incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_alert_settings->data[3] = $row;
|
||||
|
||||
// Custom response settings.
|
||||
$table_cr_settings = new StdClass();
|
||||
$table_cr_settings->data = [];
|
||||
$table_cr_settings->width = '100%';
|
||||
$table_cr_settings->styleTable = 'margin-bottom: 10px;';
|
||||
$table_cr_settings->id = 'integria-cr-settings-setup';
|
||||
$table_cr_settings->class = 'databox filters filter-table-adv';
|
||||
$table_cr_settings->size[0] = '50%';
|
||||
$table_cr_settings->size[1] = '50%';
|
||||
|
||||
// Custom response incident title.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Title'),
|
||||
html_print_input_text(
|
||||
'cr_incident_title',
|
||||
$config['cr_incident_title'],
|
||||
__('Name'),
|
||||
50,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response incident description.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Ticket body'),
|
||||
html_print_textarea(
|
||||
'cr_incident_content',
|
||||
3,
|
||||
25,
|
||||
$config['cr_incident_content'],
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_cr_settings->data[0] = $row;
|
||||
|
||||
// Custom response default group.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select(
|
||||
$integria_group_values,
|
||||
'cr_default_group',
|
||||
$config['cr_default_group'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
// Custom response default criticity.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
$integria_criticity_values,
|
||||
'cr_default_criticity',
|
||||
$config['cr_default_criticity'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data[1] = $row;
|
||||
|
||||
// Custom response default owner.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Owner'),
|
||||
html_print_autocomplete_users_from_integria(
|
||||
'cr_default_owner',
|
||||
$config['cr_default_owner'],
|
||||
true,
|
||||
'30',
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
),
|
||||
['div_class' => 'inline']
|
||||
);
|
||||
|
||||
// Custom response default incident type.
|
||||
$row[1] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$integria_types_values,
|
||||
'cr_incident_type',
|
||||
$config['cr_incident_type'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data[2] = $row;
|
||||
|
||||
// Custom response default incident status.
|
||||
$row = [];
|
||||
$row[0] = html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$integria_status_values,
|
||||
'cr_incident_status',
|
||||
$config['cr_incident_status'],
|
||||
'',
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$table_cr_settings->data[3] = $row;
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$row['control'] = __('Test connection');
|
||||
$row['control'] .= html_print_button(
|
||||
__('Test'),
|
||||
'test-integria',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$row['control'] .= '<span id="test-integria-spinner" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$row['control'] .= '<span id="test-integria-success" class="invisible"> '.html_print_image('images/status_sets/default/severity_normal.png', true).' '.__('Connection its OK').'</span>';
|
||||
$row['control'] .= '<span id="test-integria-failure" class="invisible"> '.html_print_image('images/status_sets/default/severity_critical.png', true).' '.__('Connection failed').'</span>';
|
||||
$row['control'] .= ' <span id="test-integria-message" class="invisible"></span>';
|
||||
$table_remote->data['integria_test'] = $row;
|
||||
|
||||
// Print.
|
||||
echo '<div class="center pdd_b_10px mrgn_btn_20px white_box max_floating_element_size">';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="http://integriaims.com">';
|
||||
html_print_image(
|
||||
'images/integria_logo.svg',
|
||||
false,
|
||||
['class' => 'w400px mrgn_top_15px']
|
||||
);
|
||||
echo '</a>';
|
||||
echo '<br />';
|
||||
echo '<div clsas="integria_title">';
|
||||
echo __('Integria IMS');
|
||||
echo '</div>';
|
||||
echo '<a target="_blank" rel="noopener noreferrer" href="https://integriaims.com">';
|
||||
echo 'https://integriaims.com';
|
||||
echo '</a>';
|
||||
echo '</div>';
|
||||
|
||||
echo "<form method='post' class='max_floating_element_size'>";
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
// Form enable.
|
||||
echo '<div id="form_enable">';
|
||||
html_print_table($table_enable);
|
||||
echo '</div>';
|
||||
|
||||
// Form remote.
|
||||
echo '<div id="form_remote">';
|
||||
echo '<fieldset>';
|
||||
echo '<legend>'.__('Integria API settings').'</legend>';
|
||||
|
||||
html_print_table($table_remote);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
if ($has_connection != false) {
|
||||
// Form alert default settings.
|
||||
echo '<div id="form_alert_settings">';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Alert default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_alert_settings);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
// Form custom response default settings.
|
||||
echo '<div id="form_custom_response_settings">';
|
||||
echo '<fieldset class="mrgn_top_15px">';
|
||||
echo '<legend>'.__('Event custom response default values').' '.ui_print_help_icon('alert_macros', true).'</legend>';
|
||||
|
||||
html_print_table($table_cr_settings);
|
||||
|
||||
echo '</fieldset>';
|
||||
echo '</div>';
|
||||
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$update_button = html_print_submit_button(
|
||||
__('Update and continue'),
|
||||
'update_button',
|
||||
false,
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
html_print_action_buttons($update_button);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
if($('input:checkbox[name="integria_user_level_conf"]').is(':checked'))
|
||||
{
|
||||
$('.integria-remote-setup-integria_user').hide();
|
||||
$('.integria-remote-setup-integria_pass').hide()
|
||||
}
|
||||
|
||||
var handleUserLevel = function(event) {
|
||||
var is_checked = $('input:checkbox[name="integria_enabled"]').is(':checked');
|
||||
var is_checked_userlevel = $('input:checkbox[name="integria_user_level_conf"]').is(':checked');
|
||||
|
||||
if (event.target.value == '1' && is_checked && !is_checked_userlevel) {
|
||||
showUserPass();
|
||||
$('input:checkbox[name="integria_user_level_conf"]').attr('checked', true);
|
||||
}
|
||||
else {
|
||||
hideUserPass();
|
||||
$('input:checkbox[name="integria_user_level_conf"]').attr('checked', false);
|
||||
};
|
||||
}
|
||||
|
||||
$('input:checkbox[name="integria_enabled"]').change(handleEnable);
|
||||
$('input:checkbox[name="integria_user_level_conf"]').change(handleUserLevel);
|
||||
|
||||
if(!$('input:checkbox[name="integria_enabled"]').is(':checked')) {
|
||||
$('#form_remote').hide();
|
||||
$('#form_custom_response_settings').hide();
|
||||
} else {
|
||||
$('#form_remote').show();
|
||||
$('#form_custom_response_settings').show();
|
||||
}
|
||||
|
||||
$('#form_enable').css('margin-bottom','20px');
|
||||
var showFields = function () {
|
||||
$('#form_remote').show();
|
||||
$('#form_custom_response_settings').show();
|
||||
}
|
||||
var hideFields = function () {
|
||||
$('#form_remote').hide();
|
||||
$('#form_custom_response_settings').hide();
|
||||
}
|
||||
|
||||
var hideUserPass = function () {
|
||||
$('.integria-remote-setup-integria_user').hide();
|
||||
$('.integria-remote-setup-integria_pass').hide();
|
||||
}
|
||||
|
||||
var showUserPass = function () {
|
||||
$('.integria-remote-setup-integria_user').show();
|
||||
$('.integria-remote-setup-integria_pass').show();
|
||||
}
|
||||
|
||||
var handleEnable = function (event) {
|
||||
var is_checked = $('input:checkbox[name="integria_enabled"]').is(':checked');
|
||||
|
||||
if (event.target.value == '1' && is_checked) {
|
||||
showFields();
|
||||
$('input:checkbox[name="integria_enabled"]').attr('checked', true);
|
||||
}
|
||||
else {
|
||||
hideFields();
|
||||
$('input:checkbox[name="integria_enabled"]').attr('checked', false);
|
||||
};
|
||||
}
|
||||
|
||||
$('input:checkbox[name="integria_enabled"]').change(handleEnable);
|
||||
|
||||
var handleTest = function (event) {
|
||||
var user = $('input#text-integria_user').val();
|
||||
var pass = $('input#password-integria_pass').val();
|
||||
var host = $('input#text-integria_hostname').val();
|
||||
var timeout = Number.parseInt($('input#text-integria_req_timeout').val(), 10);
|
||||
|
||||
var timeoutMessage = '<?php echo __('Connection timeout'); ?>';
|
||||
var badRequestMessage = '<?php echo __('Empty user or password'); ?>';
|
||||
var notFoundMessage = '<?php echo __('User not found'); ?>';
|
||||
var invalidPassMessage = '<?php echo __('Invalid password'); ?>';
|
||||
|
||||
var hideLoadingImage = function () {
|
||||
$('span#test-integria-spinner').hide();
|
||||
}
|
||||
var showLoadingImage = function () {
|
||||
$('span#test-integria-spinner').show();
|
||||
}
|
||||
var hideSuccessImage = function () {
|
||||
$('span#test-integria-success').hide();
|
||||
}
|
||||
var showSuccessImage = function () {
|
||||
$('span#test-integria-success').show();
|
||||
}
|
||||
var hideFailureImage = function () {
|
||||
$('span#test-integria-failure').hide();
|
||||
}
|
||||
var showFailureImage = function () {
|
||||
$('span#test-integria-failure').show();
|
||||
}
|
||||
var hideMessage = function () {
|
||||
$('span#test-integria-message').hide();
|
||||
}
|
||||
var showMessage = function () {
|
||||
$('span#test-integria-message').show();
|
||||
}
|
||||
var changeTestMessage = function (message) {
|
||||
$('span#test-integria-message').text(message);
|
||||
}
|
||||
|
||||
hideSuccessImage();
|
||||
hideFailureImage();
|
||||
hideMessage();
|
||||
showLoadingImage();
|
||||
|
||||
var integria_user = $('input[name=integria_user]').val();
|
||||
var integria_pass = $('input[name=integria_pass]').val();
|
||||
var api_hostname = $('input[name=integria_hostname]').val();
|
||||
var api_pass = $('input[name=integria_api_pass]').val();
|
||||
var user_level_conf = $('input:checkbox[name="integria_user_level_conf"]').is(':checked');
|
||||
|
||||
var data = {
|
||||
page: 'godmode/setup/setup_integria',
|
||||
operation: 'check_api_access',
|
||||
integria_user: integria_user,
|
||||
integria_pass: integria_pass,
|
||||
api_hostname: api_hostname,
|
||||
api_pass: api_pass,
|
||||
user_level_conf: user_level_conf,
|
||||
}
|
||||
|
||||
// AJAX call to check API connection.
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
dataType: "json",
|
||||
timeout: timeout ? timeout * 1000 : 0,
|
||||
data: data
|
||||
})
|
||||
.done(function(data, textStatus, xhr) {
|
||||
if (data.login == '1') {
|
||||
showSuccessImage();
|
||||
} else {
|
||||
showFailureImage();
|
||||
showMessage();
|
||||
}
|
||||
|
||||
})
|
||||
.fail(function(xhr, textStatus, errorThrown) {
|
||||
showFailureImage();
|
||||
showMessage();
|
||||
})
|
||||
.always(function(xhr, textStatus) {
|
||||
hideLoadingImage();
|
||||
});
|
||||
}
|
||||
|
||||
var handleInventorySync = function (event) {
|
||||
|
||||
var badRequestMessage = '<?php echo __('Empty user or password'); ?>';
|
||||
var notFoundMessage = '<?php echo __('User not found'); ?>';
|
||||
var invalidPassMessage = '<?php echo __('Invalid password'); ?>';
|
||||
|
||||
var hideLoadingImage = function () {
|
||||
$('span#test-integria-spinner-sync').hide();
|
||||
}
|
||||
var showLoadingImage = function () {
|
||||
$('span#test-integria-spinner-sync').show();
|
||||
}
|
||||
var hideSuccessImage = function () {
|
||||
$('span#test-integria-success-sync').hide();
|
||||
}
|
||||
var showSuccessImage = function () {
|
||||
$('span#test-integria-success-sync').show();
|
||||
}
|
||||
var hideFailureImage = function () {
|
||||
$('span#test-integria-failure-sync').hide();
|
||||
}
|
||||
var showFailureImage = function () {
|
||||
$('span#test-integria-failure-sync').show();
|
||||
}
|
||||
|
||||
hideSuccessImage();
|
||||
hideFailureImage();
|
||||
showLoadingImage();
|
||||
|
||||
var integria_user = $('input[name=integria_user]').val();
|
||||
var integria_pass = $('input[name=integria_pass]').val();
|
||||
var api_hostname = $('input[name=integria_hostname]').val();
|
||||
var api_pass = $('input[name=integria_api_pass]').val();
|
||||
|
||||
if (!api_hostname.match(/^[a-zA-Z]+:\/\//))
|
||||
{
|
||||
api_hostname = 'http://' + api_hostname;
|
||||
}
|
||||
|
||||
var url = api_hostname + '/integria/include/api.php';
|
||||
|
||||
<?php
|
||||
// Retrieve all agents and codify string in the format that will be sent over in Ajax call.
|
||||
$agent_fields = [
|
||||
'nombre',
|
||||
'alias',
|
||||
'id_os',
|
||||
'direccion',
|
||||
'id_agente',
|
||||
'id_grupo',
|
||||
];
|
||||
|
||||
$agents = agents_get_agents(false, $agent_fields);
|
||||
|
||||
$agents_query_string_array = [];
|
||||
|
||||
foreach ($agents as $agent_data) {
|
||||
$agents_query_string_array[] = implode('|;|', $agent_data);
|
||||
}
|
||||
?>
|
||||
|
||||
var agents_query_string_array = <?php echo json_encode($agents_query_string_array); ?>;
|
||||
|
||||
var data = {
|
||||
op: 'sync_pandora_agents_inventory',
|
||||
user: integria_user,
|
||||
user_pass: integria_pass,
|
||||
pass: api_pass,
|
||||
params: agents_query_string_array,
|
||||
token: '|;|'
|
||||
}
|
||||
|
||||
// AJAX call to check API connection.
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: data
|
||||
})
|
||||
.done(function(data, textStatus, xhr) {
|
||||
showSuccessImage();
|
||||
})
|
||||
.fail(function(xhr, textStatus, errorThrown) {
|
||||
showFailureImage();
|
||||
})
|
||||
.always(function(xhr, textStatus) {
|
||||
hideLoadingImage();
|
||||
});
|
||||
}
|
||||
|
||||
$('#button-test-integria').click(handleTest);
|
||||
$('#button-sync-inventory').click(handleInventorySync);
|
||||
|
||||
</script>
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* Integria incidents management.
|
||||
* Settings for Pandora Websocket engine.
|
||||
*
|
||||
* @category Ajax library.
|
||||
* @category UI file
|
||||
* @package Pandora FMS
|
||||
* @subpackage Modules.
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
|
@ -26,35 +26,28 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
if (check_login()) {
|
||||
global $config;
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_integriaims.php';
|
||||
$url = ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/setup/setup&section=quickshell&pure='.$config['pure']
|
||||
);
|
||||
|
||||
$get_users = get_parameter('get_users');
|
||||
$search_term = get_parameter('search_term', '');
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
|
||||
|
||||
if ($get_users) {
|
||||
$integria_users_csv = integria_api_call(null, null, null, null, 'get_users', []);
|
||||
|
||||
$csv_array = explode("\n", $integria_users_csv);
|
||||
|
||||
foreach ($csv_array as $csv_line) {
|
||||
if (!empty($csv_line)) {
|
||||
$integria_users_values[$csv_line] = $csv_line;
|
||||
}
|
||||
}
|
||||
|
||||
$integria_users_filtered_values = array_filter(
|
||||
$integria_users_values,
|
||||
function ($item) use ($search_term) {
|
||||
if (strpos($item, $search_term) !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
echo json_encode($integria_users_filtered_values);
|
||||
return;
|
||||
}
|
||||
if (function_exists('quickShellSettings') === true) {
|
||||
quickShellSettings();
|
||||
}
|
||||
|
||||
$action_btns = html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
$action_btns
|
||||
);
|
||||
|
||||
echo '</form>';
|
|
@ -1,195 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Settings for Pandora Websocket engine.
|
||||
*
|
||||
* @category UI file
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
$url = ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/setup/setup&section=websocket_engine&pure='.$config['pure']
|
||||
);
|
||||
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
|
||||
|
||||
echo '<fieldset class="margin-bottom-10">';
|
||||
echo '<legend>'.__('WebSocket settings').'</legend>';
|
||||
|
||||
$t = new StdClass();
|
||||
$t->data = [];
|
||||
$t->width = '100%';
|
||||
$t->class = 'databox filter-table-adv';
|
||||
$t->data = [];
|
||||
|
||||
$t->data[0][] = html_print_label_input_block(
|
||||
__('Bind address'),
|
||||
html_print_input_text(
|
||||
'ws_bind_address',
|
||||
$config['ws_bind_address'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$t->data[0][] = html_print_label_input_block(
|
||||
__('Bind port'),
|
||||
html_print_input_text(
|
||||
'ws_port',
|
||||
$config['ws_port'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$t->data[1][] = html_print_label_input_block(
|
||||
__('WebSocket proxy url'),
|
||||
html_print_input_text(
|
||||
'ws_proxy_url',
|
||||
$config['ws_proxy_url'],
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
||||
// Test.
|
||||
$row = [];
|
||||
$test_start = '<span id="test-gotty-spinner" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$test_start .= ' <span id="test-gotty-message" class="invisible"></span>';
|
||||
$row['gotty_test'] = html_print_label_input_block(
|
||||
__('Test connection'),
|
||||
html_print_button(
|
||||
__('Test'),
|
||||
'test-gotty',
|
||||
false,
|
||||
'handleTest()',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
'style' => 'width: 115px;',
|
||||
],
|
||||
true
|
||||
).$test_start,
|
||||
['div_class' => 'inline_flex row']
|
||||
);
|
||||
|
||||
$t->data['gotty_test'] = $row;
|
||||
|
||||
html_print_table($t);
|
||||
|
||||
echo '</fieldset>';
|
||||
|
||||
if (function_exists('quickShellSettings') === true) {
|
||||
quickShellSettings();
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
echo '<script>';
|
||||
echo 'var server_addr = "'.$_SERVER['SERVER_ADDR'].'";';
|
||||
$handle_test_js = "var handleTest = function (event) {
|
||||
|
||||
var ws_proxy_url = $('input#text-ws_proxy_url').val();
|
||||
var ws_port = $('input#text-ws_port').val();
|
||||
var httpsEnabled = window.location.protocol == 'https' ? true : false;
|
||||
if (ws_proxy_url == '') {
|
||||
ws_url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + ':' + ws_port;
|
||||
} else {
|
||||
ws_url = ws_proxy_url;
|
||||
}
|
||||
|
||||
var showLoadingImage = function () {
|
||||
$('#button-test-gotty').children('div').attr('class', 'subIcon cog rotation secondary mini');
|
||||
}
|
||||
|
||||
var showSuccessImage = function () {
|
||||
$('#button-test-gotty').children('div').attr('class', 'subIcon tick secondary mini');
|
||||
}
|
||||
|
||||
var showFailureImage = function () {
|
||||
$('#button-test-gotty').children('div').attr('class', 'subIcon fail secondary mini');
|
||||
}
|
||||
|
||||
var hideMessage = function () {
|
||||
$('span#test-gotty-message').hide();
|
||||
}
|
||||
var showMessage = function () {
|
||||
$('span#test-gotty-message').show();
|
||||
}
|
||||
var changeTestMessage = function (message) {
|
||||
$('span#test-gotty-message').text(message);
|
||||
}
|
||||
|
||||
var errorMessage = '".__('WebService engine has not been started, please check documentation.')."';
|
||||
|
||||
|
||||
hideMessage();
|
||||
showLoadingImage();
|
||||
|
||||
var ws = new WebSocket(ws_url);
|
||||
// Catch errors.
|
||||
|
||||
ws.onerror = () => {
|
||||
showFailureImage();
|
||||
changeTestMessage(errorMessage);
|
||||
showMessage();
|
||||
ws.close();
|
||||
};
|
||||
|
||||
ws.onopen = () => {
|
||||
showSuccessImage();
|
||||
hideMessage();
|
||||
ws.close();
|
||||
};
|
||||
|
||||
ws.onclose = (event) => {
|
||||
changeTestMessage(errorMessage);
|
||||
hideLoadingImage();
|
||||
showMessage();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
$('#button-test-ehorus').click(handleTest);";
|
||||
|
||||
echo $handle_test_js;
|
||||
echo '</script>';
|
|
@ -333,6 +333,7 @@ if ($create_user === true) {
|
|||
$values['default_custom_view'] = (int) get_parameter('default_custom_view');
|
||||
$values['time_autorefresh'] = (int) get_parameter('time_autorefresh', 0);
|
||||
$values['show_tips_startup'] = (int) get_parameter_switch('show_tips_startup');
|
||||
$values['integria_user_level_pass'] = (string) get_parameter('integria_user_level_pass');
|
||||
$dashboard = get_parameter('dashboard', '');
|
||||
$visual_console = get_parameter('visual_console', '');
|
||||
|
||||
|
@ -624,6 +625,7 @@ if ($update_user) {
|
|||
$values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false);
|
||||
$values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user');
|
||||
$values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass');
|
||||
$values['integria_user_level_pass'] = (string) get_parameter('integria_user_level_pass');
|
||||
|
||||
$values['middlename'] = get_parameter('middlename', 0);
|
||||
|
||||
|
|
|
@ -576,6 +576,57 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
|
|||
true
|
||||
);
|
||||
|
||||
// eHorus conf
|
||||
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
|
||||
$userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled');
|
||||
$userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch(
|
||||
'ehorus_user_level_enabled',
|
||||
1,
|
||||
$user_info['ehorus_user_level_enabled'],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->rowclass['captions_ehorus_user_level_user'] = 'field_half_width';
|
||||
$userManagementTable->rowclass['fields_ehorus_user_level_user'] = 'field_half_width';
|
||||
$userManagementTable->data['captions_ehorus_user_level_user'][1] = __('Pandora RC User');
|
||||
$userManagementTable->data['fields_ehorus_user_level_user'][1] = html_print_input_text_extended(
|
||||
'ehorus_user_level_user',
|
||||
$user_info['ehorus_user_level_user'],
|
||||
'',
|
||||
'',
|
||||
25,
|
||||
150,
|
||||
$view_mode,
|
||||
'',
|
||||
[
|
||||
'class' => 'input',
|
||||
'placeholder' => __('Pandora RC User'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->rowclass['captions_ehorus_user_level_pass'] = 'field_half_width';
|
||||
$userManagementTable->rowclass['fields_ehorus_user_level_pass'] = 'field_half_width';
|
||||
$userManagementTable->data['captions_ehorus_user_level_pass'][1] = __('Pandora RC Password');
|
||||
$userManagementTable->data['fields_ehorus_user_level_pass'][1] = html_print_input_text_extended(
|
||||
'ehorus_user_level_pass',
|
||||
io_output_password($user_info['ehorus_user_level_pass']),
|
||||
'',
|
||||
'',
|
||||
'25',
|
||||
'150',
|
||||
$view_mode,
|
||||
'',
|
||||
[
|
||||
'class' => 'input w100p',
|
||||
'placeholder' => __('Pandora RC Password'),
|
||||
],
|
||||
true,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Title for Language and Appearance.
|
||||
$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance'));
|
||||
// Language and color scheme.
|
||||
|
@ -789,6 +840,62 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
|||
true
|
||||
);
|
||||
|
||||
|
||||
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
|
||||
// Pandora ITSM user remote login.
|
||||
$table_ITSM = new StdClass();
|
||||
$table_ITSM->data = [];
|
||||
$table_ITSM->width = '100%';
|
||||
$table_ITSM->id = 'ITSM-remote-setup';
|
||||
$table_ITSM->class = 'white_box';
|
||||
$table_ITSM->size['name'] = '30%';
|
||||
$table_ITSM->style['name'] = 'font-weight: bold';
|
||||
|
||||
// Pandora ITSM user level authentication.
|
||||
// Title.
|
||||
$row = [];
|
||||
$row['control'] = '<p class="edit_user_labels">'.__('Pandora ITSM user configuration').': </p>';
|
||||
$table_ITSM->data['ITSM_user_level_conf'] = $row;
|
||||
|
||||
// Pandora ITSM pass.
|
||||
$row = [];
|
||||
$row['name'] = __('Token');
|
||||
$row['control'] = html_print_input_password(
|
||||
'integria_user_level_pass',
|
||||
io_output_password($user_info['integria_user_level_pass']),
|
||||
'',
|
||||
100,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table_ITSM->data['integria_user_level_pass'] = $row;
|
||||
|
||||
// Test.
|
||||
$ITSM_host = db_get_value('value', 'tconfig', 'token', 'ITSM_hostname');
|
||||
|
||||
$row = [];
|
||||
$row['name'] = __('Test');
|
||||
$row['control'] = html_print_button(
|
||||
__('Start'),
|
||||
'ITSM',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$row['control'] .= ' <span id="ITSM-spinner" class="invisible"> '.html_print_image('images/spinner.gif', true).'</span>';
|
||||
$row['control'] .= ' <span id="ITSM-success" class="invisible"> '.html_print_image('images/status_sets/default/severity_normal.png', true).'</span>';
|
||||
$row['control'] .= ' <span id="ITSM-failure" class="invisible"> '.html_print_image('images/status_sets/default/severity_critical.png', true).'</span>';
|
||||
$row['control'] .= '<span id="ITSM-message" class="invisible"></span>';
|
||||
$table_ITSM->data['ITSM_test'] = $row;
|
||||
|
||||
$userManagementTable->colspan['pandoraitsm'] = 2;
|
||||
$userManagementTable->data['pandoraitsm'] = html_print_table($table_ITSM, true);
|
||||
}
|
||||
|
||||
if (isset($CodeQRTable) === true || isset($apiTokenContent) === true) {
|
||||
// QR Code and API Token advice.
|
||||
$titleQr = '<span class="font-title-font">'.__('Contact details (QR)').'</span>';
|
||||
|
@ -814,20 +921,68 @@ $vcard_data['organization'] = io_safe_output(get_product_name());
|
|||
$vcard_data['url'] = ui_get_full_url('index.php');
|
||||
|
||||
$vcard_json = json_encode($vcard_data);
|
||||
|
||||
ui_require_javascript_file('ITSM');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
paint_vcard(
|
||||
<?php echo $vcard_json; ?>,
|
||||
"#qr_code_agent_view",
|
||||
128,
|
||||
128
|
||||
);
|
||||
<?php echo $vcard_json; ?>,
|
||||
"#qr_code_agent_view",
|
||||
128,
|
||||
128
|
||||
);
|
||||
|
||||
$('#button-ITSM').click(function() {
|
||||
var pass = $('input#password-integria_user_level_pass').val();
|
||||
var host = '<?php echo $ITSM_host; ?>';
|
||||
testConectionApi(pass, host);
|
||||
});
|
||||
|
||||
//Hint to change theme.
|
||||
$('#skin1').on("change", () => {
|
||||
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
|
||||
})
|
||||
|
||||
var ehorus_user_level_enabled =
|
||||
<?php
|
||||
if (isset($user_info['ehorus_user_level_enabled']) === true) {
|
||||
echo $user_info['ehorus_user_level_enabled'];
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
?>
|
||||
;
|
||||
var chk_ehorus_user_level_enabled = ehorus_user_level_enabled;
|
||||
|
||||
if (ehorus_user_level_enabled == 0) {
|
||||
$('#advanced-captions_ehorus_user_level_user').hide();
|
||||
$('#advanced-fields_ehorus_user_level_user').hide();
|
||||
$('#advanced-captions_ehorus_user_level_pass').hide();
|
||||
$('#advanced-fields_ehorus_user_level_pass').hide();
|
||||
} else {
|
||||
$('#advanced-captions_ehorus_user_level_user').show();
|
||||
$('#advanced-fields_ehorus_user_level_user').show();
|
||||
$('#advanced-captions_ehorus_user_level_pass').show();
|
||||
$('#advanced-fields_ehorus_user_level_pass').show();
|
||||
}
|
||||
|
||||
$('#checkbox-ehorus_user_level_enabled1').on('change', () =>{
|
||||
|
||||
if (chk_ehorus_user_level_enabled == 1) {
|
||||
$('#advanced-captions_ehorus_user_level_user').hide();
|
||||
$('#advanced-fields_ehorus_user_level_user').hide();
|
||||
$('#advanced-captions_ehorus_user_level_pass').hide();
|
||||
$('#advanced-fields_ehorus_user_level_pass').hide();
|
||||
chk_ehorus_user_level_enabled = 0;
|
||||
} else {
|
||||
$('#advanced-captions_ehorus_user_level_user').show();
|
||||
$('#advanced-fields_ehorus_user_level_user').show();
|
||||
$('#advanced-captions_ehorus_user_level_pass').show();
|
||||
$('#advanced-fields_ehorus_user_level_pass').show();
|
||||
chk_ehorus_user_level_enabled = 1;
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
|
@ -139,6 +139,14 @@ class Applications extends Wizard
|
|||
// Else: class not found pseudo exception.
|
||||
if ($classname_selected !== null) {
|
||||
$wiz = new $classname_selected($this->page);
|
||||
// Check if app has been migrated.
|
||||
if (method_exists($wiz, 'isMigrated') === true) {
|
||||
if ($wiz->isMigrated() === true) {
|
||||
ui_print_info_message(__('This legacy app has been migrated to new discovery 2.0 system'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $wiz->run();
|
||||
if (is_array($result) === true) {
|
||||
return $result;
|
||||
|
@ -157,6 +165,13 @@ class Applications extends Wizard
|
|||
foreach ($enterprise_classes as $classpath) {
|
||||
$classname = basename($classpath, '.app.php');
|
||||
$obj = new $classname();
|
||||
|
||||
if (method_exists($obj, 'isMigrated') === true) {
|
||||
if ($obj->isMigrated() === true) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$wiz_data[] = $obj->load();
|
||||
}
|
||||
|
||||
|
|
|
@ -160,6 +160,14 @@ class Cloud extends Wizard
|
|||
// Else: class not found pseudo exception.
|
||||
if ($classname_selected !== null) {
|
||||
$wiz = new $classname_selected($this->page);
|
||||
// Check if app has been migrated.
|
||||
if (method_exists($wiz, 'isMigrated') === true) {
|
||||
if ($wiz->isMigrated() === true) {
|
||||
ui_print_info_message(__('This legacy app has been migrated to new discovery 2.0 system'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $wiz->run();
|
||||
if (is_array($result) === true) {
|
||||
return $result;
|
||||
|
@ -178,6 +186,13 @@ class Cloud extends Wizard
|
|||
foreach ($enterprise_classes as $classpath) {
|
||||
$classname = basename($classpath, '.cloud.php');
|
||||
$obj = new $classname();
|
||||
// Check if legacy has been migrated.
|
||||
if (method_exists($obj, 'isMigrated') === true) {
|
||||
if ($obj->isMigrated() === true) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$wiz_data[] = $obj->load();
|
||||
}
|
||||
|
||||
|
|
|
@ -160,10 +160,9 @@ class DiscoveryTaskList extends HTML
|
|||
return $this->enableTask();
|
||||
}
|
||||
|
||||
if (enterprise_installed()) {
|
||||
// This check only applies to enterprise users.
|
||||
enterprise_hook('tasklist_checkrunning');
|
||||
enterprise_hook('tasklist_checkrunning');
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$ret = $this->showListConsoleTask();
|
||||
} else {
|
||||
$ret = false;
|
||||
|
@ -761,7 +760,7 @@ class DiscoveryTaskList extends HTML
|
|||
$data[3] = __('Manual');
|
||||
}
|
||||
|
||||
if ($task['id_recon_script'] == 0 || $ipam === true) {
|
||||
if (($task['id_recon_script'] == 0 || $ipam === true) && (int) $task['type'] !== DISCOVERY_EXTENSION) {
|
||||
$data[4] = ui_print_truncate_text($subnet, 50, true, true, true, '[…]');
|
||||
} else {
|
||||
$data[4] = '-';
|
||||
|
@ -998,7 +997,7 @@ class DiscoveryTaskList extends HTML
|
|||
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
|
||||
&& $task['type'] != DISCOVERY_CLOUD_AWS_S3
|
||||
) {
|
||||
if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== 15) {
|
||||
if (check_acl($config['id_user'], 0, 'MR') && (int) $task['type'] !== DISCOVERY_EXTENSION) {
|
||||
$data[9] .= '<a href="#" onclick="show_map('.$task['id_rt'].',\''.$task['name'].'\')">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/web@groups.svg',
|
||||
|
|
|
@ -37,6 +37,8 @@ class ManageExtensions extends HTML
|
|||
public $AJAXMethods = [
|
||||
'getExtensionsInstalled',
|
||||
'validateIniName',
|
||||
'loadMigrateModal',
|
||||
'migrateApp',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -216,6 +218,34 @@ class ManageExtensions extends HTML
|
|||
}
|
||||
}
|
||||
|
||||
// Check config migrated apps and create it if neccesary.
|
||||
$migratedAppsJson = db_get_value('value', 'tconfig', 'token', 'migrated_discovery_apps');
|
||||
if ($migratedAppsJson === false || empty($migratedAppsJson) === true) {
|
||||
// If does't exists it means is not migrated yet, insert it.
|
||||
$migratedApps = [
|
||||
'pandorafms.vmware' => 0,
|
||||
'pandorafms.mysql' => 0,
|
||||
'pandorafms.mssql' => 0,
|
||||
'pandorafms.oracle' => 0,
|
||||
'pandorafms.db2' => 0,
|
||||
'pandorafms.sap.deset' => 0,
|
||||
'pandorafms.gcp.ce' => 0,
|
||||
'pandorafms.aws.ec2' => 0,
|
||||
'pandorafms.aws.s3' => 0,
|
||||
'pandorafms.aws.rds' => 0,
|
||||
'pandorafms.azure.mc' => 0,
|
||||
];
|
||||
|
||||
$migratedAppsJson = json_encode($migratedApps);
|
||||
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
config_create_value(
|
||||
'migrated_discovery_apps',
|
||||
io_safe_input($migratedAppsJson)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->prepareBreadcrum(
|
||||
[
|
||||
[
|
||||
|
@ -283,6 +313,12 @@ class ManageExtensions extends HTML
|
|||
echo '<form id="uploadExtension" enctype="multipart/form-data" action="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=magextensions" method="POST">';
|
||||
html_print_input_hidden('upload_disco', 1);
|
||||
html_print_table($table);
|
||||
// Auxiliar div ant string for migrate modal.
|
||||
$modal = '<div id="migrate_modal" class="invisible"></div>';
|
||||
$modal .= '<div class="invisible" id="msg"></div>';
|
||||
|
||||
echo $modal;
|
||||
|
||||
echo '<div class="action-buttons w700px">';
|
||||
|
||||
echo '</div>';
|
||||
|
@ -297,6 +333,8 @@ class ManageExtensions extends HTML
|
|||
"Error": "'.__('Error').'",
|
||||
"Ok": "'.__('Ok').'",
|
||||
"Failed to upload extension": "'.__('Failed to upload extension').'",
|
||||
"Migrate": "'.__('Migrate').'",
|
||||
"migrationSuccess": "'.__('Migration Suceeded').'",
|
||||
};
|
||||
var url = "'.ui_get_full_url('ajax.php', false, false, false).'";
|
||||
</script>';
|
||||
|
@ -687,6 +725,7 @@ class ManageExtensions extends HTML
|
|||
);
|
||||
$data[$key]['actions'] .= html_print_input_hidden('short_name', $row['short_name'], true);
|
||||
$data[$key]['actions'] .= '</form>';
|
||||
|
||||
if ($this->checkFolderConsole($row['short_name']) === true) {
|
||||
$data[$key]['actions'] .= '<form name="grupo" method="post" class="rowPair table_action_buttons" action="'.$this->url.'&action=sync_server">';
|
||||
$data[$key]['actions'] .= html_print_input_image(
|
||||
|
@ -715,6 +754,24 @@ class ManageExtensions extends HTML
|
|||
],
|
||||
);
|
||||
}
|
||||
|
||||
$migrationHash = $this->canMigrate($row['short_name']);
|
||||
if ($migrationHash !== false && empty($migrationHash) !== true) {
|
||||
// Migrate button.
|
||||
$data[$key]['actions'] .= html_print_input_image(
|
||||
'button_migrate-'.$row['short_name'],
|
||||
'images/reset.png',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'onclick' => 'show_migration_form(\''.$row['short_name'].'\',\''.$migrationHash.'\')',
|
||||
'title' => __('Migrate old discovery tasks.'),
|
||||
'alt' => __('Migrate old discovery tasks.'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data) === true) {
|
||||
|
@ -1053,4 +1110,384 @@ class ManageExtensions extends HTML
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the discovery app can be migrated to .disco system.
|
||||
* If app is migrated or is not in .ini file, it cannot be migrated.
|
||||
*
|
||||
* @param string $shortName Short name of the discovery app.
|
||||
*
|
||||
* @return string App hash, false in case hash doesnt exist on ini file, or is already migraeted..
|
||||
*/
|
||||
private function canMigrate(string $shortName='')
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (empty($shortName) === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 1. Check if app is already migrated:
|
||||
// Get migrated Discovery Apps from config.
|
||||
$migratedAppsJson = db_get_value('value', 'tconfig', 'token', 'migrated_discovery_apps');
|
||||
|
||||
if ($migratedAppsJson === false || empty($migratedAppsJson) === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Decode JSON migrated apps.
|
||||
$migrateApps = json_decode(io_safe_output($migratedAppsJson), true);
|
||||
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check app migrated.
|
||||
if (array_key_exists($shortName, $migrateApps)) {
|
||||
if (empty($migrateApps[$shortName]) === false && (bool) $migrateApps[$shortName] === true) {
|
||||
// Already migrated.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. If app not migrated yet, check DiscoveryApplicationsMigrateCodes.ini
|
||||
// Path to the INI file
|
||||
$filePath = $config['homedir'].'/extras/discovery/DiscoveryApplicationsMigrateCodes.ini';
|
||||
|
||||
// Parse the INI file.
|
||||
$migrationCodes = parse_ini_file($filePath, true);
|
||||
|
||||
if ($migrationCodes === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check shortname in ini file.
|
||||
if (array_key_exists($shortName, $migrationCodes) === false) {
|
||||
return false;
|
||||
} else {
|
||||
return $migrationCodes[$shortName];
|
||||
}
|
||||
|
||||
// All checks ok, discovery app can be migrated.
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints html for migrate modal
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function loadMigrateModal()
|
||||
{
|
||||
$shortname = get_parameter('shortname', null);
|
||||
$hash = get_parameter('hash', null);
|
||||
|
||||
$form = [
|
||||
'action' => '#',
|
||||
'id' => 'modal_migrate_form',
|
||||
'onsubmit' => 'return false;',
|
||||
'class' => 'modal',
|
||||
'name' => 'migrate_form',
|
||||
];
|
||||
|
||||
$inputs = [];
|
||||
$migrateMessage = __(
|
||||
'All ‘legacy‘ tasks for this application will be migrated to the new ‘.disco’ package system. All configurations and executions will be managed with the new system. This process will not be reversible.</br></br>'
|
||||
);
|
||||
$migrateMessage .= _('Please check the migration code for the application before proceeding.');
|
||||
|
||||
$inputs[] = [
|
||||
'wrapper' => 'div',
|
||||
'block_id' => 'div_migrate_message',
|
||||
'class' => 'hole flex-row flex-items-center w98p',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
[
|
||||
'label' => $migrateMessage,
|
||||
'arguments' => [
|
||||
'class' => 'first_lbl w98p',
|
||||
'name' => 'lbl_migrate_message',
|
||||
'id' => 'lbl_migrate_message',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Applicattion hash'),
|
||||
'id' => 'div-hash',
|
||||
'arguments' => [
|
||||
'name' => 'hash',
|
||||
'type' => 'text',
|
||||
'value' => $hash,
|
||||
'return' => true,
|
||||
],
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
'block_id' => 'migrate_buttons',
|
||||
'class' => 'flex-row flex-items-center w98p',
|
||||
'direct' => 1,
|
||||
'block_content' => [
|
||||
[
|
||||
'arguments' => [
|
||||
'name' => 'cancel',
|
||||
'label' => __('Cancel'),
|
||||
'type' => 'button',
|
||||
'attributes' => [
|
||||
'icon' => 'left',
|
||||
'mode' => 'secondary',
|
||||
'class' => 'sub cancel float-left',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'arguments' => [
|
||||
'name' => 'migrate',
|
||||
'label' => __('Migrate'),
|
||||
'type' => 'submit',
|
||||
'attributes' => [
|
||||
'icon' => 'wand',
|
||||
'class' => 'sub wand float-right',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$spinner = '<div id="migration-spinner" class="invisible spinner-fixed"></div>';
|
||||
|
||||
$migration_form = $this->printForm(
|
||||
[
|
||||
'form' => $form,
|
||||
'inputs' => $inputs,
|
||||
],
|
||||
true,
|
||||
);
|
||||
|
||||
echo $migration_form.$spinner;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Migrate app to new .disco system
|
||||
*
|
||||
* @return true if success, false in case of error.
|
||||
*/
|
||||
public function migrateApp()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$hash = get_parameter('hash', false);
|
||||
$shortName = get_parameter('shortName', false);
|
||||
|
||||
if ($hash === false || $shortName === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 1. Gets md5
|
||||
try {
|
||||
$console_md5 = $this->calculateDirectoryMD5($shortName, false);
|
||||
$server_md5 = $this->calculateDirectoryMD5($shortName, true);
|
||||
} catch (Exception $e) {
|
||||
$return = [
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($console_md5 === false || $server_md5 === false) {
|
||||
$return = [
|
||||
'error' => __('Error calculating app MD5'),
|
||||
];
|
||||
echo json_encode($return);
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. Checks MD5
|
||||
if ($hash === $console_md5 && $hash === $server_md5) {
|
||||
// Init migration script.
|
||||
$return = $this->executeMigrationScript($shortName);
|
||||
} else {
|
||||
$return = [
|
||||
'error' => __('App hash does not match.'),
|
||||
];
|
||||
}
|
||||
|
||||
// Add shotrname to return for showing messages.
|
||||
$return['shortname'] = $shortName;
|
||||
|
||||
echo \json_encode($return);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculates directory MD% and saves it into array
|
||||
*
|
||||
* @param string $shortName Shorname of app.
|
||||
* @param boolean $server If true, perform checks into server folder.
|
||||
*
|
||||
* @return $md5 Array of md5 of filess.
|
||||
*/
|
||||
private function calculateDirectoryMD5($shortName, $server)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$md5List = [];
|
||||
|
||||
$serverPath = $config['remote_config'].'/discovery/'.$shortName;
|
||||
$consolePath = $config['homedir'].'/'.$this->path.'/'.$shortName;
|
||||
|
||||
if ($server === true) {
|
||||
$directory = $serverPath;
|
||||
} else {
|
||||
$directory = $consolePath;
|
||||
}
|
||||
|
||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if ($file->isFile()) {
|
||||
$md5List[] = md5_file($file->getPathname());
|
||||
}
|
||||
}
|
||||
|
||||
if ($server === true) {
|
||||
$console_ini = $consolePath.'/discovery_definition.ini';
|
||||
$logo = $consolePath.'/logo.png';
|
||||
|
||||
if (file_exists($console_ini)) {
|
||||
$md5List[] = md5_file($console_ini);
|
||||
}
|
||||
|
||||
if (file_exists($logo)) {
|
||||
$md5List[] = md5_file($logo);
|
||||
}
|
||||
}
|
||||
|
||||
sort($md5List);
|
||||
$concatenatedChecksums = implode('', $md5List);
|
||||
return md5($concatenatedChecksums);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Executed migration script for app
|
||||
*
|
||||
* @param string $shortName Shortname of the app.
|
||||
*
|
||||
* @return true on success, false in case of error.
|
||||
*/
|
||||
private function executeMigrationScript(string $shortName)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$dblock = db_get_lock('migrate-working');
|
||||
// Try to get a lock from DB.
|
||||
if ($dblock !== 1) {
|
||||
// Locked!
|
||||
return false;
|
||||
}
|
||||
|
||||
$scriptName = preg_replace('/^pandorafms\.(\w+\.?\w*)$/m', 'migrate.$1.sql', $shortName);
|
||||
|
||||
$script_path = $config['homedir'].'/extras/discovery/migration_scripts/'.$scriptName;
|
||||
if (file_exists($script_path) === false) {
|
||||
$return = [
|
||||
'error' => __('Migration script '.$scriptName.' could not be found'),
|
||||
];
|
||||
} else {
|
||||
try {
|
||||
$res = db_process_file($script_path, false);
|
||||
} catch (\Exception $e) {
|
||||
$return = [
|
||||
'error' => $e->getMessage(),
|
||||
];
|
||||
} finally {
|
||||
db_release_lock('migrate_working');
|
||||
}
|
||||
|
||||
if ($res === true) {
|
||||
$migrateAppsJson = io_safe_output(
|
||||
db_get_value(
|
||||
'value',
|
||||
'tconfig',
|
||||
'token',
|
||||
'migrated_discovery_apps'
|
||||
)
|
||||
);
|
||||
|
||||
$migrateApps = json_decode(
|
||||
$migrateAppsJson,
|
||||
true
|
||||
);
|
||||
|
||||
$migrateApps[$shortName] = 1;
|
||||
|
||||
$migratedAppsJson = json_encode($migrateApps);
|
||||
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
config_update_value(
|
||||
'migrated_discovery_apps',
|
||||
$migratedAppsJson
|
||||
);
|
||||
} else {
|
||||
$return = [
|
||||
'error' => __('Error decoding migrated apps json.'),
|
||||
];
|
||||
}
|
||||
|
||||
$return = [
|
||||
'result' => __('App migrated successfully'),
|
||||
'shortName' => $shortName,
|
||||
];
|
||||
} else {
|
||||
$return = [
|
||||
'error' => __('Error migrating app'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if legacy app has been migrated.
|
||||
*
|
||||
* @param string $shortName Shorn name of the app.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
static public function isMigrated($shortName)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$migrateAppsJson = io_safe_output(
|
||||
db_get_value(
|
||||
'value',
|
||||
'tconfig',
|
||||
'token',
|
||||
'migrated_discovery_apps'
|
||||
)
|
||||
);
|
||||
|
||||
$migratedApps = json_decode($migrateAppsJson, true);
|
||||
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (array_key_exists($shortName, $migratedApps) === true && empty($migratedApps[$shortName] === false)) {
|
||||
return (bool) $migratedApps[$shortName];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 845 B |
Before Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 895 B |
Before Width: | Height: | Size: 4.5 KiB |
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="748px" height="142px" viewBox="0 0 748 142" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
|
||||
<title>Integria IMS</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Integria-IMS" fill-rule="nonzero">
|
||||
<path d="M71.81,-2.81979301e-15 C43.0949491,-0.325771451 17.0111429,16.6781107 5.72147618,43.0827259 C-5.56819051,69.4873411 0.159601761,100.092722 20.23398,120.627561 C40.3083582,141.1624 70.7759943,147.582689 97.4298109,136.894643 C124.083628,126.206596 141.674581,100.515055 142,71.8 C142.444347,32.5906412 111.019353,0.444829018 71.81,-2.81979301e-15 Z" id="Path" fill="#F65803"></path>
|
||||
<circle id="Oval" fill="#FFFFFF" cx="43.51" cy="49.89" r="13.76"></circle>
|
||||
<path d="M43.51,71.66 L43.26,71.66 C41.5736669,71.6393594 39.8955597,71.4212055 38.26,71.01 L38,98.36 C37.9839995,99.6878244 38.4968596,100.967474 39.4254669,101.916717 C40.3540742,102.86596 41.6221446,103.406817 42.95,103.42 L43,103.42 C44.3260824,103.42 45.597852,102.893216 46.5355339,101.955534 C47.4732158,101.017852 48,99.7460824 48,98.42 L48.31,71.06 C46.7379912,71.4417108 45.1275989,71.6430099 43.51,71.66 L43.51,71.66 Z" id="Path" fill="#FFFFFF"></path>
|
||||
<path d="M94.41,48.12 C88.3631135,41.9016532 80.0832535,38.3557132 71.41,38.27 C68.4333361,38.2395201 65.4662912,38.6129237 62.59,39.38 C64.2200628,42.3331841 65.1313519,45.6288987 65.25,49 C67.208565,48.4885287 69.2257979,48.2363746 71.25,48.25 C77.2810939,48.3159047 83.0384799,50.7772152 87.2533639,55.0915157 C91.468248,59.4058163 93.7946914,65.2190086 93.72,71.25 L93.42,99 C93.4039912,100.326111 93.9154828,101.604257 94.841933,102.553212 C95.7683831,103.502167 97.0338871,104.044182 98.36,104.06 L98.42,104.06 C101.181424,104.06 103.42,101.821424 103.42,99.06 L103.74,71.33 C103.850133,62.6586006 100.491174,54.3026057 94.41,48.12 Z" id="Path" fill="#FFFFFF"></path>
|
||||
<path d="M171.72,67.81 L171.84,21.08 C171.8139,20.1443474 172.175822,19.2395415 172.84,18.58 C173.507689,17.9157505 174.418525,17.5543075 175.36,17.58 L182.36,17.58 C183.315282,17.5557708 184.239991,17.9176872 184.925039,18.583915 C185.610086,19.2501428 185.997615,20.1644142 186,21.12 L185.88,67.77 C185.889979,68.7136623 185.501469,69.6177631 184.81,70.26 C184.132306,70.9151221 183.222463,71.2747439 182.28,71.26 L175.28,71.26 C174.343006,71.2771853 173.438469,70.9168123 172.77,70.26 C172.079224,69.6357031 171.69568,68.7407667 171.72,67.81 L171.72,67.81 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M196.6,67.79 L196.72,21.15 C196.703942,20.2132116 197.064148,19.3090953 197.72,18.64 C198.367817,17.9706027 199.269041,17.6072059 200.2,17.64 L211.2,17.64 C212.220464,17.6786713 213.201721,18.0431383 214,18.68 C214.954333,19.3581671 215.769164,20.2137401 216.4,21.2 L238.94,56.06 L239,21.18 C238.972558,20.2529263 239.335335,19.3568684 240,18.71 C240.660878,18.0478442 241.564774,17.6862858 242.5,17.71 L249,17.71 C249.930306,17.697074 250.827049,18.0572118 251.49,18.71 C252.168239,19.3808021 252.531442,20.3069699 252.49,21.26 L252.37,67.91 C252.393322,68.8422107 252.031614,69.7428638 251.37,70.4 C250.707806,71.0601595 249.804802,71.4213611 248.87,71.4 L236.43,71.4 C235.352189,71.3759533 234.306677,71.0274494 233.43,70.4 C232.448952,69.7519451 231.61994,68.8990519 231,67.9 L210.36,35.7 L210.28,67.85 C210.302135,68.7819962 209.940608,69.6821976 209.28,70.34 C208.624212,71.0036445 207.722642,71.3657208 206.79,71.34 L200.2,71.34 C199.262799,71.3583203 198.357839,70.9977785 197.69,70.34 C196.973178,69.6889199 196.575278,68.758054 196.6,67.79 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M258.64,24.83 L258.64,21.31 C258.611761,20.3566005 258.979489,19.4340518 259.655831,18.7614981 C260.332174,18.0889444 261.256774,17.7264056 262.21,17.76 L309.75,17.88 C310.703399,17.8517613 311.625948,18.2194887 312.298502,18.8958315 C312.971056,19.5721742 313.333594,20.4967742 313.3,21.45 L313.3,25 C313.332066,25.9455402 312.969867,26.8619037 312.3,27.53 C311.623087,28.1989008 310.701164,28.5604392 309.75,28.53 L293.04,28.53 L292.93,68.21 C292.958015,69.1313139 292.594703,70.0214284 291.93,70.66 C291.264603,71.3152777 290.363755,71.675617 289.43,71.6604873 L282.35,71.6604873 C281.420522,71.668505 280.52541,71.3090224 279.86,70.66 C279.197933,70.0155113 278.835379,69.1236302 278.86,68.2 L278.96,28.52 L262.25,28.52 C261.299851,28.544612 260.38013,28.1839373 259.7,27.52 C258.965201,26.8249172 258.576895,25.8394983 258.64,24.83 L258.64,24.83 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M319.3,68 L319.42,21.35 C319.400371,20.4122847 319.78681,19.5118088 320.48,18.88 C321.149716,18.2251023 322.053417,17.8650622 322.99,17.8795531 L366.19,17.99 C367.130438,17.9859488 368.031045,18.3693397 368.68,19.05 C369.337779,19.717839 369.69832,20.6227989 369.68,21.56 L369.68,25.09 C369.677352,26.0235632 369.303953,26.9178376 368.641949,27.5760911 C367.979945,28.2343446 367.083563,28.6026559 366.15,28.6 L333.52,28.51 L333.52,39.42 L361.62,39.49 C362.553563,39.4926484 363.447838,39.8660468 364.106091,40.528051 C364.764345,41.1900553 365.132656,42.0864368 365.13,43.02 L365.13,46.54 C365.156933,47.4728584 364.79467,48.3748937 364.13,49.03 C363.469788,49.6931635 362.565439,50.054903 361.63,50.03 L333.47,50 L333.47,61.06 L366.03,61.14 C366.94651,61.1221856 367.829599,61.4841076 368.47,62.14 C369.129526,62.7903112 369.491355,63.6840288 369.47,64.61 L369.47,68.21 C369.482675,69.150132 369.102026,70.0528141 368.42,70.7 C367.748458,71.3583482 366.840234,71.7187547 365.9,71.7 L322.9,71.59 C321.962384,71.6106136 321.056564,71.2497292 320.39,70.59 C319.672391,69.9226941 319.2755,68.9796223 319.3,68 L319.3,68 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M380.06,65.38 C375.64,60.9 373.44,54.0566667 373.459865,44.85 C373.48,35.6433333 375.813333,28.83 380.46,24.41 C385.126667,19.99 392.08,17.7933333 401.32,17.82 L409.68,17.82 C414.926078,17.759622 420.087688,19.1434315 424.6,21.82 C429.026667,24.4866667 431.233333,27.7833333 431.22,31.71 C431.335739,32.9177383 430.840442,34.1034513 429.9,34.87 C429.175254,35.4543658 428.280429,35.7877321 427.35,35.82 L422.9,35.82 C420.76,35.82 419.053333,34.59 417.78,32.13 C416.506667,29.67 413.363333,28.44 408.35,28.44 L401.68,28.44 C396.206667,28.44 392.493333,29.6033333 390.54,31.93 C388.54,34.28 387.6,38.59 387.54,44.93 C387.48,51.27 388.38,55.58 390.13,57.99 C391.88,60.4 394.99,61.62 399.48,61.63 L407.17,61.63 C411.17,61.63 414.043333,60.87 415.79,59.35 C417.596876,57.6376908 418.574219,55.2271554 418.47,52.74 L410,52.74 C409.064789,52.7427064 408.167392,52.3710205 407.507977,51.7078475 C406.848561,51.0446746 406.48198,50.1451807 406.49,49.21 L406.49,46.23 C406.472533,45.2988546 406.833351,44.400416 407.49,43.74 C408.146465,43.0773742 409.047574,42.7154829 409.98,42.74 L428.79,42.79 C429.722858,42.763067 430.624894,43.1253302 431.28,43.79 C431.943164,44.4502124 432.304903,45.354561 432.28,46.29 L432.28,50.44 C432.28,57.44 430.17,62.8133333 425.95,66.56 C421.73,70.3066667 415.566667,72.17 407.46,72.1501593 L399.03,72.1501593 C390.803333,72.1233333 384.48,69.8666667 380.06,65.38 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M495.8,70.48 C495.8,71.55 495.16,72.09 493.89,72.0801364 L484.89,72.0801364 C483.778533,72.0359158 482.700008,71.6902348 481.77,71.08 C480.713597,70.4696085 479.821334,69.6116631 479.17,68.58 L472.83,58.58 C470.223333,54.48 467.056667,52.4233333 463.33,52.41 L454.18,52.41 L454.18,68.52 C454.203322,69.4522107 453.841614,70.3528638 453.18,71.01 C452.517806,71.6701595 451.614802,72.0313611 450.68,72.01 L443.68,72.01 C442.743006,72.0271853 441.838469,71.6668123 441.17,71.01 C440.503774,70.351816 440.141481,69.446082 440.17,68.51 L440.29,21.86 C440.269803,20.9254087 440.630829,20.0228444 441.29,19.36 C441.927395,18.6758743 442.825092,18.2942622 443.76,18.3095318 L474.67,18.39 C480.39,18.39 485.076667,19.94 488.73,23.04 C492.383333,26.14 494.203333,30.29 494.19,35.49 C494.063333,42.7033333 489.3,47.2066667 479.9,49 C481.484067,49.6135252 482.904514,50.5855906 484.05,51.84 C485.674847,53.654962 487.137133,55.6091383 488.42,57.68 L495.21,68.52 C495.577221,69.1093518 495.780866,69.7858671 495.8,70.48 L495.8,70.48 Z M454.21,41.74 L470.21,41.74 C472.559199,41.8094724 474.88989,41.3048899 477,40.27 C478.881403,39.380915 480.044647,37.4487472 479.95,35.37 C480.055656,33.2834473 478.890265,31.3398116 477,30.45 C474.897868,29.3847581 472.566149,28.8524806 470.21,28.9 L454.21,28.9 L454.21,41.74 Z" id="Shape" fill="#282828"></path>
|
||||
<path d="M502,68.66 L502.12,21.93 C502.106969,20.9868821 502.48745,20.0809738 503.17,19.43 C503.826139,18.7489431 504.734359,18.3690106 505.68,18.3797664 L512.68,18.3797664 C513.640691,18.3689866 514.564824,18.7478276 515.241347,19.4300041 C515.91787,20.1121806 516.289008,21.039434 516.27,22 L516.15,68.65 C516.159979,69.5936623 515.771469,70.4977631 515.08,71.14 C514.402306,71.7951221 513.492463,72.1547439 512.55,72.14 L505.55,72.14 C504.613006,72.1571853 503.708469,71.7968123 503.04,71.14 C502.344797,70.5069922 501.964251,69.5995358 502,68.66 Z" id="Path" fill="#282828"></path>
|
||||
<path d="M522.48,68.71 L532,33.06 C534.566667,23.3466667 542.87,18.5 556.91,18.5199384 L577.11,18.57 C577.996001,18.5541891 578.841559,18.9402048 579.41,19.62 C580.006346,20.2917863 580.330809,21.1617749 580.320262,22.06 L580.2,68.86 C580.23056,69.7817714 579.866841,70.6728823 579.2,71.31 C578.525984,71.9645342 577.619419,72.3242822 576.68,72.31 L569.68,72.31 C568.735914,72.3337643 567.822711,71.9728143 567.15,71.31 C566.480133,70.6419037 566.117934,69.7255402 566.15,68.78 L566.15,59.33 L539.51,59.27 L536.98,68.7 C536.727496,69.7139708 536.129991,70.6084614 535.29,71.23 C534.499985,71.8626048 533.521963,72.214411 532.51,72.23 L525.13,72.23 C524.459988,72.2878818 523.794912,72.0733836 523.284971,71.6349475 C522.775031,71.1965113 522.463235,70.571116 522.42,69.9 C522.400467,69.5023251 522.420566,69.1036934 522.48,68.71 Z M542.24,48.64 L566.11,48.7 L566.11,29.14 L555.43,29.14 C550.779549,29.0158892 546.663838,32.130706 545.52,36.64 L542.24,48.64 Z" id="Shape" fill="#282828"></path>
|
||||
<path d="M590.9,68.88 L591,22.16 C590.986969,21.2168821 591.36745,20.3109738 592.05,19.66 C592.709218,18.9774003 593.621131,18.5974368 594.57,18.6096981 L601.57,18.6096981 C602.520183,18.6019547 603.433929,18.9751711 604.106773,19.6461353 C604.779617,20.3170996 605.155387,21.2297986 605.150057,22.18 L605,68.85 C605.028154,69.7830757 604.665702,70.6855811 604,71.34 C603.323524,71.9970099 602.412865,72.3569544 601.47,72.34 L594.47,72.34 C593.533006,72.3571853 592.628469,71.9968123 591.96,71.34 C591.263951,70.7144482 590.876621,69.8155493 590.9,68.88 Z" id="Path" fill="#F65803"></path>
|
||||
<path d="M615.78,68.8 L615.9,22.3 C615.875203,21.340928 616.235317,20.4118317 616.9,19.72 C617.547817,19.0506027 618.449041,18.6872059 619.38,18.72 L634.63,18.72 C635.64758,18.7359883 636.627509,19.1074416 637.4,19.77 C638.233003,20.4058524 638.845164,21.2873645 639.15,22.29 L650.15,54.29 L661.29,22.29 C661.608719,21.2943995 662.226826,20.4213666 663.06,19.79 C663.836411,19.140258 664.817595,18.7860398 665.83,18.79 L681.08,18.79 C682.009485,18.7723021 682.901791,19.1547191 683.53,19.84 C684.192419,20.5373141 684.551934,21.4684571 684.53,22.43 L684.38,69 C684.412024,69.9543928 684.050454,70.8800124 683.38,71.56 C682.723535,72.2226258 681.822426,72.5845171 680.89,72.56 L674.1,72.56 C673.168855,72.5774675 672.270416,72.2166488 671.61,71.56 C670.941001,70.8749956 670.579921,69.9470191 670.61,68.99 L670.7,32.39 L657.36,69.13 C656.988416,70.0838348 656.349536,70.9102123 655.52,71.51 C654.734577,72.1438986 653.759218,72.4960135 652.75,72.51 L647.39,72.51 C646.387527,72.4923334 645.419667,72.140384 644.64,71.51 C643.818452,70.8953887 643.179069,70.0693751 642.79,69.12 L629.7,32.23 L629.6,68.83 C629.634802,69.787823 629.273023,70.7175951 628.6,71.4 C627.944212,72.0636445 627.042642,72.4257208 626.11,72.4 L619.37,72.4 C618.432799,72.4183203 617.527839,72.0577785 616.86,71.4 C616.143427,70.7285743 615.750037,69.7815254 615.78,68.8 L615.78,68.8 Z" id="Path" fill="#F65803"></path>
|
||||
<path d="M692.08,58.84 C691.973218,57.6336327 692.466829,56.4519567 693.4,55.68 C694.12014,55.0807712 695.014494,54.7300443 695.95,54.68 L700.41,54.68 C702.663333,54.68 704.373333,55.91 705.54,58.37 C706.7,60.82 709.34,62.05 713.43,62.06 L726.55,62.35 C730.943333,62.35 733.143333,60.92 733.15,58.06 C733.15,55.8933333 730.483333,54.1766667 725.15,52.91 C722.75,52.33 720.15,51.75 717.21,51.18 C714.27,50.61 711.44,49.9 708.58,49.05 C705.87988,48.2547647 703.245348,47.2517704 700.7,46.05 C698.399488,44.9682289 696.403219,43.3327311 694.89,41.29 C693.392835,39.2306421 692.616105,36.7352654 692.68,34.19 C692.68,29.17 694.473333,25.3066667 698.06,22.6 C701.646667,19.8933333 707.796667,18.56 716.51,18.6 L726.02,18.85 C730.924684,18.8052317 735.735418,20.1956173 739.86,22.85 C743.96,25.5166667 746.003333,28.8133333 745.99,32.74 C746.104216,33.9511338 745.614157,35.1407428 744.68,35.92 C743.972856,36.5214361 743.087125,36.8729163 742.16,36.92 L737.7,36.92 C735.46,36.92 733.75,35.68 732.58,33.22 C731.41,30.76 728.78,29.52 724.68,29.51 L713.41,29.25 C709.01,29.25 706.806667,30.68 706.8,33.54 C706.8,35.12 708.19,36.41 710.97,37.41 C714.24125,38.5440576 717.594334,39.426624 721,40.05 C725,40.8233333 729,41.7533333 733,42.84 C736.752403,43.796252 740.228609,45.6182636 743.15,48.16 C745.84998,50.4490644 747.377502,53.8309112 747.31,57.37 C747.31,62.39 745.506667,66.2533333 741.9,68.96 C738.293333,71.6666667 732.153333,73 723.48,72.96 L712.12,72.71 C707.211841,72.7573081 702.397191,71.3667955 698.27,68.71 C694.143333,66.0833333 692.08,62.7933333 692.08,58.84 Z" id="Path" fill="#F65803"></path>
|
||||
<path d="M176,111.05 L176,123.81 L171.69,123.81 L171.69,92.61 L183.04,92.61 C188.81,92.61 192.68,96.61 192.68,101.85 C192.68,107.09 188.81,111.05 183.04,111.05 L176,111.05 Z M182.25,107.17 C185.99,107.17 188.25,105.1 188.25,101.89 C188.25,98.68 185.96,96.48 182.25,96.48 L176,96.48 L176,107.17 L182.25,107.17 Z" id="Shape" fill="#888888"></path>
|
||||
<path d="M203.53,111.71 L209.25,110.87 C210.53,110.69 210.88,110.03 210.88,109.28 C210.88,107.22 209.51,105.5 206.3,105.5 C205.094424,105.418003 203.906525,105.824303 203.003696,106.627445 C202.100867,107.430587 201.558975,108.563079 201.5,109.77 L197.5,108.84 C197.94,104.84 201.6,101.98 206.17,101.98 C212.51,101.98 214.98,105.59 214.98,109.72 L214.98,120.33 C214.964645,121.495374 215.051646,122.659846 215.24,123.81 L211.19,123.81 C211.04052,122.881154 210.976918,121.940514 211,121 C209.510823,123.298723 206.916404,124.637778 204.18,124.52 C199.87,124.52 197.09,121.52 197.09,118.18 C197.1,114.35 199.88,112.23 203.53,111.71 Z M210.88,114.71 L210.88,113.71 L204.41,114.71 C202.65,114.98 201.33,115.99 201.33,117.88 C201.363095,118.748086 201.746619,119.565693 202.392987,120.146105 C203.039355,120.726517 203.893369,121.020169 204.76,120.96 C208.15,121 210.88,119.36 210.88,114.74 L210.88,114.71 Z" id="Shape" fill="#888888"></path>
|
||||
<path d="M227.77,123.81 L223.64,123.81 L223.64,102.64 L227.64,102.64 L227.64,105.64 C228.983384,103.304982 231.507823,101.904226 234.2,102 C239.26,102 241.77,105.66 241.77,110.37 L241.77,123.79 L237.63,123.79 L237.63,111.09 C237.63,108.09 236.4,105.76 232.7,105.76 C229.44,105.76 227.77,108.36 227.77,111.57 L227.77,123.81 Z" id="Path" fill="#888888"></path>
|
||||
<path d="M265.39,120.59 C264.123446,123.01383 261.57259,124.489821 258.84,124.38 C252.63,124.38 248.84,119.45 248.84,113.16 C248.84,107.16 252.84,102.07 258.84,102.07 C262.58,102.07 264.6,103.92 265.31,105.63 L265.31,92 L269.4,92 L269.4,119.94 C269.393999,121.249913 269.467467,122.558984 269.62,123.86 L265.62,123.86 C265.474248,122.913625 265.400702,121.957533 265.4,121 L265.39,120.59 Z M259.23,120.73 C263.02,120.73 265.35,117.43 265.35,113.07 C265.35,108.71 263.06,105.72 259.28,105.72 C255.5,105.72 253,108.8 253,113.16 C253,117.52 255.27,120.73 259.23,120.73 L259.23,120.73 Z" id="Shape" fill="#888888"></path>
|
||||
<path d="M298.53,113.2 C298.53,119.67 294.04,124.47 287.7,124.47 C281.36,124.47 276.88,119.67 276.88,113.2 C276.88,106.73 281.36,102 287.7,102 C294.04,102 298.53,106.78 298.53,113.2 Z M294.3,113.2 C294.3,108.32 291.22,105.68 287.7,105.68 C284.18,105.68 281.1,108.32 281.1,113.2 C281.1,118.08 284.18,120.77 287.7,120.77 C291.22,120.77 294.3,118.13 294.3,113.2 L294.3,113.2 Z" id="Shape" fill="#888888"></path>
|
||||
<path d="M317.75,106.82 C317.153912,106.733389 316.552347,106.689942 315.95,106.69 C312.47,106.69 310.14,108.54 310.14,113.2 L310.14,123.81 L306,123.81 L306,102.64 L310.05,102.64 L310.05,106.34 C311.132122,103.823292 313.652596,102.233087 316.39,102.34 C316.846155,102.34552 317.301059,102.389004 317.75,102.47 L317.75,106.82 Z" id="Path" fill="#888888"></path>
|
||||
<path d="M329.46,111.71 L335.18,110.87 C336.45,110.69 336.81,110.03 336.81,109.28 C336.81,107.22 335.44,105.5 332.23,105.5 C331.023761,105.415203 329.834309,105.820526 328.930841,106.624236 C328.027373,107.427945 327.486272,108.562094 327.43,109.77 L323.43,108.84 C323.87,104.84 327.52,101.98 332.1,101.98 C338.44,101.98 340.9,105.59 340.9,109.72 L340.9,120.33 C340.886006,121.495732 340.976367,122.660377 341.17,123.81 L337.17,123.81 C337.007383,122.865645 336.933727,121.908116 336.95,120.95 C335.459417,123.247172 332.865953,124.585734 330.13,124.47 C325.81,124.47 323.04,121.47 323.04,118.13 C323,114.35 325.8,112.23 329.46,111.71 Z M336.81,114.71 L336.81,113.71 L330.34,114.71 C328.58,114.98 327.26,115.99 327.26,117.88 C327.293095,118.748086 327.676619,119.565693 328.322987,120.146105 C328.969355,120.726517 329.823369,121.020169 330.69,120.96 C334.08,121 336.81,119.36 336.81,114.74 L336.81,114.71 Z" id="Shape" fill="#888888"></path>
|
||||
<polygon id="Path" fill="#888888" points="363.2 123.81 363.2 92.61 382.2 92.61 382.2 96.61 367.52 96.61 367.52 106.61 380.81 106.61 380.81 110.61 367.52 110.61 367.52 123.73"></polygon>
|
||||
<polygon id="Path" fill="#888888" points="419.09 123.81 419.09 99.52 408.44 123.81 404.44 123.81 393.92 99.52 393.92 123.81 389.65 123.81 389.65 92.61 395.5 92.61 406.5 118 417.59 92.61 423.36 92.61 423.36 123.81"></polygon>
|
||||
<path d="M449.49,101.06 C448.982092,97.8538566 446.131216,95.5515584 442.89,95.73 C439.37,95.73 436.89,98.02 436.89,100.92 C436.89,103.17 438.25,104.92 440.89,105.46 L445.56,106.46 C450.75,107.6 453.66,110.86 453.66,115.22 C453.66,120.06 449.52,124.46 442.87,124.46 C435.35,124.46 431.78,119.62 431.21,115.17 L435.35,113.85 C435.453196,115.729635 436.299659,117.49107 437.702796,118.746015 C439.105932,120.000959 440.950542,120.64638 442.83,120.54 C447.14,120.54 449.26,118.3 449.26,115.54 C449.26,113.29 447.71,111.36 444.59,110.7 L440.15,109.7 C435.7,108.7 432.53,105.83 432.53,101.16 C432.53,96.28 437.07,91.88 442.83,91.88 C449.83,91.88 452.69,96.23 453.39,99.62 L449.49,101.06 Z" id="Path" fill="#888888"></path>
|
||||
<polygon id="Path" fill="#888888" points="475 123.81 475 92.61 479.4 92.61 479.4 123.81"></polygon>
|
||||
<polygon id="Path" fill="#888888" points="500.7 96.61 500.7 123.81 496.39 123.81 496.39 96.61 486 96.61 486 92.61 511.17 92.61 511.17 96.61"></polygon>
|
||||
<path d="M533.75,101.06 C533.242092,97.8538566 530.391216,95.5515584 527.15,95.73 C523.63,95.73 521.15,98.02 521.15,100.92 C521.15,103.17 522.51,104.92 525.15,105.46 L529.82,106.46 C535.01,107.6 537.91,110.86 537.91,115.22 C537.91,120.06 533.78,124.46 527.13,124.46 C519.61,124.46 516.04,119.62 515.47,115.17 L519.61,113.85 C519.713196,115.729635 520.559659,117.49107 521.962796,118.746015 C523.365932,120.000959 525.210542,120.64638 527.09,120.54 C531.4,120.54 533.51,118.3 533.51,115.54 C533.51,113.29 531.97,111.36 528.85,110.7 L524.4,109.7 C519.96,108.7 516.79,105.83 516.79,101.16 C516.79,96.28 521.32,91.88 527.09,91.88 C534.09,91.88 536.95,96.23 537.65,99.62 L533.75,101.06 Z" id="Path" fill="#888888"></path>
|
||||
<polygon id="Path" fill="#888888" points="575.46 123.81 575.46 99.52 564.81 123.81 560.81 123.81 550.29 99.52 550.29 123.81 546 123.81 546 92.61 551.85 92.61 562.85 118 574 92.61 579.77 92.61 579.77 123.81"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 852 B |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>ITSM icon</title>
|
||||
<g id="ITSM-icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M13,0 C13.5522847,-1.01453063e-16 14,0.44771525 14,1 L14,6 L9.73239368,5.99992752 C9.90258972,6.29411727 10,6.63568294 10,7 C10,8.1045695 9.1045695,9 8,9 C6.8954305,9 6,8.1045695 6,7 C6,6.63568294 6.09741028,6.29411727 6.26760632,5.99992752 L2,6 L2,3 L2.64668367,2.35331633 C2.7130102,2.2869898 2.78443878,2.21556122 2.86096939,2.13903061 L4.78954082,0.210459184 C4.85841837,0.141581633 4.92857143,0.0714285714 5,0 L13,0 Z M14,10 L14,14 C14,15.1045695 13.1045695,16 12,16 L4,16 C2.8954305,16 2,15.1045695 2,14 L2,10 L6.26790938,9.99940385 C6.09752593,10.2937119 6,10.6354668 6,11 C6,12.1045695 6.8954305,13 8,13 C9.1045695,13 10,12.1045695 10,11 C10,10.6354668 9.90247407,10.2937119 9.73209062,9.99940385 L14,10 Z" id="Path-30" fill="#95A3BF"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>os@svg</title>
|
||||
<g id="os" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,0 C15.5228475,0 20,4.4771525 20,10 C20,15.5228475 15.5228475,20 10,20 C4.4771525,20 0,15.5228475 0,10 C0,4.4771525 4.4771525,0 10,0 Z M6.15259698,6 C4.79331529,6 3.76139537,6.31928651 3.05683722,6.95785953 C2.35227907,7.59643255 2,8.60958751 2,9.99732441 C2,11.3850613 2.35227907,12.3991081 3.05683722,13.0394649 C3.76139537,13.6798216 4.79331529,14 6.15259698,14 C7.51187868,14 8.54208016,13.6807135 9.24320144,13.0421405 C9.94775959,12.4 10.3000387,11.3850613 10.3000387,9.99732441 C10.3000387,8.60958751 9.94861881,7.59643255 9.2457791,6.95785953 C8.54293938,6.31928651 7.51187868,6 6.15259698,6 Z M13.7468746,6.11772575 C12.5474073,6.11772575 11.7019375,6.31125975 11.2104653,6.69832776 C10.718993,7.08539576 10.4732569,7.63745819 10.4732569,8.35451505 C10.4732569,8.74336678 10.5755037,9.08138239 10.7799974,9.36856187 C10.9844911,9.65574136 11.2517077,9.88138239 11.5816471,10.0454849 C11.9115865,10.2095875 12.273317,10.3522854 12.6668385,10.4735786 C13.06036,10.5948718 13.4564592,10.6956522 13.855136,10.7759197 C14.2538128,10.8561873 14.6181209,10.9373467 14.9480603,11.019398 C15.6869872,11.1977703 16.0564506,11.4421405 16.0564506,11.7525084 C16.0564506,12.1627648 15.7540061,12.367893 15.1491172,12.367893 L13.3447609,12.3304348 C12.7811144,12.3304348 12.4185247,12.1556299 12.2569919,11.8060201 C12.095459,11.4564103 11.8600335,11.2816054 11.5507153,11.2816054 L10.9372342,11.2816054 C10.8238175,11.2816054 10.706964,11.3270903 10.5866735,11.4180602 C10.4663831,11.5090301 10.4062379,11.6597547 10.4062379,11.8702341 C10.4062379,12.4338907 10.6897796,12.9039019 11.256863,13.2802676 C11.8239464,13.6566332 12.4597672,13.8448161 13.1643253,13.8448161 L14.7263823,13.8769231 C15.9224127,13.8769231 16.7670232,13.6833891 17.2602139,13.2963211 C17.7534046,12.9092531 18,12.3571906 18,11.6401338 C18,11.1157191 17.8083946,10.6778149 17.4251837,10.3264214 C17.0419728,9.97502787 16.5754178,9.72263099 16.0255188,9.56923077 C15.4756197,9.41583055 14.9282983,9.28472687 14.3835546,9.17591973 C13.8388108,9.0671126 13.3748335,8.94136009 12.9916226,8.79866221 C12.6084117,8.65596433 12.4168063,8.4722408 12.4168063,8.24749164 C12.4168063,7.83723523 12.7192508,7.63210702 13.3241397,7.63210702 L14.8758861,7.66421405 C15.4395326,7.66421405 15.8021223,7.83991081 15.9636551,8.19130435 C16.125188,8.54269788 16.3606135,8.71839465 16.6699317,8.71839465 L17.2834128,8.71839465 C17.3933926,8.71839465 17.5085277,8.67201784 17.6288181,8.57926421 C17.7491086,8.48651059 17.8092538,8.33489409 17.8092538,8.12441472 C17.8092538,7.56075808 17.5265713,7.09074693 16.9612063,6.71438127 C16.3958414,6.33801561 15.7608798,6.14983278 15.0563217,6.14983278 Z M6.15259698,7.44481605 C6.92761095,7.44481605 7.48867981,7.65886288 7.83580358,8.08695652 C8.18292735,8.51505017 8.35648924,9.15273133 8.35648924,10 C8.35648924,10.8472687 8.18292735,11.484058 7.83580358,11.9103679 C7.48867981,12.3366778 6.92761095,12.5498328 6.15259698,12.5498328 C5.37758302,12.5498328 4.81565494,12.3366778 4.46681273,11.9103679 C4.11797053,11.484058 3.94354943,10.8472687 3.94354943,10 C3.94354943,9.15273133 4.11797053,8.51505017 4.46681273,8.08695652 C4.81565494,7.65886288 5.37758302,7.44481605 6.15259698,7.44481605 Z" id="Oval-2" fill="#3F3F3F"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.5 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>os version@svg</title>
|
||||
<g id="os-version" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,5 C12.7614237,5 15,7.23857625 15,10 C15,12.7614237 12.7614237,15 10,15 C7.23857625,15 5,12.7614237 5,10 C5,7.23857625 7.23857625,5 10,5 Z M8.00124224,8 C7.34616977,8 6.84886128,8.15964326 6.50931677,8.47892977 C6.16977226,8.79821628 6,9.30479376 6,9.99866221 C6,10.6925307 6.16977226,11.1995541 6.50931677,11.5197324 C6.84886128,11.8399108 7.34616977,12 8.00124224,12 C8.6563147,12 9.15279503,11.8403567 9.49068323,11.5210702 C9.83022774,11.2 10,10.6925307 10,9.99866221 C10,9.30479376 9.83064182,8.79821628 9.49192547,8.47892977 C9.15320911,8.15964326 8.6563147,8 8.00124224,8 Z M11.7596741,8 C11.127857,8 10.6825074,8.09977011 10.4236253,8.29931034 C10.1647432,8.49885057 10.0353021,8.78344828 10.0353021,9.15310345 C10.0353021,9.35356322 10.0891604,9.52781609 10.1968771,9.67586207 C10.3045938,9.82390805 10.4453496,9.94022989 10.6191446,10.0248276 C10.7929396,10.1094253 10.9834804,10.1829885 11.1907671,10.2455172 C11.3980539,10.308046 11.6066983,10.36 11.8167006,10.4013793 C12.0267029,10.4427586 12.2186015,10.4845977 12.3923965,10.5268966 C12.7816248,10.6188506 12.976239,10.7448276 12.976239,10.9048276 C12.976239,11.1163218 12.8169269,11.222069 12.4983028,11.222069 L11.5478615,11.2027586 C11.2509618,11.2027586 11.0599683,11.1126437 10.9748812,10.9324138 C10.8897941,10.7521839 10.7657841,10.662069 10.6028513,10.662069 L10.2797013,10.662069 C10.2199593,10.662069 10.1584069,10.6855172 10.0950441,10.7324138 C10.0316814,10.7793103 10,10.8570115 10,10.9655172 C10,11.256092 10.1493551,11.4983908 10.4480652,11.6924138 C10.7467753,11.8864368 11.0816927,11.9834483 11.4528174,11.9834483 L12.275628,12 C12.9056348,12 13.3505318,11.9002299 13.6103191,11.7006897 C13.8701064,11.5011494 14,11.2165517 14,10.8468966 C14,10.5765517 13.8990722,10.3508046 13.6972166,10.1696552 C13.4953609,9.98850575 13.249604,9.8583908 12.9599457,9.77931034 C12.6702874,9.70022989 12.3819869,9.63264368 12.0950441,9.57655172 C11.8081014,9.52045977 11.5637022,9.45563218 11.3618466,9.38206897 C11.1599909,9.30850575 11.0590631,9.2137931 11.0590631,9.09793103 C11.0590631,8.88643678 11.2183752,8.78068966 11.5369993,8.78068966 L12.3543788,8.79724138 C12.6512786,8.79724138 12.842272,8.88781609 12.9273591,9.06896552 C13.0124463,9.25011494 13.1364562,9.34068966 13.299389,9.34068966 L13.622539,9.34068966 C13.6804707,9.34068966 13.7411179,9.31678161 13.8044807,9.26896552 C13.8678434,9.22114943 13.8995248,9.14298851 13.8995248,9.03448276 C13.8995248,8.74390805 13.7506223,8.5016092 13.4528174,8.30758621 C13.1550124,8.11356322 12.8205476,8.01655172 12.4494229,8.01655172 Z M8.00124224,8.72240803 C8.3747412,8.72240803 8.64513458,8.82943144 8.81242236,9.04347826 C8.97971014,9.25752508 9.06335404,9.57636566 9.06335404,10 C9.06335404,10.4236343 8.97971014,10.742029 8.81242236,10.9551839 C8.64513458,11.1683389 8.3747412,11.2749164 8.00124224,11.2749164 C7.62774327,11.2749164 7.35693582,11.1683389 7.18881988,10.9551839 C7.02070393,10.742029 6.93664596,10.4236343 6.93664596,10 C6.93664596,9.57636566 7.02070393,9.25752508 7.18881988,9.04347826 C7.35693582,8.82943144 7.62774327,8.72240803 8.00124224,8.72240803 Z" id="Oval-2" fill="#3F3F3F"></path>
|
||||
<g id="Group" transform="translate(10, 0.9972)" fill="#3F3F3F" fill-rule="nonzero">
|
||||
<path d="M0.239098823,-0.999498516 C0.367920916,-1.0006481 0.46086938,-1.00001443 0.545625818,-0.996148978 C5.85594931,-0.753608542 10,3.63723482 10,9.00280962 C10,11.7312591 8.9006895,14.287461 6.98753217,16.1564431 C5.94922318,17.1707773 5.2256829,17.9806061 4.82608058,18.5663616 C4.51483939,19.0225933 3.89267968,19.1401314 3.43644798,18.8288902 C2.98021627,18.517649 2.86267824,17.8954893 3.17391942,17.4392576 C3.66277305,16.7226734 4.46505413,15.8247132 5.5899319,14.7258091 C7.12171888,13.2293915 8,11.1871442 8,9.00280962 C8,4.70099732 4.69132984,1.19528432 0.454374182,1.00176822 C0.441581214,1.00118392 0.425875842,1.0007459 0.407122626,1.00045278 L0.204431552,1.00096401 L0.173047576,1.00133321 C0.143860257,1.00169127 0.124402045,1.00192997 0.10826377,1.00210401 L0,1.00280962 C-0.55228475,1.00280962 -1,0.555094372 -1,0.00280962244 C-1,-0.549475127 -0.55228475,-0.997190378 0,-0.997190378 L0.0986592653,-0.99792167 L0.14911528,-0.998523592 C0.192941176,-0.999044088 0.192941176,-0.999044088 0.239098823,-0.999498516 Z" id="Oval"></path>
|
||||
<path d="M4,14.0028096 C4.55228475,14.0028096 5,14.4505249 5,15.0028096 L5,17.0028096 L7,17.0028096 C7.51283584,17.0028096 7.93550716,17.3888498 7.99327227,17.8861885 L8,18.0028096 C8,18.5550944 7.55228475,19.0028096 7,19.0028096 L4,19.0028096 C3.44771525,19.0028096 3,18.5550944 3,18.0028096 L3,15.0028096 C3,14.4505249 3.44771525,14.0028096 4,14.0028096 Z" id="Path-87"></path>
|
||||
</g>
|
||||
<g id="Group" transform="translate(5.5, 9.9986) scale(-1, -1) translate(-5.5, -9.9986)translate(1, 0.9972)" fill="#3F3F3F" fill-rule="nonzero">
|
||||
<path d="M5.93830089,14.3635692 C6.30852501,13.9537491 6.94087583,13.9216502 7.35069596,14.2918743 C7.7605161,14.6620984 7.79261501,15.2944492 7.42239089,15.7042693 C7.28217928,15.8594768 7.13715,16.01028 6.98753217,16.1564431 C5.94922318,17.1707773 5.2256829,17.9806061 4.82608058,18.5663616 C4.51483939,19.0225933 3.89267968,19.1401314 3.43644798,18.8288902 C2.98021627,18.517649 2.86267824,17.8954893 3.17391942,17.4392576 C3.66277305,16.7226734 4.46505413,15.8247132 5.5899319,14.7258091 C5.7097935,14.6087152 5.82597871,14.4879044 5.93830089,14.3635692 Z M8.943119,7.56724451 C9.49480124,7.54145411 9.96293532,7.96777368 9.98872572,8.51945593 C9.99623585,8.68010519 10,8.84125436 10,9.00293537 C10,10.3523848 9.73199051,11.6661445 9.21843823,12.8844407 C9.00391256,13.3933584 8.41744587,13.6320103 7.90852821,13.4174846 C7.39961056,13.2029589 7.1609587,12.6164922 7.37548437,12.1075746 C7.78585079,11.1340654 7.99998666,10.0843244 8,9.00292303 C8,8.87239659 7.99696323,8.74238768 7.99090758,8.61285123 C7.96511718,8.06116899 8.39143675,7.59303491 8.943119,7.56724451 Z M5.35650642,1.65292436 C5.7304364,1.24648271 6.3630526,1.2201268 6.76949425,1.59405678 C7.86955054,2.60611849 8.7319506,3.85799548 9.28762134,5.25683726 C9.4915113,5.77010846 9.24070825,6.35148245 8.72743704,6.55537241 C8.21416584,6.75926237 7.63279185,6.50845932 7.42890189,5.99518811 C6.98434699,4.87606861 6.29458082,3.8747904 5.41537399,3.06591219 C5.00893235,2.6919822 4.98257643,2.05936601 5.35650642,1.65292436 Z M0.239098823,-0.999498516 C0.367920916,-1.0006481 0.46086938,-1.00001443 0.545625818,-0.996148978 C1.70508629,-0.943192496 2.82882174,-0.691139109 3.87925052,-0.254949612 C4.38930817,-0.0431486814 4.63109302,0.542033323 4.41929209,1.05209098 C4.20749116,1.56214863 3.62230915,1.80393348 3.1122515,1.59213255 C2.27594636,1.24485768 1.38082518,1.04408237 0.454374182,1.00176822 C0.441581214,1.00118392 0.425875842,1.0007459 0.407122626,1.00045278 L0.204431552,1.00096401 L0.173047576,1.00133321 C0.143860257,1.00169127 0.124402045,1.00192997 0.10826377,1.00210401 L0,1.00280962 C-0.55228475,1.00280962 -1,0.555094372 -1,0.00280962244 C-1,-0.549475127 -0.55228475,-0.997190378 0,-0.997190378 L0.0986592653,-0.99792167 L0.14911528,-0.998523592 C0.192941176,-0.999044088 0.192941176,-0.999044088 0.239098823,-0.999498516 Z" id="Oval"></path>
|
||||
<path d="M4,14.0028096 C4.55228475,14.0028096 5,14.4505249 5,15.0028096 L5,17.0028096 L7,17.0028096 C7.51283584,17.0028096 7.93550716,17.3888498 7.99327227,17.8861885 L8,18.0028096 C8,18.5550944 7.55228475,19.0028096 7,19.0028096 L4,19.0028096 C3.44771525,19.0028096 3,18.5550944 3,18.0028096 L3,15.0028096 C3,14.4505249 3.44771525,14.0028096 4,14.0028096 Z" id="Path-87"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 329 KiB |
After Width: | Height: | Size: 314 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 6.8 KiB |
|
@ -2059,7 +2059,7 @@ if ($table_events) {
|
|||
include_once 'include/functions_graph.php';
|
||||
|
||||
$id_agente = (int) get_parameter('id_agente');
|
||||
$all_events_24h = (int) get_parameter('all_events_24h');
|
||||
$all_events_24h = (int) get_parameter('all_events_24h', 0);
|
||||
|
||||
// Fix: for tag functionality groups have to be all user_groups
|
||||
// (propagate ACL funct!).
|
||||
|
|
|
@ -80,6 +80,7 @@ if (check_login()) {
|
|||
$save_monitor_filter = get_parameter('save_monitor_filter', 0);
|
||||
$update_monitor_filter = get_parameter('update_monitor_filter', 0);
|
||||
$delete_monitor_filter = get_parameter('delete_monitor_filter', 0);
|
||||
$get_cluster_module_detail = (bool) get_parameter('get_cluster_module_detail', 0);
|
||||
|
||||
if ($get_agent_modules_json_by_name === true) {
|
||||
$agent_name = get_parameter('agent_name');
|
||||
|
@ -742,13 +743,6 @@ if (check_login()) {
|
|||
include_once $config['homedir'].'/include/functions_tags.php';
|
||||
include_once $config['homedir'].'/include/functions_clippy.php';
|
||||
|
||||
|
||||
// Disable module edition in cluster module list.
|
||||
$cluster_view = (bool) preg_match(
|
||||
'/operation\/cluster\/cluster/',
|
||||
$_SERVER['HTTP_REFERER']
|
||||
);
|
||||
|
||||
$agent_a = (bool) check_acl($config['id_user'], 0, 'AR');
|
||||
$agent_w = (bool) check_acl($config['id_user'], 0, 'AW');
|
||||
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');
|
||||
|
@ -758,7 +752,19 @@ if (check_login()) {
|
|||
$cluster_list = (int) get_parameter('cluster_list');
|
||||
$sortField = (string) get_parameter('sort_field');
|
||||
$sort = (string) get_parameter('sort', 'none');
|
||||
|
||||
// Disable module edition in cluster module list.
|
||||
$cluster_view = false;
|
||||
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent;
|
||||
if ((int) agents_get_os($id_agent) === CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId($id_agent);
|
||||
$url = sprintf(
|
||||
'index.php?sec=estado&sec2=operation/cluster/cluster&op=view&id=%s',
|
||||
$cluster->id()
|
||||
);
|
||||
$cluster_view = true;
|
||||
}
|
||||
|
||||
$selectTypeUp = false;
|
||||
$selectTypeDown = false;
|
||||
$selectNameUp = false;
|
||||
|
@ -1248,7 +1254,6 @@ if (check_login()) {
|
|||
$graph_type = return_graphtype($module['id_tipo_modulo']);
|
||||
$nombre_tipo_modulo = modules_get_moduletype_name($module['id_tipo_modulo']);
|
||||
$handle = 'stat'.$nombre_tipo_modulo.'_'.$module['id_agente_modulo'];
|
||||
$url = 'include/procesos.php?agente='.$module['id_agente_modulo'];
|
||||
$win_handle = dechex(crc32($module['id_agente_modulo'].$module['nombre']));
|
||||
// Show events for boolean modules by default.
|
||||
$draw_events = ($graph_type === 'boolean') ? 1 : 0;
|
||||
|
@ -1314,6 +1319,23 @@ if (check_login()) {
|
|||
true
|
||||
);
|
||||
|
||||
if ($cluster_view === true) {
|
||||
$graphButtons[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'javascript: show_cluster_module_detail('.$cluster->id().', \''.$modules_get_agentmodule_name.'\')',
|
||||
'content' => html_print_image(
|
||||
'images/plus@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Module cluster detail'),
|
||||
'class' => 'main_menu_icon forced_title',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$data[8] = html_print_div(
|
||||
[
|
||||
'class' => 'table_action_buttons',
|
||||
|
@ -1340,7 +1362,7 @@ if (check_login()) {
|
|||
|
||||
$moduleActionButtons[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&id_agente_modulo='.$module['id_agente_modulo'].'&refr=60'.$additionalLinkAction.'"',
|
||||
'href' => $url.'&id_agente_modulo='.$module['id_agente_modulo'].'&refr=60'.$additionalLinkAction.'"',
|
||||
'content' => html_print_image(
|
||||
$imgaction,
|
||||
true,
|
||||
|
@ -1756,14 +1778,75 @@ if (check_login()) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($get_cluster_module_detail === true) {
|
||||
global $config;
|
||||
$data = [];
|
||||
|
||||
$cluster_id = get_parameter('cluster_id', 0);
|
||||
$cluster = new PandoraFMS\Cluster($cluster_id);
|
||||
$modules_ids = $cluster->getIdsModulesInvolved();
|
||||
$module_name = get_parameter('module_name', '');
|
||||
|
||||
try {
|
||||
$column_names = [
|
||||
__('Module name'),
|
||||
__('Agent'),
|
||||
__('Last status change'),
|
||||
__('Status'),
|
||||
];
|
||||
|
||||
$columns = [
|
||||
'nombre',
|
||||
'alias',
|
||||
'last_status_change',
|
||||
'estado',
|
||||
];
|
||||
|
||||
$tableId = 'ModuleByStatus';
|
||||
// Load datatables user interface.
|
||||
ui_print_datatable(
|
||||
[
|
||||
'id' => $tableId,
|
||||
'class' => 'info_table align-left-important',
|
||||
'style' => 'width: 100%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/module',
|
||||
'ajax_data' => [
|
||||
'get_data_ModulesByStatus' => 1,
|
||||
'table_id' => $tableId,
|
||||
'module_name' => $module_name,
|
||||
'modules_ids' => $modules_ids,
|
||||
'search' => '',
|
||||
],
|
||||
'default_pagination' => 5,
|
||||
'order' => [
|
||||
'field' => 'last_status_change',
|
||||
'direction' => 'desc',
|
||||
],
|
||||
'csv' => 0,
|
||||
'dom_elements' => 'frtip',
|
||||
'no_move_elements_to_action' => true,
|
||||
'mini_pagination' => true,
|
||||
]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_data_ModulesByStatus === true) {
|
||||
global $config;
|
||||
$data = [];
|
||||
|
||||
$table_id = get_parameter('table_id', '');
|
||||
$search = get_parameter('search', '');
|
||||
$module_name = get_parameter('module_name', '');
|
||||
$status = get_parameter('status', '');
|
||||
$start = get_parameter('start', 0);
|
||||
$modules_ids = get_parameter('modules_ids', []);
|
||||
$length = get_parameter('length', $config['block_size']);
|
||||
// There is a limit of (2^32)^2 (18446744073709551615) rows in a MyISAM table, show for show all use max nrows.
|
||||
$length = ($length != '-1') ? $length : '18446744073709551615';
|
||||
|
@ -1771,12 +1854,11 @@ if (check_login()) {
|
|||
$nodes = get_parameter('nodes', 0);
|
||||
$disabled_modules = (bool) get_parameter('disabled_modules', false);
|
||||
|
||||
$where = '';
|
||||
$where = '1=1';
|
||||
$recordsTotal = 0;
|
||||
|
||||
|
||||
if (empty($search) === false) {
|
||||
$where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
|
||||
$where .= ' AND tagente_modulo.nombre LIKE "%%'.$search.'%%"';
|
||||
}
|
||||
|
||||
if (str_contains($status, '6') === true) {
|
||||
|
@ -1791,16 +1873,32 @@ if (check_login()) {
|
|||
$status = implode(',', $expl);
|
||||
}
|
||||
|
||||
$where .= sprintf(
|
||||
'tagente_estado.estado IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
$status,
|
||||
);
|
||||
if (empty($status) === false) {
|
||||
$where .= sprintf(
|
||||
' AND tagente_estado.estado IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
$status,
|
||||
);
|
||||
}
|
||||
|
||||
if ($disabled_modules === false) {
|
||||
$where .= ' AND tagente_modulo.disabled = 0';
|
||||
}
|
||||
|
||||
if (empty($modules_ids) === false && is_array($modules_ids) === true) {
|
||||
$where .= sprintf(
|
||||
' AND tagente_modulo.id_agente_modulo IN (%s)',
|
||||
implode(',', $modules_ids)
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($module_name) === false) {
|
||||
$where .= sprintf(
|
||||
' AND tagente_modulo.nombre = "%s"',
|
||||
$module_name
|
||||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$order_by = '';
|
||||
switch ($order['field']) {
|
||||
|
|
|
@ -0,0 +1,376 @@
|
|||
<?php
|
||||
/**
|
||||
* Update manager client historical updates backend.
|
||||
*
|
||||
* @category Update Manager
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false
|
||||
&& (bool) is_user_admin($config['id_user']) === false
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Setup Management'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$method = get_parameter('method', null);
|
||||
|
||||
if ($method === 'deleteOS') {
|
||||
global $config;
|
||||
|
||||
$id_os = get_parameter('id_os', null);
|
||||
|
||||
if (empty($id_os) === true || $id_os < 16) {
|
||||
echo json_encode(['deleted' => false]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (db_process_sql_delete(
|
||||
'tconfig_os',
|
||||
['id_os' => $id_os]
|
||||
) === false
|
||||
) {
|
||||
echo json_encode(['deleted' => false]);
|
||||
} else {
|
||||
echo json_encode(['deleted' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($method === 'deleteOSVersion') {
|
||||
global $config;
|
||||
|
||||
$id_os_version = get_parameter('id_os_version', null);
|
||||
|
||||
if (empty($id_os_version) === true || $id_os_version < 1) {
|
||||
echo json_encode(['deleted' => false]);
|
||||
}
|
||||
|
||||
if (db_process_sql_delete(
|
||||
'tconfig_os_version',
|
||||
['id_os_version' => $id_os_version]
|
||||
) === false
|
||||
) {
|
||||
echo json_encode(['deleted' => false]);
|
||||
} else {
|
||||
echo json_encode(['deleted' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($method === 'drawOSTable') {
|
||||
// Datatables offset, limit and order.
|
||||
$filter = get_parameter('filter', []);
|
||||
$start = get_parameter('start', 0);
|
||||
$length = get_parameter('length', $config['block_size']);
|
||||
$orderBy = get_datatable_order(true);
|
||||
|
||||
$sort_field = $orderBy['field'];
|
||||
$order = $orderBy['direction'];
|
||||
|
||||
$pagination = '';
|
||||
|
||||
$pagination = sprintf(
|
||||
' LIMIT %d OFFSET %d ',
|
||||
$length,
|
||||
$start
|
||||
);
|
||||
|
||||
try {
|
||||
ob_start();
|
||||
|
||||
$fields = ['*'];
|
||||
$sql_filters = [];
|
||||
|
||||
if (isset($filter['free_search']) === true
|
||||
&& empty($filter['free_search']) === false
|
||||
) {
|
||||
$sql_filters[] = sprintf(
|
||||
' AND (`name` like "%%%s%%" OR `description` like "%%%s%%") ',
|
||||
$filter['free_search'],
|
||||
$filter['free_search']
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($order) === true) {
|
||||
$dir = 'asc';
|
||||
if ($order == 'desc') {
|
||||
$dir = 'desc';
|
||||
};
|
||||
|
||||
if (in_array(
|
||||
$sort_field,
|
||||
[
|
||||
'id_os',
|
||||
'name',
|
||||
'description',
|
||||
]
|
||||
) === true
|
||||
) {
|
||||
$order_by = sprintf(
|
||||
'ORDER BY `%s` %s',
|
||||
$sort_field,
|
||||
$dir
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve data.
|
||||
$sql = sprintf(
|
||||
'SELECT %s
|
||||
FROM tconfig_os
|
||||
WHERE 1=1
|
||||
%s
|
||||
%s
|
||||
%s',
|
||||
join(',', $fields),
|
||||
join(' ', $sql_filters),
|
||||
$order_by,
|
||||
$pagination
|
||||
);
|
||||
|
||||
$count_sql = sprintf(
|
||||
'SELECT id_os
|
||||
FROM tconfig_os
|
||||
WHERE 1=1
|
||||
%s',
|
||||
join(' ', $sql_filters)
|
||||
);
|
||||
|
||||
$return = db_get_all_rows_sql($sql);
|
||||
if ($return === false) {
|
||||
$data = [];
|
||||
} else {
|
||||
$data = $return;
|
||||
}
|
||||
|
||||
$data = array_map(
|
||||
function ($item) {
|
||||
$item['icon_img'] = ui_print_os_icon($item['id_os'], false, true);
|
||||
|
||||
if (is_management_allowed() === true) {
|
||||
if (is_metaconsole() === true) {
|
||||
$osNameUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=os_manage&action=edit&tab2=list&id_os='.$item['id_os'];
|
||||
} else {
|
||||
$osNameUrl = 'index.php?sec=gsetup&sec2=godmode/setup/os&action=edit&tab=manage_os&id_os='.$item['id_os'];
|
||||
}
|
||||
|
||||
$item['name'] = html_print_anchor(
|
||||
[
|
||||
'href' => $osNameUrl,
|
||||
'content' => $item['name'],
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$item['name'] = $item['name'];
|
||||
}
|
||||
|
||||
$item['description'] = ui_print_truncate_text(
|
||||
$item['description'],
|
||||
'description',
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
if (is_management_allowed() === true) {
|
||||
$item['enable_delete'] = false;
|
||||
|
||||
if ($item['id_os'] > 16) {
|
||||
$item['enable_delete'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
},
|
||||
$data
|
||||
);
|
||||
|
||||
// Retrieve counter.
|
||||
$count = db_get_value('count(*)', '('.$count_sql.') t');
|
||||
|
||||
// Datatables format: RecordsTotal && recordsfiltered.
|
||||
echo json_encode(
|
||||
[
|
||||
'data' => $data,
|
||||
'recordsTotal' => $count,
|
||||
'recordsFiltered' => $count,
|
||||
]
|
||||
);
|
||||
// Capture output.
|
||||
$response = ob_get_clean();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If not valid, show error with issue.
|
||||
json_decode($response);
|
||||
if (json_last_error() == JSON_ERROR_NONE) {
|
||||
// If valid dump.
|
||||
echo $response;
|
||||
} else {
|
||||
echo json_encode(
|
||||
['error' => $response]
|
||||
);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($method === 'drawOSVersionTable') {
|
||||
// Datatables offset, limit and order.
|
||||
$filter = get_parameter('filter', []);
|
||||
$start = get_parameter('start', 0);
|
||||
$length = get_parameter('length', $config['block_size']);
|
||||
$orderBy = get_datatable_order(true);
|
||||
|
||||
$sort_field = $orderBy['field'];
|
||||
$order = $orderBy['direction'];
|
||||
|
||||
$pagination = '';
|
||||
|
||||
$pagination = sprintf(
|
||||
' LIMIT %d OFFSET %d ',
|
||||
$length,
|
||||
$start
|
||||
);
|
||||
|
||||
try {
|
||||
ob_start();
|
||||
|
||||
$fields = ['*'];
|
||||
$sql_filters = [];
|
||||
|
||||
if (isset($filter['free_search']) === true
|
||||
&& empty($filter['free_search']) === false
|
||||
) {
|
||||
$sql_filters[] = sprintf(
|
||||
' AND (`product` like "%%%s%%" OR `version` like "%%%s%%") ',
|
||||
$filter['free_search'],
|
||||
$filter['free_search']
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($order) === true) {
|
||||
$dir = 'asc';
|
||||
if ($order == 'desc') {
|
||||
$dir = 'desc';
|
||||
};
|
||||
|
||||
if (in_array(
|
||||
$sort_field,
|
||||
[
|
||||
'product',
|
||||
'version',
|
||||
'end_of_support',
|
||||
]
|
||||
) === true
|
||||
) {
|
||||
$order_by = sprintf(
|
||||
'ORDER BY `%s` %s',
|
||||
$sort_field,
|
||||
$dir
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve data.
|
||||
$sql = sprintf(
|
||||
'SELECT %s
|
||||
FROM tconfig_os_version
|
||||
WHERE 1=1
|
||||
%s
|
||||
%s
|
||||
%s',
|
||||
join(',', $fields),
|
||||
join(' ', $sql_filters),
|
||||
$order_by,
|
||||
$pagination
|
||||
);
|
||||
|
||||
$count_sql = sprintf(
|
||||
'SELECT id_os_version
|
||||
FROM tconfig_os_version
|
||||
WHERE 1=1
|
||||
%s',
|
||||
join(' ', $sql_filters)
|
||||
);
|
||||
|
||||
$return = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($return === false) {
|
||||
$data = [];
|
||||
} else {
|
||||
// Format end of life date.
|
||||
$return = array_map(
|
||||
function ($item) {
|
||||
$date_string = date_w_fixed_tz($item['end_of_support']);
|
||||
$timestamp = strtotime($date_string);
|
||||
$date_without_time = date('F j, Y', $timestamp);
|
||||
$item['end_of_support'] = $date_without_time;
|
||||
return $item;
|
||||
},
|
||||
$return
|
||||
);
|
||||
|
||||
$data = $return;
|
||||
}
|
||||
|
||||
// Retrieve counter.
|
||||
$count = db_get_value('count(*)', '('.$count_sql.') t');
|
||||
|
||||
// Datatables format: RecordsTotal && recordsfiltered.
|
||||
echo json_encode(
|
||||
[
|
||||
'data' => $data,
|
||||
'recordsTotal' => $count,
|
||||
'recordsFiltered' => $count,
|
||||
]
|
||||
);
|
||||
// Capture output.
|
||||
$response = ob_get_clean();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If not valid, show error with issue.
|
||||
json_decode($response);
|
||||
if (json_last_error() == JSON_ERROR_NONE) {
|
||||
// If valid dump.
|
||||
echo $response;
|
||||
} else {
|
||||
echo json_encode(
|
||||
['error' => $response]
|
||||
);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
|
@ -256,14 +256,6 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||
}
|
||||
break;
|
||||
|
||||
// Remote Integria.
|
||||
case 'integria':
|
||||
if (enterprise_hook('remote_integria_process_user_login', [$login, $pass]) === false) {
|
||||
$config['auth_error'] = 'User not found in database or incorrect password';
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
// Unknown authentication method.
|
||||
default:
|
||||
$config['auth_error'] = 'User not found in database or incorrect password';
|
||||
|
|
|
@ -200,9 +200,7 @@ class ConsoleSupervisor
|
|||
* NOTIF.CRON.CONFIGURED
|
||||
*/
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$this->checkCronRunning();
|
||||
}
|
||||
$this->checkCronRunning();
|
||||
|
||||
/*
|
||||
* Check if instance is registered.
|
||||
|
@ -501,9 +499,7 @@ class ConsoleSupervisor
|
|||
* NOTIF.CRON.CONFIGURED
|
||||
*/
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$this->checkCronRunning();
|
||||
}
|
||||
$this->checkCronRunning();
|
||||
|
||||
/*
|
||||
* Check if instance is registered.
|
||||
|
@ -2651,14 +2647,20 @@ class ConsoleSupervisor
|
|||
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
||||
$message_conf_cron .= __('Discovery relies on an appropriate cron setup.');
|
||||
$message_conf_cron .= '. '.__('Please, add the following line to your crontab file:');
|
||||
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * <user> wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
|
||||
$message_conf_cron .= str_replace(
|
||||
ENTERPRISE_DIR.'/meta/',
|
||||
'',
|
||||
ui_get_full_url(false)
|
||||
);
|
||||
$message_conf_cron .= ENTERPRISE_DIR.'/'.EXTENSIONS_DIR;
|
||||
$message_conf_cron .= '/cron/cron.php >> </pre>';
|
||||
if (enterprise_installed()) {
|
||||
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * <user> wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
|
||||
$message_conf_cron .= str_replace(
|
||||
ENTERPRISE_DIR.'/meta/',
|
||||
'',
|
||||
ui_get_full_url(false)
|
||||
);
|
||||
$message_conf_cron .= ENTERPRISE_DIR.'/'.EXTENSIONS_DIR;
|
||||
$message_conf_cron .= '/cron/cron.php >> </pre>';
|
||||
} else {
|
||||
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * <user> wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies ';
|
||||
$message_conf_cron .= ui_get_full_url(false).'cron.php >> </pre>';
|
||||
}
|
||||
|
||||
$message_conf_cron .= $config['homedir'].'/log/cron.log</pre>';
|
||||
}
|
||||
|
||||
|
|