Merge remote-tracking branch 'origin/develop' into ent-11760-15978-anadir-el-filtro-en-el-estado-de-eventos-not-acknowledged

This commit is contained in:
daniel 2023-11-08 09:48:46 +01:00
commit 5bc1cb1862
283 changed files with 27527 additions and 9461 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.1.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.1
%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, encoding='utf-8', text=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, encoding='utf-8', text=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

@ -22,13 +22,16 @@ else
fi
SPEC_FILES="$CODEHOME/pandora_console/pandora_console.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, FreeBSD Version
# Version 7.0NG.774, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com
@ -300,3 +300,7 @@ module_plugin grep_log /var/log/syslog Syslog ssh
#module_exec echo 5
#module_description Postcondition test module
#module_end
# This plugin runs several security checks in a Linux system
#module_plugin pandora_security_check

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, Solaris Version
# Version 7.0NG.774, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773.3
# Version 7.0NG.774
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -54,7 +54,6 @@ if (!$@) {
use constant AGENT_VERSION => '4.0.1';
use constant AGENT_BUILD => '111213';
# Commands to retrieve total memory information in kB
use constant TOTALMEMORY_CMDS => {
linux => 'cat /proc/meminfo | grep MemTotal: | awk \'{ print $2 }\'',
@ -117,7 +116,6 @@ my $ConfDir = '';
# Pandora FMS agent configuration file
my $ConfFile = 'pandora_agent.conf';
# Broker agent configuration files
my @BrokerPid;
@ -264,7 +262,6 @@ sub valid_regexp ($) {
sub rmrf {
my $path = shift;
local *DIR;
if (-d $path) {
opendir (DIR, $path) || return;
while (defined (my $file_name = readdir(DIR))) {
@ -348,7 +345,6 @@ sub log_message ($$;$) {
}
}
}
################################################################################
# Add the given directory to the PATH.
################################################################################
@ -582,7 +578,6 @@ sub write_broker_conf($){
}
while (my $line = <CONF_FILE>){
# Skip broker definitions
if ($line =~ m/^\s*broker_agent/) {
next;
@ -1810,7 +1805,6 @@ sub exec_plugin ($) {
$Sem->down () if (defined ($Sem));
$Xml .= $output;
$Sem->up () if (defined ($Sem));
$ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1);
}
@ -2287,4 +2281,4 @@ This is released under the GNU Lesser General Public License.
Copyright (c) 2005-2023 Pandora FMS
=cut
=cut

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# (c) 2003-2023 Pandora FMS
# please visit http://pandora.sourceforge.net

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.773.3-231006
Version: 7.0NG.774-231108
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-231006"
pandora_version="7.0NG.774-231108"
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

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

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.773.3" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.774" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.773.3" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.774" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.773.3</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.773.3 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.773.3</string>
<key>CFBundleVersion</key> <string>7.0NG.774</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.774 Pandora FMS on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.774</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, GNU/Linux
# Version 7.0NG.774, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com
@ -239,8 +239,34 @@ module_exec df -kh / | tail -1 | awk '{ print 100-$5 }'
module_max 100
module_min 0
module_description Free disk Percentage of root partition
module_min_warning 70
module_max_warning 90
module_min_critical 91
module_max_critical 100
module_min_warning 10
module_max_warning 20
module_min_critical 0
module_max_critical 10
module_end
# Sample modules to check connectivity from your mac
#module_begin
#module_name Packet_loss
#module_type generic_data
#module_exec ping 8.8.8.8 -c 5 | grep "packet loss" | cut -d " " -f 7 | grep -o "[0-9\.]*"
#module_end
#module_begin
#module_name Internet_Latency
#module_type generic_data
#module_exec ping -c 1 8.8.8.8 | grep "time"| cut -f 4 -d "=" | grep -o "[0-9\.]*"
#module_end
#module_begin
#module_name Internet_check
#module_type generic_proc
#module_exec ping 8.8.8.8 -c 2 | grep "2 packets received" | wc -l
#module_end
# Check a running process
#module_begin
#module_name Cyberduck
#module_type generic_proc
#module_exec ps aux | grep cyberduck | grep -v grep | wc -l
#module_end

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, FreeBSD Version
# Version 7.0NG.774, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3
# Version 7.0NG.774
# Licensed under GPL license v2,
# Copyright (c) 2004-2023 Pandora FMS
# https://pandorafms.com
@ -313,6 +313,15 @@ module_plugin autodiscover --default
#Hardening plugin for security compliance analysis. Enable to use it.
#module_begin
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
#module_absoluteinterval 7d
#module_end
# Logs extraction
#module_begin
#module_name Syslog
#module_description Logs extraction module
#module_type log
#module_regexp /var/log/logfile.log
#module_pattern .*
#module_end

View File

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

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, NetBSD Version
# Version 7.0NG.774, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.773.3, Solaris Version
# Version 7.0NG.774, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2023 Pandora FMS
# http://www.pandorafms.com

View File

@ -39,6 +39,14 @@ BEGIN {
use File::Copy;
use Scalar::Util qw(looks_like_number);
use File::Basename;
BEGIN {
eval {
require MIME::Base64;
};
}
BEGIN { push @INC, '/usr/lib/perl5'; }
################################################################################
@ -1030,8 +1038,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.773.3';
use constant AGENT_BUILD => '231006';
use constant AGENT_VERSION => '7.0NG.774';
use constant AGENT_BUILD => '231108';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1562,6 +1570,9 @@ sub parse_conf_modules($) {
} elsif ($line =~ /^\s*module_occupiedpercentdisk\s+(.*)$/) {
$module->{'func'} = \&module_occupiedpercentdisk;
$module->{'params'} = $1;
}elsif ($line =~ /^\s*module_regexp\s+(.*)$/) {
$module->{'func'} = \&module_logger;
$module->{'params'} = $1;
} elsif ($line =~ /^\s*module_max\s+(.*)\s*$/) {
$module->{'max'} = $1;
} elsif ($line =~ /^\s*module_min\s+(.*)\s*$/) {
@ -1817,7 +1828,11 @@ sub parse_conf_modules($) {
# Macros
} elsif ($line =~ /^\s*module_macro(\S+)\s+(.*)\s*$/) {
$module->{'macros'}{$1} = $2;
# Regexp
}
elsif ($line =~ /^\s*module_pattern(\S+)\s+(.*)\s*$/) {
$module->{'filter'} = $1;
}
}
return;
}
@ -3663,6 +3678,11 @@ sub write_module_xml ($@) {
return;
}
if ($module->{'func'} == \&module_logger) {
$Xml .= $data[0];
return
}
# Critical section
$Sem->down () if (defined ($Sem));
@ -3860,6 +3880,237 @@ sub module_plugin ($) {
return ($output);
}
################################################################################
# Read the logs
################################################################################
sub module_logger ($) {
my $module = shift;
my $status = grep_logs(
$module->{'name'},
$module->{'params'},
$module->{'filter'}
);
return $status;
}
my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_base64 : sub {
my ($str, $endl) = @_;
my @ALPHABET = ('A'..'Z', 'a'..'z', 0..9, '+', '/');
my $str_len = length($str);
my $str_base64 = '';
for (my $i = 0; $i < $str_len; $i += 3) {
my $chunk = substr($str, $i, 3);
my $chunk_len = length($chunk);
my $num = 0;
$num |= ord(substr($chunk, 0, 1)) << 16 if ($chunk_len >= 1);
$num |= ord(substr($chunk, 1, 1)) << 8 if ($chunk_len >= 2);
$num |= ord(substr($chunk, 2, 1)) if ($chunk_len == 3);
my $enc_1 = ($num & 0xfc0000) >> 18;
my $enc_2 = ($num & 0x03f000) >> 12;
my $enc_3 = ($num & 0x000fc0) >> 6;
my $enc_4 = ($num & 0x00003f);
$str_base64 .= $ALPHABET[$enc_1];
$str_base64 .= $ALPHABET[$enc_2];
$str_base64 .= $chunk_len >= 2 ? $ALPHABET[$enc_3] : '=';
$str_base64 .= $chunk_len == 3 ? $ALPHABET[$enc_4] : '=';
}
return $str_base64;
};
sub grep_logs {
my ($str_name, $str_file, $str_regex) = @_;
if(!$str_name){
log_message("module_logger", "Missing module name");
return;
}
if(!$str_file){
log_message("module_logger", "Missing file name");
return;
}
if(!$str_regex){
$str_regex = '.*';
}
my $idx_dir = '/tmp/';
my $idx_file = '';
my $idx_pos = 0;
my $idx_size = 0;
my $idx_ino = '';
my $module_name = $str_name;
my $log_file = $str_file;
my $reg_exp = $str_regex;
# Check that log file exists
if (! -e $log_file) {
log_message("module_logger", "File $log_file does not exist");
return;
}
# Create index file storage directory
if (! -d $idx_dir) {
if (!mkdir($idx_dir)){
log_message("module_logger", "Error creating directory $idx_dir: " . $!);
return;
}
}
# Create index file if it does not exist
$idx_file = $idx_dir.$module_name."_".basename($log_file).".idx";
if (! -e $idx_file) {
return if create_idx(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$idx_size) == 1;
return
} else{
return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1;
my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size);
my $output = create_log($module_name, @data);
return $output;
}
# Start the function definition
sub create_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $idx_size_ref) = @_;
my $first_line;
log_message("module_logger", "Creating index file $$idx_file_ref");
if (!open(LOGFILE, $$log_file_ref)){
log_message("module_logger", "Error opening file $$log_file_ref: ".$!);
return 1;
}
# Go to EOF and save the position
seek(LOGFILE, 0, 2);
$$idx_pos_ref = tell(LOGFILE);
close(LOGFILE);
# Save the file inode number
$$idx_ino_ref = (stat($$log_file_ref))[1];
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
return 0;
}
sub save_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
log_message("module_logger", "Saving index file $$idx_file_ref");
if (!open(IDXFILE, "> $$idx_file_ref")){
log_message("module_logger", "Error opening file $$idx_file_ref: ". $!);
return 1;
}
print (IDXFILE $$idx_pos_ref . " " . $$idx_ino_ref . " " . $$idx_size_ref);
close(IDXFILE);
return 0;
}
sub load_idx {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) = @_;
my $line;
my $current_ino;
my $current_size;
log_message("module_logger", "Loading index file $$idx_file_ref");
if (!open(IDXFILE, $$idx_file_ref)){
log_message("module_logger", "Error opening file $$idx_file_ref: " .$!);
return 1;
}
# Read position and date
$line = <IDXFILE>;
($$idx_pos_ref, $$idx_ino_ref, $$idx_size_ref) = split(' ', $line);
close(IDXFILE);
# Reset the file index if the file has changed
$current_ino = (stat($$idx_file_ref))[1];
$current_size = -s "$$idx_file_ref";
if ($current_ino != $$idx_ino_ref || $current_size < $$idx_size_ref) {
log_message("module_logger", "File changed, resetting index");
$$idx_pos_ref = 0;
$$idx_ino_ref = $current_ino;
}
$$idx_size_ref = $current_size;
return 0;
}
sub parse_log {
my ($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $log_file_ref, $module_name_ref, $reg_exp_ref, $idx_size_ref) = @_;
my $line;
log_message("module_logger", "Parsing log file $$log_file_ref");
# Open log file for reading
if (!open(LOGFILE, $$log_file_ref)){
log_message("module_logger", "Error opening file $$log_file_ref: " . $!);
return 1;
}
# Go to starting position.
seek(LOGFILE, $$idx_pos_ref, 0);
# Parse log file
my @data;
while ($line = <LOGFILE>) {
if ($line =~ m/$$reg_exp_ref/i) {
push (@data, $line);
}
}
$$idx_pos_ref = tell(LOGFILE);
close(LOGFILE);
# Save the index file
return 1 if save_idx($idx_pos_ref, $idx_ino_ref, $idx_file_ref, $idx_size_ref) == 1;
return @data;
}
sub create_log {
my ($module_name, @data) = @_;
# No data
if ($#data < 0) {
return;
}
# Log module
my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $module_name . "]]></source>\n";
$output .= "<encoding>base64</encoding>\n";
$output .= "<data><![CDATA[";
$output .= &$encode_sub(join('', @data), '');
$output .= "]]></data>\n";
$output .= "</log_module>\n";
return $output;
}
}
################################################################################
# TERM Handler
################################################################################
@ -4030,6 +4281,8 @@ sub init_module ($) {
$module->{'module_ff_interval'} = undef;
$module->{'macros'} = {};
$module->{'alert_template'} = undef;
$module->{'filter'} = undef;
$module->{'absoluteinterval'} = undef;
}
################################################################################

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231006
%define version 7.0NG.774
%define release 231108
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231108
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231108
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231006
%define version 7.0NG.774
%define release 231108
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -3,8 +3,8 @@
#
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 231006
%define version 7.0NG.774
%define release 231108
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -0,0 +1,631 @@
#!/usr/bin/perl
################################################################################
# Author: Enrique Martin Garcia
# Copyright: 2023, PandoraFMS
# Maintainer: Operations department
# Version: 1.0
################################################################################
use strict;
use warnings;
use Getopt::Long;
use File::Basename;
use File::Spec;
use Digest::MD5 qw(md5_hex);
use Scalar::Util 'looks_like_number';
use Socket;
# Define signal handlers
sub sigint_handler {
print STDERR "\nInterrupted by user\n";
exit 0;
}
sub sigterm_handler {
print STDERR "Received SIGTERM signal.\n";
exit 0;
}
$SIG{INT} = \&sigint_handler;
$SIG{TERM} = \&sigterm_handler;
# Add lib dir path
my $lib_dir = File::Spec->catdir(dirname($0), 'lib');
unshift @INC, $lib_dir;
###
# GLOBALS
##################
my %options = ();
my $modules_group = 'Security';
my $b_ports = 'PORTS';
my $b_files = 'FILES';
my $b_passwords = 'PASSWORDS';
my @blocks = ($b_ports, $b_files, $b_passwords);
my $configuration_block;
my $integrity_file = '/tmp/' . md5_hex(File::Spec->rel2abs($0)) . '.integrity';
# Enable all checks by default
my $check_selinux = 1;
my $check_ssh_root_access = 1;
my $check_ssh_root_keys = 1;
my $check_ports = 1;
my $check_files = 1;
my $check_passwords = 1;
# Include all values for checks by default
my $include_defaults = 1;
# Initialize check lists
my @l_ports = (
80,
22
);
my @l_files = (
'/etc/shadow',
'/etc/passwd',
'/etc/hosts',
'/etc/resolv.conf',
'/etc/ssh/sshd_config',
'/etc/rsyslog.conf'
);
my @l_passwords = (
'123456',
'12345678',
'123456789',
'12345',
'1234567',
'password',
'1password',
'abc123',
'qwerty',
'111111',
'1234',
'iloveyou',
'sunshine',
'monkey',
'1234567890',
'123123',
'princess',
'baseball',
'dragon',
'football',
'shadow',
'soccer',
'unknown',
'000000',
'myspace1',
'purple',
'fuckyou',
'superman',
'Tigger',
'buster',
'pepper',
'ginger',
'qwerty123',
'qwerty1',
'peanut',
'summer',
'654321',
'michael1',
'cookie',
'LinkedIn',
'whatever',
'mustang',
'qwertyuiop',
'123456a',
'123abc',
'letmein',
'freedom',
'basketball',
'babygirl',
'hello',
'qwe123',
'fuckyou1',
'love',
'family',
'yellow',
'trustno1',
'jesus1',
'chicken',
'diamond',
'scooter',
'booboo',
'welcome',
'smokey',
'cheese',
'computer',
'butterfly',
'696969',
'midnight',
'princess1',
'orange',
'monkey1',
'killer',
'snoopy ',
'qwerty12 ',
'1qaz2wsx ',
'bandit',
'sparky',
'666666',
'football1',
'master',
'asshole',
'batman',
'sunshine1',
'bubbles',
'friends',
'1q2w3e4r',
'chocolate',
'Yankees',
'Tinkerbell',
'iloveyou1',
'abcd1234',
'flower',
'121212',
'passw0rd',
'pokemon',
'StarWars',
'iloveyou2',
'123qwe',
'Pussy',
'angel1'
);
###
# ARGS PARSER
##################
my $HELP = <<EO_HELP;
Run several security checks in a Linux system
Usage: $0
[-h,--help]
[--check_selinux {0,1}]
[--check_ssh_root_access {0,1}]
[--check_ssh_root_keys {0,1}]
[--check_ports {0,1}]
[--check_files {0,1}]
[--check_passwords {0,1}]
[--include_defaults {0,1}]
[--integrity_file <integrity_file>]
[--conf <conf_file>]
Optional arguments:
-h, --help Show this help message and exit
--check_selinux {0,1} Enable/Disable check SElinux module
--check_ssh_root_access {0,1} Enable/Disable check SSH root access module
--check_ssh_root_keys {0,1} Enable/Disable check SSH root keys module
--check_ports {0,1} Enable/Disable check ports module
--check_files {0,1} Enable/Disable check files module
--check_passwords {0,1} Enable/Disable check passwords module
--include_defaults {0,1} Enable/Disable default plugin checks for ports, files and passwords
--integrity_file <integrity_file> Path to integrity check file
Default: $integrity_file
--conf <conf_file> Path to plugin configuration file
Available configuration blocks:
[$b_ports], [$b_files] and [$b_passwords]
Content example:
[$b_ports]
3306
443
[$b_files]
/etc/httpd/httpd.conf
/etc/my.cnf
[$b_passwords]
pandora
PANDORA
P4nd0r4
EO_HELP
sub help {
my ($extra_message) = @_;
print $HELP;
print $extra_message if defined($extra_message);
exit 0;
}
sub parse_bool_arg {
my ($arg, $default) = @_;
if (defined $options{$arg}) {
if (looks_like_number($options{$arg}) && ($options{$arg} == 1 || $options{$arg} == 0)) {
return $options{$arg};
} else {
help("Invalid value for argument: $arg\n");
}
} else {
return $default;
}
}
# Parse arguments
GetOptions(
"help|h" => \$options{help},
"check_selinux=s" => \$options{check_selinux},
"check_ssh_root_access=s" => \$options{check_ssh_root_access},
"check_ssh_root_keys=s" => \$options{check_ssh_root_keys},
"check_ports=s" => \$options{check_ports},
"check_files=s" => \$options{check_files},
"check_passwords=s" => \$options{check_passwords},
"include_defaults=s" => \$options{include_defaults},
"integrity_file=s" => \$options{integrity_file},
"conf=s" => \$options{conf}
);
help() if ($options{help});
$check_selinux = parse_bool_arg('check_selinux', $check_selinux);
$check_ssh_root_access = parse_bool_arg('check_ssh_root_access', $check_ssh_root_access);
$check_ssh_root_keys = parse_bool_arg('check_ssh_root_keys', $check_ssh_root_keys);
$check_ports = parse_bool_arg('check_ports', $check_ports);
$check_files = parse_bool_arg('check_files', $check_files);
$check_passwords = parse_bool_arg('check_passwords', $check_passwords);
$include_defaults = parse_bool_arg('include_defaults', $include_defaults);
if (!$include_defaults) {
@l_ports = ();
@l_files = ();
@l_passwords = ();
}
$integrity_file = $options{integrity_file} if defined $options{integrity_file};
parse_configuration($options{conf}) if defined $options{conf};
###
# FUNCTIONS
##################
# Function to parse configuration file
sub parse_configuration {
my ($conf_file) = @_;
open my $conf_fh, '<', $conf_file or die "Error opening configuration file [$conf_file]: $!\n";
while (my $line = <$conf_fh>) {
chomp $line;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) {
$configuration_block = $1;
}
elsif ($configuration_block) {
if ($configuration_block eq $b_ports) {
push @l_ports, $line;
}
elsif ($configuration_block eq $b_files) {
push @l_files, $line;
}
elsif ($configuration_block eq $b_passwords) {
push @l_passwords, $line;
}
}
}
close $conf_fh;
}
# Function to print module XML to STDOUT
sub print_xml_module {
my ($m_name, $m_type, $m_desc, $m_value) = @_;
print "<module>\n";
print "\t<name><![CDATA[$m_name]]></name>\n";
print "\t<type>$m_type</type>\n";
print "\t<data><![CDATA[$m_value]]></data>\n";
print "\t<description><![CDATA[$m_desc]]></description>\n";
print "\t<module_group>$modules_group</module_group>\n";
print "</module>\n";
}
# Make unique array
sub uniq {
my %seen;
return grep { !$seen{$_}++ } @_;
}
###
# MAIN
##################
# Check SELinux status
if ($check_selinux) {
my $value = 0;
my $desc = 'SELinux is disabled.';
my $output = `sestatus 2> /dev/null`;
if ($? == 0) {
if ($output =~ /SELinux status: enabled/) {
$value = 1;
$desc = 'SELinux is enabled.';
}
} else {
$value = 0;
$desc = 'Can not determine if SELinux is enabled.';
}
print_xml_module('SELinux status', 'generic_proc', $desc, $value);
}
# Check if SSH allows root access
if ($check_ssh_root_access) {
my $value = 1;
my $desc = 'SSH does not allow root access.';
my $ssh_config_file = '/etc/ssh/sshd_config';
if (-e $ssh_config_file && open my $ssh_fh, '<', $ssh_config_file) {
while (my $line = <$ssh_fh>) {
chomp $line;
$line =~ s/^\s+//;
$line =~ s/\s+$//;
next if $line =~ /^$/ or $line =~ /^#/;
my ($option, $val) = split /\s+/, $line, 2;
if ($option eq 'PermitRootLogin' && lc($val) ne 'no') {
$value = 0;
$desc = 'SSH config allows root access.';
last;
}
}
close $ssh_fh;
} else {
$value = 0;
$desc = 'Can not read '.$ssh_config_file.' to check if root access allowed.';
}
print_xml_module('SSH root access status', 'generic_proc', $desc, $value);
}
# Specific function for recursive directory check
sub find_files {
my ($dir) = @_;
my @files = ();
opendir my $dh, $dir or return;
while (my $file = readdir $dh) {
next if $file eq '.' or $file eq '..';
my $file_path = File::Spec->catfile($dir, $file);
if (-f $file_path) {
push @files, $file_path;
} elsif (-d $file_path) {
push @files, find_files($file_path);
}
}
closedir $dh;
return @files;
}
# Check if /root has SSH keys
if ($check_ssh_root_keys) {
my $value = 1;
my $desc = 'SSH root keys not found.';
my $ssh_keys = {'private' => [], 'public' => []};
my $ssh_dir = '/root/.ssh';
my @all_files = find_files($ssh_dir);
foreach my $file (@all_files) {
if (open my $fh, '<:raw', $file) {
my $content = '';
while(my $l = <$fh>) {
$content .= $l;
}
if ($content) {
my ($filename, $directories) = fileparse($file);
if ($content =~ /-----BEGIN RSA PRIVATE KEY-----.*?-----END RSA PRIVATE KEY-----/s) {
push @{$ssh_keys->{'private'}}, $file;
} elsif ($content =~ /ssh-rsa/ && $filename ne 'known_hosts' && $filename ne 'authorized_keys') {
push @{$ssh_keys->{'public'}}, $file;
}
}
}
}
if (@{$ssh_keys->{'private'}} > 0 || @{$ssh_keys->{'public'}} > 0) {
$value = 0;
$desc = "SSH root keys found:\n" . join("\n", @{$ssh_keys->{'private'}}, @{$ssh_keys->{'public'}});
}
print_xml_module('SSH root keys status', 'generic_proc', $desc, $value);
}
# Check authorized ports
if ($check_ports) {
my $value = 1;
my $desc = 'No unauthorized ports found.';
my @open_ports;
my @not_allowed_ports;
my @net_tcp_files = ('/proc/net/tcp', '/proc/net/tcp6');
foreach my $net_tcp_file (@net_tcp_files) {
if (-e $net_tcp_file && open my $tcp_fh, '<', $net_tcp_file) {
while (my $line = <$tcp_fh>) {
chomp $line;
my @parts = split /\s+/, $line;
if (scalar @parts >= 12) {
my $local_addr_hex = (split /:/, $parts[2])[0];
my $local_port_hex = (split /:/, $parts[2])[1];
my $state = $parts[4];
# Check if the connection is in state 0A (listening)
if ($state eq "0A") {
my $local_addr_4 = join('.', reverse split(/\./, inet_ntoa(pack("N", hex($local_addr_hex)))));
my $local_addr_6 = join(':', map { hex($_) } unpack("(A4)*", $local_addr_hex));
# Skip localhost listening ports
if ($local_addr_4 eq "127.0.0.1" || $local_addr_6 eq "0:0:0:0:0:0:0:1") {
next;
}
my $local_port = hex($local_port_hex);
push @open_ports, $local_port;
}
}
}
close $tcp_fh;
}
}
@open_ports = uniq(@open_ports);
my %allowed_ports;
foreach my $port (@l_ports) {
$allowed_ports{$port} = 1;
}
foreach my $port (@open_ports) {
if (!exists $allowed_ports{$port}) {
push @not_allowed_ports, $port;
}
}
if (@not_allowed_ports) {
$value = 0;
$desc = "Unauthorized ports found:\n" . join("\n", @not_allowed_ports);
}
print_xml_module('Authorized ports status', 'generic_proc', $desc, $value);
}
# Check files integrity
if ($check_files) {
my $value = 1;
my $desc = 'No changed files found.';
my %integrity;
my $can_check_files = 0;
if (-e $integrity_file) {
if (-r $integrity_file && -w $integrity_file) {
# Read integrity file content
open my $integrity_fh, '<', $integrity_file;
while (my $line = <$integrity_fh>) {
chomp $line;
if ($line =~ /^\s*(.*?)=(.*?)\s*$/) {
$integrity{$1} = $2;
}
}
close $integrity_fh;
$can_check_files = 1;
} else {
$value = 0;
$desc = 'Integrity check file can not be read or written: ' . $integrity_file;
}
} else {
if (open my $integrity_fh, '>', $integrity_file) {
close $integrity_fh;
$can_check_files = 1;
} else {
$value = 0;
$desc = 'Integrity check file can not be created: ' . $integrity_file;
}
}
if ($can_check_files) {
# Check each file integrity
my @errored_files;
my @no_integrity_files;
# Create unique check files list
@l_files = uniq(@l_files);
foreach my $file (@l_files) {
my $file_key = md5_hex($file);
if (open my $fh, '<:raw', $file) {
my $md5 = Digest::MD5->new;
$md5->addfile($fh);
my $file_md5 = $md5->hexdigest;
chomp $file_md5;
close $fh;
if (exists $integrity{$file_key} && $integrity{$file_key} ne $file_md5) {
push @no_integrity_files, $file;
}
$integrity{$file_key} = $file_md5;
} else {
push @errored_files, $file;
}
}
# Overwrite integrity file content
open my $file_handle, '>', $integrity_file;
print $file_handle map { "$_=$integrity{$_}\n" } keys %integrity;
close $file_handle;
# Check module status
if (@no_integrity_files) {
$value = 0;
$desc = "Changed files found:\n" . join("\n", @no_integrity_files);
}
if (@errored_files) {
$value = 0;
$desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files);
}
}
print_xml_module('Files check status', 'generic_proc', $desc, $value);
}
# Check weak passwords
if ($check_passwords) {
my $value = 1;
my $desc = 'No insecure passwords found.';
# Create unique check passwords list
@l_passwords = uniq(@l_passwords);
my @insecure_users;
my $shadow_file = '/etc/shadow';
if (-e $shadow_file && -r $shadow_file) {
open my $shadow_fh, '<', $shadow_file;
while (my $line = <$shadow_fh>) {
chomp $line;
my ($username, $password_hash, @rest) = split /:/, $line;
# Skip users with no password hash
if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") {
my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1);
my $user_hash = crypt($username, $salt);
if ($user_hash eq $password_hash) {
push @insecure_users, $username;
} else {
foreach my $weak_password (@l_passwords) {
my $weak_password_hash = crypt($weak_password, $salt);
if ($weak_password_hash eq $password_hash) {
push @insecure_users, $username;
last;
}
}
}
}
}
close $shadow_fh;
} else {
$value = 0;
$desc = 'Can not read '.$shadow_file.' to check passwords.';
}
if (@insecure_users) {
$value = 0;
$desc = "Users with insecure passwords found:\n" . join("\n", @insecure_users);
}
print_xml_module('Insecure passwords status', 'generic_proc', $desc, $value);
}

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2023 Pandora FMS
# Version 7.0NG.773.3
# Version 7.0NG.774
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version
@ -526,7 +526,15 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
# Hardening plugin for security compliance analysis.
#module_begin
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe"
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_hardening.exe -t 150"
#module_absoluteinterval 7d
#module_end
# Logs extraction
#module_begin
#module_name X_Server_log
#module_description Logs extraction module
#module_type log
#module_regexp C:\server\logs\xserver.log
#module_pattern .*
#module_end

