Merge remote-tracking branch 'origin/develop' into ent-12196-problemas-con-la-vista-mobile

This commit is contained in:
daniel 2023-10-11 10:50:05 +02:00
commit 744a563034
81 changed files with 9632 additions and 771 deletions

1
extras/pandora_gotty/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
src/pandora_gotty filter=lfs diff=lfs merge=lfs -text

2
extras/pandora_gotty/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.rpm
*.deb

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
To create the .deb and .rpm package need to hace docker installed on main system and execit `build_all_docker.sh`

View File

@ -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)"

View File

@ -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

View File

@ -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

3
extras/pandora_gotty/deb/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.deb
**/usr
**/etc

View File

@ -0,0 +1,5 @@
pandora_gotty (1.0-1) stable; urgency=low
* Initial release.
-- PandoraFMS Mon, 18 Sep 2023 00:00:00 +0000

View File

@ -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.

View File

@ -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

2
extras/pandora_gotty/src/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*rpm
bin/*

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3758eddb64db79c6ea1dac4cb200ee8ec86ef3f51723dad5be4365a1315b952b
size 13642854

View File

@ -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"

View File

@ -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)

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-231010
Version: 7.0NG.773.3-231011
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773.3-231010"
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

View File

@ -1031,7 +1031,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773.3';
use constant AGENT_BUILD => '231010';
use constant AGENT_BUILD => '231011';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231010
%define release 231011
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231010
%define release 231011
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231010
%define release 231011
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="231010"
PI_BUILD="231011"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231010}
{231011}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.773.3 Build 231010")
#define PANDORA_VERSION ("7.0NG.773.3 Build 231011")
string pandora_path;
string pandora_dir;

View File

@ -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 231010))"
VALUE "ProductVersion", "(7.0NG.773.3(Build 231011))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-231010
Version: 7.0NG.773.3-231011
Architecture: all
Priority: optional
Section: admin

View File

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

31
pandora_console/cron.php Normal file
View File

@ -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();
}

View File

@ -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&section=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">&nbsp;'.html_print_image('images/spinner.gif', true).'</span>';
$test_start .= '&nbsp;<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">&nbsp;'.html_print_image('images/spinner.gif', true).'</span>';
$test_start .= '&nbsp;<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');

View File

@ -1708,6 +1708,7 @@ enterprise/godmode/wizards/Cloud.class.php
enterprise/images/wizard/applications.png
enterprise/images/wizard/cloud.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

View File

@ -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

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,600 @@
-- Insert new RDS APP
SET @current_app_type = 7;
SET @short_name = 'pandorafms.aws.rds';
SET @name = 'Amazon&#x20;RDS';
SET @section = 'cloud';
SET @description = 'Monitor&#x20;AWS&#x20;RDS&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileRDS_&#039;');
-- Insert new MySQL APP
SET @short_name = 'pandorafms.mysql';
SET @name = 'MySQL';
SET @section = 'app';
SET @description = 'Monitor&#x20;MySQL&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- Insert new Oracle APP
SET @short_name = 'pandorafms.oracle';
SET @name = 'Oracle';
SET @section = 'app';
SET @description = 'Monitor&#x20;Oracle&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- 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__&#x0d;&#x0a;agents_group_name=__taskGroup__&#x0d;&#x0a;advance_monitoring=_rdsInstanceSummary_&#x0d;&#x0a;cpu_summary=_rdsCpuPerfSummary_&#x0d;&#x0a;iops_summary=_rdsIopsPerfSummary_&#x0d;&#x0a;disk_summary=_rdsDiskPerfSummary_&#x0d;&#x0a;network_summary=_rdsNetworkPerfSummary_&#x0d;&#x0a;aws_instances=_rdsInstance_&#x0d;&#x0a;aws_regions=_rdsZones_&#x0d;&#x0a;creds_b64=_credentials_&#x0d;&#x0a;temporal=__temp__&#x0d;&#x0a;transfer_mode=tentacle&#x0d;&#x0a;tentacle_ip=_tentacleIP_&#x0d;&#x0a;tentacle_port=_tentaclePort_&#x0d;&#x0a;tentacle_opts=_tentacleExtraOpt_&#x0d;&#x0a;threads=_threads_&#x0d;&#x0a;stats_agent=_statsAgent_&#x0d;&#x0a;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&#x20;-&#x20;', `name`),
CONCAT('Migrated&#x20;from&#x20;-&#x20;', `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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;scan_databases&#x20;=&#x20;_scanDatabases_&#x0d;&#x0a;agent_per_database&#x20;=&#x20;_agentPerDatabase_&#x0d;&#x0a;db_agent_prefix&#x20;=&#x20;_prefixAgent_&#x0d;&#x0a;innodb_stats&#x20;=&#x20;_checkInnodb_&#x0d;&#x0a;engine_uptime&#x20;=&#x20;_checkUptime_&#x0d;&#x0a;query_stats&#x20;=&#x20;_queryStats_&#x0d;&#x0a;cache_stats&#x20;=&#x20;_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&#x20;-&#x20;', `name`),
CONCAT('Migrated&#x20;from&#x20;-&#x20;', `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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;engine_uptime&#x20;=&#x20;_checkUptime_&#x0d;&#x0a;query_stats&#x20;=&#x20;_queryStats_&#x0d;&#x0a;cache_stats&#x20;=&#x20;_checkCache_&#x0d;&#x0a;fragmentation_ratio&#x20;=&#x20;_checkFragmentation_&#x0d;&#x0a;check_tablescpaces&#x20;=&#x20;_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
;

View File

@ -0,0 +1,442 @@
-- Insert new S3 APP
SET @current_app_type = 14;
SET @short_name = 'pandorafms.aws.s3';
SET @name = 'Amazon&#x20;S3';
SET @section = 'cloud';
SET @description = 'Monitor&#x20;AWS&#x20;S3&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileS3_&#039;');
-- 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__&#x0d;&#x0a;agents_group_name=__taskGroup__&#x0d;&#x0a;aws_regions=_s3Zone_&#x0d;&#x0a;aws_buckets=_s3Bucket_&#x0d;&#x0a;s3_monitoring=_s3Monitoring_&#x0d;&#x0a;size_monitoring=_s3Size_&#x0d;&#x0a;items_monitoring=_s3Items_&#x0d;&#x0a;creds_b64=_credentials_&#x0d;&#x0a;temporal=__temp__&#x0d;&#x0a;transfer_mode=tentacle&#x0d;&#x0a;tentacle_ip=_tentacleIP_&#x0d;&#x0a;tentacle_port=_tentaclePort_&#x0d;&#x0a;tentacle_opts=_tentacleExtraOpt_&#x0d;&#x0a;threads=_threads_&#x0d;&#x0a;stats_agent=_statsAgent_&#x0d;&#x0a;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
;

View File

@ -0,0 +1,716 @@
-- Insert new Azure APP
SET @current_app_type = 8;
SET @short_name = 'pandorafms.azure.mc';
SET @name = 'Azure&#x20;Microsoft&#x20;Compute';
SET @section = 'cloud';
SET @description = 'Monitor&#x20;Azure&#x20;Microsoft&#x20;Compute&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileAzureMC_&#039;');
-- 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__&#x0d;&#x0a;threads=_threads_&#x0d;&#x0a;interval=__taskInterval__&#x0d;&#x0a;transfer_mode=tentacle&#x0d;&#x0a;tentacle_ip=_tentacleIP_&#x0d;&#x0a;tentacle_port=_tentaclePort_&#x0d;&#x0a;tentacle_opts=_tentacleExtraOpt_&#x0d;&#x0a;advance_monitoring=_azureMCInstanceSummary_&#x0d;&#x0a;cpu_summary=_azureMCCpuPerfSummary_&#x0d;&#x0a;iops_summary=_azureMCIopsPerfSummary_&#x0d;&#x0a;disk_summary=_azureMCDiskPerfSummary_&#x0d;&#x0a;network_summary=_azureMCNetworkPerfSummary_&#x0d;&#x0a;azure_zones=_azureMCZones_&#x0d;&#x0a;azure_instances=_azureMCInstance_&#x0d;&#x0a;creds_b64=_credentials_&#x0d;&#x0a;stats_agent=_statsAgent_&#x0d;&#x0a;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
;

View File

@ -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&#x20;DB2&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- 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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;cache_stats&#x20;=&#x20;_checkCache_&#x0d;&#x0a;database_summary&#x20;=&#x20;_checkDbSummary_&#x0d;&#x0a;transactional_log&#x20;=&#x20;_checkTransactionalLogUtilization_&#x0d;&#x0a;db_size&#x20;=&#x20;_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
;

View File

@ -0,0 +1,716 @@
-- Insert new Google APP
SET @current_app_type = 13;
SET @short_name = 'pandorafms.gcp.ce';
SET @name = 'Google&#x20;Cloud&#x20;Compute&#x20;Engine';
SET @section = 'cloud';
SET @description = 'Monitor&#x20;Google&#x20;Cloud&#x20;Platform&#x20;Compute&#x20;Engine&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileGoogleCE_&#039;');
-- 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__&#x0d;&#x0a;interval=__taskInterval__&#x0d;&#x0a;threads=_threads_&#x0d;&#x0a;temporal=__temp__&#x0d;&#x0a;transfer_mode=tentacle&#x0d;&#x0a;tentacle_ip=_tentacleIP_&#x0d;&#x0a;tentacle_port=_tentaclePort_&#x0d;&#x0a;tentacle_opts=_tentacleExtraOpt_&#x0d;&#x0a;advance_monitoring=_googleCEInstanceSummary_&#x0d;&#x0a;cpu_summary=_googleCECpuPerfSummary_&#x0d;&#x0a;iops_summary=_googleCEIopsPerfSummary_&#x0d;&#x0a;disk_summary=_googleCEDiskPerfSummary_&#x0d;&#x0a;network_summary=_googleCENetworkPerfSummary_&#x0d;&#x0a;creds_b64=_credentials_&#x0d;&#x0a;gcp_zones=_googleCEZones_&#x0d;&#x0a;gcp_instances=_googleCEInstances_&#x0d;&#x0a;stats_agent=_statsAgent_&#x0d;&#x0a;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
;

View File

@ -0,0 +1,145 @@
-- Insert new MSSQL APP
SET @current_app_type = 12;
SET @short_name = 'pandorafms.mssql';
SET @name = 'Microsoft&#x20;SQL&#x20;Server';
SET @section = 'app';
SET @description = 'Monitor&#x20;Microsoft&#x20;SQL&#x20;Server&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- 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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;engine_uptime&#x20;=&#x20;_checkUptime_&#x0d;&#x0a;query_stats&#x20;=&#x20;_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
;

View File

@ -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&#x20;MySQL&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- 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')), '&#x20;', '') AS `port`,
1 AS `pos`,
SUBSTRING_INDEX(
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), '&#x20;', ''),
',', 1
) AS `host`,
SUBSTRING(
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), '&#x20;', ''),
LENGTH(SUBSTRING_INDEX(
REPLACE(JSON_UNQUOTE(JSON_EXTRACT(CONVERT(FROM_BASE64(`field1`) USING UTF8MB4), '$.dbhost')), '&#x20;', ''),
',', 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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;scan_databases&#x20;=&#x20;_scanDatabases_&#x0d;&#x0a;agent_per_database&#x20;=&#x20;_agentPerDatabase_&#x0d;&#x0a;db_agent_prefix&#x20;=&#x20;_prefixAgent_&#x0d;&#x0a;innodb_stats&#x20;=&#x20;_checkInnodb_&#x0d;&#x0a;engine_uptime&#x20;=&#x20;_checkUptime_&#x0d;&#x0a;query_stats&#x20;=&#x20;_queryStats_&#x0d;&#x0a;cache_stats&#x20;=&#x20;_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
;

View File

@ -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&#x20;Oracle&#x20;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, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--target_databases&#x20;&#039;_tempfileTargetDatabases_&#039;&#x20;--target_agents&#x20;&#039;_tempfileTargetAgents_&#039;&#x20;--custom_queries&#x20;&#039;_tempfileCustomQueries_&#039;');
-- 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&#x20;=&#x20;__taskGroupID__&#x0d;&#x0a;interval&#x20;=&#x20;__taskInterval__&#x0d;&#x0a;user&#x20;=&#x20;_dbuser_&#x0d;&#x0a;password&#x20;=&#x20;_dbpass_&#x0d;&#x0a;threads&#x20;=&#x20;_threads_&#x0d;&#x0a;modules_prefix&#x20;=&#x20;_prefixModuleName_&#x0d;&#x0a;execute_custom_queries&#x20;=&#x20;_executeCustomQueries_&#x0d;&#x0a;analyze_connections&#x20;=&#x20;_checkConnections_&#x0d;&#x0a;engine_uptime&#x20;=&#x20;_checkUptime_&#x0d;&#x0a;query_stats&#x20;=&#x20;_queryStats_&#x0d;&#x0a;cache_stats&#x20;=&#x20;_checkCache_&#x0d;&#x0a;fragmentation_ratio&#x20;=&#x20;_checkFragmentation_&#x0d;&#x0a;check_tablescpaces&#x20;=&#x20;_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
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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,7 +475,7 @@ if ($access_console_node === true) {
}
}
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('Pandora RC');
$sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&section=ITSM']['text'] = __('ITSM');
@ -485,8 +486,8 @@ if ($access_console_node === true) {
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
$sub2['godmode/setup/setup&section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&section=websocket_engine']['refr'] = 0;
$sub2['godmode/setup/setup&section=quickshell']['text'] = __('QuickShell');
$sub2['godmode/setup/setup&section=quickshell']['refr'] = 0;
$sub2['godmode/setup/setup&section=external_tools']['text'] = __('External Tools');
$sub2['godmode/setup/setup&section=external_tools']['refr'] = 0;

View File

@ -188,7 +188,7 @@ $buttons['ehorus'] = [
'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&section=websocket_engine').'">'.html_print_image(
'text' => '<a href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup&section=quickshell').'">'.html_print_image(
'images/websocket_small.png',
true,
[
'title' => __('Websocket engine'),
'title' => __('QuickShell'),
'class' => 'invert_filter',
]
).'</a>',
@ -299,7 +299,7 @@ switch ($section) {
case 'ehorus':
$buttons['ehorus']['active'] = true;
$subpage = __('eHorus');
$subpage = __('Pandora RC');
$help_header = 'setup_ehorus_tab';
break;
@ -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;
@ -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':

View File

@ -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);

View File

@ -0,0 +1,53 @@
<?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&amp;section=quickshell&amp;pure='.$config['pure']
);
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="'.$url.'">';
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>';

View File

@ -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&amp;section=websocket_engine&amp;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">&nbsp;'.html_print_image('images/spinner.gif', true).'</span>';
$test_start .= '&nbsp;<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>';

View File

@ -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.
@ -893,5 +944,45 @@ $(document).ready(function () {
$('#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>

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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, '[&hellip;]');
} 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',

View File

@ -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;
}
}
}

View File

@ -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>* * * * * &lt;user&gt; 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 &gt;&gt; </pre>';
if (enterprise_installed()) {
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * &lt;user&gt; 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 &gt;&gt; </pre>';
} else {
$message_conf_cron .= '<b><pre class=""ui-dialog>* * * * * &lt;user&gt; 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 &gt;&gt; </pre>';
}
$message_conf_cron .= $config['homedir'].'/log/cron.log</pre>';
}

View File

@ -0,0 +1,345 @@
<?php
/**
* Extension to schedule tasks on Pandora FMS Console
*
* @category Extensions
* @package Pandora FMS
* @subpackage Enterprise
* @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.
* ============================================================================
*/
if ((bool) $config['enterprise_installed'] === true) {
enterprise_include_once('/include/functions_cron.php');
} else {
include_once $config['homedir'].'/include/functions_cron_task.php';
}
/**
* Base class to run scheduled tasks in cron extension
*/
class DiscoveryConsoleTask
{
public const SCHEDULES = [
'no',
'hourly',
'daily',
'weekly',
'monthly',
'yearly',
'custom',
];
/**
* Retrieve scheduled tasks given filters.
*
* @param array $filter Tasks filtered.
*
* @return array List of scheduled tasks.
*/
public function list(array $filter)
{
$tasks = db_get_all_rows_filter(
'tuser_task_scheduled INNER JOIN tuser_task ON tuser_task.id = tuser_task_scheduled.id_user_task',
$filter,
'tuser_task_scheduled.*'
);
if ($tasks === false) {
return [];
}
$tasks = array_map(
function ($item) {
$item['args'] = unserialize($item['args']);
return $item;
},
$tasks
);
return $tasks;
}
/**
* Should execute task.
*
* @param array $task Info task.
*
* @return boolean
*/
private function shouldTaskRun($task)
{
global $config;
if (isset($config['reporting_console_enable']) === true
&& (bool) $config['reporting_console_enable'] === true
) {
$task_info = db_get_row('tuser_task', 'id', $task['id_user_task']);
if (isset($config['reporting_console_node']) === true
&& (bool) $config['reporting_console_node'] === true
) {
if (($task_info['function_name'] !== 'cron_task_generate_report_by_template'
&& $task_info['function_name'] !== 'cron_task_generate_report'
&& $task_info['function_name'] !== 'cron_task_save_report_to_disk')
) {
return false;
}
} else {
if (($task_info['function_name'] === 'cron_task_generate_report_by_template'
|| $task_info['function_name'] === 'cron_task_generate_report'
|| $task_info['function_name'] === 'cron_task_save_report_to_disk')
) {
return false;
}
}
}
return true;
}
/**
* Manage scheduled tasks.
*
* @return void
*/
public function run()
{
global $config;
global $pandora_version;
// Maintenance tasks for tconsole table.
// Must do at every Cron execution.
if (isset($config['id_console']) === true && $config['id_console'] > 0) {
$console_exists = db_get_row('tconsole', 'id_console', $config['id_console']);
if ($console_exists === false) {
db_process_sql_insert(
'tconsole',
[
'id_console' => $config['id_console'],
'description' => $config['console_description'],
'version' => $pandora_version,
'console_type' => ($config['reporting_console_node'] === true) ? 1 : 0,
'timezone' => $config['timezone'],
'public_url' => $config['public_url'],
]
);
} else {
db_process_sql_update(
'tconsole',
[
'description' => $config['console_description'],
'timezone' => $config['timezone'],
'public_url' => $config['public_url'],
'console_type' => (int) $config['reporting_console_node'],
'version' => $pandora_version,
],
[
'id_console' => $config['id_console'],
]
);
}
}
// Maintenance task: schedule daily task to manage GoTTY processes if not defined yet.
// Must do at every Cron execution.
$gotty_ssh_enabled = (bool) $config['gotty_ssh_enabled'];
$gotty_telnet_enabled = (bool) $config['gotty_telnet_enabled'];
if ($gotty_ssh_enabled === true || $gotty_telnet_enabled === true) {
// Create necessary data in task tables when some method of GoTTY is enabled in setup.
if ((bool) $config['enterprise_installed'] === false) {
$call_func_user_task_id = db_get_value_sql('SELECT id FROM `tuser_task` WHERE `function_name` = "cron_task_call_user_function"');
if ($call_func_user_task_id === false) {
db_process_sql("INSERT INTO `tuser_task` (`function_name`, `parameters`, `name`) VALUES ('cron_task_call_user_function','a:1:{i:0;a:2:{s:11:\"description\";s:13:\"Function name\";s:4:\"type\";s:4:\"text\";}}','Call PHP function')");
}
}
$user_function_task_id = db_get_value_sql('SELECT id FROM `tuser_task_scheduled` WHERE `args` LIKE "%cron_task_start_gotty%"');
if ($user_function_task_id === false) {
// Schedule task to manage GoTTY processes daily if it is not scheduled yet.
$this->schedule(
'cron_task_call_user_function',
[
0 => 'cron_task_start_gotty',
'function_name' => 'cron_task_start_gotty',
'internal' => 1,
],
'daily',
0,
0,
strtotime('tomorrow')
);
}
}
// Maintenance task: check whether start GoTTY SSH and Telnet processes are running and start otherwise.
// Must do at every Cron execution.
cron_task_start_gotty(false);
// Do not output anything until is completed. There're session
// operations inside cron_task_run function.
ob_start();
if (cron_task_lock() === false) {
// Cannot continue. Locked.
echo ob_get_clean();
exit;
}
$time = get_system_time();
$scheduled_tasks = db_get_all_rows_in_table('tuser_task_scheduled');
if (!$scheduled_tasks) {
$scheduled_tasks = [];
}
/*
Watch out! First_execution corresponds to next_execution the name
of the bbdd is maintained to ensure integrity.
*/
foreach ($scheduled_tasks as $task) {
$params = unserialize($task['args']);
if ($this->shouldTaskRun($task) === false) {
continue;
}
if ($task['scheduled'] == 'no') {
if (($params['first_execution']) < $time) {
echo date('Y/m/d H:i:s').' Execute once time cron task: ';
echo $task['id'];
echo "\n\n";
cron_task_run($task['id']);
// The task was not scheduled and was executed once.
db_process_sql_delete(
'tuser_task_scheduled',
['id' => $task['id']]
);
}
} else {
if (($params['first_execution']) < $time) {
echo date('Y/m/d H:i:s').' EXECUTED CRON TASK: '.$task['id'];
echo "\n";
echo "\n";
cron_task_run($task['id']);
}
}
}
// Dump to output.
echo ob_get_clean();
// Release the lock.
cron_task_release_lock();
}
/**
* Schedules a discovery console task to be executed by cron.
*
* @param string $function_name Name of the function:
* cron_task_generate_report
* cron_task_generate_report_by_template
* cron_task_save_report_to_disk
* cron_task_do_backup
* cron_task_execute_custom_script
* cron_task_save_xml_report_to_disk
* cron_task_feedback_send_mail
* cron_task_generate_csv_log.
* @param array $arguments Task execution arguments (if needed).
* @param string $schedule Task schedule options:
* 'no',
* 'hourly',
* 'daily',
* 'weekly',
* 'monthly',
* 'yearly',
* 'custom'.
* @param integer $group_id Group id (0 => all).
* @param string|null $id_user User id, if null, current user.
* @param integer|null $time_start When to start, if null, now.
*
* @return boolean Sucessfully scheduled or not.
*/
public function schedule(
string $function_name,
array $arguments=[],
string $schedule='no',
int $group_id=0,
?string $id_user=null,
?int $time_start=null
) {
global $config;
if ($id_user === null) {
$id_user = $config['id_user'];
}
$idUserTask = db_get_value(
'id',
'tuser_task',
'function_name',
$function_name
);
if ($idUserTask === false) {
// Failed to identify function.
return false;
}
if (in_array($schedule, self::SCHEDULES) === false) {
// Failed to schedule. Not a valid schedule option.
return false;
}
if ($time_start === null) {
$time_start = strtotime('now');
}
// Params for send mail with cron.
$parameters = array_merge(
$arguments,
[ 'first_execution' => $time_start ]
);
// Values insert task cron.
$task = [
'id_usuario' => $id_user,
'id_user_task' => $idUserTask,
'args' => serialize($parameters),
'scheduled' => $schedule,
'id_grupo' => $group_id,
];
$result = db_process_sql_insert(
'tuser_task_scheduled',
$task
);
return ($result !== false);
}
}

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC231010';
$build_version = 'PC231011';
$pandora_version = 'v7.0NG.773.3';
// Do not overwrite default timezone set if defined.

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="2586px" height="500.001408px" viewBox="0 0 2586 500.001408" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Pandora RC blanco</title>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-RC-blanco" fill="#FFFFFF">
<g id="Group-3">
<path d="M383.135312,354.853112 C368.253912,367.5785 348.637362,378.490503 327.50345,384.159533 C303.84882,390.511663 277.275646,392.268711 251.94523,388.906025 C204.245186,382.627838 161.368307,352.529162 132.513812,324.293167 C135.802013,316.507934 136.780729,313.662855 140.153423,306.004383 C145.821522,311.895245 155.890319,319.754422 160.364948,322.842459 C191.34234,344.395336 231.811157,362.951727 285.415177,359.849605 C312.558681,358.367207 337.737713,348.948166 355.601026,334.610097 C372.922172,320.747382 387.409269,300.838876 387.081857,273.134572 C386.743884,243.817588 372.358883,219.902028 356.667755,203.880856 C351.291862,198.373798 345.4759,192.479415 339.603609,188.137854 C330.316376,181.275159 319.990579,175.954721 309.611973,170.926538 C299.046778,165.72934 288.196418,160.528621 275.606901,157.810304 C296.371154,144.613083 352.112153,128.436982 358.71672,132.204598 C362.846335,134.549675 367.299841,138.306728 370.728864,141.10251 C382.124911,150.218733 391.852214,163.060318 400.188896,174.965282 C412.123588,192.15195 422.185344,212.035809 425.864327,234.409111 C434.817107,289.666309 412.176397,330.117127 383.135312,354.853112 M50.3193389,262.986656 L50.3193389,262.919755 C75.7729749,222.828092 105.162595,186.549821 140.051327,155.736354 C164.10026,134.436998 192.444275,115.447508 223.82301,101.655216 C229.089766,99.3030966 234.194575,96.3453418 239.883797,94.5108296 C245.509649,92.6551906 251.38194,90.8136361 257.384492,88.8206727 C280.331491,81.2572711 311.903857,77.4474013 337.220191,80.2361415 C356.153753,82.4227674 375.002822,87.8664447 387.578256,97.6411201 C391.852214,100.912256 396.967585,104.493252 399.699538,108.415798 C401.290831,110.690453 403.515823,115.919341 402.255463,119.024983 C400.692336,122.792599 394.932702,123.162319 390.165866,123.070769 C373.879764,122.736261 358.987803,121.02851 343.240346,122.926403 C320.923527,125.662326 302.444117,131.926428 286.50655,138.606024 C252.842972,152.62719 223.925107,175.729368 201.125971,199.046335 C178.136726,222.490063 156.900719,252.028879 139.998519,282.356429 C121.181135,316.127651 106.986244,351.733385 95.2663059,389.120814 C68.3621998,353.990434 51.6923566,310.567776 50.3193389,262.986656 M249.952594,0 C111.890382,0 0,111.901724 0,249.979577 C0,388.075037 111.890382,500.001408 249.952594,500.001408 C388.025367,500.001408 499.919269,388.075037 499.919269,249.979577 C499.919269,111.901724 388.025367,0 249.952594,0" id="Fill-1"></path>
</g>
<path d="M659.867032,265.066592 L707.890966,265.066592 C722.624503,265.066592 733.809316,262.587712 741.438366,257.629951 C749.070936,252.675712 752.887221,243.112305 752.887221,228.946772 C752.887221,214.777718 749.070936,205.21431 741.438366,200.260071 C733.809316,195.305832 722.624503,192.82343 707.890966,192.82343 L659.867032,192.82343 L659.867032,265.066592 Z M610.265887,331.91185 L610.265887,168.087445 C610.265887,164.6649 611.452315,161.724751 613.82165,159.270519 C616.187466,156.812766 619.081364,155.583889 622.503347,155.583889 L722.888545,155.583889 C775.953919,155.583889 802.488366,180.041704 802.488366,228.946772 C802.488366,277.851839 775.953919,302.306133 722.888545,302.306133 L659.867032,302.306133 L659.867032,331.91185 C659.867032,335.334395 658.65948,338.253418 656.251418,340.661875 C653.836315,343.077375 650.921293,344.281604 647.49931,344.281604 L622.767389,344.281604 C619.345406,344.281604 616.40574,343.077375 613.951911,340.661875 C611.494561,338.253418 610.265887,335.334395 610.265887,331.91185 L610.265887,331.91185 Z" id="Fill-4"></path>
<path d="M876.429595,261.512708 L960.236483,261.512708 L960.236483,192.825895 L922.739018,192.825895 C914.321363,192.825895 906.973958,195.213226 900.703844,199.99493 C894.430209,204.776633 890.198498,211.202708 888.00519,219.273153 L876.429595,261.512708 Z M807.225981,332.174879 L840.248818,206.9034 C849.194556,172.780064 878.313093,155.670861 927.60795,155.586354 L998.522554,155.586354 C1001.76851,155.586354 1004.46174,156.81523 1006.61632,159.269463 C1008.76034,161.727216 1009.83763,164.579337 1009.83763,167.822304 L1009.83763,332.174879 C1009.83763,335.597424 1008.60895,338.470672 1006.15512,340.794622 C1003.69425,343.118572 1000.75811,344.280547 997.339647,344.280547 L972.600684,344.280547 C969.006194,344.280547 966.045405,343.118572 963.721836,340.794622 C961.398268,338.470672 960.236483,335.509396 960.236483,331.914315 L960.236483,298.75225 L866.691731,298.75225 L857.876253,331.914315 C856.996113,335.509396 855.024601,338.470672 851.958194,340.794622 C848.884747,343.118572 845.642313,344.280547 842.22033,344.280547 L816.301981,344.280547 C812.879998,344.280547 810.426169,343.294629 808.933452,341.322792 C807.440735,339.347435 806.719021,337.615036 806.764788,336.122074 C806.807035,334.632633 806.96194,333.315728 807.225981,332.174879 L807.225981,332.174879 Z" id="Fill-6"></path>
<path d="M1047.46219,331.912907 L1047.46219,168.084981 C1047.46219,164.662436 1048.64861,161.725808 1051.01795,159.268054 C1053.38377,156.813822 1056.27766,155.584945 1059.69965,155.584945 L1098.38002,155.584945 C1101.44995,155.584945 1104.6959,156.813822 1108.11788,159.268054 C1111.53635,161.725808 1114.34223,164.662436 1116.53554,168.084981 L1196.00158,290.328283 L1196.00158,167.820895 C1196.00158,164.401872 1197.20561,161.503976 1199.62071,159.137772 C1202.02878,156.768047 1204.94732,155.584945 1208.3693,155.584945 L1230.99945,155.584945 C1234.41791,155.584945 1237.33645,156.768047 1239.74804,159.137772 C1242.15962,161.503976 1243.36717,164.4899 1243.36717,168.084981 L1243.36717,331.912907 C1243.36717,335.335452 1242.15962,338.250953 1239.74804,340.662931 C1237.33645,343.07491 1234.41791,344.28266 1230.99945,344.28266 L1187.31988,344.28266 C1183.8979,344.28266 1180.3879,343.07491 1176.79341,340.662931 C1173.1954,338.250953 1170.34375,335.335452 1168.24198,331.912907 L1095.48612,219.01118 L1095.48612,331.912907 C1095.48612,335.335452 1094.27857,338.250953 1091.86699,340.662931 C1089.45541,343.07491 1086.54038,344.28266 1083.1184,344.28266 L1059.96369,344.28266 C1056.54171,344.28266 1053.60204,343.07491 1051.14821,340.662931 C1048.69086,338.250953 1047.46219,335.335452 1047.46219,331.912907" id="Fill-8"></path>
<path d="M1330.72595,307.04171 L1365.7203,307.04171 C1389.3186,307.04171 1405.36883,302.745923 1413.87801,294.147307 C1422.38368,285.548692 1426.63652,270.833862 1426.63652,249.999296 C1426.63652,229.16473 1422.38368,214.425252 1413.87801,205.784382 C1405.36883,197.147034 1389.3186,192.823078 1365.7203,192.823078 L1330.72595,192.823078 L1330.72595,307.04171 Z M1281.12481,332.175584 L1281.12481,168.347657 C1281.12481,164.752577 1282.35348,161.724399 1284.81083,159.270167 C1287.26466,156.812414 1290.20432,155.583537 1293.62631,155.583537 L1367.17077,155.583537 C1405.23504,155.583537 1432.93128,163.196234 1450.25594,178.414587 C1467.57709,193.636461 1476.23766,217.495683 1476.23766,249.999296 C1476.23766,282.502908 1467.57709,306.341004 1450.25594,321.517103 C1432.93128,336.693202 1405.23504,344.281251 1367.17077,344.281251 L1293.62631,344.281251 C1290.20432,344.281251 1287.26466,343.119276 1284.81083,340.795326 C1282.35348,338.471376 1281.12481,335.598128 1281.12481,332.175584 L1281.12481,332.175584 Z" id="Fill-10"></path>
<path d="M1641.35677,202.956558 C1632.49201,192.428359 1618.17742,187.16426 1598.39892,187.16426 C1578.62043,187.16426 1564.27767,192.428359 1555.37418,202.956558 C1546.47421,213.484756 1542.0207,229.164378 1542.0207,249.998944 C1542.0207,270.833509 1546.47421,286.495525 1555.37418,296.974428 C1564.27767,307.460373 1578.62043,312.699825 1598.39892,312.699825 C1618.17742,312.699825 1632.49201,307.460373 1641.35677,296.974428 C1650.2145,286.495525 1654.64336,270.833509 1654.64336,249.998944 C1654.64336,229.164378 1650.2145,213.484756 1641.35677,202.956558 M1677.3404,324.738591 C1659.39963,340.488635 1633.08698,348.361897 1598.39892,348.361897 C1563.70734,348.361897 1537.37356,340.488635 1519.39055,324.738591 C1501.41106,308.995589 1492.41956,284.058899 1492.41956,249.932042 C1492.41956,215.808707 1501.41106,190.896664 1519.39055,175.192395 C1537.37356,159.488125 1563.70734,151.635991 1598.39892,151.635991 C1633.08698,151.635991 1659.39963,159.488125 1677.3404,175.192395 C1695.27412,190.896664 1704.2445,215.808707 1704.2445,249.932042 C1704.2445,284.058899 1695.27412,308.995589 1677.3404,324.738591" id="Fill-12"></path>
<path d="M1780.81453,238.090459 L1836.86182,238.090459 C1845.89557,238.090459 1853.85556,236.29468 1860.74177,232.696078 C1867.62446,229.097476 1871.07109,223.350981 1871.07109,215.456593 C1871.07109,207.562204 1867.62446,201.815709 1860.74177,198.217108 C1853.85556,194.622027 1845.89557,192.826247 1836.86182,192.826247 L1780.81453,192.826247 L1780.81453,238.090459 Z M1927.11837,338.622433 C1927.11837,342.397091 1924.88282,344.280899 1920.40467,344.280899 L1888.8323,344.280899 C1885.49481,344.280899 1881.83343,343.076671 1877.84816,340.661171 C1873.85585,338.252713 1870.80704,335.333691 1868.70175,331.914667 L1846.33564,296.911048 C1837.12586,282.523683 1825.98682,275.330001 1812.9185,275.330001 L1780.81453,275.330001 L1780.81453,331.914667 C1780.81453,335.333691 1779.60698,338.252713 1777.19892,340.661171 C1774.78382,343.076671 1771.8688,344.280899 1768.44681,344.280899 L1743.71489,344.280899 C1740.29291,344.280899 1737.35324,343.076671 1734.89941,340.661171 C1732.44206,338.252713 1731.21339,335.333691 1731.21339,331.914667 L1731.21339,168.086741 C1731.21339,164.664196 1732.39982,161.727568 1734.76915,159.269815 C1737.13497,156.812061 1740.02887,155.583185 1743.45085,155.583185 L1851.99318,155.583185 C1872.07797,155.583185 1888.54714,160.981087 1901.39717,171.76985 C1914.24369,182.558613 1920.67223,197.122034 1920.67223,215.456593 C1920.67223,240.984834 1904.13617,256.995442 1871.07109,263.484897 C1876.33432,265.418001 1881.20325,268.731391 1885.67436,273.421545 C1890.14899,278.11522 1895.27844,284.935662 1901.06624,293.88287 L1925.01308,331.914667 C1926.41426,334.3689 1927.11837,336.608343 1927.11837,338.622433 L1927.11837,338.622433 Z" id="Fill-14"></path>
<path d="M2002.63716,261.512708 L2086.44405,261.512708 L2086.44405,192.825895 L2048.94659,192.825895 C2040.52893,192.825895 2033.18153,195.213226 2026.91141,199.99493 C2020.63778,204.776633 2016.40607,211.202708 2014.21276,219.273153 L2002.63716,261.512708 Z M1933.43355,332.174879 L1966.45639,206.9034 C1975.40212,172.780064 2004.52066,155.670861 2053.81552,155.586354 L2124.73012,155.586354 C2127.97608,155.586354 2130.6693,156.81523 2132.82389,159.269463 C2134.96791,161.727216 2136.0452,164.579337 2136.0452,167.822304 L2136.0452,332.174879 C2136.0452,335.597424 2134.81652,338.470672 2132.36269,340.794622 C2129.90182,343.118572 2126.96568,344.280547 2123.54722,344.280547 L2098.80825,344.280547 C2095.21376,344.280547 2092.25297,343.118572 2089.9294,340.794622 C2087.60584,338.470672 2086.44405,335.509396 2086.44405,331.914315 L2086.44405,298.75225 L1992.8993,298.75225 L1984.08382,331.914315 C1983.20368,335.509396 1981.23217,338.470672 1978.16576,340.794622 C1975.09232,343.118572 1971.84988,344.280547 1968.4279,344.280547 L1942.50955,344.280547 C1939.08757,344.280547 1936.63374,343.294629 1935.14102,341.322792 C1933.6483,339.347435 1932.92659,337.615036 1932.97236,336.122074 C1933.0146,334.632633 1933.16951,333.315728 1933.43355,332.174879 L1933.43355,332.174879 Z" id="Fill-16"></path>
<path d="M2223.2702,238.090459 L2279.31748,238.090459 C2288.35124,238.090459 2296.31122,236.29468 2303.19743,232.696078 C2310.08012,229.097476 2313.52675,223.350981 2313.52675,215.456593 C2313.52675,207.562204 2310.08012,201.815709 2303.19743,198.217108 C2296.31122,194.622027 2288.35124,192.826247 2279.31748,192.826247 L2223.2702,192.826247 L2223.2702,238.090459 Z M2369.57403,338.622433 C2369.57403,342.397091 2367.33848,344.280899 2362.86033,344.280899 L2331.28796,344.280899 C2327.95047,344.280899 2324.28909,343.076671 2320.30382,340.661171 C2316.31151,338.252713 2313.26271,335.333691 2311.15741,331.914667 L2288.79131,296.911048 C2279.58152,282.523683 2268.44248,275.330001 2255.37417,275.330001 L2223.2702,275.330001 L2223.2702,331.914667 C2223.2702,335.333691 2222.06264,338.252713 2219.65458,340.661171 C2217.23948,343.076671 2214.32446,344.280899 2210.90247,344.280899 L2186.17055,344.280899 C2182.74857,344.280899 2179.8089,343.076671 2177.35508,340.661171 C2174.89773,338.252713 2173.66905,335.333691 2173.66905,331.914667 L2173.66905,168.086741 C2173.66905,164.664196 2174.85548,161.727568 2177.22481,159.269815 C2179.59063,156.812061 2182.48453,155.583185 2185.90651,155.583185 L2294.44884,155.583185 C2314.53363,155.583185 2331.0028,160.981087 2343.85284,171.76985 C2356.69935,182.558613 2363.12789,197.122034 2363.12789,215.456593 C2363.12789,240.984834 2346.59183,256.995442 2313.52675,263.484897 C2318.78998,265.418001 2323.65891,268.731391 2328.13002,273.421545 C2332.60465,278.11522 2337.73411,284.935662 2343.5219,293.88287 L2367.46874,331.914667 C2368.86992,334.3689 2369.57403,336.608343 2369.57403,338.622433 L2369.57403,338.622433 Z" id="Fill-18"></path>
<path d="M2405.03275,322.042456 C2388.76072,306.514244 2380.62471,282.503613 2380.62471,250 C2380.62471,217.496387 2388.76072,193.461108 2405.03275,177.890642 C2421.30124,162.316654 2445.70927,154.531421 2478.24979,154.531421 L2507.59013,154.531421 C2527.49888,154.531421 2545.1052,159.707492 2560.41258,170.059634 C2575.71645,180.411776 2583.37014,194.58083 2583.37014,212.563275 C2583.37014,217.739346 2581.83518,221.443582 2578.76877,223.679503 C2575.69533,225.918946 2572.71341,227.038668 2569.81951,227.038668 L2554.16359,227.038668 C2546.09095,227.038668 2539.82084,222.211189 2535.34973,212.563275 C2528.85782,198.70056 2518.06731,191.770963 2502.98172,191.770963 L2479.56648,191.770963 C2460.35832,191.770963 2447.33225,195.894214 2440.48829,204.140716 C2433.64784,212.387218 2430.22586,227.651345 2430.22586,249.933098 C2430.22586,272.218372 2433.64784,287.500106 2440.48829,295.792383 C2447.33225,304.081138 2460.35832,308.225516 2479.56648,308.225516 L2505.74535,308.225516 C2520.83447,308.225516 2531.57569,301.295919 2537.98311,287.436725 C2542.45422,277.697261 2548.7701,272.827529 2556.92723,272.827529 L2572.58315,272.827529 C2576.70573,272.827529 2579.96928,274.362745 2582.38439,277.436697 C2584.79597,280.507128 2586,283.838123 2586,287.436725 C2586,305.41917 2578.37095,319.563576 2563.10933,329.873464 C2547.84771,340.179831 2530.259,345.334776 2510.35024,345.334776 L2478.24979,345.334776 C2445.70927,345.334776 2421.30124,337.570669 2405.03275,322.042456" id="Fill-20"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="2586px" height="500.001408px" viewBox="0 0 2586 500.001408" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Pandora RC negro</title>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-RC-negro" fill="#181818">
<g id="Group-3">
<path d="M383.135312,354.853112 C368.253912,367.5785 348.637362,378.490503 327.50345,384.159533 C303.84882,390.511663 277.275646,392.268711 251.94523,388.906025 C204.245186,382.627838 161.368307,352.529162 132.513812,324.293167 C135.802013,316.507934 136.780729,313.662855 140.153423,306.004383 C145.821522,311.895245 155.890319,319.754422 160.364948,322.842459 C191.34234,344.395336 231.811157,362.951727 285.415177,359.849605 C312.558681,358.367207 337.737713,348.948166 355.601026,334.610097 C372.922172,320.747382 387.409269,300.838876 387.081857,273.134572 C386.743884,243.817588 372.358883,219.902028 356.667755,203.880856 C351.291862,198.373798 345.4759,192.479415 339.603609,188.137854 C330.316376,181.275159 319.990579,175.954721 309.611973,170.926538 C299.046778,165.72934 288.196418,160.528621 275.606901,157.810304 C296.371154,144.613083 352.112153,128.436982 358.71672,132.204598 C362.846335,134.549675 367.299841,138.306728 370.728864,141.10251 C382.124911,150.218733 391.852214,163.060318 400.188896,174.965282 C412.123588,192.15195 422.185344,212.035809 425.864327,234.409111 C434.817107,289.666309 412.176397,330.117127 383.135312,354.853112 M50.3193389,262.986656 L50.3193389,262.919755 C75.7729749,222.828092 105.162595,186.549821 140.051327,155.736354 C164.10026,134.436998 192.444275,115.447508 223.82301,101.655216 C229.089766,99.3030966 234.194575,96.3453418 239.883797,94.5108296 C245.509649,92.6551906 251.38194,90.8136361 257.384492,88.8206727 C280.331491,81.2572711 311.903857,77.4474013 337.220191,80.2361415 C356.153753,82.4227674 375.002822,87.8664447 387.578256,97.6411201 C391.852214,100.912256 396.967585,104.493252 399.699538,108.415798 C401.290831,110.690453 403.515823,115.919341 402.255463,119.024983 C400.692336,122.792599 394.932702,123.162319 390.165866,123.070769 C373.879764,122.736261 358.987803,121.02851 343.240346,122.926403 C320.923527,125.662326 302.444117,131.926428 286.50655,138.606024 C252.842972,152.62719 223.925107,175.729368 201.125971,199.046335 C178.136726,222.490063 156.900719,252.028879 139.998519,282.356429 C121.181135,316.127651 106.986244,351.733385 95.2663059,389.120814 C68.3621998,353.990434 51.6923566,310.567776 50.3193389,262.986656 M249.952594,0 C111.890382,0 0,111.901724 0,249.979577 C0,388.075037 111.890382,500.001408 249.952594,500.001408 C388.025367,500.001408 499.919269,388.075037 499.919269,249.979577 C499.919269,111.901724 388.025367,0 249.952594,0" id="Fill-1"></path>
</g>
<path d="M659.867032,265.066592 L707.890966,265.066592 C722.624503,265.066592 733.809316,262.587712 741.438366,257.629951 C749.070936,252.675712 752.887221,243.112305 752.887221,228.946772 C752.887221,214.777718 749.070936,205.21431 741.438366,200.260071 C733.809316,195.305832 722.624503,192.82343 707.890966,192.82343 L659.867032,192.82343 L659.867032,265.066592 Z M610.265887,331.91185 L610.265887,168.087445 C610.265887,164.6649 611.452315,161.724751 613.82165,159.270519 C616.187466,156.812766 619.081364,155.583889 622.503347,155.583889 L722.888545,155.583889 C775.953919,155.583889 802.488366,180.041704 802.488366,228.946772 C802.488366,277.851839 775.953919,302.306133 722.888545,302.306133 L659.867032,302.306133 L659.867032,331.91185 C659.867032,335.334395 658.65948,338.253418 656.251418,340.661875 C653.836315,343.077375 650.921293,344.281604 647.49931,344.281604 L622.767389,344.281604 C619.345406,344.281604 616.40574,343.077375 613.951911,340.661875 C611.494561,338.253418 610.265887,335.334395 610.265887,331.91185 L610.265887,331.91185 Z" id="Fill-4"></path>
<path d="M876.429595,261.512708 L960.236483,261.512708 L960.236483,192.825895 L922.739018,192.825895 C914.321363,192.825895 906.973958,195.213226 900.703844,199.99493 C894.430209,204.776633 890.198498,211.202708 888.00519,219.273153 L876.429595,261.512708 Z M807.225981,332.174879 L840.248818,206.9034 C849.194556,172.780064 878.313093,155.670861 927.60795,155.586354 L998.522554,155.586354 C1001.76851,155.586354 1004.46174,156.81523 1006.61632,159.269463 C1008.76034,161.727216 1009.83763,164.579337 1009.83763,167.822304 L1009.83763,332.174879 C1009.83763,335.597424 1008.60895,338.470672 1006.15512,340.794622 C1003.69425,343.118572 1000.75811,344.280547 997.339647,344.280547 L972.600684,344.280547 C969.006194,344.280547 966.045405,343.118572 963.721836,340.794622 C961.398268,338.470672 960.236483,335.509396 960.236483,331.914315 L960.236483,298.75225 L866.691731,298.75225 L857.876253,331.914315 C856.996113,335.509396 855.024601,338.470672 851.958194,340.794622 C848.884747,343.118572 845.642313,344.280547 842.22033,344.280547 L816.301981,344.280547 C812.879998,344.280547 810.426169,343.294629 808.933452,341.322792 C807.440735,339.347435 806.719021,337.615036 806.764788,336.122074 C806.807035,334.632633 806.96194,333.315728 807.225981,332.174879 L807.225981,332.174879 Z" id="Fill-6"></path>
<path d="M1047.46219,331.912907 L1047.46219,168.084981 C1047.46219,164.662436 1048.64861,161.725808 1051.01795,159.268054 C1053.38377,156.813822 1056.27766,155.584945 1059.69965,155.584945 L1098.38002,155.584945 C1101.44995,155.584945 1104.6959,156.813822 1108.11788,159.268054 C1111.53635,161.725808 1114.34223,164.662436 1116.53554,168.084981 L1196.00158,290.328283 L1196.00158,167.820895 C1196.00158,164.401872 1197.20561,161.503976 1199.62071,159.137772 C1202.02878,156.768047 1204.94732,155.584945 1208.3693,155.584945 L1230.99945,155.584945 C1234.41791,155.584945 1237.33645,156.768047 1239.74804,159.137772 C1242.15962,161.503976 1243.36717,164.4899 1243.36717,168.084981 L1243.36717,331.912907 C1243.36717,335.335452 1242.15962,338.250953 1239.74804,340.662931 C1237.33645,343.07491 1234.41791,344.28266 1230.99945,344.28266 L1187.31988,344.28266 C1183.8979,344.28266 1180.3879,343.07491 1176.79341,340.662931 C1173.1954,338.250953 1170.34375,335.335452 1168.24198,331.912907 L1095.48612,219.01118 L1095.48612,331.912907 C1095.48612,335.335452 1094.27857,338.250953 1091.86699,340.662931 C1089.45541,343.07491 1086.54038,344.28266 1083.1184,344.28266 L1059.96369,344.28266 C1056.54171,344.28266 1053.60204,343.07491 1051.14821,340.662931 C1048.69086,338.250953 1047.46219,335.335452 1047.46219,331.912907" id="Fill-8"></path>
<path d="M1330.72595,307.04171 L1365.7203,307.04171 C1389.3186,307.04171 1405.36883,302.745923 1413.87801,294.147307 C1422.38368,285.548692 1426.63652,270.833862 1426.63652,249.999296 C1426.63652,229.16473 1422.38368,214.425252 1413.87801,205.784382 C1405.36883,197.147034 1389.3186,192.823078 1365.7203,192.823078 L1330.72595,192.823078 L1330.72595,307.04171 Z M1281.12481,332.175584 L1281.12481,168.347657 C1281.12481,164.752577 1282.35348,161.724399 1284.81083,159.270167 C1287.26466,156.812414 1290.20432,155.583537 1293.62631,155.583537 L1367.17077,155.583537 C1405.23504,155.583537 1432.93128,163.196234 1450.25594,178.414587 C1467.57709,193.636461 1476.23766,217.495683 1476.23766,249.999296 C1476.23766,282.502908 1467.57709,306.341004 1450.25594,321.517103 C1432.93128,336.693202 1405.23504,344.281251 1367.17077,344.281251 L1293.62631,344.281251 C1290.20432,344.281251 1287.26466,343.119276 1284.81083,340.795326 C1282.35348,338.471376 1281.12481,335.598128 1281.12481,332.175584 L1281.12481,332.175584 Z" id="Fill-10"></path>
<path d="M1641.35677,202.956558 C1632.49201,192.428359 1618.17742,187.16426 1598.39892,187.16426 C1578.62043,187.16426 1564.27767,192.428359 1555.37418,202.956558 C1546.47421,213.484756 1542.0207,229.164378 1542.0207,249.998944 C1542.0207,270.833509 1546.47421,286.495525 1555.37418,296.974428 C1564.27767,307.460373 1578.62043,312.699825 1598.39892,312.699825 C1618.17742,312.699825 1632.49201,307.460373 1641.35677,296.974428 C1650.2145,286.495525 1654.64336,270.833509 1654.64336,249.998944 C1654.64336,229.164378 1650.2145,213.484756 1641.35677,202.956558 M1677.3404,324.738591 C1659.39963,340.488635 1633.08698,348.361897 1598.39892,348.361897 C1563.70734,348.361897 1537.37356,340.488635 1519.39055,324.738591 C1501.41106,308.995589 1492.41956,284.058899 1492.41956,249.932042 C1492.41956,215.808707 1501.41106,190.896664 1519.39055,175.192395 C1537.37356,159.488125 1563.70734,151.635991 1598.39892,151.635991 C1633.08698,151.635991 1659.39963,159.488125 1677.3404,175.192395 C1695.27412,190.896664 1704.2445,215.808707 1704.2445,249.932042 C1704.2445,284.058899 1695.27412,308.995589 1677.3404,324.738591" id="Fill-12"></path>
<path d="M1780.81453,238.090459 L1836.86182,238.090459 C1845.89557,238.090459 1853.85556,236.29468 1860.74177,232.696078 C1867.62446,229.097476 1871.07109,223.350981 1871.07109,215.456593 C1871.07109,207.562204 1867.62446,201.815709 1860.74177,198.217108 C1853.85556,194.622027 1845.89557,192.826247 1836.86182,192.826247 L1780.81453,192.826247 L1780.81453,238.090459 Z M1927.11837,338.622433 C1927.11837,342.397091 1924.88282,344.280899 1920.40467,344.280899 L1888.8323,344.280899 C1885.49481,344.280899 1881.83343,343.076671 1877.84816,340.661171 C1873.85585,338.252713 1870.80704,335.333691 1868.70175,331.914667 L1846.33564,296.911048 C1837.12586,282.523683 1825.98682,275.330001 1812.9185,275.330001 L1780.81453,275.330001 L1780.81453,331.914667 C1780.81453,335.333691 1779.60698,338.252713 1777.19892,340.661171 C1774.78382,343.076671 1771.8688,344.280899 1768.44681,344.280899 L1743.71489,344.280899 C1740.29291,344.280899 1737.35324,343.076671 1734.89941,340.661171 C1732.44206,338.252713 1731.21339,335.333691 1731.21339,331.914667 L1731.21339,168.086741 C1731.21339,164.664196 1732.39982,161.727568 1734.76915,159.269815 C1737.13497,156.812061 1740.02887,155.583185 1743.45085,155.583185 L1851.99318,155.583185 C1872.07797,155.583185 1888.54714,160.981087 1901.39717,171.76985 C1914.24369,182.558613 1920.67223,197.122034 1920.67223,215.456593 C1920.67223,240.984834 1904.13617,256.995442 1871.07109,263.484897 C1876.33432,265.418001 1881.20325,268.731391 1885.67436,273.421545 C1890.14899,278.11522 1895.27844,284.935662 1901.06624,293.88287 L1925.01308,331.914667 C1926.41426,334.3689 1927.11837,336.608343 1927.11837,338.622433 L1927.11837,338.622433 Z" id="Fill-14"></path>
<path d="M2002.63716,261.512708 L2086.44405,261.512708 L2086.44405,192.825895 L2048.94659,192.825895 C2040.52893,192.825895 2033.18153,195.213226 2026.91141,199.99493 C2020.63778,204.776633 2016.40607,211.202708 2014.21276,219.273153 L2002.63716,261.512708 Z M1933.43355,332.174879 L1966.45639,206.9034 C1975.40212,172.780064 2004.52066,155.670861 2053.81552,155.586354 L2124.73012,155.586354 C2127.97608,155.586354 2130.6693,156.81523 2132.82389,159.269463 C2134.96791,161.727216 2136.0452,164.579337 2136.0452,167.822304 L2136.0452,332.174879 C2136.0452,335.597424 2134.81652,338.470672 2132.36269,340.794622 C2129.90182,343.118572 2126.96568,344.280547 2123.54722,344.280547 L2098.80825,344.280547 C2095.21376,344.280547 2092.25297,343.118572 2089.9294,340.794622 C2087.60584,338.470672 2086.44405,335.509396 2086.44405,331.914315 L2086.44405,298.75225 L1992.8993,298.75225 L1984.08382,331.914315 C1983.20368,335.509396 1981.23217,338.470672 1978.16576,340.794622 C1975.09232,343.118572 1971.84988,344.280547 1968.4279,344.280547 L1942.50955,344.280547 C1939.08757,344.280547 1936.63374,343.294629 1935.14102,341.322792 C1933.6483,339.347435 1932.92659,337.615036 1932.97236,336.122074 C1933.0146,334.632633 1933.16951,333.315728 1933.43355,332.174879 L1933.43355,332.174879 Z" id="Fill-16"></path>
<path d="M2223.2702,238.090459 L2279.31748,238.090459 C2288.35124,238.090459 2296.31122,236.29468 2303.19743,232.696078 C2310.08012,229.097476 2313.52675,223.350981 2313.52675,215.456593 C2313.52675,207.562204 2310.08012,201.815709 2303.19743,198.217108 C2296.31122,194.622027 2288.35124,192.826247 2279.31748,192.826247 L2223.2702,192.826247 L2223.2702,238.090459 Z M2369.57403,338.622433 C2369.57403,342.397091 2367.33848,344.280899 2362.86033,344.280899 L2331.28796,344.280899 C2327.95047,344.280899 2324.28909,343.076671 2320.30382,340.661171 C2316.31151,338.252713 2313.26271,335.333691 2311.15741,331.914667 L2288.79131,296.911048 C2279.58152,282.523683 2268.44248,275.330001 2255.37417,275.330001 L2223.2702,275.330001 L2223.2702,331.914667 C2223.2702,335.333691 2222.06264,338.252713 2219.65458,340.661171 C2217.23948,343.076671 2214.32446,344.280899 2210.90247,344.280899 L2186.17055,344.280899 C2182.74857,344.280899 2179.8089,343.076671 2177.35508,340.661171 C2174.89773,338.252713 2173.66905,335.333691 2173.66905,331.914667 L2173.66905,168.086741 C2173.66905,164.664196 2174.85548,161.727568 2177.22481,159.269815 C2179.59063,156.812061 2182.48453,155.583185 2185.90651,155.583185 L2294.44884,155.583185 C2314.53363,155.583185 2331.0028,160.981087 2343.85284,171.76985 C2356.69935,182.558613 2363.12789,197.122034 2363.12789,215.456593 C2363.12789,240.984834 2346.59183,256.995442 2313.52675,263.484897 C2318.78998,265.418001 2323.65891,268.731391 2328.13002,273.421545 C2332.60465,278.11522 2337.73411,284.935662 2343.5219,293.88287 L2367.46874,331.914667 C2368.86992,334.3689 2369.57403,336.608343 2369.57403,338.622433 L2369.57403,338.622433 Z" id="Fill-18"></path>
<path d="M2405.03275,322.042456 C2388.76072,306.514244 2380.62471,282.503613 2380.62471,250 C2380.62471,217.496387 2388.76072,193.461108 2405.03275,177.890642 C2421.30124,162.316654 2445.70927,154.531421 2478.24979,154.531421 L2507.59013,154.531421 C2527.49888,154.531421 2545.1052,159.707492 2560.41258,170.059634 C2575.71645,180.411776 2583.37014,194.58083 2583.37014,212.563275 C2583.37014,217.739346 2581.83518,221.443582 2578.76877,223.679503 C2575.69533,225.918946 2572.71341,227.038668 2569.81951,227.038668 L2554.16359,227.038668 C2546.09095,227.038668 2539.82084,222.211189 2535.34973,212.563275 C2528.85782,198.70056 2518.06731,191.770963 2502.98172,191.770963 L2479.56648,191.770963 C2460.35832,191.770963 2447.33225,195.894214 2440.48829,204.140716 C2433.64784,212.387218 2430.22586,227.651345 2430.22586,249.933098 C2430.22586,272.218372 2433.64784,287.500106 2440.48829,295.792383 C2447.33225,304.081138 2460.35832,308.225516 2479.56648,308.225516 L2505.74535,308.225516 C2520.83447,308.225516 2531.57569,301.295919 2537.98311,287.436725 C2542.45422,277.697261 2548.7701,272.827529 2556.92723,272.827529 L2572.58315,272.827529 C2576.70573,272.827529 2579.96928,274.362745 2582.38439,277.436697 C2584.79597,280.507128 2586,283.838123 2586,287.436725 C2586,305.41917 2578.37095,319.563576 2563.10933,329.873464 C2547.84771,340.179831 2530.259,345.334776 2510.35024,345.334776 L2478.24979,345.334776 C2445.70927,345.334776 2421.30124,337.570669 2405.03275,322.042456" id="Fill-20"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="2586px" height="500px" viewBox="0 0 2586 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Pandora RC</title>
<defs>
<polygon id="path-1" points="0 0 499.919269 0 499.919269 500 0 500"></polygon>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Pandora-RC">
<ellipse id="Oval" fill="#FFFFFF" cx="246.439077" cy="250.000704" rx="232.356844" ry="232.395021"></ellipse>
<g id="Group-3">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="Clip-2"></g>
<path d="M383.135312,354.853112 C368.253912,367.5785 348.637362,378.490503 327.50345,384.159533 C303.84882,390.511663 277.275646,392.268711 251.94523,388.906025 C204.245186,382.627838 161.368307,352.529162 132.513812,324.293167 C135.802013,316.507934 136.780729,313.662855 140.153423,306.004383 C145.821522,311.895245 155.890319,319.754422 160.364948,322.842459 C191.34234,344.395336 231.811157,362.951727 285.415177,359.849605 C312.558681,358.367207 337.737713,348.948166 355.601026,334.610097 C372.922172,320.747382 387.409269,300.838876 387.081857,273.134572 C386.743884,243.817588 372.358883,219.902028 356.667755,203.880856 C351.291862,198.373798 345.4759,192.479415 339.603609,188.137854 C330.316376,181.275159 319.990579,175.954721 309.611973,170.926538 C299.046778,165.72934 288.196418,160.528621 275.606901,157.810304 C296.371154,144.613083 352.112153,128.436982 358.71672,132.204598 C362.846335,134.549675 367.299841,138.306728 370.728864,141.10251 C382.124911,150.218733 391.852214,163.060318 400.188896,174.965282 C412.123588,192.15195 422.185344,212.035809 425.864327,234.409111 C434.817107,289.666309 412.176397,330.117127 383.135312,354.853112 M50.3193389,262.986656 L50.3193389,262.919755 C75.7729749,222.828092 105.162595,186.549821 140.051327,155.736354 C164.10026,134.436998 192.444275,115.447508 223.82301,101.655216 C229.089766,99.3030966 234.194575,96.3453418 239.883797,94.5108296 C245.509649,92.6551906 251.38194,90.8136361 257.384492,88.8206727 C280.331491,81.2572711 311.903857,77.4474013 337.220191,80.2361415 C356.153753,82.4227674 375.002822,87.8664447 387.578256,97.6411201 C391.852214,100.912256 396.967585,104.493252 399.699538,108.415798 C401.290831,110.690453 403.515823,115.919341 402.255463,119.024983 C400.692336,122.792599 394.932702,123.162319 390.165866,123.070769 C373.879764,122.736261 358.987803,121.02851 343.240346,122.926403 C320.923527,125.662326 302.444117,131.926428 286.50655,138.606024 C252.842972,152.62719 223.925107,175.729368 201.125971,199.046335 C178.136726,222.490063 156.900719,252.028879 139.998519,282.356429 C121.181135,316.127651 106.986244,351.733385 95.2663059,389.120814 C68.3621998,353.990434 51.6923566,310.567776 50.3193389,262.986656 M249.952594,0 C111.890382,0 0,111.901724 0,249.979577 C0,388.075037 111.890382,500.001408 249.952594,500.001408 C388.025367,500.001408 499.919269,388.075037 499.919269,249.979577 C499.919269,111.901724 388.025367,0 249.952594,0" id="Fill-1" fill="#82B92E" mask="url(#mask-2)"></path>
</g>
<path d="M659.867032,265.066592 L707.890966,265.066592 C722.624503,265.066592 733.809316,262.587712 741.438366,257.629951 C749.070936,252.675712 752.887221,243.112305 752.887221,228.946772 C752.887221,214.777718 749.070936,205.21431 741.438366,200.260071 C733.809316,195.305832 722.624503,192.82343 707.890966,192.82343 L659.867032,192.82343 L659.867032,265.066592 Z M610.265887,331.91185 L610.265887,168.087445 C610.265887,164.6649 611.452315,161.724751 613.82165,159.270519 C616.187466,156.812766 619.081364,155.583889 622.503347,155.583889 L722.888545,155.583889 C775.953919,155.583889 802.488366,180.041704 802.488366,228.946772 C802.488366,277.851839 775.953919,302.306133 722.888545,302.306133 L659.867032,302.306133 L659.867032,331.91185 C659.867032,335.334395 658.65948,338.253418 656.251418,340.661875 C653.836315,343.077375 650.921293,344.281604 647.49931,344.281604 L622.767389,344.281604 C619.345406,344.281604 616.40574,343.077375 613.951911,340.661875 C611.494561,338.253418 610.265887,335.334395 610.265887,331.91185 L610.265887,331.91185 Z" id="Fill-4" fill="#181818"></path>
<path d="M876.429595,261.512708 L960.236483,261.512708 L960.236483,192.825895 L922.739018,192.825895 C914.321363,192.825895 906.973958,195.213226 900.703844,199.99493 C894.430209,204.776633 890.198498,211.202708 888.00519,219.273153 L876.429595,261.512708 Z M807.225981,332.174879 L840.248818,206.9034 C849.194556,172.780064 878.313093,155.670861 927.60795,155.586354 L998.522554,155.586354 C1001.76851,155.586354 1004.46174,156.81523 1006.61632,159.269463 C1008.76034,161.727216 1009.83763,164.579337 1009.83763,167.822304 L1009.83763,332.174879 C1009.83763,335.597424 1008.60895,338.470672 1006.15512,340.794622 C1003.69425,343.118572 1000.75811,344.280547 997.339647,344.280547 L972.600684,344.280547 C969.006194,344.280547 966.045405,343.118572 963.721836,340.794622 C961.398268,338.470672 960.236483,335.509396 960.236483,331.914315 L960.236483,298.75225 L866.691731,298.75225 L857.876253,331.914315 C856.996113,335.509396 855.024601,338.470672 851.958194,340.794622 C848.884747,343.118572 845.642313,344.280547 842.22033,344.280547 L816.301981,344.280547 C812.879998,344.280547 810.426169,343.294629 808.933452,341.322792 C807.440735,339.347435 806.719021,337.615036 806.764788,336.122074 C806.807035,334.632633 806.96194,333.315728 807.225981,332.174879 L807.225981,332.174879 Z" id="Fill-6" fill="#181818"></path>
<path d="M1047.46219,331.912907 L1047.46219,168.084981 C1047.46219,164.662436 1048.64861,161.725808 1051.01795,159.268054 C1053.38377,156.813822 1056.27766,155.584945 1059.69965,155.584945 L1098.38002,155.584945 C1101.44995,155.584945 1104.6959,156.813822 1108.11788,159.268054 C1111.53635,161.725808 1114.34223,164.662436 1116.53554,168.084981 L1196.00158,290.328283 L1196.00158,167.820895 C1196.00158,164.401872 1197.20561,161.503976 1199.62071,159.137772 C1202.02878,156.768047 1204.94732,155.584945 1208.3693,155.584945 L1230.99945,155.584945 C1234.41791,155.584945 1237.33645,156.768047 1239.74804,159.137772 C1242.15962,161.503976 1243.36717,164.4899 1243.36717,168.084981 L1243.36717,331.912907 C1243.36717,335.335452 1242.15962,338.250953 1239.74804,340.662931 C1237.33645,343.07491 1234.41791,344.28266 1230.99945,344.28266 L1187.31988,344.28266 C1183.8979,344.28266 1180.3879,343.07491 1176.79341,340.662931 C1173.1954,338.250953 1170.34375,335.335452 1168.24198,331.912907 L1095.48612,219.01118 L1095.48612,331.912907 C1095.48612,335.335452 1094.27857,338.250953 1091.86699,340.662931 C1089.45541,343.07491 1086.54038,344.28266 1083.1184,344.28266 L1059.96369,344.28266 C1056.54171,344.28266 1053.60204,343.07491 1051.14821,340.662931 C1048.69086,338.250953 1047.46219,335.335452 1047.46219,331.912907" id="Fill-8" fill="#181818"></path>
<path d="M1330.72595,307.04171 L1365.7203,307.04171 C1389.3186,307.04171 1405.36883,302.745923 1413.87801,294.147307 C1422.38368,285.548692 1426.63652,270.833862 1426.63652,249.999296 C1426.63652,229.16473 1422.38368,214.425252 1413.87801,205.784382 C1405.36883,197.147034 1389.3186,192.823078 1365.7203,192.823078 L1330.72595,192.823078 L1330.72595,307.04171 Z M1281.12481,332.175584 L1281.12481,168.347657 C1281.12481,164.752577 1282.35348,161.724399 1284.81083,159.270167 C1287.26466,156.812414 1290.20432,155.583537 1293.62631,155.583537 L1367.17077,155.583537 C1405.23504,155.583537 1432.93128,163.196234 1450.25594,178.414587 C1467.57709,193.636461 1476.23766,217.495683 1476.23766,249.999296 C1476.23766,282.502908 1467.57709,306.341004 1450.25594,321.517103 C1432.93128,336.693202 1405.23504,344.281251 1367.17077,344.281251 L1293.62631,344.281251 C1290.20432,344.281251 1287.26466,343.119276 1284.81083,340.795326 C1282.35348,338.471376 1281.12481,335.598128 1281.12481,332.175584 L1281.12481,332.175584 Z" id="Fill-10" fill="#181818"></path>
<path d="M1641.35677,202.956558 C1632.49201,192.428359 1618.17742,187.16426 1598.39892,187.16426 C1578.62043,187.16426 1564.27767,192.428359 1555.37418,202.956558 C1546.47421,213.484756 1542.0207,229.164378 1542.0207,249.998944 C1542.0207,270.833509 1546.47421,286.495525 1555.37418,296.974428 C1564.27767,307.460373 1578.62043,312.699825 1598.39892,312.699825 C1618.17742,312.699825 1632.49201,307.460373 1641.35677,296.974428 C1650.2145,286.495525 1654.64336,270.833509 1654.64336,249.998944 C1654.64336,229.164378 1650.2145,213.484756 1641.35677,202.956558 M1677.3404,324.738591 C1659.39963,340.488635 1633.08698,348.361897 1598.39892,348.361897 C1563.70734,348.361897 1537.37356,340.488635 1519.39055,324.738591 C1501.41106,308.995589 1492.41956,284.058899 1492.41956,249.932042 C1492.41956,215.808707 1501.41106,190.896664 1519.39055,175.192395 C1537.37356,159.488125 1563.70734,151.635991 1598.39892,151.635991 C1633.08698,151.635991 1659.39963,159.488125 1677.3404,175.192395 C1695.27412,190.896664 1704.2445,215.808707 1704.2445,249.932042 C1704.2445,284.058899 1695.27412,308.995589 1677.3404,324.738591" id="Fill-12" fill="#181818"></path>
<path d="M1780.81453,238.090459 L1836.86182,238.090459 C1845.89557,238.090459 1853.85556,236.29468 1860.74177,232.696078 C1867.62446,229.097476 1871.07109,223.350981 1871.07109,215.456593 C1871.07109,207.562204 1867.62446,201.815709 1860.74177,198.217108 C1853.85556,194.622027 1845.89557,192.826247 1836.86182,192.826247 L1780.81453,192.826247 L1780.81453,238.090459 Z M1927.11837,338.622433 C1927.11837,342.397091 1924.88282,344.280899 1920.40467,344.280899 L1888.8323,344.280899 C1885.49481,344.280899 1881.83343,343.076671 1877.84816,340.661171 C1873.85585,338.252713 1870.80704,335.333691 1868.70175,331.914667 L1846.33564,296.911048 C1837.12586,282.523683 1825.98682,275.330001 1812.9185,275.330001 L1780.81453,275.330001 L1780.81453,331.914667 C1780.81453,335.333691 1779.60698,338.252713 1777.19892,340.661171 C1774.78382,343.076671 1771.8688,344.280899 1768.44681,344.280899 L1743.71489,344.280899 C1740.29291,344.280899 1737.35324,343.076671 1734.89941,340.661171 C1732.44206,338.252713 1731.21339,335.333691 1731.21339,331.914667 L1731.21339,168.086741 C1731.21339,164.664196 1732.39982,161.727568 1734.76915,159.269815 C1737.13497,156.812061 1740.02887,155.583185 1743.45085,155.583185 L1851.99318,155.583185 C1872.07797,155.583185 1888.54714,160.981087 1901.39717,171.76985 C1914.24369,182.558613 1920.67223,197.122034 1920.67223,215.456593 C1920.67223,240.984834 1904.13617,256.995442 1871.07109,263.484897 C1876.33432,265.418001 1881.20325,268.731391 1885.67436,273.421545 C1890.14899,278.11522 1895.27844,284.935662 1901.06624,293.88287 L1925.01308,331.914667 C1926.41426,334.3689 1927.11837,336.608343 1927.11837,338.622433 L1927.11837,338.622433 Z" id="Fill-14" fill="#181818"></path>
<path d="M2002.63716,261.512708 L2086.44405,261.512708 L2086.44405,192.825895 L2048.94659,192.825895 C2040.52893,192.825895 2033.18153,195.213226 2026.91141,199.99493 C2020.63778,204.776633 2016.40607,211.202708 2014.21276,219.273153 L2002.63716,261.512708 Z M1933.43355,332.174879 L1966.45639,206.9034 C1975.40212,172.780064 2004.52066,155.670861 2053.81552,155.586354 L2124.73012,155.586354 C2127.97608,155.586354 2130.6693,156.81523 2132.82389,159.269463 C2134.96791,161.727216 2136.0452,164.579337 2136.0452,167.822304 L2136.0452,332.174879 C2136.0452,335.597424 2134.81652,338.470672 2132.36269,340.794622 C2129.90182,343.118572 2126.96568,344.280547 2123.54722,344.280547 L2098.80825,344.280547 C2095.21376,344.280547 2092.25297,343.118572 2089.9294,340.794622 C2087.60584,338.470672 2086.44405,335.509396 2086.44405,331.914315 L2086.44405,298.75225 L1992.8993,298.75225 L1984.08382,331.914315 C1983.20368,335.509396 1981.23217,338.470672 1978.16576,340.794622 C1975.09232,343.118572 1971.84988,344.280547 1968.4279,344.280547 L1942.50955,344.280547 C1939.08757,344.280547 1936.63374,343.294629 1935.14102,341.322792 C1933.6483,339.347435 1932.92659,337.615036 1932.97236,336.122074 C1933.0146,334.632633 1933.16951,333.315728 1933.43355,332.174879 L1933.43355,332.174879 Z" id="Fill-16" fill="#181818"></path>
<path d="M2223.2702,238.090459 L2279.31748,238.090459 C2288.35124,238.090459 2296.31122,236.29468 2303.19743,232.696078 C2310.08012,229.097476 2313.52675,223.350981 2313.52675,215.456593 C2313.52675,207.562204 2310.08012,201.815709 2303.19743,198.217108 C2296.31122,194.622027 2288.35124,192.826247 2279.31748,192.826247 L2223.2702,192.826247 L2223.2702,238.090459 Z M2369.57403,338.622433 C2369.57403,342.397091 2367.33848,344.280899 2362.86033,344.280899 L2331.28796,344.280899 C2327.95047,344.280899 2324.28909,343.076671 2320.30382,340.661171 C2316.31151,338.252713 2313.26271,335.333691 2311.15741,331.914667 L2288.79131,296.911048 C2279.58152,282.523683 2268.44248,275.330001 2255.37417,275.330001 L2223.2702,275.330001 L2223.2702,331.914667 C2223.2702,335.333691 2222.06264,338.252713 2219.65458,340.661171 C2217.23948,343.076671 2214.32446,344.280899 2210.90247,344.280899 L2186.17055,344.280899 C2182.74857,344.280899 2179.8089,343.076671 2177.35508,340.661171 C2174.89773,338.252713 2173.66905,335.333691 2173.66905,331.914667 L2173.66905,168.086741 C2173.66905,164.664196 2174.85548,161.727568 2177.22481,159.269815 C2179.59063,156.812061 2182.48453,155.583185 2185.90651,155.583185 L2294.44884,155.583185 C2314.53363,155.583185 2331.0028,160.981087 2343.85284,171.76985 C2356.69935,182.558613 2363.12789,197.122034 2363.12789,215.456593 C2363.12789,240.984834 2346.59183,256.995442 2313.52675,263.484897 C2318.78998,265.418001 2323.65891,268.731391 2328.13002,273.421545 C2332.60465,278.11522 2337.73411,284.935662 2343.5219,293.88287 L2367.46874,331.914667 C2368.86992,334.3689 2369.57403,336.608343 2369.57403,338.622433 L2369.57403,338.622433 Z" id="Fill-18" fill="#82B92E"></path>
<path d="M2405.03275,322.042456 C2388.76072,306.514244 2380.62471,282.503613 2380.62471,250 C2380.62471,217.496387 2388.76072,193.461108 2405.03275,177.890642 C2421.30124,162.316654 2445.70927,154.531421 2478.24979,154.531421 L2507.59013,154.531421 C2527.49888,154.531421 2545.1052,159.707492 2560.41258,170.059634 C2575.71645,180.411776 2583.37014,194.58083 2583.37014,212.563275 C2583.37014,217.739346 2581.83518,221.443582 2578.76877,223.679503 C2575.69533,225.918946 2572.71341,227.038668 2569.81951,227.038668 L2554.16359,227.038668 C2546.09095,227.038668 2539.82084,222.211189 2535.34973,212.563275 C2528.85782,198.70056 2518.06731,191.770963 2502.98172,191.770963 L2479.56648,191.770963 C2460.35832,191.770963 2447.33225,195.894214 2440.48829,204.140716 C2433.64784,212.387218 2430.22586,227.651345 2430.22586,249.933098 C2430.22586,272.218372 2433.64784,287.500106 2440.48829,295.792383 C2447.33225,304.081138 2460.35832,308.225516 2479.56648,308.225516 L2505.74535,308.225516 C2520.83447,308.225516 2531.57569,301.295919 2537.98311,287.436725 C2542.45422,277.697261 2548.7701,272.827529 2556.92723,272.827529 L2572.58315,272.827529 C2576.70573,272.827529 2579.96928,274.362745 2582.38439,277.436697 C2584.79597,280.507128 2586,283.838123 2586,287.436725 C2586,305.41917 2578.37095,319.563576 2563.10933,329.873464 C2547.84771,340.179831 2530.259,345.334776 2510.35024,345.334776 L2478.24979,345.334776 C2445.70927,345.334776 2421.30124,337.570669 2405.03275,322.042456" id="Fill-20" fill="#82B92E"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