View File

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

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d93bd9d56c938063045fa2093198d324746f84df2b74567648f3baebd635657
size 5248006

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.773.3}
{Pandora FMS Windows Agent v7.0NG.774}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231006}
{231108}
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 231006")
#define PANDORA_VERSION ("7.0NG.774 Build 231108")
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 231006))"
VALUE "ProductVersion", "(7.0NG.774(Build 231108))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.773.3-231006
Version: 7.0NG.774-231108
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-231006"
pandora_version="7.0NG.774-231108"
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,11 +182,15 @@ 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,
],
],
],
@ -221,119 +214,73 @@ 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);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$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 +294,107 @@ 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 +402,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 +414,157 @@ 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_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
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 +589,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

@ -106,6 +106,7 @@ enterprise/godmode/alerts/alert_events.php
enterprise/godmode/alerts/alert_events_list.php
enterprise/godmode/alerts/alert_events_rules.php
enterprise/godmode/alerts/configure_alert_rule.php
enterprise/godmode/alerts/alert_correlation.php
enterprise/include/functions_networkmap.php
enterprise/operation/agentes/pandora_networkmap.view.php
enterprise/include/ajax/map_enterprise.ajax.php
@ -1708,6 +1709,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
@ -1716,3 +1718,5 @@ operation/incidents/list_integriaims_incidents.php
include/functions_incidents.php
include/functions_integriaims.php
include/ajax/integria_incidents.ajax.php
enterprise/operation/log/log_source.php
enterprise/include/class/LogSource.class.php

View File

@ -0,0 +1,11 @@
pandorafms.vmware=9959cc3e5cc6bfcfadd6d05b56d4a11b
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

@ -5,6 +5,98 @@ ALTER TABLE `ttrap` ADD COLUMN `utimestamp` INT UNSIGNED NOT NULL DEFAULT 0;
UPDATE ttrap SET utimestamp=UNIX_TIMESTAMP(timestamp);
CREATE TABLE IF NOT EXISTS `tlog_alert` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` TEXT ,
`description` MEDIUMTEXT,
`order` INT UNSIGNED DEFAULT 0,
`mode` ENUM('PASS','DROP'),
`field1` TEXT ,
`field2` TEXT ,
`field3` TEXT ,
`field4` TEXT ,
`field5` TEXT ,
`field6` TEXT ,
`field7` TEXT ,
`field8` TEXT ,
`field9` TEXT ,
`field10` TEXT ,
`time_threshold` INT NOT NULL DEFAULT 86400,
`max_alerts` INT UNSIGNED NOT NULL DEFAULT 1,
`min_alerts` INT UNSIGNED NOT NULL DEFAULT 0,
`time_from` time DEFAULT '00:00:00',
`time_to` time DEFAULT '00:00:00',
`monday` TINYINT DEFAULT 1,
`tuesday` TINYINT DEFAULT 1,
`wednesday` TINYINT DEFAULT 1,
`thursday` TINYINT DEFAULT 1,
`friday` TINYINT DEFAULT 1,
`saturday` TINYINT DEFAULT 1,
`sunday` TINYINT DEFAULT 1,
`recovery_notify` TINYINT DEFAULT 0,
`field1_recovery` TEXT,
`field2_recovery` TEXT,
`field3_recovery` TEXT,
`field4_recovery` TEXT,
`field5_recovery` TEXT,
`field6_recovery` TEXT,
`field7_recovery` TEXT,
`field8_recovery` TEXT,
`field9_recovery` TEXT,
`field10_recovery` TEXT,
`id_group` MEDIUMINT UNSIGNED NULL DEFAULT 0,
`internal_counter` INT DEFAULT 0,
`last_fired` BIGINT NOT NULL DEFAULT 0,
`last_reference` BIGINT NOT NULL DEFAULT 0,
`times_fired` INT NOT NULL DEFAULT 0,
`disabled` TINYINT DEFAULT 0,
`standby` TINYINT DEFAULT 0,
`priority` TINYINT DEFAULT 0,
`force_execution` TINYINT DEFAULT 0,
`group_by` enum ('','id_agente','id_agentmodule','id_alert_am','id_grupo') DEFAULT '',
`special_days` TINYINT DEFAULT 0,
`disable_event` TINYINT DEFAULT 0,
`id_template_conditions` INT UNSIGNED NOT NULL DEFAULT 0,
`id_template_fields` INT UNSIGNED NOT NULL DEFAULT 0,
`last_evaluation` BIGINT NOT NULL DEFAULT 0,
`pool_occurrences` INT UNSIGNED NOT NULL DEFAULT 0,
`schedule` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tlog_rule` (
`id_log_rule` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_log_alert` INT UNSIGNED NOT NULL,
`operation` ENUM('NOP', 'AND','OR','XOR','NAND','NOR','NXOR'),
`order` INT UNSIGNED DEFAULT 0,
`window` INT NOT NULL DEFAULT 0,
`count` INT NOT NULL DEFAULT 1,
`name` TEXT,
`log_content` TEXT,
`log_source` TEXT,
`log_agent` TEXT,
`operator_log_content` TEXT COMMENT 'Operator for log_content',
`operator_log_source` TEXT COMMENT 'Operator for log_source',
`operator_log_agent` TEXT COMMENT 'Operator for log_agent',
PRIMARY KEY (`id_log_rule`),
KEY `idx_id_log_alert` (`id_log_alert`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tlog_alert_action` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_log_alert` INT UNSIGNED NOT NULL,
`id_alert_action` INT UNSIGNED NOT NULL,
`fires_min` INT UNSIGNED DEFAULT 0,
`fires_max` INT UNSIGNED DEFAULT 0,
`module_action_threshold` INT NOT NULL DEFAULT 0,
`last_execution` BIGINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`id_log_alert`) REFERENCES tlog_alert(`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`id_alert_action`) REFERENCES talert_actions(`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE IF NOT EXISTS `tgraph_analytics_filter` (
`id` INT NOT NULL auto_increment,
`filter_name` VARCHAR(45) NULL,
@ -68,6 +160,9 @@ UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
ALTER TABLE tagente_modulo ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE tpolicy_modules ADD COLUMN `made_enabled` TINYINT UNSIGNED DEFAULT 0;
ALTER TABLE talert_templates
ADD COLUMN `time_window` ENUM ('thirty_days','this_month','seven_days','this_week','one_day','today'),
ADD COLUMN `math_function` ENUM ('avg', 'min', 'max', 'sum'),
@ -117,6 +212,22 @@ INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES
-- Insert into tdiscovery_apps_executions
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, '&#039;_exec1_&#039;&#x20;-g&#x20;&#039;__taskGroup__&#039;&#x20;--host&#x20;&#039;_host_&#039;&#x20;--port&#x20;&#039;_port_&#039;&#x20;--user&#x20;&#039;_user_&#039;&#x20;--password&#x20;&#039;_password_&#039;&#x20;--vm&#x20;&#039;_scanVM_&#039;&#x20;--lxc&#x20;&#039;_scanLXC_&#039;&#x20;--backups&#x20;&#039;_scanBackups_&#039;&#x20;--nodes&#x20;&#039;_scanNodes_&#039;&#x20;--transfer_mode&#x20;tentacle&#x20;--tentacle_address&#x20;&#039;_tentacleIP_&#039;&#x20;--tentacle_port&#x20;&#039;_tentaclePort_&#039;&#x20;--as_discovery_plugin&#x20;1');
-- Insert new SAP APP
SET @short_name = 'pandorafms.sap.deset';
SET @name = 'SAP&#x20;R3&#x20;-&#x20;Deset';
SET @section = 'app';
SET @description = 'Monitor&#x20;SAP&#x20;R3&#x20;environments';
SET @version = '1.0';
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
-- Insert into tdiscovery_apps_scripts
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_sap_deset');
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_java_', 'bin/lib/jre/bin/java');
-- Insert into tdiscovery_apps_executions
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, '&#039;_exec1_&#039;&#x20;--conf&#x20;&#039;_tempfileConf_&#039;&#x20;--custom_modules&#x20;&#039;_tempfileCustomModules_&#039;');
-- Insert new EC2 APP
SET @short_name = 'pandorafms.aws.ec2';
SET @name = 'Amazon&#x20;EC2';
@ -202,5 +313,139 @@ ALTER TABLE `treport_content` ADD COLUMN `ignore_skipped` INT NOT NULL DEFAULT
ALTER TABLE `treport_content` ADD COLUMN `status_of_check` TINYTEXT;
ALTER TABLE `tservice` ADD COLUMN `enable_horizontal_tree` TINYINT NOT NULL DEFAULT 0;
INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security');
SET @tmodule_name = 'CPU';
SET @tmodule_description = 'CPU';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'Brand;Clock;Model' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'RAM';
SET @tmodule_description = 'RAM';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'Size' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'NIC';
SET @tmodule_description = 'NIC';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'NIC;Mac;Speed' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Software';
SET @tmodule_description = 'Software';
SET @id_os = 2;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'PKGINST;VERSION;NAME' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Security';
SET @tmodule_description = 'Hardening&#x20;plugin&#x20;for&#x20;security&#x20;compliance&#x20;analysis';
SET @id_os = 1;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
SET @tmodule_name = 'Security';
SET @tmodule_description = 'Hardening&#x20;plugin&#x20;for&#x20;security&#x20;compliance&#x20;analysis';
SET @id_os = 9;
INSERT INTO tmodule_inventory (`id_os`, `name`, `description`, `interpreter`, `data_format`, `code`, `block_mode`,`script_mode`)
SELECT * FROM (SELECT @id_os id_os, @tmodule_name name, @tmodule_description description, '' interpreter, 'ID:STATUS' data_format, '' code, '0' block_mode, 2 script_mode) AS tmp
WHERE NOT EXISTS (SELECT name, description FROM tmodule_inventory WHERE name = @tmodule_name and description = @tmodule_description and id_os = @id_os);
INSERT INTO tmodule_group (name) SELECT ('Security') WHERE NOT EXISTS (SELECT name FROM tmodule_group WHERE LOWER(name) = 'security');
ALTER TABLE tagente_modulo ADD COLUMN `last_compact` TIMESTAMP NOT NULL DEFAULT 0;
UPDATE `tevent_alert` ea INNER JOIN `tevent_rule` er ON ea.id = er.id_event_alert SET disabled=1 WHERE er.log_agent IS NOT NULL OR er.log_content IS NOT NULL OR er.log_source IS NOT NULL;
ALTER TABLE `tnetwork_explorer_filter`
MODIFY COLUMN `id` INT NOT NULL AUTO_INCREMENT;
-- Add messaging alerts
SET @command_name = 'Pandora&#x20;Google&#x20;chat';
SET @action_name = 'Pandora&#x20;Google&#x20;chat';
-- Get command ID in case it exists
SET @id_command = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-gchat-cli&#x20;-u&#x20;&quot;_field1_&quot;&#x20;-d&#x20;&quot;_field2_&quot;&#x20;-t&#x20;&quot;_field3_&quot;&#x20;-D&#x20;&quot;_field4_&quot;', 'Send&#x20;messages&#x20;using&#x20;Google&#x20;chat&#x20;API', 0, '["Google&#x20;chat&#x20;webhook&#x20;URL","Data&#x20;in&#x20;coma&#x20;separate&#x20;keypairs","Title","Description"]', '["","","",""]');
-- Get command ID again in case it has been created
SET @id_command = NULL;
SET @id_action = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
SET @command_name = 'Pandora&#x20;Slack';
SET @action_name = 'Pandora&#x20;Slack';
-- Get command ID in case it exists
SET @id_command = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-slack-cli&#x20;-t&#x20;&quot;TOKEN&quot;&#x20;-d&#x20;&quot;_field1_&quot;&#x20;-c&#x20;&quot;_field2_&quot;&#x20;-e&#x20;&quot;_field3_&quot;&#x20;-T&#x20;&quot;_field4_&quot;&#x20;-D&#x20;&quot;_field5_&quot;', 'Send&#x20;messages&#x20;using&#x20;Slack&#x20;API', 0, '["Data&#x20;in&#x20;coma&#x20;separate&#x20;keypairs","Slack&#x20;channel&#x20;id/name","Title&#x20;emoji","Title","Description"]', '["","",":red_circle:,Red&#x20;circle;:green_circle:,Green&#x20;circle","",""]');
-- Get command ID again in case it has been created
SET @id_command = NULL;
SET @id_action = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "");
SET @command_name = 'Pandora&#x20;Telegram';
SET @action_name = 'Pandora&#x20;Telegram';
-- Get command ID in case it exists
SET @id_command = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora-telegram-cli&#x20;-t&#x20;&quot;TOKEN&quot;&#x20;-c&#x20;&quot;_field1_&quot;&#x20;-m&#x20;&quot;_field2_&quot;', 'Send&#x20;messages&#x20;using&#x20;Telegram&#x20;API', 0, '["Chat&#x20;ID","Message"]', '["",""]');
-- Get command ID again in case it has been created
SET @id_command = NULL;
SET @id_action = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
SET @command_name = 'Pandora&#x20;ilert';
SET @action_name = 'Pandora&#x20;ilert';
-- Get command ID in case it exists
SET @id_command = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_ilert&#x20;-a&#x20;&quot;API_KEY&quot;&#x20;-t&#x20;&quot;_field1_&quot;&#x20;-k&#x20;&quot;_field2_&quot;&#x20;-T&#x20;&quot;_field3_&quot;&#x20;-d&#x20;&quot;_field4_&quot;&#x20;-A&#x20;&quot;_agentname_&quot;&#x20;-m&#x20;&quot;_module_&quot;&#x20;-p&#x20;&quot;_alert_text_severity_&quot;&#x20;-D&#x20;&quot;_data_&quot;&#x20;-C&#x20;&quot;_timestamp_&quot;', 'Send&#x20;SMS&#x20;using&#x20;ilert&#x20;API:&#x20;https://docs.ilert.com/integrations/pandorafms/', 0, '["Event&#x20;type","Event&#x20;title","Title","Description"]', '["alert,Alert;resolved,Resolved","","",""]');
-- Get command ID again in case it has been created
SET @id_command = NULL;
SET @id_action = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
SET @command_name = 'Pandora&#x20;Vonage';
SET @action_name = 'Pandora&#x20;Vonage';
-- Get command ID in case it exists
SET @id_command = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
INSERT IGNORE INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (@id_command, @command_name, '/usr/share/pandora_server/util/plugin/pandora_vonage&#x20;-a&#x20;&quot;API_KEY&quot;&#x20;-s&#x20;&quot;SECRET&quot;&#x20;-f&#x20;&quot;FROM_ALIAS&quot;&#x20;-n&#x20;&quot;_field1_&quot;&#x20;-m&#x20;&quot;_field2_&quot;', 'Send&#x20;SMS&#x20;using&#x20;Vonage&#x20;API:&#x20;https://www.vonage.com/communications-apis/sms/', 0, '["Phone&#x20;number","Message"]', '["",""]');
-- Get command ID again in case it has been created
SET @id_command = NULL;
SET @id_action = NULL;
SELECT @id_command := `id` FROM `talert_commands` WHERE `name` = @command_name;
SELECT @id_action := `id` FROM `talert_actions` WHERE `name` = @action_name;
INSERT IGNORE INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (@id_action, @action_name, @id_command, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "");
COMMIT;

View File

@ -26,14 +26,16 @@
* ============================================================================
*/
use PandoraFMS\TacticalView\GeneralTacticalView;
// Config functions.
require_once 'include/config.php';
require_once 'include/config.php';
// This solves problems in enterprise load.
global $config;
// This solves problems in enterprise load.
global $config;
check_login();
// ACL Check.
check_login();
// ACL Check.
if (check_acl($config['id_user'], 0, 'AR') === 0) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -43,322 +45,5 @@ if (check_acl($config['id_user'], 0, 'AR') === 0) {
exit;
}
require_once 'include/functions_reporting.php';
require_once 'include/functions_tactical.php';
require_once $config['homedir'].'/include/functions_graph.php';
if (tags_has_user_acl_tags()) {
ui_print_tags_warning();
}
$all_data = tactical_status_modules_agents(
$config['id_user'],
false,
'AR'
);
$data = [];
$data['monitor_not_init'] = (int) $all_data['_monitors_not_init_'];
$data['monitor_unknown'] = (int) $all_data['_monitors_unknown_'];
$data['monitor_ok'] = (int) $all_data['_monitors_ok_'];
$data['monitor_warning'] = (int) $all_data['_monitors_warning_'];
$data['monitor_critical'] = (int) $all_data['_monitors_critical_'];
$data['monitor_not_normal'] = (int) $all_data['_monitor_not_normal_'];
$data['monitor_alerts'] = (int) $all_data['_monitors_alerts_'];
$data['monitor_alerts_fired'] = (int) $all_data['_monitors_alerts_fired_'];
$data['monitor_total'] = (int) $all_data['_monitor_total_'];
$data['total_agents'] = (int) $all_data['_total_agents_'];
$data['monitor_checks'] = (int) $all_data['_monitor_checks_'];
if (!empty($all_data)) {
if ($data['monitor_not_normal'] > 0 && $data['monitor_checks'] > 0) {
$data['monitor_health'] = format_numeric((100 - ($data['monitor_not_normal'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['monitor_health'] = 100;
}
if ($data['monitor_not_init'] > 0 && $data['monitor_checks'] > 0) {
$data['module_sanity'] = format_numeric((100 - ($data['monitor_not_init'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['module_sanity'] = 100;
}
if (isset($data['alerts'])) {
if ($data['monitor_alerts_fired'] > 0 && $data['alerts'] > 0) {
$data['alert_level'] = format_numeric((100 - ($data['monitor_alerts_fired'] / ($data['alerts'] / 100))), 1);
} else {
$data['alert_level'] = 100;
}
} else {
$data['alert_level'] = 100;
$data['alerts'] = 0;
}
$data['monitor_bad'] = ($data['monitor_critical'] + $data['monitor_warning']);
if ($data['monitor_bad'] > 0 && $data['monitor_checks'] > 0) {
$data['global_health'] = format_numeric((100 - ($data['monitor_bad'] / ($data['monitor_checks'] / 100))), 1);
} else {
$data['global_health'] = 100;
}
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
}
ui_require_css_file('logon');
echo '<div id="welcome_panel">';
//
// Overview Table.
//
$table = new stdClass();
$table->class = 'no-class';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head_colspan[0] = 4;
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">';
foreach ($stats as $stat) {
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>';
}
$status .= '</table>';
$table->rowclass = [];
$table->rowclass[0] = 'w100p';
$table->rowclass[1] = 'w100p';
$table->rowclass[2] = 'w100p';
$table->rowclass[3] = 'w100p';
$table->rowclass[4] = 'w100p';
$table->rowclass[5] = 'w100p';
$table->data[0][0] = $status;
$table->data[] = $tdata;
// Alerts.
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Modules by status.
$tdata = [];
$data_agents = [
__('Critical') => $data['monitor_critical'],
__('Warning') => $data['monitor_warning'],
__('Normal') => $data['monitor_ok'],
__('Unknown') => $data['monitor_unknown'],
__('Not init') => $data['monitor_not_init'],
];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Total agents and modules.
$tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Users.
if (users_is_admin() || check_acl($config['id_user'], 0, 'UM')) {
$tdata = [];
$tdata[0] = reporting_get_stats_users($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
}
ui_toggle(
html_print_table($table, true),
__('%s Overview', get_product_name()),
'',
'overview',
false
);
unset($table);
echo '<div id="right">';
// News.
require_once 'general/news_dialog.php';
$options = [];
$options['id_user'] = $config['id_user'];
$options['modal'] = false;
$options['limit'] = 3;
$news = get_news($options);
if (!empty($news)) {
ui_require_css_file('news');
// NEWS BOARD.
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
$output_news = '<div id="news_board" class="new">';
foreach ($news as $article) {
$default = false;
if ($article['text'] == '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;') {
$article['subject'] = __('Welcome to Pandora FMS Console');
$default = true;
}
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
$output_news .= '<div class="new-board">';
$output_news .= '<div class="new-board-header">';
$output_news .= '<span class="new-board-title">'.$article['subject'].'</span>';
$output_news .= '<span class="new-board-author">'.__('By').' '.$article['author'].' '.ui_print_timestamp($article['timestamp'], true).'</span>';
$output_news .= '</div>';
$output_news .= '<div class="new content">';
if ($default) {
$output_news .= '<div class="default-new">';
$output_news .= '<div class="default-image-new">';
$output_news .= '<img src="./images/welcome_image.svg" alt="img colabora con nosotros - Support">';
$output_news .= '</div><div class="default-text-new">';
$output_news .= '
<p>'.__('Welcome to our monitoring tool so grand,').'
<br>'.__('Where data insights are at your command.').'
<br>'.__('Sales, marketing, operations too,').'
<br>'.__("Customer support, we've got you.").'
</p>
<p>'.__('Our interface is user-friendly,').'
<br>'.__("Customize your dashboard, it's easy.").'
<br>'.__('Set up alerts and gain insights so keen,').'
<br>'.__("Optimize your data, like you've never seen.").'
</p>
<p>'.__('Unleash its power now, and join the pro league,').'
<br>'.__('Unlock the potential of your data to intrigue.').'
<br>'.__('Monitoring made simple, efficient and fun,').'
<br>'.__('Discover a whole new way to get things done.').'
</p>
<p>'.__('And take control of your IT once and for all.').'</p>
<span>'.__('You can replace this message with a personalized one at Admin tools -> Site news.').'</span>
';
$output_news .= '</div></div>';
} else {
$text = str_replace('<script', '&lt;script', $text);
$text = str_replace('</script', '&lt;/script', $text);
$output_news .= nl2br($text);
}
$output_news .= '</div></div>';
}
$output_news .= '</div>';
// News board.
ui_toggle(
$output_news,
__('News board'),
'',
'news',
false
);
// END OF NEWS BOARD.
}
// LAST ACTIVITY.
// Show last activity from this user.
$table = new stdClass();
$table->class = 'no-td-padding info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
// Don't specify px.
$table->data = [];
$table->size = [];
$table->headstyle = [];
$table->size[0] = '5%';
$table->size[1] = '15%';
$table->headstyle[1] = 'min-width: 12em;';
$table->size[2] = '5%';
$table->headstyle[2] = 'min-width: 65px;';
$table->size[3] = '10%';
$table->size[4] = '25%';
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->align[4] = 'left';
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql);
if ($sessions === false) {
$sessions = [];
}
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = io_safe_output(str_replace([',', ', '], ', ', $session['descripcion']));
if (strlen($description) > 100) {
$data[4] = '<div >'.io_safe_input(substr($description, 0, 150)).'...</div>';
} else {
$data[4] = '<div >'.io_safe_input($description).'</div>';
}
array_push($table->data, $data);
}
$activity = html_print_table($table, true);
unset($table);
ui_toggle(
$activity,
__('Latest activity'),
'',
'activity',
false,
false,
'',
'white-box-content padded'
);
// END OF LAST ACTIVIYY.
// Close right panel.
echo '</div>';
// Close welcome panel.
echo '</div>';
$tacticalView = new GeneralTacticalView();
$tacticalView->render();

View File

@ -1326,6 +1326,12 @@ if ($update_module === true || $create_module === true) {
*/
$post_process = (string) get_parameter('post_process', 0.0);
if (modules_made_compatible($id_module_type) === true) {
$made_enabled = (bool) get_parameter_checkbox('made_enabled', 0);
} else {
$made_enabled = false;
}
$prediction_module = (int) get_parameter('prediction_module');
$max_timeout = (int) get_parameter('max_timeout');
$max_retries = (int) get_parameter('max_retries');
@ -1348,6 +1354,14 @@ if ($update_module === true || $create_module === true) {
}
$configuration_data = (string) get_parameter('configuration_data');
$array_configuration_data = explode(PHP_EOL, io_safe_output($configuration_data));
$configuration_data = '';
foreach ($array_configuration_data as $value) {
$configuration_data .= trim($value).PHP_EOL;
}
$configuration_data = io_safe_input($configuration_data);
$old_configuration_data = (string) get_parameter('old_configuration_data');
$new_configuration_data = '';
@ -1488,6 +1502,14 @@ if ($update_module === true || $create_module === true) {
}
$plugin_parameter = (string) get_parameter('plugin_parameter');
$array_plugin_parameter = explode(PHP_EOL, io_safe_output($plugin_parameter));
$plugin_parameter = '';
foreach ($array_plugin_parameter as $value) {
$plugin_parameter .= trim($value).PHP_EOL;
}
$plugin_parameter = io_safe_input($plugin_parameter);
}
$parent_module_id = (int) get_parameter('parent_module_id');
@ -1704,6 +1726,7 @@ if ($update_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,
@ -1902,6 +1925,7 @@ if ($create_module) {
'plugin_parameter' => $plugin_parameter,
'id_plugin' => $id_plugin,
'post_process' => $post_process,
'made_enabled' => $made_enabled,
'prediction_module' => $prediction_module,
'max_timeout' => $max_timeout,
'max_retries' => $max_retries,

View File

@ -294,6 +294,7 @@ if ($id_agent_module) {
$plugin_parameter = $module['plugin_parameter'];
$id_plugin = $module['id_plugin'];
$post_process = $module['post_process'];
$made_enabled = $module['made_enabled'];
$prediction_module = $module['prediction_module'];
$custom_integer_1 = $module['custom_integer_1'];
$custom_integer_2 = $module['custom_integer_2'];
@ -408,6 +409,7 @@ if ($id_agent_module) {
$id_module_group = 1;
$id_module_type = 1;
$post_process = '';
$made_enabled = false;
$max_timeout = 0;
$max_retries = 0;
$min = '';

View File

@ -318,7 +318,7 @@ foreach ($texts as $code => $text) {
return;
}
$(plugin_parameter).val('task_begin\ncookie 0\nresource 0\ntask_end');
$(plugin_parameter).val('task_begin\nget https://demoweb.com/page/\ncheck_string text string or HTML code to search (regexp)\ntask_end\n');
$('#button-btn_loadbasic').attr('disabled', 'disabled');

View File

@ -484,6 +484,7 @@ echo '</form>';
ui_require_javascript_file('pandora_alerts');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script type="text/javascript">
@ -500,194 +501,6 @@ $(document).ready (function () {
render_command_description(command_description);
}
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
var values = values || [];
var recovery_values = recovery_values || [];
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').val('');
$('[name=field'+i+'_recovery_value\\[\\]').val('');
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
data.forEach(function(custom_field, key) {
var custom_field_key = key+8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $('#table_macros-field'+custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
var label_name = label_html.split('<br>')[0];
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case 'CHECKBOX':
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
checkbox_selector.on('change', function() {
if (checkbox_selector.prop('checked')) {
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.attr('value', "0");
}
});
checkbox_recovery_selector.on('change', function() {
if (checkbox_recovery_selector.prop('checked')) {
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.attr('value', "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop('checked', true);
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.prop('checked', false);
checkbox_selector.attr('value', "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop('checked', true);
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.prop('checked', false);
checkbox_recovery_selector.attr('value', "0");
}
}
$('[name=field'+custom_field_key+'_value_container]').show();
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'COMBO':
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
combo_input.find('option').remove();
combo_input_recovery.find('option').remove();
var combo_values_array = custom_field.comboValue.split(',');
combo_values_array.forEach(function(value) {
combo_input.append($('<option>', {
value: value,
text: value
}));
combo_input_recovery.append($('<option>', {
value: value,
text: value
}));
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case 'DATE':
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
if (typeof values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
break;
case 'NUMERIC':
if (typeof values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXT':
if (typeof values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXTAREA':
default:
if (typeof values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
}
});
},
"json"
);
}
$("#id_command").change (function () {
values = Array ();
// No se envia el valor del commando.
@ -914,12 +727,22 @@ $(document).ready (function () {
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
ajax_get_integria_custom_fields(
$('#field5_value').val(),
integria_custom_fields_values,
integria_custom_fields_rvalues,
max_macro_fields
);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val());
ajax_get_integria_custom_fields(
$(this).val(),
[],
[],
max_macro_fields
);
});
}

View File

@ -916,7 +916,24 @@ $table->data[17][0] = html_print_label_input_block(
)
);
$table->data[17][1] = html_print_label_input_block(
$table->data['made_enabled'][1] = html_print_label_input_block(
__('MADE enabled').ui_print_help_tip(
__('By activating this option, the module data will be processed by the MADE engine (if active), and events will be generated automatically by the IA engine'),
true
),
html_print_checkbox_switch(
'made_enabled',
1,
false,
true,
false,
'',
false,
'wp100 static'
)
);
$table->data[17][2] = html_print_label_input_block(
__('SNMP community'),
html_print_input_text(
'snmp_community',
@ -1653,7 +1670,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
var params = {
@ -1728,7 +1746,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show ();
switch($('#module_type').val()) {
@ -1838,7 +1857,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide ();
$('input[type=checkbox]').attr('checked', false);
$('input[type=checkbox]').attr('disabled', true);
@ -1877,7 +1897,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").show();
}
else {
@ -1908,7 +1929,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -1932,6 +1954,9 @@ $(document).ready (function () {
else if (this.id == "checkbox-dynamic_two_tailed") {
return; //Do none
}
else if (this.id == "checkbox-made_enabled") {
return; //Do none
}
else {
if (this.id == "checkbox-force_group") {
$("#checkbox-recursion").prop("checked", false);
@ -1964,7 +1989,7 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-40").show ();
}
else {
@ -1995,7 +2020,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
}
}
@ -2085,7 +2111,8 @@ $(document).ready (function () {
"tr#delete_table-36, " +
"tr#delete_table-37, " +
"tr#delete_table-38, " +
"tr#delete_table-39, " +
"tr#delete_table-39, " +
"tr#delete_table-made_enabled, " +
"tr#delete_table-40").hide();
jQuery.post ("ajax.php",
@ -2315,6 +2342,7 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
'module_interval',
'disabled',
'post_process',
'made_enabled',
'unit_select',
'snmp_community',
'snmp_oid',
@ -2626,6 +2654,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
$values['macros'] = json_encode($module_macros);
}
if (modules_made_compatible($module['id_tipo_modulo']) === false) {
$values['made_enabled'] = 0;
}
$result = modules_update_agent_module(
$module['id_agente_modulo'],
$values,

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)'));
}
@ -383,6 +384,7 @@ if ($access_console_node === true) {
$sub['godmode/alerts/alert_special_days']['pages'] = ['godmode/alerts/configure_alert_special_days'];
enterprise_hook('eventalerts_submenu');
enterprise_hook('alert_log_submenu');
$sub['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP_alerts';
enterprise_hook('alert_inventory_submenu');
@ -474,7 +476,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 +487,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

@ -1284,7 +1284,7 @@ $class = 'databox filters';
?>
</td>
<td>
<?php
<?php
html_print_input_text(
'text_os_version',
$text_os_version,
@ -1932,33 +1932,8 @@ if (is_metaconsole() === true) {
<td class="bolder"><?php echo __('Source'); ?></td>
<td >
<?php
$agents = agents_get_group_agents($group);
if ((empty($agents)) || $agents == -1) {
$agents = [];
}
$sql_log = 'SELECT source AS k, source AS v
FROM tagente,tagent_module_log
WHERE tagente.id_agente = tagent_module_log.id_agent
AND tagente.disabled = 0';
if (!empty($agents)) {
$index = 0;
foreach ($agents as $key => $a) {
if ($index == 0) {
$sql_log .= ' AND (id_agente = '.$key;
} else {
$sql_log .= ' OR id_agente = '.$key;
}
$index++;
}
$sql_log .= ')';
}
html_print_select_from_sql(
$sql_log,
html_print_select(
[],
'source',
$source,
'onselect=source_change_agents();',
@ -1966,7 +1941,7 @@ if (is_metaconsole() === true) {
'',
false,
false,
false
false,
);
?>
</td>
@ -6625,7 +6600,7 @@ function addGeneralRow() {
function loadGeneralAgents(agent_group) {
var params = [];
var group = <?php echo $group ?? -1; ?>;
var group = <?php echo ($group ?? -1); ?>;
if (group < 0) {
return;
}
@ -6702,68 +6677,41 @@ function loadGeneralAgents(agent_group) {
function loadLogAgents() {
var params = [];
params.push("get_log_agents=1");
params.push("source=<?php echo $source; ?>");
params.push('id_agents=<?php echo json_encode($id_agents); ?>');
params.push("page=include/ajax/reporting.ajax");
let source = '<?php echo $source; ?>';
let agent = '<?php echo json_encode($id_agents); ?>';
agent = JSON.parse(agent);
$('#id_agents3')
.find('option')
.remove();
var params = {};
params["get_agent_source"] = 1;
params["log_alert"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
$('#id_agents3')
.append('<option>Loading agents...</option>');
jQuery.ajax ({
data: params.join ("&"),
type: 'POST',
url: action=
<?php
echo '"'.ui_get_full_url(
false,
false,
false,
false
).'"';
?>
+ "/ajax.php",
timeout: 300000,
dataType: 'json',
success: function (data) {
if (data['correct']) {
$('#id_agents3')
.find('option')
.remove();
var selectElements = [];
var selectedStr = 'selected="selected"';
if (data['select_agents'] === null) {
return;
}
if (Array.isArray(data['select_agents'])) {
data['select_agents'].forEach(function(agentAlias, agentID) {
var optionAttr = '';
if (typeof data['agents_selected'][agentID] !== 'undefined') {
optionAttr = ' selected="selected"';
}
$('#id_agents3')
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
});
jQuery.ajax({
data: params,
dataType: "json",
type: "POST",
url: "ajax.php",
async: true,
success: function(data) {
$('#id_agents3')
.find('option')
.remove();
$.each(data['source'],function(key,value) {
if (value === source) {
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
} else {
for (const [agentID, agentAlias] of Object.entries(data['select_agents'])) {
var optionAttr = '';
if (typeof data['agents_selected'][agentID] !== 'undefined') {
optionAttr = ' selected="selected"';
}
$('#id_agents3')
.append('<option value="'+agentID+'" '+optionAttr+'>'+agentAlias+'</option>');
}
$('#source').append( `<option value='${key}'>${value}</option>`);
}
}
});
$.each(data['agent'],function(key,value) {
const result = agent.includes(key);
if (result === true) {
$('#id_agents3').append( `<option selected='selected' value='${key}'>${value}</option>`);
} else {
$('#id_agents3').append( `<option value='${key}'>${value}</option>`);
}
});
}
});
}
@ -7948,23 +7896,46 @@ function set_last_value_period() {
}
function source_change_agents() {
$("#id_agents3").empty();
$("#spinner_hack").show();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_source_json" : 1,
"source" : $("#source").val()
},
function (data, status) {
for (var clave in data) {
$("#id_agents3").append(
'<option value="'+clave+'">'+data[clave]+'</option>'
);
const source = $("#source").val();
if (source === '') {
$("#id_agents3 option[value!=0]").attr("style","display:");
} else {
$("#spinner_hack").show();
$("#id_agents3 option").attr("style","display:none");
var params = {};
params["get_agent_source"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
jQuery.ajax({
data: params,
dataType: "json",
type: "POST",
url: "ajax.php",
async: true,
success: function(data) {
let source_array = [];
$.each(data['source'],function(key,value) {
if (value === source) {
const split = key.split('-');
source_array.push(split[1]);
}
});
$.each(data['agent'],function(key,value) {
const result = source_array.includes(key);
if (result === true) {
$(`#id_agents3 option[value*='${key}']`).attr("style","display:");
}
});
$("#spinner_hack").hide();
},
error: function(error){
$("#spinner_hack").hide();
}
$("#spinner_hack").hide();
},
"json"
);
});
}
}
function dialog_message(message_id) {

View File

@ -151,6 +151,10 @@ if (isset($_GET['server']) === true) {
$title .= __('Netflow server').' ID: '.$id_server;
break;
case SERVER_TYPE_MADE:
$title .= __('MADE server').' ID: '.$id_server;
break;
default:
$title = __('Update server').' ID: '.$id_server;
break;

View File

@ -290,6 +290,7 @@ html_print_action_buttons(
echo '</form>';
function get_list_os_icons_dir()
{
global $config;

View File

@ -98,7 +98,10 @@ try {
'ajax_url' => 'include/ajax/os',
'ajax_data' => ['method' => 'drawOSTable'],
'ajax_postprocess' => 'process_datatables_item(item)',
'no_sortable_columns' => [-1, 1],
'no_sortable_columns' => [
-1,
1,
],
'order' => [
'field' => 'id',
'direction' => 'asc',

View File

@ -53,7 +53,7 @@ if ($idOS > 0) {
} else {
$product = io_safe_input(strip_tags(io_safe_output((string) get_parameter('product'))));
$version = io_safe_input(strip_tags(io_safe_output((string) get_parameter('version'))));
$end_of_life_date = get_parameter('end_of_life_date', date("Y/m/d"));
$end_of_life_date = get_parameter('end_of_life_date', date('Y/m/d'));
}
$message = '';

View File

@ -220,7 +220,7 @@ switch ($tab) {
break;
default:
// Default.
// Default.
break;
}
@ -282,4 +282,4 @@ if (empty($id_message) === false) {
}
}
include_once $config['homedir'].'/godmode/setup/os_version.list.php';
require_once $config['homedir'].'/godmode/setup/os_version.list.php';

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

@ -2063,7 +2063,7 @@ if ($create_alert || $update_alert) {
}
// DIALOG ADD MORE ACTIONS.
echo '<div id="add_action_snmp-div" class="invisible left">';
echo '<div id="add_action_snmp-div" class="invisible">';
echo '<form id="add_action_form" method="post">';
echo '<table class="w100p">';
@ -2212,6 +2212,7 @@ if ($create_alert || $update_alert) {
ui_require_javascript_file('pandora', 'include/javascript/', true);
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script language="javascript" type="text/javascript">
@ -2287,6 +2288,7 @@ $(document).ready (function () {
name: "content_type",
value: "<?php echo $al_field4; ?>"
})
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
values,
function (data, status) {
@ -2317,6 +2319,26 @@ $(document).ready (function () {
}
$('#table_macros-field').show();
}
if($("#alert_type option:selected").text() === "Create Pandora ITSM ticket") {
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
if (i>=8) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), [], [], max_fields);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val(), [], [], max_fields);
});
}
}
},
"json"
@ -2341,7 +2363,8 @@ $(document).ready (function () {
});
function show_add_action_snmp(id_alert_snmp) {
$("#add_action_snmp-div").hide()
$("#add_action_snmp-div")
.hide()
.dialog ({
resizable: true,
draggable: true,

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',
@ -1269,7 +1268,7 @@ class DiscoveryTaskList extends HTML
$status = db_get_value('status', 'trecon_task', 'id_rt', $id_task);
if ($status < 0) {
$status = 100;
$status = '100';
}
echo json_encode($status);
@ -1288,7 +1287,6 @@ class DiscoveryTaskList extends HTML
$result = '<div class="flex">';
$result .= '<div class="subtitle">';
$result .= '<span>'._('Overall Progress').'</span>';
$result .= '<div class="mrgn_top_25px">';
$result .= progress_circular_bar(
$task['id_rt'],
@ -1974,7 +1972,6 @@ class DiscoveryTaskList extends HTML
{
$status = '';
$can_be_reviewed = false;
if (empty($task['summary']) === false
&& $task['summary'] == 'cancelled'
) {
@ -1992,11 +1989,9 @@ class DiscoveryTaskList extends HTML
$status = __('Done');
}
} else if ($task['utimestamp'] == 0
&& empty($task['summary'])
&& (bool) empty($task['summary']) === true
) {
$status = __('Not started');
} else if ($task['utimestamp'] > 0) {
$status = __('Done');
} else {
$status = __('Pending');
}

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