View File

@ -2033,20 +2033,6 @@ function config_update_config()
}
break;
case 'websocket_engine':
if (config_update_value('ws_bind_address', get_parameter('ws_bind_address'), true) === false) {
$error_update[] = __('WebSocket bind address');
}
if (config_update_value('ws_port', get_parameter('ws_port'), true) === false) {
$error_update[] = __('WebSocket port');
}
if (config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'), true) === false) {
$error_update[] = __('WebSocket proxy url');
}
break;
default:
// Ignore.
break;
@ -2503,6 +2489,18 @@ function config_process_config()
config_update_value('2Fa_auth', '');
}
if (!isset($config['gotty_ssh_enabled'])) {
config_update_value('gotty_ssh_enabled', 1);
}
if (!isset($config['gotty_telnet_enabled'])) {
config_update_value('gotty_telnet_enabled', 0);
}
if (!isset($config['gotty_port'])) {
config_update_value('gotty_port', 8080);
}
if (isset($config['performance_variables_control']) === false) {
config_update_value(
'performance_variables_control',

View File

@ -463,7 +463,6 @@ function cron_list_table()
);
$defined_tasks = db_get_all_rows_sql($sql);
if (!check_acl($config['id_user'], 0, 'PM')) {
$read_tasks = [];
foreach ($defined_tasks as $task) {

View File

@ -0,0 +1,542 @@
<?php
/**
* Schedule tasks on Pandora FMS Console
*
* @category library
* @package Pandora FMS
* @subpackage cron
* @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.
* ============================================================================
*/
/**
* Generate a lock system to avoid multiple executions.
*
* @param string $lockfile Filename to use as lock.
*
* @return boolean
*/
function cron_lock(string $lockfile)
{
global $config;
if (empty($lockfile) === true) {
$lockfile = 'cron.lock';
}
$ignore_lock = 0;
// Lock to prevent multiple instances of the cron extension.
$lock = $config['attachment_store'].'/'.$lockfile;
if (file_exists($lock) === true) {
// Lock file exists.
$read_PID = file_get_contents($lock);
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// Windows check.
$processes = explode("\n", shell_exec('tasklist.exe'));
$ignore_lock = 1;
foreach ($processes as $process) {
if (empty($process) === true
|| strpos('===', $process) === 0
) {
continue;
}
$matches = false;
preg_match('/(.*?)\s+(\d+).*$/', $process, $matches);
$pid = $matches[2];
if ((int) $pid === (int) $read_PID) {
$ignore_lock = 0;
break;
}
}
} else {
// Linux check.
if (file_exists('/proc/'.$read_PID) === true) {
// Process with a pid = $pid is running.
// CRON already running: [$read_PID].
$ignore_lock = 0;
} else {
// CRON process [$read_PID] does not exist.
// process not found, ignore $lock.
$ignore_lock = 1;
}
}
// The lock automatically expires after 24 hours.
$lock_mtime = filemtime($lock);
if (($ignore_lock === 0 )
&& ($lock_mtime !== false && $lock_mtime + SECONDS_1DAY > time())
) {
// Locked!
return false;
}
}
// Try to get a lock from DB.
$dblock = db_get_lock($config['dbname'].'.'.$lockfile);
if ($dblock !== 1) {
// Locked!
return false;
}
// Store PID in lock file.
$PID = getmypid();
echo 'CRON running ['.$PID."]\n";
file_put_contents($lock, $PID);
return true;
}
/**
* Check if CRON.task is available to start.
*
* @return boolean True, available. False not available.
*/
function cron_task_lock()
{
return cron_lock('cron.lock');
}
/**
* Release CRON.task lock
*
* @return void
*/
function cron_task_release_lock()
{
global $config;
// Release DB lock.
$dblock = db_release_lock($config['dbname'].'.cron.lock');
unlink($config['attachment_store'].'/cron.lock');
}
/**
* Calculates target schedule time
*
* @param string $scheduled_time Desired scheduled time.
* @param integer $custom_data Custom scheduled time.
* @param integer|null $timestamp Custom timestamp.
*
* @return integer amount of time.
*/
function cron_get_scheduled_time(
string $scheduled_time,
int $custom_data=0,
$timestamp=null
) {
if ($scheduled_time == 'no') {
return 0;
}
if ($scheduled_time == 'hourly') {
return SECONDS_1HOUR;
}
if ($scheduled_time == 'daily') {
return SECONDS_1DAY;
}
if ($scheduled_time == 'weekly') {
return SECONDS_1WEEK;
}
if ($scheduled_time == 'monthly') {
$month = (($timestamp === null) ? date('m') : date('m', $timestamp));
$year = (($timestamp === null) ? date('Y') : date('Y', $timestamp));
$days_month = (cal_days_in_month(
CAL_GREGORIAN,
$month,
$year
) * SECONDS_1DAY);
return $days_month;
}
if ($scheduled_time == 'yearly') {
return SECONDS_1YEAR;
}
if ($scheduled_time == 'custom') {
return $custom_data;
}
return 0;
}
/**
* Run scheduled task.
*
* @param integer $id_user_task Task to be run.
* @param boolean $force_run Force run.
*
* @return void
*/
function cron_task_run(
int $id_user_task,
bool $force_run=false
) {
global $config;
if (isset($config['id_console']) === true && $config['id_console'] > 0) {
$sql = sprintf(
'SELECT *
FROM tuser_task_scheduled
WHERE id=%d AND id_console IN (0, %d)',
$id_user_task,
$config['id_console']
);
$task_scheduled = db_get_row_sql($sql);
if ($task_scheduled !== false) {
db_process_sql_update(
'tconsole',
['last_execution' => time()],
['id_console' => $config['id_console']]
);
}
} else {
$filter = [
'id' => $id_user_task,
'id_console' => 0,
];
$task_scheduled = db_get_row_filter('tuser_task_scheduled', $filter, false);
}
$args = unserialize($task_scheduled['args']);
if ((bool) $config['enterprise_installed'] === false
&& isset($args['function_name']) === true
&& $args['function_name'] !== 'cron_task_start_gotty'
) {
// Only cron_task_start_gotty is allowed to run in non enterprise environments.
return;
}
if ((bool) $config['enterprise_installed'] === true) {
$task = db_get_row('tuser_task', 'id', $task_scheduled['id_user_task']);
} else {
$task = [
'name' => 'Call PHP function',
'function_name' => 'cron_task_call_user_function',
];
}
// Register shutdown function in case of fatal error, like.
register_shutdown_function('cron_task_handle_error', $task_scheduled, $task, $force_run);
if (is_metaconsole() && !defined('METACONSOLE')) {
define('METACONSOLE', 1);
}
if (! function_exists($task['function_name'])) {
return;
}
// If the task is disable, not run.
if ((bool) $task_scheduled['enabled'] === false) {
return;
}
if (session_status() === PHP_SESSION_DISABLED) {
return;
}
$old_user = '';
if (isset($config['id_user']) === false) {
$config['id_user'] = $task_scheduled['id_usuario'];
}
$old_user = $config['id_user'];
$old_session_id = session_id();
$new_session_id = 'cron-'.uniqid();
// Simulate user login.
session_id($new_session_id);
session_start();
$_SESSION['id_usuario'] = $config['id_user'];
session_write_close();
set_time_limit(0);
if ($task['function_name'] == 'cron_task_generate_report_by_template'
|| $task['function_name'] == 'cron_task_generate_report'
) {
// If empty agent position, add it.
if (!isset($args[1])) {
array_splice($args, 1, 0, '');
}
$args[] = $task_scheduled['scheduled'];
}
call_user_func_array(
$task['function_name'],
array_merge(array_values(($args ?? [])), [$id_user_task])
);
if (session_status() === PHP_SESSION_ACTIVE) {
@session_destroy();
}
session_id($old_session_id);
session_start();
$config['id_user'] = $old_user;
$sql = '';
$sql2 = '';
if (!$force_run) {
$period = cron_get_scheduled_time(
$task_scheduled['scheduled'],
$task_scheduled['custom_data']
);
$old_args = unserialize($task_scheduled['args']);
if ($period > 3600) {
$array_explode = explode(
':',
date('H:i', $old_args['first_execution'])
);
$hora_en_segundos = (($array_explode[0] * 3600 ) + ($array_explode[1] * 60));
$array_explode_period = explode(
':',
date('H:i', ($old_args['first_execution'] + $period))
);
$hora_en_segundos2 = (($array_explode_period[0] * 3600 ) + ($array_explode_period[1] * 60));
if ($hora_en_segundos !== $hora_en_segundos2) {
$period = ($period + ($hora_en_segundos - $hora_en_segundos2));
}
}
try {
/*
Calculate the number of periods between last execution and
current time.
*/
$num_of_periods = 0;
if ($period !== 0) {
$num_of_periods = ceil(
(time() - $old_args['first_execution']) / $period
);
}
if ($task_scheduled['scheduled'] == 'monthly') {
$updated_time = $old_args['first_execution'];
// Update updated_time adding the period for each month individually since it is a variable value depending on the number of days a month has.
while ($num_of_periods > 0) {
// Get days of current month.
$monthly_period = cron_get_scheduled_time(
'monthly',
$task_scheduled['custom_data'],
$updated_time
);
$updated_time += $monthly_period;
$num_of_periods--;
}
$old_args['first_execution'] = $updated_time;
} else if ($task_scheduled['scheduled'] == 'weekly') {
$weekly_schedule = json_decode(io_safe_output($old_args['weekly_schedule']), true);
if (empty($weekly_schedule) !== true) {
$datetime = new DateTime('tomorrow');
$nameday = strtolower($datetime->format('l'));
$continue = true;
while ($continue === true) {
if (isset($weekly_schedule[$nameday]) === true) {
$weekly_date = $datetime->format('Y-m-d');
$weekly_time = $weekly_schedule[$nameday][0]['start'];
$old_args['first_execution'] = strtotime($weekly_date.' '.$weekly_time);
$continue = false;
} else {
$datetime->modify('+1 day');
$nameday = strtolower($datetime->format('l'));
}
}
}
} else {
// Add it to next execution.
$old_args['first_execution'] += ($period * $num_of_periods);
}
} catch (Exception $e) {
// If some error (ex $period=0) next execution=current time+period.
$old_args['first_execution'] = (time() + $period);
}
$new_args = serialize($old_args);
}
if ($config['timesource'] == 'sql') {
$sql = sprintf(
'UPDATE tuser_task_scheduled
SET last_run=UNIX_TIMESTAMP()
WHERE id=%d',
$id_user_task
);
} else {
$sql = sprintf(
'UPDATE tuser_task_scheduled
SET last_run= %d
WHERE id=%d',
time(),
$id_user_task
);
}
if (!$force_run) {
$sql2 = "UPDATE tuser_task_scheduled
SET args = '".$new_args."'
WHERE id=".$id_user_task;
}
db_process_sql($sql);
db_process_sql($sql2);
}
/**
* Execuytes custom function defined in PHP.
*
* @param string $function_name Name to execute.
*
* @return void
*/
function cron_task_call_user_function(string $function_name)
{
global $config;
include_once $config['homedir'].'/vendor/autoload.php';
call_user_func($function_name);
}
/**
* Check whether GoTTY SSH and Telnet processes are running and start otherwise.
*
* @param boolean $restart_mode Restart the processes if running.
*
* @return void
*/
function cron_task_start_gotty(bool $restart_mode=true)
{
global $config;
include_once $config['homedir'].'/include/functions_config.php';
$gotty_ssh_enabled = (bool) $config['gotty_ssh_enabled'];
$gotty_telnet_enabled = (bool) $config['gotty_telnet_enabled'];
// Check prev process running and kill it (only if port changed in setup params).
if (empty($config['restart_gotty_next_cron_port']) === false) {
config_update_value('restart_gotty_next_cron_port', '');
$prevProcessRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
if (empty($prevProcessRunning) === false) {
shell_exec("pkill -f 'pandora_gotty.*-p ".$config['restart_gotty_next_cron_port']."'");
}
}
// Check if gotty is running on the configured port.
$processRunning = shell_exec("pgrep -f 'pandora_gotty.*-p ".$config['gotty_port']."'");
$start_proc = true;
// If both methods are disabled, do not start process.
if ($gotty_ssh_enabled === false && $gotty_telnet_enabled === false) {
$start_proc = false;
}
if (empty($processRunning) === false) {
// Process is running.
if ($restart_mode === true || $start_proc === false) {
// Stop the process for restarting or in case GoTTY method is disabled in this iteration.
shell_exec("pkill -f 'pandora_gotty.*-p ".$config['gotty_port']."'");
} else {
// Prevent starting if already running and must not be restarted or terminated.
return;
}
}
if ($start_proc === true) {
$logFilePath = $config['homedir'].'/log/gotty_cron_tmp.log';
shell_exec('touch '.$logFilePath);
// Start gotty process and capture the output.
$command = '/usr/bin/nohup /usr/bin/pandora_gotty --config /etc/pandora_gotty/pandora_gotty.conf -p '.$config['gotty_port'].' /usr/bin/pandora_gotty_exec > '.$logFilePath.' 2>&1 &';
shell_exec($command);
} else {
return;
}
$hash_read = false;
// Maximum wait time to read asynchronously the output of the executed commands (seconds).
$maxWaitTime = 10;
// Wait for content to appear in the log file.
$startTime = time();
// Workaround to wait until process inputs data in the log.
while (time() - $startTime < $maxWaitTime) {
if ($start_proc === true) {
// Read command output.
$log_content = file_get_contents($logFilePath);
}
if ($start_proc === true
&& !empty($log_content)
&& $hash_read === false
) {
// Extract the URL from the output.
if (preg_match('/.*?HTTP server is listening at:\s+(\S+)/', $log_content, $matches)) {
$url = $matches[1];
// Extract the hash.
$parts = explode('/', $url);
$hash = array_slice($parts, -2, 1)[0];
config_update_value('gotty_connection_hash', $hash);
$hash_read = true;
}
unlink($logFilePath);
}
if ($start_proc === false || $hash_read === true) {
// As soon as the read has completed, the timing loop will terminate.
break;
}
// Sleep for a short interval before checking again.
usleep(100000);
}
}

View File

@ -70,3 +70,138 @@ $(document).ready(function() {
});
});
});
/**
* Loads modal from AJAX to add a new key or edit an existing one.
*/
function show_migration_form(shortName, hash) {
var title = textsToTranslate["Migrate"];
var method = "migrateApp";
$("#migrate_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 630,
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
title: title,
open: function() {
$("#migrate_modal").empty();
$.ajax({
type: "POST",
url: url,
data: {
page: page,
method: "loadMigrateModal",
shortName: shortName,
hash: hash
},
dataType: "html",
success: function(data) {
$("#migrate_modal").append(data);
$("#button-migrate").click(function() {
// All fields are required.
loadingMigration(true);
$.ajax({
type: "POST",
url: url,
data: {
page: page,
method: method,
hash: $("#text-hash").val(),
shortName: shortName
},
success: function(data) {
loadingMigration(false);
showMsg(data, shortName);
},
error: function(e) {
loadingMigration(false);
e.error = e.statusText;
showMsg(JSON.stringify(e));
}
});
});
$("#button-cancel").click(function() {
$("#migrate_modal").dialog("close");
});
}
});
}
});
$(".ui-widget-overlay").css("background", "#000");
$(".ui-widget-overlay").css("opacity", 0.6);
$(".ui-draggable").css("cursor", "inherit");
}
/**
* Process ajax responses and shows a dialog with results.
*/
function showMsg(data, shortName) {
var title = textsToTranslate["migrationSuccess"];
var text = "";
var failed = 0;
try {
data = JSON.parse(data);
text = data["result"];
} catch (err) {
title = textsToTranslate["Error"];
text = err.message;
failed = 1;
}
if (!failed && data["error"] != undefined) {
title = textsToTranslate["Error"];
text = data["error"];
failed = 1;
} else {
$("input[name='button_migrate-" + shortName + "']").hide();
$("#migrate_modal").dialog("close");
}
$("#msg").empty();
$("#msg").html(text);
$("#msg").dialog({
width: 450,
position: {
my: "center",
at: "center",
of: window,
collision: "fit"
},
title: title,
buttons: [
{
class:
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: "OK",
click: function(e) {
if (!failed) {
$(".ui-dialog-content").dialog("close");
$(".info").hide();
} else {
$(this).dialog("close");
}
}
}
]
});
}
function loadingMigration(status) {
if (status) {
$("#migration-spinner").show();
$("#button-migrate").attr("disabled", "true");
$("#button-cancel").attr("disabled", "true");
} else {
$("#migration-spinner").hide();
$("#button-migrate").removeAttr("disabled");
$("#button-cancel").removeAttr("disabled");
}
}

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.773.3';
$build = '231010';
$build = '231011';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -1759,7 +1759,7 @@ if ((bool) $config['ehorus_enabled'] === true && empty($config['ehorus_custom_fi
'images/RC.png',
true,
[
'title' => __('eHorus'),
'title' => __('Pandora RC'),
'class' => 'invert_filter',
]
).'</a>';
@ -2048,7 +2048,7 @@ switch ($tab) {
break;
case 'ehorus':
$tab_name = __('eHorus');
$tab_name = __('Pandora RC');
break;
case 'extension':

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 231010
%define release 231011
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 231010
%define release 231011
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.773.3
%define release 231010
%define release 231011
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,175 +0,0 @@
#!/bin/bash
# Copyright (c) 2005-2023 Pandora FMS
#
# /etc/init.d/websocket
#
# System startup script for Pandora FMS Console websocket engine
#
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 10
# description: Pandora FMS Console webscoket engine startup script
#
# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: websocket
# Required-Start: $syslog cron
# Should-Start: $network cron mysql
# Required-Stop: $syslog
# Should-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Pandora FMS Console websocket engine startup script
# Description: Pandora FMS Console websocket engine startup script
### END INIT INFO
if [ -x /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
fi
# If you want to run several pandora Console Websocket engines in this machine, just copy
# this script to another name, editing PANDORA_HOME to the new .conf
export WS_ENGINE="/var/www/html/pandora_console/ws.php"
export PHP=/usr/bin/php
export WS_LOG="/var/log/pandora/web_socket.log"
export GOTTY="/tmp/"
# Environment variables
if [[ -z ${PANDORA_RB_PRODUCT_NAME} ]]; then
PANDORA_RB_PRODUCT_NAME="Pandora FMS"
fi
if [[ -z ${PANDORA_RB_COPYRIGHT_NOTICE} ]]; then
PANDORA_RB_COPYRIGHT_NOTICE="Pandora FMS"
fi
export PANDORA_RB_PRODUCT_NAME=$PANDORA_RB_PRODUCT_NAME
export PANDORA_RB_COPYRIGHT_NOTICE=$PANDORA_RB_COPYRIGHT_NOTICE
# Uses a wait limit before sending a KILL signal, before trying to stop
# Pandora FMS Console Websocket engine nicely. Some big systems need some time before close
# all pending tasks / threads.
export MAXWAIT=60
# Check for SUSE status scripts
if [ -f /etc/rc.status ]
then
. /etc/rc.status
rc_reset
else
# Define part of rc functions for non-suse systems
function rc_status () {
RETVAL=$?
case $1 in
-v) RETVAL=0;;
esac
}
function rc_exit () { exit $RETVAL; }
function rc_failed () { RETVAL=${1:-1}; }
RETVAL=0
fi
# This function replace pidof, not working in the same way in different linux distros
function pidof_pandora () {
# This sets COLUMNS to XXX chars, because if command is run
# in a "strech" term, ps aux don't report more than COLUMNS
# characters and this will not work.
COLUMNS=300
PANDORA_PID=`ps aux | grep "$PHP $WS_ENGINE" | grep -v grep | tail -1 | awk '{ print $2 }'`
echo $PANDORA_PID
}
# Main script
if [ ! -x $GOTTY ]
then
echo "Gotty not found in $GOTTY"
rc_failed 5 # program is not installed
rc_exit
fi
if [ ! -f $PHP ]
then
echo "$PHP not found, please install version >= 7.0"
rc_failed 5 # program is not installed
rc_exit
fi
case "$1" in
start)
PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is currently running on this machine with PID ($PANDORA_PID)."
rc_exit # running start on a service already running
fi
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
$PHP $WS_ENGINE >> $WS_LOG 2>&1 &
sleep 1
PANDORA_PID=`pidof_pandora`
if [ ! -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is now running with PID $PANDORA_PID"
rc_status -v
else
echo "Cannot start $PANDORA_RB_PRODUCT_NAME Console Websocket engine. Aborted."
echo "Check $PANDORA_RB_PRODUCT_NAME log files at $WS_LOG"
rc_failed 7 # program is not running
fi
;;
stop)
PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running, cannot stop it."
rc_exit # running stop on a service already stopped or not running
else
echo "Stopping $PANDORA_RB_PRODUCT_NAME Console Websocket engine"
kill $PANDORA_PID > /dev/null 2>&1
COUNTER=0
while [ $COUNTER -lt $MAXWAIT ]
do
_PID=`pidof_pandora`
if [ "$_PID" != "$PANDORA_PID" ]
then
COUNTER=$MAXWAIT
fi
COUNTER=`expr $COUNTER + 1`
sleep 1
done
# Send a KILL -9 signal to process, if it's alive after 60secs, we need
# to be sure is really dead, and not pretending...
if [ "$_PID" = "$PANDORA_PID" ]
then
kill -9 $PANDORA_PID > /dev/null 2>&1
fi
rc_status -v
fi
;;
status)
PANDORA_PID=`pidof_pandora`
if [ -z "$PANDORA_PID" ]
then
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is not running."
rc_failed 7 # program is not running
else
echo "$PANDORA_RB_PRODUCT_NAME Console Websocket engine is running with PID $PANDORA_PID."
rc_status
fi
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
exit 1
esac
rc_exit

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.773.3-231010
Version: 7.0NG.773.3-231011
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.773.3-231010"
pandora_version="7.0NG.773.3-231011"
package_cpan=0
package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.3";
my $pandora_build = "231010";
my $pandora_build = "231011";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.773.3";
my $pandora_build = "231010";
my $pandora_build = "231011";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 231010
%define release 231011
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773.3
%define release 231010
%define release 231011
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773.3"
PI_BUILD="231010"
PI_BUILD="231011"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.773.3 Build 231010";
my $version = "7.0NG.773.3 Build 231011";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.773.3 Build 231010";
my $version = "7.0NG.773.3 Build 231011";
# save program name for logging
my $progname = basename($0);