diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index d0a75daa64..8db984fcac 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, AIX version +# Version 7.0NG.748, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 99c223c44b..556ed487a7 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, FreeBSD Version +# Version 7.0NG.748, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index e02ab21bc0..c1da6574a0 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, HP-UX Version +# Version 7.0NG.748, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index 8fb9619396..3151bba156 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, GNU/Linux +# Version 7.0NG.748, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index da44447fb5..f1519cae0b 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, GNU/Linux +# Version 7.0NG.748, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index 1732b09047..c058969154 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, Solaris Version +# Version 7.0NG.748, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index a792678b72..36f45e7821 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.746 +# Version 7.0NG.748 # 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 diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 1701726cac..5cf06e1f73 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.746, AIX version +# Version 7.0NG.748, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index d22024a70e..2e910275a3 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.746 +# Version 7.0NG.748 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index be269b14bb..9f48dbc4a2 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.746, HPUX Version +# Version 7.0NG.748, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index b8e6838203..231f062798 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746 +# Version 7.0NG.748 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index a3dd4a0d2f..5e6ccf8344 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746 +# Version 7.0NG.748 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index c491068bf4..3ea473e72e 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746 +# Version 7.0NG.748 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index e0be14d00a..a7665291a5 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.746, Solaris version +# Version 7.0NG.748, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index c24870acfd..7b064f83f8 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, AIX version +# Version 7.0NG.748, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 7c02643280..c08c213aff 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.746-200624 +Version: 7.0NG.748-200811 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index aa139a38dd..d446c8d824 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.746-200624" +pandora_version="7.0NG.748-200811" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 1f3c3f196a..d210575bcc 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, GNU/Linux +# Version 7.0NG.748, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 5afed87d77..50a374dd1e 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, FreeBSD Version +# Version 7.0NG.748, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index dc16545f04..c5214a85eb 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, HP-UX Version +# Version 7.0NG.748, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 9e1bd63a83..cdd9bec203 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, GNU/Linux +# Version 7.0NG.748, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 82a63a8d00..5999f2211b 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, GNU/Linux +# Version 7.0NG.748, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index 36ab7779b3..33914c658e 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, NetBSD Version +# Version 7.0NG.748, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index b7510e704b..afbebccdf3 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.746, Solaris Version +# Version 7.0NG.748, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 606464c8ed..a5c63ffd55 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -54,8 +54,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.746'; -use constant AGENT_BUILD => '200624'; +use constant AGENT_VERSION => '7.0NG.748'; +use constant AGENT_BUILD => '200811'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 4bf4b1ce76..beb7d66ed5 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.746 -%define release 200624 +%define version 7.0NG.748 +%define release 200811 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index ddd8b5ceb0..cc875fdcbe 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.746 -%define release 200624 +%define version 7.0NG.748 +%define release 200811 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 57b5f32c3e..b6de8386b4 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.746" -PI_BUILD="200624" +PI_VERSION="7.0NG.748" +PI_BUILD="200811" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/grep_log b/pandora_agents/unix/plugins/grep_log index 76661c5230..2143464b48 100755 --- a/pandora_agents/unix/plugins/grep_log +++ b/pandora_agents/unix/plugins/grep_log @@ -56,6 +56,8 @@ my $Reg_exp = ''; # Flag to show or not summary module my $summary_flag = 0; +my $nodatalist_flag = 0; + # Number of coincidences found my $coincidences = 0; @@ -120,7 +122,15 @@ sub error_msg ($) { # Print a help message. ############################################################################### sub print_help () { - print "Usage: $0 [--summary]\n"; + print "Usage: $0 [--summary] [--nodatalist]\n\n"; + print "Options:\n"; + print "\t\t\tPath to the log file to be monitored\n"; + print "\t\t\tName of the module that will be created\n"; + print "\t\t\tRegex string to be matched in log file\n"; + print "\t\tShows NUM lines before matching lines to provide context\n"; + print "\t\tShows NUM lines after matching lines to provide context\n"; + print "\t--summary\t\tCreates a module with the total number of matches\n"; + print "\t--nodatalist\t\tInserts all coincidences in a single data output instead of a data per line\n"; } ############################################################################### @@ -317,6 +327,7 @@ sub print_log ($) { if ($#kdata < 0) { print_summary() if ($summary_flag == 1); return; + } # Log module @@ -341,6 +352,18 @@ sub print_log ($) { $output = "\n"; $output .= "\n"; $output .= "\n"; + if ($nodatalist_flag == 1){ + $output .= "{$line}}) { + my $processed_line = $content; + $processed_line =~ "\n"; + $output .= $processed_line; + } + } + $output .= "]]>\n"; + } + else { $output .= "\n"; foreach my $line (@kdata) { $output .= "\n"; } $output .= "\n"; + } $output .= "\n"; print stdout $output; } + } ############################################################################### @@ -376,12 +401,18 @@ $Reg_exp = trim($ARGV[2]); my $up_lines = trim($ARGV[3]); my $bot_lines = trim($ARGV[4]); my $sum_flag = trim($ARGV[5]); +my $nodatalist = trim($ARGV[6]); -if ( ( defined($up_lines) && ($up_lines eq "--summary")) - || ( defined($bot_lines) && ($bot_lines eq "--summary")) - || ( defined($sum_flag) && ($sum_flag eq "--summary")) ) { - $summary_flag = 1; +if ( grep { /--summary/ } @ARGV ) +{ + $summary_flag = 1; } + +if ( grep { /--nodatalist/ } @ARGV ) +{ + $nodatalist_flag = 1; +} + # Create index file storage directory if ( ! -d $Idx_dir) { mkdir($Idx_dir) || error_msg("Error creating directory $Idx_dir: " diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 1cbeeafa0a..f3037deb21 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.746 +# Version 7.0NG.748 # 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 diff --git a/pandora_agents/win32/bin/util/grep_log.exe b/pandora_agents/win32/bin/util/grep_log.exe index 4e4029fb60..dbabc454b4 100644 Binary files a/pandora_agents/win32/bin/util/grep_log.exe and b/pandora_agents/win32/bin/util/grep_log.exe differ diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 95cdfcad96..eba7041fb5 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.746} +{Pandora FMS Windows Agent v7.0NG.748} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{200624} +{200811} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 48b6f8d86c..ec1084545f 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.746(Build 200624)") +#define PANDORA_VERSION ("7.0NG.748(Build 200811)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 81ae1f5b41..7e1c5246b0 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.746(Build 200624))" + VALUE "ProductVersion", "(7.0NG.748(Build 200811))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/.gitignore b/pandora_console/.gitignore index 14c3e02e3d..a56f376f61 100644 --- a/pandora_console/.gitignore +++ b/pandora_console/.gitignore @@ -6,7 +6,10 @@ attachment/collection attachment/files_repo include/config.php pandora_console.log +log/console.log +log/cron.log enterprise *.bak audit.log +log/audit.log install_old.php diff --git a/pandora_console/.htaccess b/pandora_console/.htaccess index a1e6f62d2d..ca572f7df1 100644 --- a/pandora_console/.htaccess +++ b/pandora_console/.htaccess @@ -4,5 +4,4 @@ Options -Indexes Order Allow,Deny Deny from All - - + \ No newline at end of file diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index a81fe2204e..957f209119 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.746-200624 +Version: 7.0NG.748-200811 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 6e132326a8..3b64b77f3c 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.746-200624" +pandora_version="7.0NG.748-200811" package_pear=0 package_pandora=1 diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index a304fd516b..7d7619ff95 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -27,6 +27,8 @@ */ // Begin. +require 'vendor/autoload.php'; + define('AJAX', true); if (!defined('__PAN_XHPROF__')) { @@ -39,7 +41,9 @@ if (__PAN_XHPROF__ === 1) { } } -if ((! file_exists('include/config.php')) || (! is_readable('include/config.php'))) { +if ((! file_exists('include/config.php')) + || (! is_readable('include/config.php')) +) { exit; } @@ -50,13 +54,25 @@ require_once 'include/functions.php'; require_once 'include/functions_db.php'; require_once 'include/auth/mysql.php'; -// Hash login process -if (isset($_GET['loginhash'])) { +if (isset($config['console_log_enabled']) === true + && $config['console_log_enabled'] == 1 +) { + ini_set('log_errors', 1); + ini_set('error_log', $config['homedir'].'/log/console.log'); +} else { + ini_set('log_errors', 0); + ini_set('error_log', 0); +} + +// Hash login process. +if (isset($_GET['loginhash']) === true) { $loginhash_data = get_parameter('loginhash_data', ''); $loginhash_user = str_rot13(get_parameter('loginhash_user', '')); if ($config['loginhash_pwd'] != '' - && $loginhash_data == md5($loginhash_user.io_output_password($config['loginhash_pwd'])) + && $loginhash_data == md5( + $loginhash_user.io_output_password($config['loginhash_pwd']) + ) ) { db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $loginhash_user; @@ -65,14 +81,38 @@ if (isset($_GET['loginhash'])) { include_once 'general/login_page.php'; db_pandora_audit('Logon Failed (loginhash', '', 'system'); while (@ob_end_flush()) { + // Dumping... + continue; } exit(''); } } +$auth_class = io_safe_output( + get_parameter('auth_class', 'PandoraFMS\Dashboard\Manager') +); +$public_hash = get_parameter('auth_hash', false); +$public_login = false; // Check user. -check_login(); +if (class_exists($auth_class) === false || $public_hash === false) { + check_login(); +} else { + if ($auth_class::validatePublicHash($public_hash) === false) { + db_pandora_audit( + 'Invalid public hash', + 'Trying to access public dashboard' + ); + include 'general/noaccess.php'; + exit; + } + + // OK. Simulated user log in. If you want to use your own auth_class + // remember to set $config['force_instant_logout'] to true to avoid + // persistent user login. +} + +ob_start(); // Enterprise support. if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { @@ -87,7 +127,10 @@ $page .= '.php'; $config['id_user'] = $_SESSION['id_usuario']; $isFunctionSkins = enterprise_include_once('include/functions_skins.php'); if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { - $config['relative_path'] = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]); + $config['relative_path'] = enterprise_hook( + 'skins_set_image_skin_path', + [$config['id_user']] + ); } if (is_metaconsole()) { @@ -104,3 +147,29 @@ if (file_exists($page)) { if (__PAN_XHPROF__ === 1) { pandora_xhprof_display_result('ajax', 'console'); } + + +if ($config['force_instant_logout'] === true) { + // Force user logout. + if (session_status() !== PHP_SESSION_ACTIVE) { + session_start(); + } + + $iduser = $_SESSION['id_usuario']; + $_SESSION = []; + session_destroy(); + header_remove('Set-Cookie'); + setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); + + if ($config['auth'] == 'saml') { + include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; + $as = new SimpleSAML_Auth_Simple('PandoraFMS'); + $as->logout(); + } +} + + +while (@ob_end_flush()) { + // Dumping... + continue; +} diff --git a/pandora_console/attachment/.htaccess b/pandora_console/attachment/.htaccess index 71f7bf9540..ddd1f3ee4c 100644 --- a/pandora_console/attachment/.htaccess +++ b/pandora_console/attachment/.htaccess @@ -6,6 +6,4 @@ Deny from all Allow from localhost - -php_flag engine off - + \ No newline at end of file diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index bbdac372cd..038997f156 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -69,7 +69,11 @@ function pandoralogs_extension_main() $logs_directory = (!empty($config['server_log_dir'])) ? io_safe_output($config['server_log_dir']) : '/var/log/pandora'; - view_logfile($config['homedir'].'/pandora_console.log'); + // Do not attempt to show console log if disabled. + if ($config['console_log_enabled']) { + view_logfile($config['homedir'].'/log/console.log'); + } + view_logfile($logs_directory.'/pandora_server.log'); view_logfile($logs_directory.'/pandora_server.error'); } diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index e487d49ee5..8940b36c2d 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -199,8 +199,8 @@ function pandora_realtime_graphs() html_print_input_hidden('custom_action', urlencode(base64_encode(' ')), false); html_print_input_hidden('incremental_base', '0'); - echo ''; echo ''; + echo ''; echo ''; // Store servers timezone offset to be retrieved from js diff --git a/pandora_console/extras/mr/39.sql b/pandora_console/extras/mr/39.sql index d37235e2ff..a8d8d2e3dd 100644 --- a/pandora_console/extras/mr/39.sql +++ b/pandora_console/extras/mr/39.sql @@ -1,5 +1,1050 @@ START TRANSACTION; +ALTER TABLE `tnetwork_component` ADD COLUMN `manufacturer_id` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `protocol` tinytext NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `module_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `execution_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `scan_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `value` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `value_operations` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `module_enabled` tinyint(1) UNSIGNED DEFAULT 0; +ALTER TABLE `tnetwork_component` ADD COLUMN `name_oid` varchar(255) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_class` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_key_field` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `scan_filters` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_filters` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `enabled` tinyint(1) UNSIGNED DEFAULT 1; + +INSERT INTO tmodule VALUES (9, 'Wizard module'); + +SET @plugin_name = 'Wizard SNMP module'; +SET @plugin_description = 'Get the result of an arithmetic operation using several OIDs values.'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_snmp_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Version\",\"help\":\"1, 2c, 3\",\"value\":\"1\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"public\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Security level (v3)\",\"help\":\"noAuthNoPriv, authNoPriv, authPriv\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Username (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Authentication method (v3)\",\"help\":\"MD5, SHA\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Authentication password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"Privacy method (v3)\",\"help\":\"DES, AES\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"Privacy password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"OID list\",\"help\":\"Comma separated OIDs used\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"Operation\",\"help\":\"Aritmetic operation to get data. Macros _oN_ will be changed by OIDs in list. Example: (_o1_ * 100) / _o2_\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -port '_field2_' -version '_field3_' -community '_field4_' -secLevel '_field5_' -user '_field6_' -authMethod '_field7_' -authPass '_field8_' -privMethod '_field9_' -privPass '_field10_' -oidList '_field11_' -operation '_field12_''); + +SET @plugin_name = 'Wizard SNMP process'; +SET @plugin_description = 'Check if a process is running (1) or not (0) in OID .1.3.6.1.2.1.25.4.2.1.2 SNMP tree.'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_snmp_process',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Version\",\"help\":\"1, 2c, 3\",\"value\":\"1\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"public\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Security level (v3)\",\"help\":\"noAuthNoPriv, authNoPriv, authPriv\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Username (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Authentication method (v3)\",\"help\":\"MD5, SHA\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Authentication password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"Privacy method (v3)\",\"help\":\"DES, AES\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"Privacy password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"Process\",\"help\":\"Process name to check if is running (case sensitive)\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -port '_field2_' -version '_field3_' -community '_field4_' -secLevel '_field5_' -user '_field6_' -authMethod '_field7_' -authPass '_field8_' -privMethod '_field9_' -privPass '_field10_' -process '_field11_''); + +SET @plugin_name = 'Wizard WMI module'; +SET @plugin_description = 'Get the result of an arithmetic operation using distinct fields in a WMI query (Query must return only 1 row).'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_wmi_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Namespace (Optional)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"User\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"WMI Class\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Fields list\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Query filter (Optional)\",\"help\":\"Use single quotes for query conditions\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Operation\",\"help\":\"Aritmetic operation to get data. Macros _fN_ will be changed by fields in list. Example: ((_f1_ - _f2_) * 100) / _f1_\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -namespace '_field2_' -user '_field3_' -pass '_field4_' -wmiClass '_field5_' -fieldsList '_field6_' -queryFilter "_field7_" -operation '_field8_' -wmicPath /usr/bin/wmic'); + +SET @main_component_group_name = 'Wizard'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@main_component_group_name,0); + +SELECT @component_group_parent := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name; + +SET @component_group_name = 'CPU'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Memory'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Disk devices'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Storage'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Temperature sensors'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Processes'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Other'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Power supply'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Fans'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Temperature'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Sessions'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'VPN'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Intrussions'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Antivirus'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Services'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Disks'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'CPU'; + +SET @component_name = 'CPU User (%)'; +SET @component_description = 'The percentage of CPU time spent processing user-level code, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.9.0','',1,'','','','','',1); + +SET @component_name = 'CPU System (%)'; +SET @component_description = 'The percentage of CPU time spent processing system-level code, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.10.0','',1,'','','','','',1); + +SET @component_name = 'CPU Idle (%)'; +SET @component_description = 'The percentage of CPU time spent idle, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.11.0','',0,'','','','','',1); + +SET @component_name = 'Load average - _nameOID_'; +SET @component_description = 'The 1, 5 or 15 minutes load average'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.10.1.3','',0,'1.3.6.1.4.1.2021.10.1.2','','','','',1); + +SET @component_name = 'Cisco CPU _nameOID_ usage (%)'; +SET @component_description = 'The overall CPU busy percentage in the last 5 minute period'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.109.1.1.1.1.8','',1,'1.3.6.1.4.1.9.9.109.1.1.1.1.2','','','','',1); + +SET @component_name = 'F5 CPU _nameOID_ usage (%)'; +SET @component_description = 'This is average usage ratio of CPU for the associated host in the last five minutes'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.7.5.2.1.35','',1,'1.3.6.1.4.1.3375.2.1.7.5.2.1.3','','','','',1); + +SET @component_name = 'Juniper _nameOID_ CPU usage (%)'; +SET @component_description = 'The average usage ratio of CPU in the last five minutes'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.21','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP CPU usage (%)'; +SET @component_description = 'The CPU utilization in percent(%)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',1,1,'1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet system CPU usage (%)'; +SET @component_description = 'CPU usage of the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.1.3.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ CPU usage (%)'; +SET @component_description = 'CPU usage of the virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.3.2.1.1.5','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'WMI _DeviceID_ usage (%)'; +SET @component_description = 'Load capacity of each processor, averaged to the last second'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','{\"extra_field_1\":\"LoadPercentage\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"\",\"_field11__wmi_field\":\"_field11_\",\"_field12__wmi_field\":\"_field12_\",\"_field9__wmi_field\":\"_field9_\",\"_field10__wmi_field\":\"_field10_\",\"_field7__wmi_field\":\"_field7_\",\"_field8__wmi_field\":\"_field8_\",\"_field5__wmi_field\":\"_field5_\",\"_field6__wmi_field\":\"_field6_\",\"_field3__wmi_field\":\"_field3_\",\"_field4__wmi_field\":\"_field4_\",\"_field1__wmi_field\":\"_field1_\",\"_field2__wmi_field\":\"_field2_\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',1,'','Win32_Processor','DeviceID','','{\"scan\":\"\",\"execution\":\"DeviceID = '_DeviceID_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_group_name = 'Memory'; + +SET @component_name = 'Total RAM used (%)'; +SET @component_description = 'Total real/physical memory used on the host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.2021.4.6.0\",\"extra_field_2\":\"1.3.6.1.4.1.2021.4.5.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__snmp_field\":\"_port_\",\"_field1__snmp_field\":\"_address_\",\"_field4__snmp_field\":\"_community_\",\"_field3__snmp_field\":\"_version_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,1,'','',1,'','','','','',1); + +SET @component_name = 'F5 host RAM used (%)'; +SET @component_description = 'The host memory percentage currently in use'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.3375.2.1.7.1.2.0\",\"extra_field_2\":\"1.3.6.1.4.1.3375.2.1.7.1.1.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',2,1,'','',1,'','','','','',1); + +SET @component_name = 'F5 Host _nameOID_ RAM used (%)'; +SET @component_description = 'The host memory percentage currently in use for the specified host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.3375.2.1.7.4.2.1.3\",\"extra_field_2\":\"1.3.6.1.4.1.3375.2.1.7.4.2.1.2\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',2,2,'','',1,'1.3.6.1.4.1.3375.2.1.7.4.2.1.1','','','','',1); + +SET @component_name = 'Fortinet system RAM usage (%)'; +SET @component_description = 'Memory usage of the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.1.4.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ RAM usage (%)'; +SET @component_description = 'Memory usage of the virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.3.2.1.1.6','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'WMI total RAM used (%)'; +SET @component_description = 'Percentage of physical memory currently used'; +SET @plugin_name = 'Wizard WMI module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"TotalVisibleMemorySize\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_wmi_module -host "_address_" -namespace "_namespace_wmi_" -user "_user_wmi_" -pass "_pass_wmi_" -wmiClass "_class_wmi_" -fieldsList "_field_wmi_0_,_field_wmi_1_" -queryFilter "" -operation "((_f2_ - _f1_) * 100) / _f2_" -wmicPath /usr/bin/wmic\",\"value_operation\":\"((_TotalVisibleMemorySize_ - _FreePhysicalMemory_) * 100) / _TotalVisibleMemorySize_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__wmi_field\":\"_namespace_wmi_\",\"_field1__wmi_field\":\"_address_\",\"_field4__wmi_field\":\"_pass_wmi_\",\"_field3__wmi_field\":\"_user_wmi_\",\"_field6__wmi_field\":\"_field_wmi_0_,_field_wmi_1_\",\"_field5__wmi_field\":\"_class_wmi_\",\"_field8__wmi_field\":\"((_f2_ - _f1_) * 100) / _f2_\",\"_field7__wmi_field\":\"\",\"field0_wmi_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',2,1,'','',1,'','Win32_OperatingSystem','FreePhysicalMemory','','{\"scan\":\"\",\"execution\":\"\",\"field\":\"\",\"key_string\":\"\"}',1); + +SET @component_name = 'Total Swap used (%)'; +SET @component_description = 'Total swap memory used on the host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.2021.4.4.0\",\"extra_field_2\":\"1.3.6.1.4.1.2021.4.3.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,1,'','',1,'','','','','',1); + +SET @component_name = 'Cisco memory pool _nameOID_ usage (%)'; +SET @component_description = 'Indicates the percentage of bytes from the memory pool that are currently in use by applications on the managed device'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.9.9.48.1.1.1.5\",\"extra_field_2\":\"1.3.6.1.4.1.9.9.48.1.1.1.6\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / (_o1_ + _o2_)"\",\"value_operation\":\"(_oid_1_ * 100) / (_oid_1_ + _oid_2_)\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / (_o1_ + _o2_)\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',2,2,'','',1,'1.3.6.1.4.1.9.9.48.1.1.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ memory usage (%)'; +SET @component_description = 'The buffer pool utilization in percentage of this subject'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.11','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP memory slot _nameOID_ usage (%)'; +SET @component_description = 'The percentage of currently allocated bytes'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.7\",\"extra_field_2\":\"1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.5\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',2,2,'','',1,'1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.1','','','','',1); + +SET @component_group_name = 'Disk devices'; + +SET @component_name = 'Disk _nameOID_ bytes read'; +SET @component_description = 'The number of bytes read from this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.3','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ bytes written'; +SET @component_description = 'The number of bytes written to this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.4','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ read accesses'; +SET @component_description = 'The number of read accesses from this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'accesses/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.5','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ write accesses'; +SET @component_description = 'The number of write accesses to this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'accesses/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.6','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_group_name = 'Storage'; + +SET @component_name = 'Storage _nameOID_ (%)'; +SET @component_description = 'The amount of the storage represented by this entry that is allocated'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.2.1.25.2.3.1.6\",\"extra_field_2\":\"1.3.6.1.2.1.25.2.3.1.5\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,2,'','',1,'1.3.6.1.2.1.25.2.3.1.3','','','','',1); + +SET @component_group_name = 'Temperature sensors'; + +SET @component_name = 'Temperature _nameOID_'; +SET @component_description = 'The temperature of this sensor'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.16.2.1.3','',0,'1.3.6.1.4.1.2021.13.16.2.1.2','','','','',1); + +SET @component_group_name = 'Processes'; + +SET @component_name = 'Process _nameOID_'; +SET @component_description = 'Check if the process is running'; +SET @plugin_name = 'Wizard SNMP process'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.2.1.25.4.2.1.7\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_process -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -process "_nameOID_"\",\"value_operation\":\"1\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_nameOID_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,2,'','',0,'1.3.6.1.2.1.25.4.2.1.2','','','','',1); + +SET @component_name = 'WMI Number of processes'; +SET @component_description = 'Number of process contexts currently loaded or running on the operating system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,1,'','',1,'','Win32_OperatingSystem','NumberOfProcesses','','{\"scan\":\"\",\"execution\":\"\",\"field\":\"0\",\"key_string\":\"\"}',1); + +SET @component_name = 'WMI process _Name_ running'; +SET @component_description = 'Check if process is running'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"Name\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_Process','Handle','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"_Name_\"}',1); + +SET @component_group_name = 'Other'; + +SET @component_name = 'Wizard system uptime'; +SET @component_description = 'The time (in hundredths of a second) since the network management portion of the system was last re-initialized'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','all',1,1,'1.3.6.1.2.1.25.1.1.0','',1,'','','','','',1); + +SET @component_name = 'Wizard network uptime'; +SET @component_description = 'The time (in hundredths of a second) since the network management portion of the system was last re-initialized'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','all',1,1,'1.3.6.1.2.1.1.3.0','',1,'','','','','',1); + +SET @component_name = 'Blocks sent'; +SET @component_description = 'Number of blocks sent to a block device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.57.0','',0,'','','','','',1); + +SET @component_name = 'Blocks received'; +SET @component_description = 'Number of blocks received from a block device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.58.0','',0,'','','','','',1); + +SET @component_name = 'Interrupts processed'; +SET @component_description = 'Number of interrupts processed'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.59.0','',0,'','','','','',1); + +SET @component_group_name = 'Power supply'; + +SET @component_name = 'Cisco _nameOID_ power state'; +SET @component_description = 'The current state of the power supply: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.5.1.3','',0,'1.3.6.1.4.1.9.9.13.1.5.1.2','','','','',1); + +SET @component_name = 'F5 Power supply _nameOID_ status'; +SET @component_description = 'The status of the indexed power supply on the system: bad(0), good(1), notpresent(2)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.2.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.2.2.1','','','','',1); + +SET @component_name = 'WMI _Name_ power supply state'; +SET @component_description = 'State of the power supply or supplies when last booted: Other (1), Unknown (2), Safe (3), Warning (4), Critical (5), Non-recoverable (6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"PowerSupplyState\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_ComputerSystem','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_name = 'WMI _Name_ Power state'; +SET @component_description = 'Current power state of a computer and its associated operating system: Unknown (0), Full Power (1), Low Power Mode (2), Standby (3), Unknown (4), Power Cycle (5), Power Off (6), Warning (7), Hibernate (8), Soft Off (9)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"PowerState\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,1,'','',0,'','Win32_ComputerSystem','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_group_name = 'Fans'; + +SET @component_name = 'Cisco _nameOID_ fan state'; +SET @component_description = 'The current state of the fan: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.4.1.3','',1,'1.3.6.1.4.1.9.9.13.1.4.1.2','','','','',1); + +SET @component_name = 'F5 Fan _nameOID_ status'; +SET @component_description = 'The status of the indexed chassis fan on the system: bad(0), good(1), notpresent(2)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.1.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.1.2.1.1','','','','',1); + +SET @component_name = 'HP fan tray _nameOID_ state'; +SET @component_description = 'Current state of the fan: failed(0), removed(1), off(2), underspeed(3), overspeed(4), ok(5), maxstate(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.11.2.14.11.5.1.54.2.1.1.4','',1,'1.3.6.1.4.1.11.2.14.11.5.1.54.2.1.1.2','','','','',1); + +SET @component_group_name = 'Temperature'; + +SET @component_name = 'Cisco _nameOID_ temperature'; +SET @component_description = 'The current measurement of the testpoint being instrumented'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.3.1.3','',1,'1.3.6.1.4.1.9.9.13.1.3.1.2','','','','',1); + +SET @component_name = 'F5 Temperature sensor _nameOID_'; +SET @component_description = 'The chassis temperature of the indexed sensor on the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.3.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.3.2.1.1','','','','',1); + +SET @component_name = 'Juniper _nameOID_ temperature'; +SET @component_description = 'The temperature of this subject'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.7','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP _nameOID_ temperature'; +SET @component_description = 'The current temperature given by the indexed chassis'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',1,2,'1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.3','',0,'1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.2','','','','',1); + +SET @component_group_name = 'Sessions'; + +SET @component_name = 'F5 Current auth sessions'; +SET @component_description = 'The current number of concurrent auth sessions'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.3.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth success results'; +SET @component_description = 'The total number of auth success results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.5.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth failure results'; +SET @component_description = 'The total number of auth failure results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.6.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth error results'; +SET @component_description = 'The total number of auth error results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.8.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet ephemeral sessions count'; +SET @component_description = 'The current number of ephemeral sessions on the device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.1.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet direct requests count'; +SET @component_description = 'The number of direct requests to Fortigate local stack from external, reflecting DOS attack towards the Fortigate'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.7.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet clash sessions count'; +SET @component_description = 'The number of new sessions which have collision with existing sessions. This generally highlights a shortage of ports or IP in ip-pool during source natting (PNAT)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.3.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet expectation sessions count'; +SET @component_description = 'The number of current expectation sessions'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.4.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet sync queue sessions count'; +SET @component_description = 'The sync queue full counter, reflecting bursts on the sync queue'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.5.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet accept queue sessions count'; +SET @component_description = 'The accept queue full counter, reflecting bursts on the accept queue'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.6.0','',1,'','','','','',1); + +SET @component_group_name = 'VPN'; + +SET @component_name = 'F5 Current SSL/VPN connections'; +SET @component_description = 'The total current SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.3.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total SSL/VPN bytes received'; +SET @component_description = 'The total raw bytes received by SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.5.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total SSL/VPN bytes transmitted'; +SET @component_description = 'The total raw bytes transmitted by SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.6.0','',1,'','','','','',1); + +SET @component_name = 'Juniper _nameOID_ active sites'; +SET @component_description = 'The number of active sites in the VPN'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.2.1.9','',1,'1.3.6.1.4.1.2636.3.26.1.2.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ age'; +SET @component_description = 'The age (i.e., time from creation till now) of this VPN in hundredths of a second'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.2.1.12','',1,'1.3.6.1.4.1.2636.3.26.1.2.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ interface status'; +SET @component_description = 'Status of this interface: unknown(0), noLocalInterface(1), disabled(2), encapsulationMismatch(3), down(4), up(5)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.3.1.10','',1,'1.3.6.1.4.1.2636.3.26.1.3.1.2','','','','',1); + +SET @component_group_name = 'Intrussions'; + +SET @component_name = 'Fortinet virtual domain _nameOID_ intrussions detected'; +SET @component_description = 'Number of intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ intrussions blocked'; +SET @component_description = 'Number of intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ critical severity intrussions'; +SET @component_description = 'Number of critical severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.3','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ high severity intrussions'; +SET @component_description = 'Number of high severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.4','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ medium severity intrussions'; +SET @component_description = 'Number of medium severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.5','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ low severity intrussions'; +SET @component_description = 'Number of low severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.6','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ informational severity intrussions'; +SET @component_description = 'Number of informational severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.7','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ signature detections'; +SET @component_description = 'Number of intrusions detected by signature since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.8','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ anomaly detections'; +SET @component_description = 'Number of intrusions DECed as anomalies since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.9','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_group_name = 'Antivirus'; + +SET @component_name = 'Fortinet virtual domain _nameOID_ virus detected'; +SET @component_description = 'Number of virus transmissions detected in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ virus blocked'; +SET @component_description = 'Number of virus transmissions blocked in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.2','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ oversized detected'; +SET @component_description = 'Number of over-sized file transmissions detected in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.17','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ oversized blocked'; +SET @component_description = 'Number of over-sized file transmissions blocked in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.18','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_group_name = 'Services'; + +SET @component_name = 'WMI Service _Name_ running'; +SET @component_description = '_Caption_'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"State\",\"extra_field_2\":\"Caption\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_Service','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"Running\"}',1); + +SET @component_group_name = 'Disks'; + +SET @component_name = 'WMI disk _DeviceID_ used (%)'; +SET @component_description = 'Space percentage used on the logical disk'; +SET @plugin_name = 'Wizard WMI module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"Size\",\"extra_field_2\":\"FreeSpace\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_wmi_module -host "_address_" -namespace "_namespace_wmi_" -user "_user_wmi_" -pass "_pass_wmi_" -wmiClass "_class_wmi_" -fieldsList "_field_wmi_1_,_field_wmi_2_" -queryFilter "DeviceID = '_DeviceID_'" -operation "((_f1_ - _f2_) * 100) / _f1_" -wmicPath /usr/bin/wmic\",\"value_operation\":\"((_Size_ - _FreeSpace_) * 100) / _Size_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__wmi_field\":\"_namespace_wmi_\",\"_field1__wmi_field\":\"_address_\",\"_field4__wmi_field\":\"_pass_wmi_\",\"_field3__wmi_field\":\"_user_wmi_\",\"_field6__wmi_field\":\"_field_wmi_1_,_field_wmi_2_\",\"_field5__wmi_field\":\"_class_wmi_\",\"_field8__wmi_field\":\"((_f1_ - _f2_) * 100) / _f1_\",\"_field7__wmi_field\":\"DeviceID = '_DeviceID_'\",\"field0_wmi_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',2,2,'','',1,'','Win32_LogicalDisk','DeviceID','','{\"scan\":\"DriveType = 3\",\"execution\":\"\",\"field\":\"\",\"key_string\":\"\"}',1); + +INSERT IGNORE INTO `tpen` VALUES (171,'dlink','D-Link Systems, Inc.'),(14988,'mikrotik','MikroTik'),(6486,'alcatel','Alcatel-Lucent Enterprise'),(41112,'ubiquiti','Ubiquiti Networks, Inc.'),(207,'telesis','Allied Telesis, Inc.'),(10002,'frogfoot','Frogfoot Networks'),(2,'ibm','IBM'),(4,'unix','Unix'),(63,'apple','Apple Computer, Inc.'),(674,'dell','Dell Inc.'),(111,'oracle','Oracle'),(116,'hitachi','Hitachi, Ltd.'),(173,'netlink','Netlink'),(188,'ascom','Ascom'),(6574,'synology','Synology Inc.'),(3861,'fujitsu','Fujitsu Network Communications, Inc.'),(53526,'dell','Dell ATC'),(52627,'apple','Apple Inc'),(19464,'hitachi','Hitachi Communication Technologies, Ltd.'),(13062,'ascom','Ascom'); + ALTER TABLE `tmensajes` ADD COLUMN `hidden_sent` TINYINT(1) UNSIGNED DEFAULT 0; COMMIT; diff --git a/pandora_console/extras/mr/40.sql b/pandora_console/extras/mr/40.sql new file mode 100644 index 0000000000..fece05576f --- /dev/null +++ b/pandora_console/extras/mr/40.sql @@ -0,0 +1,15 @@ +START TRANSACTION; + +UPDATE `talert_commands` SET name='Monitoring Event' WHERE name='Pandora FMS Event'; + +ALTER TABLE `tservice_element` ADD COLUMN `rules` text; +ALTER TABLE `tservice` ADD COLUMN `unknown_as_critical` tinyint(1) NOT NULL default 0 AFTER `warning`; +ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT ''; + +UPDATE `tservice` SET `auto_calculate`=0; + +UPDATE `tservice` SET `cps`= `cps` - 1 WHERE `cps` > 0; +UPDATE `tagente` SET `cps`= `cps` - 1 WHERE `cps` > 0; +UPDATE `tagente_modulo` SET `cps`= `cps` - 1 WHERE `cps` > 0; + +COMMIT; diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index d05785f4ed..193705ed89 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1271,6 +1271,7 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; -- ---------------------------------------------------------------------- ALTER TABLE tserver ADD COLUMN `server_keepalive` int(11) DEFAULT 0; ALTER TABLE `tserver` MODIFY COLUMN `server_keepalive` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `tserver` MODIFY COLUMN `version` varchar(25) NOT NULL DEFAULT ''; -- ---------------------------------------------------------------------- -- Table `tagente_estado` @@ -1342,13 +1343,13 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT ''; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 38); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 40); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '746'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '748'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; @@ -1476,6 +1477,20 @@ ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL def ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` ADD COLUMN `ff_type` tinyint(1) unsigned default '0'; ALTER TABLE `tnetwork_component` MODIFY COLUMN `ff_type` tinyint(1) unsigned NULL DEFAULT '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `manufacturer_id` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `protocol` tinytext NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `module_type` tinyint UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `execution_type` tinyint UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `scan_type` tinyint UNSIGNED NOT NULL DEFAULT 1; +ALTER TABLE `tnetwork_component` ADD COLUMN `value` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `value_operations` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `module_enabled` tinyint(1) UNSIGNED DEFAULT '0'; +ALTER TABLE `tnetwork_component` ADD COLUMN `name_oid` varchar(255) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_class` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_key_field` varchar(200) NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `scan_filters` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `query_filters` text NOT NULL; +ALTER TABLE `tnetwork_component` ADD COLUMN `enabled` tinyint(1) UNSIGNED DEFAULT 1; -- ---------------------------------------------------------------------- -- Table `tpen` @@ -1526,7 +1541,16 @@ ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `evaluate_sla` int(1) NOT NULL default 0; ALTER TABLE `tservice` ADD COLUMN `is_favourite` tinyint(1) NOT NULL default 0; +ALTER TABLE `tservice` ADD COLUMN `unknown_as_critical` tinyint(1) NOT NULL default 0 AFTER `warning`; + UPDATE tservice SET `is_favourite` = 1 WHERE `name` REGEXP '^[_|.|\[|\(]'; +-- ALl previous services are manual now. +UPDATE `tservice` SET `auto_calculate` = 0; + +-- --------------------------------------------------------------------- +-- Table `tservice_element` +-- --------------------------------------------------------------------- +ALTER TABLE `tservice_element` ADD COLUMN `rules` text; -- --------------------------------------------------------------------- -- Table `tlayout` @@ -1856,6 +1880,7 @@ ALTER TABLE tevent_response ADD COLUMN command_timeout int(5) unsigned NOT NULL -- --------------------------------------------------------------------- INSERT INTO tmodule VALUES (8, 'Wux module'); +INSERT INTO tmodule VALUES (9, 'Wizard module'); -- --------------------------------------------------------------------- -- Table `ttipo_modulo` @@ -2735,4 +2760,1034 @@ CREATE TABLE `tnode_relations` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- ------------------------------------------------------------------------ +-- New wizards components and plugins +-- ------------------------------------------------------------------------ +SET @plugin_name = 'Wizard SNMP module'; +SET @plugin_description = 'Get the result of an arithmetic operation using several OIDs values.'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_snmp_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Version\",\"help\":\"1, 2c, 3\",\"value\":\"1\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"public\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Security level (v3)\",\"help\":\"noAuthNoPriv, authNoPriv, authPriv\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Username (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Authentication method (v3)\",\"help\":\"MD5, SHA\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Authentication password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"Privacy method (v3)\",\"help\":\"DES, AES\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"Privacy password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"OID list\",\"help\":\"Comma separated OIDs used\",\"value\":\"\",\"hide\":\"\"},\"12\":{\"macro\":\"_field12_\",\"desc\":\"Operation\",\"help\":\"Aritmetic operation to get data. Macros _oN_ will be changed by OIDs in list. Example: (_o1_ * 100) / _o2_\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -port '_field2_' -version '_field3_' -community '_field4_' -secLevel '_field5_' -user '_field6_' -authMethod '_field7_' -authPass '_field8_' -privMethod '_field9_' -privPass '_field10_' -oidList '_field11_' -operation '_field12_''); + +SET @plugin_name = 'Wizard SNMP process'; +SET @plugin_description = 'Check if a process is running (1) or not (0) in OID .1.3.6.1.2.1.25.4.2.1.2 SNMP tree.'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_snmp_process',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Port\",\"help\":\"\",\"value\":\"161\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Version\",\"help\":\"1, 2c, 3\",\"value\":\"1\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Community\",\"help\":\"\",\"value\":\"public\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Security level (v3)\",\"help\":\"noAuthNoPriv, authNoPriv, authPriv\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Username (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Authentication method (v3)\",\"help\":\"MD5, SHA\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Authentication password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"9\":{\"macro\":\"_field9_\",\"desc\":\"Privacy method (v3)\",\"help\":\"DES, AES\",\"value\":\"\",\"hide\":\"\"},\"10\":{\"macro\":\"_field10_\",\"desc\":\"Privacy password (v3)\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"11\":{\"macro\":\"_field11_\",\"desc\":\"Process\",\"help\":\"Process name to check if is running (case sensitive)\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -port '_field2_' -version '_field3_' -community '_field4_' -secLevel '_field5_' -user '_field6_' -authMethod '_field7_' -authPass '_field8_' -privMethod '_field9_' -privPass '_field10_' -process '_field11_''); + +SET @plugin_name = 'Wizard WMI module'; +SET @plugin_description = 'Get the result of an arithmetic operation using distinct fields in a WMI query (Query must return only 1 row).'; +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; +INSERT IGNORE INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`, `execute`, `net_dst_opt`, `net_port_opt`, `user_opt`, `pass_opt`, `plugin_type`, `macros`, `parameters`) VALUES (@plugin_id,@plugin_name,@plugin_description,20,0,'/usr/share/pandora_server/util/plugin/wizard_wmi_module',NULL,NULL,NULL,NULL,0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Host\",\"help\":\"\",\"value\":\"_address_\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Namespace (Optional)\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"User\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"WMI Class\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"6\":{\"macro\":\"_field6_\",\"desc\":\"Fields list\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"7\":{\"macro\":\"_field7_\",\"desc\":\"Query filter (Optional)\",\"help\":\"Use single quotes for query conditions\",\"value\":\"\",\"hide\":\"\"},\"8\":{\"macro\":\"_field8_\",\"desc\":\"Operation\",\"help\":\"Aritmetic operation to get data. Macros _fN_ will be changed by fields in list. Example: ((_f1_ - _f2_) * 100) / _f1_\",\"value\":\"\",\"hide\":\"\"}}','-host '_field1_' -namespace '_field2_' -user '_field3_' -pass '_field4_' -wmiClass '_field5_' -fieldsList '_field6_' -queryFilter "_field7_" -operation '_field8_' -wmicPath /usr/bin/wmic'); + +SET @main_component_group_name = 'Wizard'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@main_component_group_name,0); + +SELECT @component_group_parent := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @main_component_group_name; + +SET @component_group_name = 'CPU'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Memory'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Disk devices'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Storage'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Temperature sensors'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Processes'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Other'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Power supply'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Fans'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Temperature'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Sessions'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'VPN'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Intrussions'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Antivirus'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Services'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'Disks'; +SET @component_id = ''; +SELECT @component_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; +INSERT IGNORE INTO `tnetwork_component_group` (`id_sg`, `name`, `parent`) VALUES (@component_id,@component_group_name,@component_group_parent); + +SET @component_group_name = 'CPU'; + +SET @component_name = 'CPU User (%)'; +SET @component_description = 'The percentage of CPU time spent processing user-level code, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.9.0','',1,'','','','','',1); + +SET @component_name = 'CPU System (%)'; +SET @component_description = 'The percentage of CPU time spent processing system-level code, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.10.0','',1,'','','','','',1); + +SET @component_name = 'CPU Idle (%)'; +SET @component_description = 'The percentage of CPU time spent idle, calculated over the last minute'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.11.0','',0,'','','','','',1); + +SET @component_name = 'Load average - _nameOID_'; +SET @component_description = 'The 1, 5 or 15 minutes load average'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.10.1.3','',0,'1.3.6.1.4.1.2021.10.1.2','','','','',1); + +SET @component_name = 'Cisco CPU _nameOID_ usage (%)'; +SET @component_description = 'The overall CPU busy percentage in the last 5 minute period'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.109.1.1.1.1.8','',1,'1.3.6.1.4.1.9.9.109.1.1.1.1.2','','','','',1); + +SET @component_name = 'F5 CPU _nameOID_ usage (%)'; +SET @component_description = 'This is average usage ratio of CPU for the associated host in the last five minutes'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.7.5.2.1.35','',1,'1.3.6.1.4.1.3375.2.1.7.5.2.1.3','','','','',1); + +SET @component_name = 'Juniper _nameOID_ CPU usage (%)'; +SET @component_description = 'The average usage ratio of CPU in the last five minutes'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.21','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP CPU usage (%)'; +SET @component_description = 'The CPU utilization in percent(%)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',1,1,'1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet system CPU usage (%)'; +SET @component_description = 'CPU usage of the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.1.3.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ CPU usage (%)'; +SET @component_description = 'CPU usage of the virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.3.2.1.1.5','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'WMI _DeviceID_ usage (%)'; +SET @component_description = 'Load capacity of each processor, averaged to the last second'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','{\"extra_field_1\":\"LoadPercentage\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"\",\"_field11__wmi_field\":\"_field11_\",\"_field12__wmi_field\":\"_field12_\",\"_field9__wmi_field\":\"_field9_\",\"_field10__wmi_field\":\"_field10_\",\"_field7__wmi_field\":\"_field7_\",\"_field8__wmi_field\":\"_field8_\",\"_field5__wmi_field\":\"_field5_\",\"_field6__wmi_field\":\"_field6_\",\"_field3__wmi_field\":\"_field3_\",\"_field4__wmi_field\":\"_field4_\",\"_field1__wmi_field\":\"_field1_\",\"_field2__wmi_field\":\"_field2_\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',1,'','Win32_Processor','DeviceID','','{\"scan\":\"\",\"execution\":\"DeviceID = '_DeviceID_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_group_name = 'Memory'; + +SET @component_name = 'Total RAM used (%)'; +SET @component_description = 'Total real/physical memory used on the host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.2021.4.6.0\",\"extra_field_2\":\"1.3.6.1.4.1.2021.4.5.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__snmp_field\":\"_port_\",\"_field1__snmp_field\":\"_address_\",\"_field4__snmp_field\":\"_community_\",\"_field3__snmp_field\":\"_version_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,1,'','',1,'','','','','',1); + +SET @component_name = 'F5 host RAM used (%)'; +SET @component_description = 'The host memory percentage currently in use'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.3375.2.1.7.1.2.0\",\"extra_field_2\":\"1.3.6.1.4.1.3375.2.1.7.1.1.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',2,1,'','',1,'','','','','',1); + +SET @component_name = 'F5 Host _nameOID_ RAM used (%)'; +SET @component_description = 'The host memory percentage currently in use for the specified host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.3375.2.1.7.4.2.1.3\",\"extra_field_2\":\"1.3.6.1.4.1.3375.2.1.7.4.2.1.2\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',2,2,'','',1,'1.3.6.1.4.1.3375.2.1.7.4.2.1.1','','','','',1); + +SET @component_name = 'Fortinet system RAM usage (%)'; +SET @component_description = 'Memory usage of the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.1.4.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ RAM usage (%)'; +SET @component_description = 'Memory usage of the virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.3.2.1.1.6','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'WMI total RAM used (%)'; +SET @component_description = 'Percentage of physical memory currently used'; +SET @plugin_name = 'Wizard WMI module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"TotalVisibleMemorySize\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_wmi_module -host "_address_" -namespace "_namespace_wmi_" -user "_user_wmi_" -pass "_pass_wmi_" -wmiClass "_class_wmi_" -fieldsList "_field_wmi_0_,_field_wmi_1_" -queryFilter "" -operation "((_f2_ - _f1_) * 100) / _f2_" -wmicPath /usr/bin/wmic\",\"value_operation\":\"((_TotalVisibleMemorySize_ - _FreePhysicalMemory_) * 100) / _TotalVisibleMemorySize_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__wmi_field\":\"_namespace_wmi_\",\"_field1__wmi_field\":\"_address_\",\"_field4__wmi_field\":\"_pass_wmi_\",\"_field3__wmi_field\":\"_user_wmi_\",\"_field6__wmi_field\":\"_field_wmi_0_,_field_wmi_1_\",\"_field5__wmi_field\":\"_class_wmi_\",\"_field8__wmi_field\":\"((_f2_ - _f1_) * 100) / _f2_\",\"_field7__wmi_field\":\"\",\"field0_wmi_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',2,1,'','',1,'','Win32_OperatingSystem','FreePhysicalMemory','','{\"scan\":\"\",\"execution\":\"\",\"field\":\"\",\"key_string\":\"\"}',1); + +SET @component_name = 'Total Swap used (%)'; +SET @component_description = 'Total swap memory used on the host'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.2021.4.4.0\",\"extra_field_2\":\"1.3.6.1.4.1.2021.4.3.0\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,1,'','',1,'','','','','',1); + +SET @component_name = 'Cisco memory pool _nameOID_ usage (%)'; +SET @component_description = 'Indicates the percentage of bytes from the memory pool that are currently in use by applications on the managed device'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.9.9.48.1.1.1.5\",\"extra_field_2\":\"1.3.6.1.4.1.9.9.48.1.1.1.6\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / (_o1_ + _o2_)"\",\"value_operation\":\"(_oid_1_ * 100) / (_oid_1_ + _oid_2_)\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / (_o1_ + _o2_)\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',2,2,'','',1,'1.3.6.1.4.1.9.9.48.1.1.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ memory usage (%)'; +SET @component_description = 'The buffer pool utilization in percentage of this subject'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.11','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP memory slot _nameOID_ usage (%)'; +SET @component_description = 'The percentage of currently allocated bytes'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.7\",\"extra_field_2\":\"1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.5\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',2,2,'','',1,'1.3.6.1.4.1.11.2.14.11.5.1.1.2.1.1.1.1','','','','',1); + +SET @component_group_name = 'Disk devices'; + +SET @component_name = 'Disk _nameOID_ bytes read'; +SET @component_description = 'The number of bytes read from this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.3','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ bytes written'; +SET @component_description = 'The number of bytes written to this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.4','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ read accesses'; +SET @component_description = 'The number of read accesses from this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'accesses/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.5','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_name = 'Disk _nameOID_ write accesses'; +SET @component_description = 'The number of write accesses to this device since boot'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,16,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'accesses/sec','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.15.1.1.6','',0,'1.3.6.1.4.1.2021.13.15.1.1.2','','','','',1); + +SET @component_group_name = 'Storage'; + +SET @component_name = 'Storage _nameOID_ (%)'; +SET @component_description = 'The amount of the storage represented by this entry that is allocated'; +SET @plugin_name = 'Wizard SNMP module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.2.1.25.2.3.1.6\",\"extra_field_2\":\"1.3.6.1.2.1.25.2.3.1.5\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_module -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -oidList "_oid_1_,_oid_2_" -operation "(_o1_ * 100) / _o2_"\",\"value_operation\":\"(_oid_1_ * 100) / _oid_2_\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_oid_1_,_oid_2_\",\"_field12__snmp_field\":\"(_o1_ * 100) / _o2_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,2,'','',1,'1.3.6.1.2.1.25.2.3.1.3','','','','',1); + +SET @component_group_name = 'Temperature sensors'; + +SET @component_name = 'Temperature _nameOID_'; +SET @component_description = 'The temperature of this sensor'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,2,'1.3.6.1.4.1.2021.13.16.2.1.3','',0,'1.3.6.1.4.1.2021.13.16.2.1.2','','','','',1); + +SET @component_group_name = 'Processes'; + +SET @component_name = 'Process _nameOID_'; +SET @component_description = 'Check if the process is running'; +SET @plugin_name = 'Wizard SNMP process'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard',CONCAT('{\"extra_field_1\":\"1.3.6.1.2.1.25.4.2.1.7\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_snmp_process -host "_address_" -port "_port_" -version "_version_" -community "_community_" -secLevel "_sec_level_" -user "_auth_user_" -authMethod "_auth_method_" -authPass "_auth_pass_" -privMethod "_priv_method_" -privPass "_priv_pass_" -process "_nameOID_"\",\"value_operation\":\"1\",\"server_plugin\":\"',@plugin_id,'\",\"_field11__snmp_field\":\"_nameOID_\",\"_field9__snmp_field\":\"_priv_method_\",\"_field10__snmp_field\":\"_priv_pass_\",\"_field7__snmp_field\":\"_auth_method_\",\"_field8__snmp_field\":\"_auth_pass_\",\"_field5__snmp_field\":\"_sec_level_\",\"_field6__snmp_field\":\"_auth_user_\",\"_field3__snmp_field\":\"_version_\",\"_field4__snmp_field\":\"_community_\",\"_field1__snmp_field\":\"_address_\",\"_field2__snmp_field\":\"_port_\",\"field0_snmp_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',2,2,'','',0,'1.3.6.1.2.1.25.4.2.1.2','','','','',1); + +SET @component_name = 'WMI Number of processes'; +SET @component_description = 'Number of process contexts currently loaded or running on the operating system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,1,'','',1,'','Win32_OperatingSystem','NumberOfProcesses','','{\"scan\":\"\",\"execution\":\"\",\"field\":\"0\",\"key_string\":\"\"}',1); + +SET @component_name = 'WMI process _Name_ running'; +SET @component_description = 'Check if process is running'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"Name\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_Process','Handle','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"_Name_\"}',1); + +SET @component_group_name = 'Other'; + +SET @component_name = 'Wizard system uptime'; +SET @component_description = 'The time (in hundredths of a second) since the network management portion of the system was last re-initialized'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','all',1,1,'1.3.6.1.2.1.25.1.1.0','',1,'','','','','',1); + +SET @component_name = 'Wizard network uptime'; +SET @component_description = 'The time (in hundredths of a second) since the network management portion of the system was last re-initialized'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','all',1,1,'1.3.6.1.2.1.1.3.0','',1,'','','','','',1); + +SET @component_name = 'Blocks sent'; +SET @component_description = 'Number of blocks sent to a block device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.57.0','',0,'','','','','',1); + +SET @component_name = 'Blocks received'; +SET @component_description = 'Number of blocks received from a block device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.58.0','',0,'','','','','',1); + +SET @component_name = 'Interrupts processed'; +SET @component_description = 'Number of interrupts processed'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','general_snmp',1,1,'1.3.6.1.4.1.2021.11.59.0','',0,'','','','','',1); + +SET @component_group_name = 'Power supply'; + +SET @component_name = 'Cisco _nameOID_ power state'; +SET @component_description = 'The current state of the power supply: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.5.1.3','',0,'1.3.6.1.4.1.9.9.13.1.5.1.2','','','','',1); + +SET @component_name = 'F5 Power supply _nameOID_ status'; +SET @component_description = 'The status of the indexed power supply on the system: bad(0), good(1), notpresent(2)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.2.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.2.2.1','','','','',1); + +SET @component_name = 'WMI _Name_ power supply state'; +SET @component_description = 'State of the power supply or supplies when last booted: Other (1), Unknown (2), Safe (3), Warning (4), Critical (5), Non-recoverable (6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"PowerSupplyState\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_ComputerSystem','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_name = 'WMI _Name_ Power state'; +SET @component_description = 'Current power state of a computer and its associated operating system: Unknown (0), Full Power (1), Low Power Mode (2), Standby (3), Unknown (4), Power Cycle (5), Power Off (6), Warning (7), Hibernate (8), Soft Off (9)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"PowerState\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,1,'','',0,'','Win32_ComputerSystem','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"\"}',1); + +SET @component_group_name = 'Fans'; + +SET @component_name = 'Cisco _nameOID_ fan state'; +SET @component_description = 'The current state of the fan: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.4.1.3','',1,'1.3.6.1.4.1.9.9.13.1.4.1.2','','','','',1); + +SET @component_name = 'F5 Fan _nameOID_ status'; +SET @component_description = 'The status of the indexed chassis fan on the system: bad(0), good(1), notpresent(2)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.1.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.1.2.1.1','','','','',1); + +SET @component_name = 'HP fan tray _nameOID_ state'; +SET @component_description = 'Current state of the fan: failed(0), removed(1), off(2), underspeed(3), overspeed(4), ok(5), maxstate(6)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.11.2.14.11.5.1.54.2.1.1.4','',1,'1.3.6.1.4.1.11.2.14.11.5.1.54.2.1.1.2','','','','',1); + +SET @component_group_name = 'Temperature'; + +SET @component_name = 'Cisco _nameOID_ temperature'; +SET @component_description = 'The current measurement of the testpoint being instrumented'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','cisco',1,2,'1.3.6.1.4.1.9.9.13.1.3.1.3','',1,'1.3.6.1.4.1.9.9.13.1.3.1.2','','','','',1); + +SET @component_name = 'F5 Temperature sensor _nameOID_'; +SET @component_description = 'The chassis temperature of the indexed sensor on the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,2,'1.3.6.1.4.1.3375.2.1.3.2.3.2.1.2','',1,'1.3.6.1.4.1.3375.2.1.3.2.3.2.1.1','','','','',1); + +SET @component_name = 'Juniper _nameOID_ temperature'; +SET @component_description = 'The temperature of this subject'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.1.13.1.7','',1,'1.3.6.1.4.1.2636.3.1.13.1.5','','','','',1); + +SET @component_name = 'HP _nameOID_ temperature'; +SET @component_description = 'The current temperature given by the indexed chassis'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'ºC','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','hp',1,2,'1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.3','',0,'1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.2','','','','',1); + +SET @component_group_name = 'Sessions'; + +SET @component_name = 'F5 Current auth sessions'; +SET @component_description = 'The current number of concurrent auth sessions'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.3.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth success results'; +SET @component_description = 'The total number of auth success results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.5.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth failure results'; +SET @component_description = 'The total number of auth failure results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.6.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total auth error results'; +SET @component_description = 'The total number of auth error results'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.1.1.2.2.8.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet ephemeral sessions count'; +SET @component_description = 'The current number of ephemeral sessions on the device'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.1.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet direct requests count'; +SET @component_description = 'The number of direct requests to Fortigate local stack from external, reflecting DOS attack towards the Fortigate'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.7.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet clash sessions count'; +SET @component_description = 'The number of new sessions which have collision with existing sessions. This generally highlights a shortage of ports or IP in ip-pool during source natting (PNAT)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.3.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet expectation sessions count'; +SET @component_description = 'The number of current expectation sessions'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.4.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet sync queue sessions count'; +SET @component_description = 'The sync queue full counter, reflecting bursts on the sync queue'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.5.0','',1,'','','','','',1); + +SET @component_name = 'Fortinet accept queue sessions count'; +SET @component_description = 'The accept queue full counter, reflecting bursts on the accept queue'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,1,'1.3.6.1.4.1.12356.101.4.6.2.6.0','',1,'','','','','',1); + +SET @component_group_name = 'VPN'; + +SET @component_name = 'F5 Current SSL/VPN connections'; +SET @component_description = 'The total current SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.3.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total SSL/VPN bytes received'; +SET @component_description = 'The total raw bytes received by SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.5.0','',1,'','','','','',1); + +SET @component_name = 'F5 Total SSL/VPN bytes transmitted'; +SET @component_description = 'The total raw bytes transmitted by SSL/VPN connections in the system'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'bytes','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','f5',1,1,'1.3.6.1.4.1.3375.2.6.1.5.6.0','',1,'','','','','',1); + +SET @component_name = 'Juniper _nameOID_ active sites'; +SET @component_description = 'The number of active sites in the VPN'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.2.1.9','',1,'1.3.6.1.4.1.2636.3.26.1.2.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ age'; +SET @component_description = 'The age (i.e., time from creation till now) of this VPN in hundredths of a second'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'_timeticks_','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.2.1.12','',1,'1.3.6.1.4.1.2636.3.26.1.2.1.2','','','','',1); + +SET @component_name = 'Juniper _nameOID_ interface status'; +SET @component_description = 'Status of this interface: unknown(0), noLocalInterface(1), disabled(2), encapsulationMismatch(3), down(4), up(5)'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','juniper',1,2,'1.3.6.1.4.1.2636.3.26.1.3.1.10','',1,'1.3.6.1.4.1.2636.3.26.1.3.1.2','','','','',1); + +SET @component_group_name = 'Intrussions'; + +SET @component_name = 'Fortinet virtual domain _nameOID_ intrussions detected'; +SET @component_description = 'Number of intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ intrussions blocked'; +SET @component_description = 'Number of intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ critical severity intrussions'; +SET @component_description = 'Number of critical severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.3','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ high severity intrussions'; +SET @component_description = 'Number of high severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.4','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ medium severity intrussions'; +SET @component_description = 'Number of medium severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.5','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ low severity intrussions'; +SET @component_description = 'Number of low severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.6','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ informational severity intrussions'; +SET @component_description = 'Number of informational severity intrusions detected since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.7','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ signature detections'; +SET @component_description = 'Number of intrusions detected by signature since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.8','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ anomaly detections'; +SET @component_description = 'Number of intrusions DECed as anomalies since start-up in this virtual domain'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.9.2.1.1.9','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_group_name = 'Antivirus'; + +SET @component_name = 'Fortinet virtual domain _nameOID_ virus detected'; +SET @component_description = 'Number of virus transmissions detected in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.1','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ virus blocked'; +SET @component_description = 'Number of virus transmissions blocked in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.2','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ oversized detected'; +SET @component_description = 'Number of over-sized file transmissions detected in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.17','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_name = 'Fortinet virtual domain _nameOID_ oversized blocked'; +SET @component_description = 'Number of over-sized file transmissions blocked in the virtual domain since start-up'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,15,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','Array','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'snmp','fortinet',1,2,'1.3.6.1.4.1.12356.101.8.2.1.1.18','',1,'1.3.6.1.4.1.12356.101.3.2.1.1.2','','','','',1); + +SET @component_group_name = 'Services'; + +SET @component_name = 'WMI Service _Name_ running'; +SET @component_description = '_Caption_'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,2,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,0.00,0.00,'',0.00,0.00,'',0,'','','',0,0,0.000000000000000,'','nowizard','{\"extra_field_1\":\"State\",\"extra_field_2\":\"Caption\",\"satellite_execution\":\"\",\"value_operation\":\"\",\"server_plugin\":\"0\",\"field0_wmi_field\":\"\"}','','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',1,2,'','',0,'','Win32_Service','Name','','{\"scan\":\"\",\"execution\":\"Name = '_Name_'\",\"field\":\"1\",\"key_string\":\"Running\"}',1); + +SET @component_group_name = 'Disks'; + +SET @component_name = 'WMI disk _DeviceID_ used (%)'; +SET @component_description = 'Space percentage used on the logical disk'; +SET @plugin_name = 'Wizard WMI module'; + +SET @component_id = ''; +SELECT @component_id := `id_nc` FROM `tnetwork_component` WHERE `name` = @component_name; + +SET @group_id = ''; +SELECT @group_id := `id_sg` FROM `tnetwork_component_group` WHERE `name` = @component_group_name; + +SET @plugin_id = ''; +SELECT @plugin_id := `id` FROM `tplugin` WHERE `name` = @plugin_name; + +INSERT IGNORE INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `id_plugin`, `plugin_user`, `plugin_pass`, `plugin_parameter`, `max_timeout`, `max_retries`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `custom_string_1`, `custom_string_2`, `custom_string_3`, `custom_integer_1`, `custom_integer_2`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `module_macros`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `ff_type`, `each_ff`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `dynamic_next`, `dynamic_two_tailed`, `module_type`, `protocol`, `manufacturer_id`, `execution_type`, `scan_type`, `value`, `value_operations`, `module_enabled`, `name_oid`, `query_class`, `query_key_field`, `scan_filters`, `query_filters`, `enabled`) VALUES (@component_id,@component_name,@component_description,@group_id,1,0,0,0,0,'','','','',0,9,0,'','','',0,0,0,80.00,90.00,'',90.00,0.00,'',0,'','','',0,0,0.000000000000000,'%','nowizard',CONCAT('{\"extra_field_1\":\"Size\",\"extra_field_2\":\"FreeSpace\",\"satellite_execution\":\"/etc/pandora/satellite_plugins/wizard_wmi_module -host "_address_" -namespace "_namespace_wmi_" -user "_user_wmi_" -pass "_pass_wmi_" -wmiClass "_class_wmi_" -fieldsList "_field_wmi_1_,_field_wmi_2_" -queryFilter "DeviceID = '_DeviceID_'" -operation "((_f1_ - _f2_) * 100) / _f1_" -wmicPath /usr/bin/wmic\",\"value_operation\":\"((_Size_ - _FreeSpace_) * 100) / _Size_\",\"server_plugin\":\"',@plugin_id,'\",\"_field2__wmi_field\":\"_namespace_wmi_\",\"_field1__wmi_field\":\"_address_\",\"_field4__wmi_field\":\"_pass_wmi_\",\"_field3__wmi_field\":\"_user_wmi_\",\"_field6__wmi_field\":\"_field_wmi_1_,_field_wmi_2_\",\"_field5__wmi_field\":\"_class_wmi_\",\"_field8__wmi_field\":\"((_f1_ - _f2_) * 100) / _f1_\",\"_field7__wmi_field\":\"DeviceID = '_DeviceID_'\",\"field0_wmi_field\":\"\"}'),'','','',0,0,0,'','{\"going_unknown\":0}','',0,0,0,0,0,0,0,0,0,0,1,'wmi','',2,2,'','',1,'','Win32_LogicalDisk','DeviceID','','{\"scan\":\"DriveType = 3\",\"execution\":\"\",\"field\":\"\",\"key_string\":\"\"}',1); + +INSERT IGNORE INTO `tpen` VALUES (171,'dlink','D-Link Systems, Inc.'),(14988,'mikrotik','MikroTik'),(6486,'alcatel','Alcatel-Lucent Enterprise'),(41112,'ubiquiti','Ubiquiti Networks, Inc.'),(207,'telesis','Allied Telesis, Inc.'),(10002,'frogfoot','Frogfoot Networks'),(2,'ibm','IBM'),(4,'unix','Unix'),(63,'apple','Apple Computer, Inc.'),(674,'dell','Dell Inc.'),(111,'oracle','Oracle'),(116,'hitachi','Hitachi, Ltd.'),(173,'netlink','Netlink'),(188,'ascom','Ascom'),(6574,'synology','Synology Inc.'),(3861,'fujitsu','Fujitsu Network Communications, Inc.'),(53526,'dell','Dell ATC'),(52627,'apple','Apple Inc'),(19464,'hitachi','Hitachi Communication Technologies, Ltd.'),(13062,'ascom','Ascom'); diff --git a/pandora_console/general/alert_enterprise.php b/pandora_console/general/alert_enterprise.php index 4cb4a29740..0335ef76be 100644 --- a/pandora_console/general/alert_enterprise.php +++ b/pandora_console/general/alert_enterprise.php @@ -165,7 +165,12 @@ if (check_login()) { break; case 'monitorcheckmodal': - echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 40 modules per agent. This configuration has B/A modules per agent. Checkout the Enterprise Version for a professional supported system.'); + // Get agent/module average. + $agentCount = db_get_value_sql('SELECT count(*) FROM tagente'); + $modulesCount = db_get_value_sql('SELECT count(*) FROM tagente_modulo'); + $average = ($modulesCount / $agentCount); + + echo __('This system has too many modules per agent. OpenSource version could manage thousands of modules, but is not recommended to have more than 100 modules per agent. This configuration has %d modules per agent. Checkout the Enterprise Version for a professional supported system.', $average); break; case 'remotemodulesmodal': diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php index 7ae56a4287..8261ee5c08 100644 --- a/pandora_console/general/first_task/HA_cluster_builder.php +++ b/pandora_console/general/first_task/HA_cluster_builder.php @@ -53,8 +53,8 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no HA clus "; - echo "
"; + echo ""; + echo ""; ?> - images/icono_cerrar.png'> + /images/icono_cerrar.png'>
diff --git a/pandora_console/godmode/agentes/agent_wizard.php b/pandora_console/godmode/agentes/agent_wizard.php index c04edf4d66..3671d7053e 100644 --- a/pandora_console/godmode/agentes/agent_wizard.php +++ b/pandora_console/godmode/agentes/agent_wizard.php @@ -1,66 +1,67 @@ "; - echo "" . __('SNMP Interfaces explorer') . ""; - echo " | "; - echo "" . __('WMI explorer') . ""; - echo "
"; -*/ - -require 'agent_wizard.'.$wizard_section.'.php'; - -?> - \ No newline at end of file +// AJAX controller. +if (is_ajax()) { + $method = get_parameter('method'); + + if (method_exists($obj, $method) === true) { + $obj->{$method}(); + } else { + $obj->error('Method not found. ['.$method.']'); + } + + // Stop any execution. + exit; +} else { + // Run. + $obj->run(); +} diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php deleted file mode 100644 index 21cb4eb378..0000000000 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php +++ /dev/null @@ -1,1179 +0,0 @@ - __('The SNMP remote plugin doesnt seem to be installed').'. '.__('It is necessary to use some features').'.

'.__('Please, install the SNMP remote plugin (The name of the plugin must be snmp_remote.pl)'), 'no_close' => true]); -} - -// Using plugin -if (!empty($plugin)) { - $static_snmp_descriptions['avgCpuLoad'] = 'Average of CPUs Load (%)'; - $static_snmp_descriptions['memoryUse'] = 'Memory use (%)'; -} - -$fail = false; - -$devices = []; -$processes = []; -$disks = []; -$temperatures = []; - -$arrow = false; - -$snmp_translation_data = index_array(snmp_get_translation_wizard(), null, 'description'); -$other_snmp_data = []; - -if ($snmpwalk) { - // OID Used is for DISKS - $snmpis = get_snmpwalk( - $ip_target, - $snmp_version, - $snmp_community, - $snmp3_auth_user, - $snmp3_security_level, - $snmp3_auth_method, - $snmp3_auth_pass, - $snmp3_privacy_method, - $snmp3_privacy_pass, - 0, - '.1.3.6.1.2.1.25.2.3.1.3', - $tcp_port, - $server_to_exec - ); - - if (empty($snmpis)) { - $fail = true; - $snmpis = []; - } else { - // We get here only the interface part of the MIB, not full mib - foreach ($snmpis as $key => $snmp) { - $data = explode(': ', $snmp); - $keydata = explode('::', $key); - $keydata2 = explode('.', $keydata[1]); - - // Avoid results without index and results without name - if (!isset($keydata2[1]) || !isset($data[1])) { - continue; - } - - - if (array_key_exists(1, $data)) { - $disks[$data[1]] = $data[1]; - } else { - $disks[$data[0]] = $data[0]; - } - } - - // OID Used is for PROCESSES - $snmpis = get_snmpwalk( - $ip_target, - $snmp_version, - $snmp_community, - $snmp3_auth_user, - $snmp3_security_level, - $snmp3_auth_method, - $snmp3_auth_pass, - $snmp3_privacy_method, - $snmp3_privacy_pass, - 0, - '.1.3.6.1.2.1.25.4.2.1.2', - $tcp_port, - $server_to_exec - ); - - if ($snmpis === false) { - $snmpis = []; - } - - - // We get here only the interface part of the MIB, not full mib - foreach ($snmpis as $key => $snmp) { - $data = explode(': ', $snmp); - $keydata = explode('::', $key); - $keydata2 = explode('.', $keydata[1]); - - // Avoid results without index and results without name - if (!isset($keydata2[1]) || !isset($data[1])) { - continue; - } - - if (array_key_exists(1, $data)) { - $process_name = str_replace('"', '', $data[1]); - } else { - $process_name = str_replace('"', '', $data[0]); - } - - $processes[$process_name] = $process_name; - } - - // Keep only the first process found - $processes = array_unique($processes); - - - // OID Used is for SENSOR TEMPERATURES - $snmpis = get_snmpwalk( - $ip_target, - $snmp_version, - $snmp_community, - $snmp3_auth_user, - $snmp3_security_level, - $snmp3_auth_method, - $snmp3_auth_pass, - $snmp3_privacy_method, - $snmp3_privacy_pass, - 0, - '.1.3.6.1.4.1.2021.13.16.2.1', - $tcp_port, - $server_to_exec - ); - - if ($snmpis === false) { - $snmpis = []; - } - - - // We get here only the interface part of the MIB, not full mib - foreach ($snmpis as $key => $snmp) { - $data = explode(': ', $snmp); - $keydata = explode('::', $key); - $keydata2 = explode('.', $keydata[1]); - - // Avoid results without index and results without name - if (!isset($keydata2[1]) || !isset($data[1])) { - continue; - } - - - if ($keydata2[0] == 'lmTempSensorsDevice') { - if (array_key_exists(1, $data)) { - $temperatures[$keydata2[1]] = $data[1]; - } else { - $temperatures[$keydata2[1]] = $data[0]; - } - } - } - - // Keep only the first sensor found - $temperatures = array_unique($temperatures); - - // OID Used is for DEVICES - $snmpis = get_snmpwalk( - $ip_target, - $snmp_version, - $snmp_community, - $snmp3_auth_user, - $snmp3_security_level, - $snmp3_auth_method, - $snmp3_auth_pass, - $snmp3_privacy_method, - $snmp3_privacy_pass, - 0, - '.1.3.6.1.4.1.2021.13.15.1.1', - $tcp_port, - $server_to_exec - ); - - if ($snmpis === false) { - $snmpis = []; - } - - - // We get here only the interface part of the MIB, not full mib - foreach ($snmpis as $key => $snmp) { - $data = explode(': ', $snmp); - $keydata = explode('::', $key); - $keydata2 = explode('.', $keydata[1]); - - // Avoid results without index and results without name - if (!isset($keydata2[1]) || !isset($data[1])) { - continue; - } - - - if ($keydata2[0] == 'diskIODevice') { - if (array_key_exists(1, $data)) { - $devices['diskIONRead'.$separator.$keydata2[1]] = $data[1].' - Bytes read'; - $devices['diskIONWritten'.$separator.$keydata2[1]] = $data[1].' - Bytes written'; - $devices['diskIONReads'.$separator.$keydata2[1]] = $data[1].' - Read accesses'; - $devices['diskIONWrites'.$separator.$keydata2[1]] = $data[1].' - Write accesses'; - } else { - $devices['diskIONRead'.$separator.$keydata2[1]] = $data[0].' - Bytes read'; - $devices['diskIONWritten'.$separator.$keydata2[1]] = $data[0].' - Bytes written'; - $devices['diskIONReads'.$separator.$keydata2[1]] = $data[0].' - Read accesses'; - $devices['diskIONWrites'.$separator.$keydata2[1]] = $data[0].' - Write accesses'; - } - } - } - } - - // Other SNMP Data - $arrow = true; - - foreach ($snmp_translation_data as $oid => $temp) { - if ($snmp_version == 3) { - $result = false; - // It is statics oids. - } else { - $result = @snmpget($ip_target, $snmp_community, $oid); - } - - if ($result != false) { - $other_snmp_data[$oid] = $snmp_translation_data[$oid]; - } - } - - if (empty($other_snmp_data)) { - $arrow = false; - $other_snmp_data[0] = __('Remote system doesnt support host SNMP information'); - } -} - -if ($create_modules) { - $modules = io_safe_output(get_parameter('module', [])); - - $devices = []; - $processes = []; - $disks = []; - $temperatures = []; - $snmpdata = []; - - foreach ($modules as $module) { - // Split module data to get type - $module_exploded = explode($separator, $module); - $type = $module_exploded[0]; - - // Delete type from module data - unset($module_exploded[0]); - - // Rebuild module data - $module = implode($separator, $module_exploded); - - switch ($type) { - case 'device': - $devices[] = $module; - break; - - case 'process': - $processes[] = $module; - break; - - case 'disk': - $disks[] = $module; - break; - - case 'temperature': - $temperatures[] = $module; - break; - - case 'snmpdata': - $snmpdata[] = $module; - break; - } - } - - if (agents_get_name($id_agent) == false) { - ui_print_error_message(__('No agent selected or the agent does not exist')); - } else { - // Common values - $common_values = []; - - if ($tcp_port != '') { - $common_values['tcp_port'] = $tcp_port; - } - - $common_values['snmp_community'] = $snmp_community; - if ($use_agent) { - $common_values['ip_target'] = 'auto'; - } else { - $common_values['ip_target'] = $ip_target; - } - - $common_values['tcp_send'] = $snmp_version; - - if ($snmp_version == '3') { - $common_values['plugin_user'] = $snmp3_auth_user; - $common_values['plugin_pass'] = $snmp3_auth_pass; - $common_values['plugin_parameter'] = $snmp3_auth_method; - $common_values['custom_string_1'] = $snmp3_privacy_method; - $common_values['custom_string_2'] = $snmp3_privacy_pass; - $common_values['custom_string_3'] = $snmp3_security_level; - } - - - // DEVICES - $devices_prefix_oids = [ - 'diskIONRead' => '.1.3.6.1.4.1.2021.13.15.1.1.3.', - 'diskIONWritten' => '.1.3.6.1.4.1.2021.13.15.1.1.4.', - 'diskIONReads' => '.1.3.6.1.4.1.2021.13.15.1.1.5.', - 'diskIONWrites' => '.1.3.6.1.4.1.2021.13.15.1.1.6.', - ]; - - $devices_prefix_descriptions = [ - 'diskIONRead' => __('The number of bytes read from this device since boot'), - 'diskIONWritten' => __('The number of bytes written to this device since boot'), - 'diskIONReads' => __('The number of read accesses from this device since boot'), - 'diskIONWrites' => __('The number of write accesses from this device since boot'), - ]; - - $results = []; - - foreach ($devices as $device) { - $module_values = $common_values; - - // Split module data to get type, name, etc - $device_exploded = explode($separator, $device); - $device_name = $device_exploded[0]; - - $name_exploded = explode('-', $device_name); - $name = ltrim(html_entity_decode($name_exploded[1])); - - $device_type = $device_exploded[1]; - - // Delete type from device id - unset($device_exploded[0]); - unset($device_exploded[1]); - - // Rebuild device_name - $device_id = implode($separator, $device_exploded); - - $module_values['descripcion'] = $devices_prefix_descriptions[$device_type]; - - if (($name == 'Bytes read') || ($name == 'Bytes written')) { - $module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp_inc'); - } else { - $module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); - } - - $module_values['snmp_oid'] = $devices_prefix_oids[$device_type].$device_id; - - $module_values['id_modulo'] = MODULE_SNMP; - - $result = modules_create_agent_module($id_agent, io_safe_input($device_name), $module_values); - - $results[$result][] = $device_name; - } - - // TEMPERATURE SENSORS - $temperatures_prefix_oid = '.1.3.6.1.4.1.2021.13.16.2.1.3.'; - $temperatures_description = 'The temperature of this sensor in C'; - - foreach ($temperatures as $temperature) { - $module_values = $common_values; - - // Split module data to get type, name, etc - $temperature_exploded = explode($separator, $temperature); - $temperature_name = $temperature_exploded[0]; - - // Delete name from temperature sensor id - unset($temperature_exploded[0]); - - // Rebuild device_name - $temperature_id = implode($separator, $temperature_exploded); - - $module_values['descripcion'] = $temperatures_description; - - $module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); - - $module_values['snmp_oid'] = $temperatures_prefix_oid.$temperature_id; - - $module_values['id_modulo'] = MODULE_SNMP; - - // Temperature are given in mC. Convert to Celsius - $module_values['post_process'] = 0.001; - - $module_values['unit'] = 'C'; - - $result = modules_create_agent_module($id_agent, io_safe_input($temperature_name), $module_values); - - $results[$result][] = $temperature_name; - } - - // SNMP DATA (STATIC MODULES) - foreach ($snmpdata as $snmpdata_oid) { - $module_values = $common_values; - $snmp_translation = snmp_get_translation($snmpdata_oid); - - $module_values['descripcion'] = $snmp_translation['description']; - $module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); - $module_values['post_process'] = $snmp_translation['post_process']; - - // Average use of CPUs is a plugin module - switch ($snmpdata_oid) { - case 'avgCpuLoad': - case 'memoryUse': - $module_values['id_modulo'] = MODULE_PLUGIN; - $module_values['id_plugin'] = $plugin['id']; - - // Avoid the return of a string containing the word 'null' if the macros column is not defined - $macros = []; - if (isset($plugin['macros']) && !empty($plugin['macros'])) { - $macros = json_decode($plugin['macros'], true); - } - - foreach ($macros as $k => $macro) { - switch ($macro['macro']) { - case '_field1_': - // Field 1 is the IP Address - $macros[$k]['value'] = $module_values['ip_target']; - break; - - case '_field2_': - // Field 2 is the community - $macros[$k]['value'] = $module_values['snmp_community']; - break; - - case '_field3_': - // Field 3 is the plugin parameters - switch ($snmpdata_name) { - case 'avgCpuLoad': - $macros[$k]['value'] = '-m cpuload'; - break; - - case 'memoryUse': - $macros[$k]['value'] = '-m memuse'; - break; - } - - if ($snmp_version == '3') { - $macros[$k]['value'] .= ' -v3 '; - switch ($snmp3_security_level) { - case 'authNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method; - break; - - case 'noAuthNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -l '.$snmp3_security_level; - break; - - default: - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method.' -x '.$snmp3_privacy_method.' -X '.$snmp3_privacy_pass; - break; - } - } - break; - } - } - - if (!empty($macros)) { - $module_values['macros'] = io_json_mb_encode($macros); - } - - unset($module_values['snmp_community']); - // snmp_community - unset($module_values['ip_target']); - // ip_target - unset($module_values['tcp_send']); - // snmp_version - break; - - default: - $module_values['snmp_oid'] = $snmpdata_oid; - - $module_values['id_modulo'] = MODULE_SNMP; - break; - } - - $result = modules_create_agent_module( - $id_agent, - io_safe_input($snmp_translation['description']), - $module_values - ); - - $results[$result][] = $snmp_translation['description']; - } - - // PROCESSES - foreach ($processes as $process) { - $module_values = $common_values; - - $module_values['descripcion'] = sprintf(__('Check if the process %s is running or not'), $process); - $module_values['id_tipo_modulo'] = modules_get_type_id('generic_proc'); - $module_values['id_modulo'] = MODULE_PLUGIN; - $module_values['id_plugin'] = $plugin['id']; - - // Avoid the return of a string containing the word 'null' if the macros column is not defined - $macros = []; - if (isset($plugin['macros']) && !empty($plugin['macros'])) { - $macros = json_decode($plugin['macros'], true); - } - - foreach ($macros as $k => $macro) { - switch ($macro['macro']) { - case '_field1_': - // Field 1 is the IP Address - $macros[$k]['value'] = $module_values['ip_target']; - break; - - case '_field2_': - // Field 2 is the community - $macros[$k]['value'] = $module_values['snmp_community']; - break; - - case '_field3_': - // Field 3 is the plugin parameters - $macros[$k]['value'] = io_safe_input('-m process -p "'.$process.'"'); - - if ($snmp_version == '3') { - $macros[$k]['value'] .= ' -v3 '; - switch ($snmp3_security_level) { - case 'authNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method; - break; - - case 'noAuthNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -l '.$snmp3_security_level; - break; - - default: - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method.' -x '.$snmp3_privacy_method.' -X '.$snmp3_privacy_pass; - break; - } - } - break; - } - } - - if (!empty($macros)) { - $module_values['macros'] = io_json_mb_encode($macros); - } - - unset($module_values['snmp_community']); - // snmp_community - unset($module_values['ip_target']); - // ip_target - unset($module_values['tcp_send']); - // snmp_version - $result = modules_create_agent_module($id_agent, io_safe_input($process), $module_values); - - $results[$result][] = $process; - } - - - // DISKS USE - foreach ($disks as $disk) { - $module_values = $common_values; - - $module_values['descripcion'] = __('Disk use information'); - $module_values['id_tipo_modulo'] = modules_get_type_id('remote_snmp'); - $module_values['id_modulo'] = MODULE_PLUGIN; - $module_values['id_plugin'] = $plugin['id']; - - // Avoid the return of a string containing the word 'null' if the macros column is not defined - $macros = []; - if (isset($plugin['macros']) && !empty($plugin['macros'])) { - $macros = json_decode($plugin['macros'], true); - } - - foreach ($macros as $k => $macro) { - switch ($macro['macro']) { - case '_field1_': - // Field 1 is the IP Address - $macros[$k]['value'] = $module_values['ip_target']; - break; - - case '_field2_': - // Field 2 is the community - $macros[$k]['value'] = $module_values['snmp_community']; - break; - - case '_field3_': - // Field 3 is the plugin parameters - $macros[$k]['value'] = io_safe_input('-m diskuse -d "'.io_safe_output($disk).'"'); - - if ($snmp_version == '3') { - $macros[$k]['value'] .= ' -v3 '; - switch ($snmp3_security_level) { - case 'authNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method; - break; - - case 'noAuthNoPriv': - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -l '.$snmp3_security_level; - break; - - default: - $macros[$k]['value'] .= ' -u '.$snmp3_auth_user.' -A '.$snmp3_auth_pass.' -l '.$snmp3_security_level.' -a '.$snmp3_auth_method.' -x '.$snmp3_privacy_method.' -X '.$snmp3_privacy_pass; - break; - } - } - } - } - - if (!empty($macros)) { - $module_values['macros'] = io_json_mb_encode($macros); - } - - unset($module_values['snmp_community']); - // snmp_community - unset($module_values['ip_target']); - // ip_target - unset($module_values['tcp_send']); - // snmp_version - $result = modules_create_agent_module( - $id_agent, - io_safe_input($disk), - $module_values - ); - - $results[$result][] = $disk; - } - - $success_message = ''; - $error_message = ''; - - if (isset($results[NOERR])) { - if (count($results[NOERR]) > 0) { - $success_message .= sprintf(__('%s modules created succesfully'), count($results[NOERR])).'
'; - } - } - - if (isset($results[ERR_GENERIC])) { - if (count($results[ERR_GENERIC]) > 0) { - $error_message .= sprintf(__('Error creating %s modules').':
  * '.implode('
  * ', $results[ERR_GENERIC]), count($results[ERR_GENERIC])).'
'; - } - } - - if (isset($results[ERR_DB])) { - if (count($results[ERR_DB]) > 0) { - $error_message .= sprintf(__('Error creating %s modules').':
  * '.implode('
  * ', $results[ERR_DB]), count($results[ERR_DB])).'
'; - } - } - - if (isset($results[ERR_EXIST])) { - if (count($results[ERR_EXIST]) > 0) { - $error_message .= sprintf(__('%s modules already exist').':
  * '.implode('
  * ', $results[ERR_EXIST]), count($results[ERR_EXIST])).'
'; - } - } - - if (!empty($error_message)) { - ui_print_error_message($error_message); - } else { - if (empty($success_message)) { - $success_message .= sprintf(__('Modules created succesfully')).'
'; - } - - ui_print_success_message($success_message); - } - } -} - -echo ''; -echo "
"; - -$table->width = '100%'; -$table->cellpadding = 0; -$table->cellspacing = 0; -$table->class = 'databox filters'; - -$table->data[0][0] = ''.__('Target IP').''; -$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); - -$table->data[0][2] = ''.__('Port').''; -$table->data[0][3] = html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true); - -$table->data[1][0] = ''.__('Use agent ip').''; -$table->data[1][1] = html_print_checkbox('use_agent', 1, $use_agent, true); - -$servers_to_exec = []; -$servers_to_exec[0] = __('Local console'); -if (enterprise_installed()) { - enterprise_include_once('include/functions_satellite.php'); - - $rows = get_proxy_servers(); - - // Check if satellite server has remote configuration enabled. - $satellite_remote = config_agents_has_remote_configuration($id_agent); - - foreach ($rows as $row) { - if ($row['server_type'] != 13) { - $s_type = ' (Standard)'; - } else { - $id_satellite = $row['id_server']; - $s_type = ' (Satellite)'; - } - - $servers_to_exec[$row['id_server']] = $row['name'].$s_type; - } -} - -$table->data[1][2] = ''.__('Server to execute command').''.ui_print_help_icon('agent_snmp_explorer_tab', true); -$table->data[1][3] = html_print_select( - $servers_to_exec, - 'server_to_exec', - $server_to_exec, - 'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')', - '', - '', - true -); - -$snmp_versions['1'] = 'v. 1'; -$snmp_versions['2'] = 'v. 2'; -$snmp_versions['2c'] = 'v. 2c'; -$snmp_versions['3'] = 'v. 3'; - -$table->data[2][0] = ''.__('SNMP community').''; -$table->data[2][1] = html_print_input_text('snmp_community', $snmp_community, '', 15, 60, true); - -$table->data[2][2] = ''.__('SNMP version').''; -$table->data[2][3] = html_print_select($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); - -$table->data[2][3] .= ''; - -html_print_input_hidden('snmpwalk', 1); - -html_print_table($table); - -unset($table); - -// SNMP3 OPTIONS -$table->width = '100%'; - -$table->data[2][1] = ''.__('Auth user').''; -$table->data[2][2] = html_print_input_text('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true); -$table->data[2][3] = ''.__('Auth password').''; -$table->data[2][4] = html_print_input_password('snmp3_auth_pass', $snmp3_auth_pass, '', 15, 60, true); -$table->data[2][4] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_awse', true); - -$table->data[5][0] = ''.__('Privacy method').''; -$table->data[5][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true); -$table->data[5][2] = ''.__('privacy pass').''; -$table->data[5][3] = html_print_input_password('snmp3_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true); - -$table->data[6][0] = ''.__('Auth method').''; -$table->data[6][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp3_auth_method', $snmp3_auth_method, '', '', '', true); -$table->data[6][2] = ''.__('Security level').''; -$table->data[6][3] = html_print_select( - [ - 'noAuthNoPriv' => __('Not auth and not privacy method'), - 'authNoPriv' => __('Auth and not privacy method'), - 'authPriv' => __('Auth and privacy method'), - ], - 'snmp3_security_level', - $snmp3_security_level, - '', - '', - '', - true -); - -if ($snmp_version == 3) { - echo '
'; -} else { - echo ''; - -echo "
"; -echo ''; -html_print_submit_button(__('SNMP Walk'), 'snmp_walk', false, ['class' => 'sub next']); -echo '
'; - -if ($snmpwalk && $fail) { - ui_print_error_message('
'.__('No data found').'

'.__('If the device is a network device, try with the SNMP Interfaces wizard')); -} - -unset($table); - -echo ''; - -if (!$fail) { - echo ''; - echo "
"; - echo ''; - - html_print_input_hidden('create_modules', 1); - html_print_input_hidden('ip_target', $ip_target); - html_print_input_hidden('use_agent', $use_agent); - html_print_input_hidden('tcp_port', $tcp_port); - html_print_input_hidden('snmp_community', $snmp_community); - html_print_input_hidden('snmp_version', $snmp_version); - html_print_input_hidden('snmp3_auth_user', $snmp3_auth_user); - html_print_input_hidden('snmp3_auth_pass', $snmp3_auth_pass); - html_print_input_hidden('snmp3_auth_method', $snmp3_auth_method); - html_print_input_hidden('snmp3_privacy_method', $snmp3_privacy_method); - html_print_input_hidden('snmp3_privacy_pass', $snmp3_privacy_pass); - html_print_input_hidden('snmp3_security_level', $snmp3_security_level); - - $table->width = '100%'; - - // Mode selector - $modes = []; - $modes['devices'] = __('Devices'); - $modes['processes'] = __('Processes'); - $modes['disks'] = __('Free space on disk'); - $modes['temperatures'] = __('Temperature sensors'); - $modes['snmpdata'] = __('Other SNMP data'); - - $table->data[1][0] = __('Wizard mode').': '; - $table->data[1][0] .= html_print_select( - $modes, - 'snmp_wizard_modes', - '', - '', - '', - '', - true, - false, - false - ); - $table->cellstyle[1][0] = 'vertical-align: middle;'; - - $table->colspan[1][0] = 2; - $table->data[1][2] = ''.__('Modules').''; - $table->cellstyle[1][2] = 'vertical-align: middle;'; - - // Devices list - $table->data[2][0] = '
'; - $table->data[2][0] .= html_print_select( - $devices, - 'devices', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - - // If SNMP remote plugin is not installed, show an advice - if (empty($plugin)) { - // Processes list - $table->data[2][0] .= '
'; - $table->data[2][0] .= ui_print_info_message(__('SNMP remote plugin is necessary for this feature'), '', true); - $table->data[2][0] .= '
'; - - // Disks list - $table->data[2][0] .= '
'; - $table->data[2][0] .= ui_print_info_message(__('SNMP remote plugin is necessary for this feature'), '', true); - $table->data[2][0] .= '
'; - } else { - // Processes list - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $processes, - 'processes', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - - // Disks list - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $disks, - 'disks', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - } - - // Sensors temperatures list - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $temperatures, - 'temperatures', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - - // SNMP data list - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $other_snmp_data, - 'snmpdata', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - - $table->cellstyle[2][0] = 'vertical-align: top; text-align: center;'; - - // Devices arrow - $table->data[2][1] = '
'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'
'; - // Processes arrow - $table->data[2][1] .= '
'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'
'; - // Disks arrow - $table->data[2][1] .= '
'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'
'; - // Temperatures arrow - $table->data[2][1] .= '
'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'
'; - // SNMP data arrow - if ($arrow) { - $table->data[2][1] .= '
'.html_print_image('images/darrowright.png', true, ['title' => __('Add to modules list')]).'
'; - } - - $table->data[2][1] .= '

'.html_print_image('images/cross.png', true, ['title' => __('Remove from modules list')]).'
'; - $table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;'; - - $table->data[2][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:300px; height: 100%;'); - $table->data[2][2] .= html_print_input_hidden('agent', $id_agent, true); - $table->cellstyle[2][2] = 'vertical-align: top; text-align: center;'; - - html_print_table($table); - - echo "
"; - html_print_submit_button(__('Create modules'), 'create_modules_btn', false, ['class' => 'sub add']); - echo '
'; - unset($table); - - echo '
'; - echo '
'; - echo '
'; -} - -ui_require_jquery_file('pandora.controls'); -ui_require_jquery_file('ajaxqueue'); -ui_require_jquery_file('bgiframe'); -ui_require_javascript_file('pandora_modules'); - -?> - diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php deleted file mode 100644 index 3c197ac4a1..0000000000 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ /dev/null @@ -1,743 +0,0 @@ -] => [] array. - if (!empty($snmp_int_ip)) { - foreach ($snmp_int_ip as $key => $value) { - // The key is something like IP-MIB::ipAddressIfIndex.ipv4."". - // or IP-MIB::ipAddressIfIndex.ipv6."". - // The value is something like INTEGER: . - $data = explode(': ', $value); - $interface_id = !empty($data) && isset($data[1]) ? $data[1] : false; - - if (preg_match('/^.+"(.+)"$/', $key, $matches) && isset($matches[1])) { - $interface_ip = $matches[1]; - } - - // Get the first ip. - if ($interface_id !== false && !empty($interface_ip) && !isset($interfaces_ip[$interface_id])) { - $interfaces_ip[$interface_id] = $interface_ip; - } - } - - unset($snmp_int_ip); - } - - $snmpis = array_merge((($snmpis === false) ? [] : $snmpis), (($ifxitems === false) ? [] : $ifxitems)); - - $interfaces = []; - - // We get here only the interface part of the MIB, not full mib. - foreach ($snmpis as $key => $snmp) { - $data = explode(': ', $snmp, 2); - $keydata = explode('::', $key); - $keydata2 = explode('.', $keydata[1]); - - // Avoid results without index and interfaces without name. - if (!isset($keydata2[1]) || !isset($data[1])) { - continue; - } - - if (array_key_exists(1, $data)) { - $interfaces[$keydata2[1]][$keydata2[0]]['type'] = $data[0]; - $interfaces[$keydata2[1]][$keydata2[0]]['value'] = $data[1]; - } else { - $interfaces[$keydata2[1]][$keydata2[0]]['type'] = ''; - $interfaces[$keydata2[1]][$keydata2[0]]['value'] = $data[0]; - } - - $interfaces[$keydata2[1]][$keydata2[0]]['oid'] = $key; - $interfaces[$keydata2[1]][$keydata2[0]]['checked'] = 0; - } - - unset($interfaces[0]); -} - -if ($create_modules) { - $id_snmp_serialize = get_parameter_post('id_snmp_serialize'); - $interfaces = unserialize_in_temp($id_snmp_serialize); - - $id_snmp_int_ip_serialize = get_parameter_post('id_snmp_int_ip_serialize'); - $interfaces_ip = unserialize_in_temp($id_snmp_int_ip_serialize); - - if (!$interfaces) { - $interfaces = []; - } - - if (!$interfaces_ip) { - $interfaces_ip = []; - } - - $values = []; - - if ($tcp_port != '') { - $values['tcp_port'] = $tcp_port; - } - - $values['snmp_community'] = $snmp_community; - if ($use_agent) { - $values['ip_target'] = 'auto'; - } else { - $values['ip_target'] = $ip_target; - } - - $values['tcp_send'] = $snmp_version; - - if ($snmp_version == '3') { - $values['plugin_user'] = $snmp3_auth_user; - $values['plugin_pass'] = $snmp3_auth_pass; - $values['plugin_parameter'] = $snmp3_auth_method; - $values['custom_string_1'] = $snmp3_privacy_method; - $values['custom_string_2'] = $snmp3_privacy_pass; - $values['custom_string_3'] = $snmp3_security_level; - } - - $oids = []; - foreach ($interfaces as $key => $interface) { - foreach ($interface as $key2 => $module) { - $oid = get_parameter($key.'-'.$key2, ''); - if ($oid != '') { - $interfaces[$key][$key2]['checked'] = 1; - $oids[$key][] = $interfaces[$key][$key2]['oid']; - } else { - $interfaces[$key][$key2]['checked'] = 0; - } - } - } - - $modules = get_parameter('module', []); - $id_snmp = get_parameter('id_snmp'); - - if ($id_snmp == false) { - ui_print_error_message(__('No modules selected')); - $id_snmp = []; - } - - if (agents_get_name($id_agent) == false) { - ui_print_error_message(__('No agent selected or the agent does not exist')); - $id_snmp = []; - } - - $result = false; - - $errors = []; - $done = 0; - - foreach ($id_snmp as $id) { - $ifname = ''; - $ifPhysAddress = ''; - - if (isset($interfaces[$id]['ifName']) && $interfaces[$id]['ifName']['value'] != '') { - $ifname = $interfaces[$id]['ifName']['value']; - } else if (isset($interfaces[$id]['ifDescr']) && $interfaces[$id]['ifDescr']['value'] != '') { - $ifname = $interfaces[$id]['ifDescr']['value']; - } - - if (isset($interfaces[$id]['ifPhysAddress']) && $interfaces[$id]['ifPhysAddress']['value'] != '') { - $ifPhysAddress = $interfaces[$id]['ifPhysAddress']['value']; - $ifPhysAddress = strtoupper($ifPhysAddress); - } - - foreach ($modules as $module) { - $oid_array = explode('.', $module); - $oid_array[(count($oid_array) - 1)] = $id; - $oid = implode('.', $oid_array); - - // Get the name. - $name_array = explode('::', $oid_array[0]); - $name = $ifname.'_'.$name_array[1]; - - // If you select "show all modules" and the module is not from the interface. - if (!array_key_exists($name_array[1], $interfaces[$id])) { - continue; - } - - // Clean the name. - $name = str_replace('"', '', $name); - - // Proc moduletypes. - if (preg_match('/Status/', $name_array[1])) { - $module_type = 18; - } else if (preg_match('/Present/', $name_array[1])) { - $module_type = 18; - } else if (preg_match('/PromiscuousMode/', $name_array[1])) { - $module_type = 18; - } else if (preg_match('/Alias/', $name_array[1])) { - // String moduletypes. - $module_type = 17; - } else if (preg_match('/Address/', $name_array[1])) { - $module_type = 17; - } else if (preg_match('/Name/', $name_array[1])) { - $module_type = 17; - } else if (preg_match('/Specific/', $name_array[1])) { - $module_type = 17; - } else if (preg_match('/Descr/', $name_array[1])) { - $module_type = 17; - } else if (preg_match('/s$/', $name_array[1])) { - // Specific counters (ends in s). - $module_type = 16; - } else { - // Otherwise, numeric. - $module_type = 15; - } - - $values['unit'] = ''; - if (preg_match('/Octets/', $name_array[1])) { - $values['unit'] = 'Bytes'; - } - - $module_server = 2; - - if ($server_to_exec != 0) { - $sql = sprintf('SELECT server_type, ip_address FROM tserver WHERE id_server = %d', $server_to_exec); - $row = db_get_row_sql($sql); - - if ($row['server_type'] == 13) { - if (preg_match('/ifPhysAddress/', $name_array[1])) { - $module_type = 3; - } else if (preg_match('/ifSpecific/', $name_array[1])) { - $module_type = 3; - } else if (preg_match('/ifType/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifSpeed/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifPromiscuousMode/', $name_array[1])) { - $module_type = 2; - } else if (preg_match('/ifOutQLen/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifName/', $name_array[1])) { - $module_type = 3; - } else if (preg_match('/ifMtu/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifLinkUpDownTrapEnable/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifLastChange/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifIndex/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifDescr/', $name_array[1])) { - $module_type = 3; - } else if (preg_match('/ifCounterDiscontinuityTime/', $name_array[1])) { - $module_type = 1; - } else if (preg_match('/ifConnectorPresent/', $name_array[1])) { - $module_type = 2; - } else if (preg_match('/ifAdminStatus/', $name_array[1])) { - $module_type = 2; - } else if (preg_match('/ifOperStatus/', $name_array[1])) { - $module_type = 2; - } else { - $module_type = 4; - } - - $module_server = 1; - - $output_oid = ''; - - exec('snmptranslate -On '.$oid, $output_oid, $rc); - - $conf_oid = $output_oid[0]; - $oid = $conf_oid; - } - } - - $values['id_tipo_modulo'] = $module_type; - - if (!empty($ifPhysAddress) && isset($interfaces_ip[$id])) { - $values['descripcion'] = io_safe_input('(IP: '.$interfaces_ip[$id].' - MAC: '.$ifPhysAddress.' - '.$name.') '.$interfaces[$id]['ifDescr']['value']); - } else if (!empty($ifPhysAddress)) { - $values['descripcion'] = io_safe_input('(MAC: '.$ifPhysAddress.' - '.$name.') '.$interfaces[$id]['ifDescr']['value']); - } else if (isset($interfaces_ip[$id])) { - $values['descripcion'] = io_safe_input('(IP: '.$interfaces_ip[$id].' - '.$name.') '.$interfaces[$id]['ifDescr']['value']); - } else { - $values['descripcion'] = io_safe_input('('.$name.') '.$interfaces[$id]['ifDescr']['value']); - } - - $values['snmp_oid'] = $oid; - $values['id_modulo'] = $module_server; - - $result = modules_create_agent_module($id_agent, io_safe_input($name), $values); - - if (is_error($result)) { - if (!isset($errors[$result])) { - $errors[$result] = 0; - } - - $errors[$result]++; - } else { - if ($server_to_exec != 0) { - $sql = sprintf('SELECT server_type FROM tserver WHERE id_server = %d', $server_to_exec); - $row = db_get_row_sql($sql); - - if ($row['server_type'] == 13) { - $module_type_name = db_get_value_filter('nombre', 'ttipo_modulo', ['id_tipo' => $values['id_tipo_modulo']]); - - $new_module_configuration_data = "module_begin\nmodule_name ".io_safe_input($name)."\nmodule_description ".io_safe_output($values['descripcion'])."\nmodule_type ".$module_type_name."\nmodule_snmp\nmodule_version ".$snmp_version."\nmodule_oid ".$conf_oid."\nmodule_community ".$values['snmp_community']; - - if ($snmp_version == '3') { - $new_module_configuration_data .= "\nmodule_secname ".$snmp3_auth_user; - $new_module_configuration_data .= "\nmodule_seclevel ".$snmp3_security_level; - - if ($snmp3_security_level == 'authNoPriv' || $snmp3_security_level == 'authPriv') { - $new_module_configuration_data .= "\nmodule_authpass ".$snmp3_auth_pass; - $new_module_configuration_data .= "\nmodule_authproto ".$snmp3_auth_method; - } - - if ($snmp3_security_level == 'authPriv') { - $new_module_configuration_data .= "\nmodule_privproto ".$snmp3_privacy_method; - $new_module_configuration_data .= "\nmodule_privpass ".$snmp3_privacy_pass; - } - } - - $new_module_configuration_data .= "\nmodule_end"; - - config_agents_add_module_in_conf($id_agent, $new_module_configuration_data); - } - } - - $done++; - } - } - } - - if ($done > 0) { - ui_print_success_message( - __('Successfully modules created').' ('.$done.')' - ); - } - - if (!empty($errors)) { - $msg = __('Could not be created').':'; - - - foreach ($errors as $code => $number) { - switch ($code) { - case ERR_EXIST: - $msg .= '
'.__('Another module already exists with the same name').' ('.$number.')'; - break; - - case ERR_INCOMPLETE: - $msg .= '
'.__('Some required fields are missed').': ('.__('name').') ('.$number.')'; - break; - - case ERR_DB: - case ERR_GENERIC: - default: - $msg .= '
'.__('Processing error').' ('.$number.')'; - break; - } - } - - ui_print_error_message($msg); - } -} - -// Create the interface list for the interface. -$interfaces_list = []; -foreach ($interfaces as $interface) { - // Get the interface name, removing " " characters and avoid "blank" interfaces. - if (isset($interface['ifDescr']) && $interface['ifDescr']['value'] != '') { - $ifname = $interface['ifDescr']['value']; - } else if (isset($interface['ifName']) && $interface['ifName']['value'] != '') { - $ifname = $interface['ifName']['value']; - } else { - continue; - } - - $interfaces_list[$interface['ifIndex']['value']] = str_replace('"', '', $ifname); -} - -echo ''; -echo "
"; - -$table->width = '100%'; -$table->cellpadding = 0; -$table->cellspacing = 0; -$table->class = 'databox filters'; - -$table->data[0][0] = ''.__('Target IP').''; -$table->data[0][1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true); - -$table->data[0][2] = ''.__('Port').''; -$table->data[0][3] = html_print_input_text('tcp_port', $tcp_port, '', 5, 20, true); - -$table->data[1][0] = ''.__('Use agent ip').''; -$table->data[1][1] = html_print_checkbox('use_agent', 1, $use_agent, true); - -$servers_to_exec = []; -$servers_to_exec[0] = __('Local console'); -if (enterprise_installed()) { - enterprise_include_once('include/functions_satellite.php'); - - $rows = get_proxy_servers(); - - // Check if satellite server has remote configuration enabled. - $satellite_remote = config_agents_has_remote_configuration($id_agent); - - foreach ($rows as $row) { - if ($row['server_type'] != 13) { - $s_type = ' (Standard)'; - } else { - $id_satellite = $row['id_server']; - $s_type = ' (Satellite)'; - } - - $servers_to_exec[$row['id_server']] = $row['name'].$s_type; - } -} - -$table->data[1][2] = ''.__('Server to execute command').''.ui_print_help_icon('agent_snmp_explorer_tab', true); -$table->data[1][2] .= ''.ui_print_help_tip(__('In order to use remote executions you need to enable remote execution in satellite server'), true, 'images/tip_help.png', false, 'display:').''; -$table->data[1][4] = html_print_select( - $servers_to_exec, - 'server_to_exec', - $server_to_exec, - 'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')', - '', - '', - true -); - -$snmp_versions['1'] = 'v. 1'; -$snmp_versions['2'] = 'v. 2'; -$snmp_versions['2c'] = 'v. 2c'; -$snmp_versions['3'] = 'v. 3'; - -$table->data[2][0] = ''.__('SNMP community').''; -$table->data[2][1] = html_print_input_text('snmp_community', $snmp_community, '', 15, 60, true); - -$table->data[2][2] = ''.__('SNMP version').''; -$table->data[2][3] = html_print_select($snmp_versions, 'snmp_version', $snmp_version, '', '', '', true, false, false, ''); - -$table->data[2][3] .= ''; -html_print_input_hidden('snmpwalk', 1); - -html_print_table($table); - -unset($table); - -// SNMP3 OPTIONS. -$table->width = '100%'; - -$table->data[2][1] = ''.__('Auth user').''; -$table->data[2][2] = html_print_input_text('snmp3_auth_user', $snmp3_auth_user, '', 15, 60, true); -$table->data[2][3] = ''.__('Auth password').''; -$table->data[2][4] = html_print_input_password('snmp3_auth_pass', $snmp3_auth_pass, '', 15, 60, true); -$table->data[2][4] .= html_print_input_hidden_extended('active_snmp_v3', 0, 'active_snmp_v3_awsie', true); - -$table->data[5][0] = ''.__('Privacy method').''; -$table->data[5][1] = html_print_select(['DES' => __('DES'), 'AES' => __('AES')], 'snmp3_privacy_method', $snmp3_privacy_method, '', '', '', true); -$table->data[5][2] = ''.__('privacy pass').''; -$table->data[5][3] = html_print_input_password('snmp3_privacy_pass', $snmp3_privacy_pass, '', 15, 60, true); - -$table->data[6][0] = ''.__('Auth method').''; -$table->data[6][1] = html_print_select(['MD5' => __('MD5'), 'SHA' => __('SHA')], 'snmp3_auth_method', $snmp3_auth_method, '', '', '', true); -$table->data[6][2] = ''.__('Security level').''; -$table->data[6][3] = html_print_select( - [ - 'noAuthNoPriv' => __('Not auth and not privacy method'), - 'authNoPriv' => __('Auth and not privacy method'), - 'authPriv' => __('Auth and privacy method'), - ], - 'snmp3_security_level', - $snmp3_security_level, - '', - '', - '', - true -); - -if ($snmp_version == 3) { - echo '
'; -} else { - echo ''; - -echo "
"; -echo ''; -html_print_submit_button(__('SNMP Walk'), 'snmp_walk', false, ['class' => 'sub next']); -echo '
'; - -if ($snmpwalk && !$snmpis) { - ui_print_error_message(__('Unable to do SNMP walk')); -} - -unset($table); - -echo ''; - -if (!empty($interfaces_list)) { - echo ''; - echo "
"; - echo ''; - - $id_snmp_serialize = serialize_in_temp($interfaces, $config['id_user'].'_snmp'); - html_print_input_hidden('id_snmp_serialize', $id_snmp_serialize); - - $id_snmp_int_ip_serialize = serialize_in_temp($interfaces_ip, $config['id_user'].'_snmp_int_ip'); - html_print_input_hidden('id_snmp_int_ip_serialize', $id_snmp_int_ip_serialize); - - html_print_input_hidden('create_modules', 1); - html_print_input_hidden('ip_target', $ip_target); - html_print_input_hidden('use_agent', $use_agent); - html_print_input_hidden('tcp_port', $tcp_port); - html_print_input_hidden('snmp_community', $snmp_community); - html_print_input_hidden('snmp_version', $snmp_version); - html_print_input_hidden('snmp3_auth_user', $snmp3_auth_user); - html_print_input_hidden('snmp3_auth_pass', $snmp3_auth_pass); - html_print_input_hidden('snmp3_auth_method', $snmp3_auth_method); - html_print_input_hidden('snmp3_privacy_method', $snmp3_privacy_method); - html_print_input_hidden('snmp3_privacy_pass', $snmp3_privacy_pass); - html_print_input_hidden('snmp3_security_level', $snmp3_security_level); - html_print_input_hidden('server_to_exec', $server_to_exec); - - $table->width = '100%'; - - // Agent selector. - $table->data[0][0] = ''.__('Interfaces').''; - $table->data[0][1] = ''; - $table->data[0][2] = ''.__('Modules').''; - - $table->data[1][0] = html_print_select($interfaces_list, 'id_snmp[]', 0, false, '', '', true, true, true, '', false, 'width:500px; overflow: auto;'); - - $table->data[1][1] = __('When selecting interfaces'); - $table->data[1][1] .= '
'; - $table->data[1][1] .= html_print_select( - [ - 1 => __('Show common modules'), - 0 => __('Show all modules'), - ], - 'modules_selection_mode', - 1, - false, - '', - '', - true, - false, - false - ); - - $table->data[1][2] = html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, 'width:200px;'); - $table->data[1][2] .= html_print_input_hidden('agent', $id_agent, true); - - html_print_table($table); - - echo "
"; - html_print_submit_button(__('Create modules'), '', false, ['class' => 'sub add']); - echo '
'; - unset($table); - - echo '
'; - echo '
'; - echo '
'; -} - -ui_require_jquery_file('pandora.controls'); -ui_require_jquery_file('ajaxqueue'); -ui_require_jquery_file('bgiframe'); -?> - diff --git a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php deleted file mode 100644 index 20c955ab05..0000000000 --- a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php +++ /dev/null @@ -1,873 +0,0 @@ - $row) { - // First and second rows are Class and column names, ignore it. - if ($index < 2) { - continue; - } - - $row_exploded = explode('|', $row); - - if (!in_array($row_exploded[$processes_name_field], $processes)) { - if (preg_match('/ERROR/', $row_exploded[$processes_name_field])) { - $processes[$row_exploded[$prouycesses_name_field]] = __('None'); - } else { - $processes[$row_exploded[$prouycesses_name_field]] = $row_exploded[$processes_name_field]; - } - } - } - - unset($output); - - // Services. - $wmi_services = $wmi_command.' "select Name from Win32_Service"'; - $services_name_field = 0; - $services_check_field = 1; - - if (enterprise_installed() && (int) $server_to_exec != 0) { - $server_data = db_get_row( - 'tserver', - 'id_server', - $server_to_exec - ); - if (empty($server_data['port'])) { - exec( - 'ssh pandora_exec_proxy@'.$server_data['ip_address']." - '".$wmi_services."'", - $output, - $rc - ); - } else { - exec( - 'ssh -p '.$server_data['port'].' pandora_exec_proxy@'.$server_data['ip_address']." - '".$wmi_services."'", - $output, - $rc - ); - } - } else { - exec($wmi_services, $output); - } - - foreach ($output as $index => $row) { - // First and second rows are Class and column names, ignore it. - if ($index < 2) { - continue; - } - - $row_exploded = explode('|', $row); - - if (!in_array($row_exploded[$services_name_field], $services)) { - if (preg_match('/ERROR/', $row_exploded[$services_name_field])) { - $services[$row_exploded[$services_name_field]] = __('None'); - } else { - $services[$row_exploded[$services_name_field]] = $row_exploded[$services_name_field]; - } - } - } - - unset($output); - - // Disks. - $wmi_disks = $wmi_command.' "Select DeviceID from Win32_LogicalDisk"'; - $disks_name_field = 0; - - if (enterprise_installed() && (int) $server_to_exec != 0) { - $server_data = db_get_row('tserver', 'id_server', $server_to_exec); - - if (empty($server_data['port'])) { - exec( - 'ssh pandora_exec_proxy@'.$server_data['ip_address']." - '".$wmi_disks."'", - $output, - $rc - ); - } else { - exec( - 'ssh -p '.$server_data['port'].' pandora_exec_proxy@'.$server_data['ip_address']." - '".$wmi_disks."'", - $output, - $rc - ); - } - } else { - exec($wmi_disks, $output); - } - - foreach ($output as $index => $row) { - // First and second rows are Class and column names, ignore it. - if ($index < 2) { - continue; - } - - $row_exploded = explode('|', $row); - - if (!in_array($row_exploded[$disks_name_field], $services)) { - if (preg_match('/ERROR/', $row_exploded[$disks_name_field])) { - $disks[$row_exploded[$disks_name_field]] = __('None'); - } else { - $disk_string = sprintf( - __('Free space on %s'), - $row_exploded[$disks_name_field] - ); - $disks[$row_exploded[$disks_name_field]] = $disk_string; - } - } - } - - unset($output); - - // WMI Components. - $network_component_groups = network_components_get_groups(MODULE_WMI); - } -} - -if ($create_modules) { - $modules = get_parameter('module', []); - - $services = []; - $processes = []; - $disks = []; - $components = []; - - foreach ($modules as $module) { - // Split module data to get type. - $module_exploded = explode('_', $module); - $type = $module_exploded[0]; - - // Delete type from module data. - unset($module_exploded[0]); - - // Rebuild module data. - $module = implode('_', $module_exploded); - - switch ($type) { - case 'service': - $services[] = $module; - break; - - case 'process': - $processes[] = $module; - break; - - case 'disk': - $disks[] = $module; - break; - - case 'component': - $components[] = $module; - break; - - default: - // Default. - break; - } - } - - // Common values for WMI modules. - $values = [ - 'ip_target' => $ip_target, - 'tcp_send' => $tcp_send, - 'plugin_user' => $plugin_user, - 'plugin_pass' => $plugin_pass, - 'id_modulo' => MODULE_WMI, - ]; - - if ($server_to_exec != 0) { - $sql = sprintf( - 'SELECT server_type FROM tserver WHERE id_server = %d', - $server_to_exec - ); - $row = db_get_row_sql($sql); - - if ($row['server_type'] == 13) { - $values['id_modulo'] = 1; - } - } - - // Create Service modules. - $services_values = $values; - - $services_values['snmp_community'] = 'Running'; - // Key string. - $services_values['tcp_port'] = 1; - // Field number (Running/Stopped). - $services_values['id_tipo_modulo'] = 2; - // Generic boolean. - $services_result = wmi_create_wizard_modules( - $id_agent, - $services, - 'services', - $services_values, - 0, - 0, - $server_to_exec - ); - - // Create Process modules. - $processes_values = $values; - - $processes_values['tcp_port'] = 0; - // Field number (OID). - $processes_values['id_tipo_modulo'] = 2; - // Generic boolean. - $processes_result = wmi_create_wizard_modules( - $id_agent, - $processes, - 'processes', - $processes_values, - 0, - 0, - $server_to_exec - ); - - // Create Space on disk modules. - $disks_values = $values; - - $disks_values['tcp_port'] = 1; - // Free space in bytes. - $disks_values['id_tipo_modulo'] = 1; - // Generic numeric. - $disks_values['unit'] = 'Bytes'; - // Unit. - $disks_result = wmi_create_wizard_modules( - $id_agent, - $disks, - 'disks', - $disks_values, - 0, - 0, - $server_to_exec - ); - - // Create modules from component. - $components_values = $values; - - $components_values['id_agente'] = $id_agent; - - $components_result = wmi_create_module_from_components( - $components, - $components_values, - 0, - 0, - $server_to_exec - ); - - - // Errors/Success messages. - $success_message = ''; - $error_message = ''; - if (!empty($services_result)) { - if (count($services_result[NOERR]) > 0) { - $success_message .= sprintf( - __('%s service modules created succesfully'), - count($services_result[NOERR]) - ).'
'; - } - - if (count($services_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf( - __('Error creating %s service modules'), - count($services_result[ERR_GENERIC]) - ).'
'; - } - } - - if (!empty($processes_result)) { - if (count($processes_result[NOERR]) > 0) { - $success_message .= sprintf( - __('%s process modules created succesfully'), - count($processes_result[NOERR]) - ).'
'; - } - - if (count($processes_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf( - __('Error creating %s process modules'), - count($processes_result[ERR_GENERIC]) - ).'
'; - } - } - - if (!empty($disks_result)) { - if (count($disks_result[NOERR]) > 0) { - $success_message .= sprintf( - __('%s disk space modules created succesfully'), - count($disks_result[NOERR]) - ).'
'; - } - - if (count($disks_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf( - __('Error creating %s disk space modules'), - count($disks_result[ERR_GENERIC]) - ).'
'; - } - } - - if (!empty($components_result)) { - if (count($components_result[NOERR]) > 0) { - $success_message .= sprintf( - __('%s modules created from components succesfully'), - count($components_result[NOERR]) - ).'
'; - } - - if (count($components_result[ERR_GENERIC]) > 0) { - $error_message .= sprintf( - __('Error creating %s modules from components'), - count($components_result[ERR_GENERIC]) - ).'
'; - } - - if (count($components_result[ERR_EXIST]) > 0) { - $error_message .= sprintf( - __('%s modules already exist'), - count($components_result[ERR_EXIST]) - ).'
'; - } - } - - if (!empty($success_message)) { - ui_print_success_message($success_message); - } - - if (!empty($error_message)) { - ui_print_error_message($error_message); - } -} - -echo ''; -echo "
"; - -$table->width = '100%'; -$table->cellpadding = 0; -$table->cellspacing = 0; -$table->class = 'databox filters'; - -$table->data[0][0] = ''.__('Target IP').''; -$table->data[0][1] = html_print_input_text( - 'ip_target', - $ip_target, - '', - 15, - 60, - true -); - -$table->data[0][2] = ''.__('Namespace').''; -$table->data[0][3] = html_print_input_text( - 'tcp_send', - $tcp_send, - '', - 15, - 60, - true -); - -$table->data[1][0] = ''.__('Username').''; -$table->data[1][1] = html_print_input_text( - 'plugin_user', - $plugin_user, - '', - 15, - 60, - true -); - -$table->data[1][2] = ''.__('Password').''; -$table->data[1][3] = html_print_input_password( - 'plugin_pass', - $plugin_pass, - '', - 15, - 60, - true -); - -$table->data[1][3] .= ''; -html_print_input_hidden('wmiexplore', 1); - -$servers_to_exec = []; -$servers_to_exec[0] = __('Local console'); -if (enterprise_installed()) { - enterprise_include_once('include/functions_satellite.php'); - - $rows = get_proxy_servers(); - foreach ($rows as $row) { - if ($row['server_type'] != 13) { - $s_type = ' (Standard)'; - } else { - $s_type = ' (Satellite)'; - } - - $servers_to_exec[$row['id_server']] = $row['name'].$s_type; - } -} - -$table->data[2][0] = ''.__('Server to execute command').''.ui_print_help_icon('agent_snmp_explorer_tab', true); -$table->data[2][1] = html_print_select( - $servers_to_exec, - 'server_to_exec', - $server_to_exec, - '', - '', - '', - true -); - -html_print_table($table); - -echo "
"; -echo ''; -html_print_submit_button( - __('WMI Explore'), - 'wmi_explore', - false, - ['class' => 'sub next'] -); -echo '

'; - -if ($wmiexplore && $fail) { - ui_print_error_message(__('Unable to do WMI explorer')); -} - -unset($table); - -echo '
'; - -if ($wmiexplore && !$fail) { - echo '
'; - echo "
"; - echo ''; - - html_print_input_hidden('create_modules', 1); - html_print_input_hidden('ip_target', $ip_target); - // Host. - html_print_input_hidden('plugin_user', $plugin_user); - // User. - html_print_input_hidden('plugin_pass', $plugin_pass); - // Password. - html_print_input_hidden('tcp_send', $tcp_send); - // Namespace. - html_print_input_hidden('server_to_exec', $server_to_exec); - - $table->width = '100%'; - - // Mode selector. - $modes = []; - $modes['services'] = __('Services'); - $modes['processes'] = __('Processes'); - $modes['disks'] = __('Free space on disk'); - $modes['components'] = __('WMI components'); - - $table->data[1][0] = __('Wizard mode').': '; - $table->data[1][0] .= html_print_select( - $modes, - 'wmi_wizard_modes', - '', - '', - '', - '', - true, - false, - false - ); - $table->cellstyle[1][0] = 'vertical-align: middle;'; - - $table->colspan[1][0] = 2; - $table->data[1][2] = ''.__('Modules').''; - $table->cellstyle[1][2] = 'text-align: center;'; - - // Components list. - $table->data[2][0] = '
'; - $table->data[2][0] .= __('Filter by group').'
'; - $table->data[2][0] .= html_print_select( - $network_component_groups, - 'network_component_group', - '', - '', - '', - '', - true, - false, - false, - '', - false, - 'width: 300px;' - ).'
'; - $table->data[2][0] .= html_print_select( - [], - 'network_component', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - - // Services list. - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $services, - 'services', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - // Processes list. - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $processes, - 'processes', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - $table->data[2][0] .= ''; - - // Disks list. - $table->data[2][0] .= '
'; - $table->data[2][0] .= html_print_select( - $disks, - 'disks', - '', - '', - '', - '', - true, - true, - true, - '', - false, - 'width: 300px;' - ); - $table->data[2][0] .= '
'; - $table->cellstyle[2][0] = 'vertical-align: bottom; text-align: center;'; - - - // Components arrow. - $table->data[2][1] = '
- '.html_print_image( - 'images/darrowright.png', - true, - ['title' => __('Add to modules list')] - ).'
'; - // Services arrow. - $table->data[2][1] .= '
- '.html_print_image( - 'images/darrowright.png', - true, - ['title' => __('Add to modules list')] - ).'
'; - // Processes arrow. - $table->data[2][1] .= '
- '.html_print_image( - 'images/darrowright.png', - true, - ['title' => __('Add to modules list')] - ).'
'; - // Disks arrow. - $table->data[2][1] .= '
- '.html_print_image( - 'images/darrowright.png', - true, - ['title' => __('Add to modules list')] - ).'
'; - - - $table->data[2][1] .= '

-
- '.html_print_image( - 'images/cross.png', - true, - ['title' => __('Remove from modules list')] - ).'
'; - $table->cellstyle[2][1] = 'vertical-align: middle; text-align: center;'; - - $table->data[2][2] = html_print_select( - [], - 'module[]', - 0, - false, - '', - 0, - true, - true, - true, - '', - false, - 'width:300px; height: 100%;' - ); - $table->data[2][2] .= html_print_input_hidden( - 'agent', - $id_agent, - true - ); - $table->cellstyle[2][2] = 'vertical-align: top; text-align: center;'; - - html_print_table($table); - - echo "
"; - html_print_submit_button( - __('Create modules'), - 'create_modules_btn', - false, - ['class' => 'sub add'] - ); - echo '
'; - unset($table); - - echo '
'; - echo '
'; - echo ''; -} - -ui_require_jquery_file('pandora.controls'); -ui_require_jquery_file('ajaxqueue'); -ui_require_jquery_file('bgiframe'); -ui_require_javascript_file('pandora_modules'); - -?> - \ No newline at end of file diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 0635e8e6be..1cd65a95db 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1378,8 +1378,8 @@ if ($update_module || $create_module) { $ip_target = (string) get_parameter('ip_target'); // No autofill if the module is a webserver module. if ($ip_target == '' - && $id_module_type < MODULE_WEBSERVER_CHECK_LATENCY - && $id_module_type > MODULE_WEBSERVER_RETRIEVE_STRING_DATA + && $id_module_type < MODULE_TYPE_WEB_DATA + && $id_module_type > MODULE_TYPE_WEB_CONTENT_STRING ) { $ip_target = 'auto'; } diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 2ae1761f49..7aef28931b 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -24,7 +24,16 @@ require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_servers.php'; -$search_string = io_safe_output(urldecode(trim(get_parameter('search_string', '')))); +$search_string = io_safe_output( + urldecode( + trim( + get_parameter( + 'search_string', + '' + ) + ) + ) +); global $policy_page; @@ -32,17 +41,27 @@ if (!isset($policy_page)) { $policy_page = false; } -// Search string filter form + +echo '
'; + +echo ''; +echo "
"; +echo __('Search').' '.html_print_input_text( + 'search_string', + $search_string, + '', + 15, + 255, + true +); +html_print_input_hidden('search', 1); +// Search string filter form. if (($policy_page) || (isset($agent))) { echo ''; } else { echo ''; } -echo ''; -echo "'; echo "'; echo ""; echo ''; // Check if there is at least one server of each type available to assign that -// kind of modules. If not, do not show server type in combo +// kind of modules. If not, do not show server type in combo. $network_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 1' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $wmi_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 6' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $plugin_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 4' ); -// POSTGRESQL AND ORACLE COMPATIBLE +// POSTGRESQL AND ORACLE COMPATIBLE. $prediction_available = db_get_sql( 'SELECT count(*) FROM tserver WHERE server_type = 5' ); -// POSTGRESQL AND ORACLE COMPATIBLE -// Development mode to use all servers +// POSTGRESQL AND ORACLE COMPATIBLE. +// Development mode to use all servers. if ($develop_bypass || is_metaconsole()) { $network_available = 1; $wmi_available = 1; $plugin_available = 1; - // FIXME when prediction predictions server modules can be configured - // on metaconsole + // FIXME when prediction predictions server modules can be configured. + // on metaconsole. $prediction_available = is_metaconsole() ? 0 : 1; } @@ -140,7 +159,7 @@ if (($policy_page) || (isset($agent))) { } if ($show_creation) { - // Create module/type combo + // Create module/type combo. echo ''; if (!$policy_page) { echo ''; } echo ''; echo '
"; -echo __('Search').' '.html_print_input_text('search_string', $search_string, '', 15, 255, true); - html_print_input_hidden('search', 1); echo '"; html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"'); @@ -50,38 +69,38 @@ echo '
'; @@ -151,13 +170,33 @@ if (($policy_page) || (isset($agent))) { $checked = false; } - html_print_checkbox('status_hierachy_mode', '', $checked, false, false, 'onChange=change_mod_filter();'); + html_print_checkbox( + 'status_hierachy_mode', + '', + $checked, + false, + false, + 'onChange=change_mod_filter();' + ); echo ''; echo __('

Type

'); - html_print_select($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;'); + html_print_select( + $modules, + 'moduletype', + '', + '', + '', + '', + false, + false, + false, + '', + false, + 'max-width:300px;' + ); html_print_input_hidden('edit_module', 1); echo '
'; @@ -212,7 +251,13 @@ if ($multiple_delete) { } enterprise_include_once('include/functions_config_agents.php'); - enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_agent_module_del), modules_get_agentmodule_name($id_agent_module_del)]); + enterprise_hook( + 'config_agents_delete_module_in_conf', + [ + modules_get_agentmodule_agent($id_agent_module_del), + modules_get_agentmodule_name($id_agent_module_del), + ] + ); $error = 0; @@ -220,7 +265,12 @@ if ($multiple_delete) { // error. NOTICE that we don't delete all data here, just marking for deletion // and delete some simple data. $status = ''; - $agent_id_of_module = db_get_value('id_agente', 'tagente_modulo', 'id_agente_modulo', (int) $id_agent_module_del); + $agent_id_of_module = db_get_value( + 'id_agente', + 'tagente_modulo', + 'id_agente_modulo', + (int) $id_agent_module_del + ); if (db_process_sql( "UPDATE tagente_modulo @@ -235,7 +285,7 @@ if ($multiple_delete) { ) { $error++; } else { - // Set flag to update module status count + // Set flag to update module status count. if ($agent_id_of_module !== false) { db_process_sql( 'UPDATE tagente @@ -286,32 +336,48 @@ if ($multiple_delete) { break; } - // Trick to detect if we are deleting a synthetic module (avg or arithmetic) - // If result is empty then module doesn't have this type of submodules - $ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_agent_module_del]); + // Trick to detect if we are deleting a synthetic module (avg or arithmetic). + // If result is empty then module doesn't have this type of submodules. + $ops_json = enterprise_hook( + 'modules_get_synthetic_operations', + [$id_agent_module_del] + ); $result_ops_synthetic = json_decode($ops_json); if (!empty($result_ops_synthetic)) { - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_agent_module_del]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [$id_agent_module_del] + ); if ($result === false) { $error++; } - } //end if - else { - $result_components = enterprise_hook('modules_get_synthetic_components', [$id_agent_module_del]); + } else { + $result_components = enterprise_hook( + 'modules_get_synthetic_components', + [$id_agent_module_del] + ); $count_components = 1; if (!empty($result_components)) { - // Get number of components pending to delete to know when it's needed to update orders + // Get number of components pending to delete to know when it's needed to update orders. $num_components = count($result_components); $last_target_module = 0; foreach ($result_components as $id_target_module) { - // Detects change of component or last component to update orders - if (($count_components == $num_components) or ($last_target_module != $id_target_module)) { + // Detects change of component or last component to update orders. + if (($count_components == $num_components) || ($last_target_module != $id_target_module) + ) { $update_orders = true; } else { $update_orders = false; } - $result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_agent_module_del, $update_orders]); + $result = enterprise_hook( + 'modules_delete_synthetic_operations', + [ + $id_target_module, + $id_agent_module_del, + $update_orders, + ] + ); if ($result === false) { $error++; } @@ -323,7 +389,7 @@ if ($multiple_delete) { } - // Check for errors + // Check for errors. if ($error != 0) { } else { $count_correct_delete_modules++; @@ -509,7 +575,7 @@ switch ($sortField) { } -// Build the order sql +// Build the order sql. if (!empty($order)) { $order_sql = ' ORDER BY '; } @@ -525,7 +591,7 @@ foreach ($order as $ord) { $order_sql .= $ord['field'].' '.$ord['order']; } -// Get limit and offset parameters +// Get limit and offset parameters. $limit = (int) $config['block_size']; $offset = (int) get_parameter('offset'); @@ -559,9 +625,15 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente); $search_string_entities = io_safe_input($search_string); -$basic_where = sprintf("(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", $search_string, $search_string_entities, $search_string, $search_string_entities); +$basic_where = sprintf( + "(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND", + $search_string, + $search_string_entities, + $search_string, + $search_string_entities +); -// Tags acl +// Tags acl. $agent_tags = tags_get_user_applied_agent_tags($id_agente); if ($agent_tags !== true) { $where_tags = ' AND ttag_module.id_tag IN ('.implode(',', $agent_tags).')'; @@ -619,7 +691,7 @@ if ($modules === false) { return; } -// Prepare pagination +// Prepare pagination. $url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string); if ($paginate_module) { @@ -635,17 +707,48 @@ $table = new stdClass(); $table->width = '100%'; $table->class = 'info_table'; $table->head = []; -$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); -$table->head[0] = __('Name').ui_get_sorting_arrows($url_name.'up', $url_name.'down', $selectNameUp, $selectNameDown); +$table->head['checkbox'] = html_print_checkbox( + 'all_delete', + 0, + false, + true, + false +); +$table->head[0] = __('Name').ui_get_sorting_arrows( + $url_name.'up', + $url_name.'down', + $selectNameUp, + $selectNameDown +); -// The access to the policy is granted only with AW permission -if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { +// The access to the policy is granted only with AW permission. +if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' +) +) { $table->head[1] = "".__('P.').''; } -$table->head[2] = "".__('S.').''.ui_get_sorting_arrows($url_server.'up', $url_server.'down', $selectServerUp, $selectServerDown); -$table->head[3] = __('Type').ui_get_sorting_arrows($url_type.'up', $url_type.'down', $selectTypeUp, $selectTypeDown); -$table->head[4] = __('Interval').ui_get_sorting_arrows($url_interval.'up', $url_interval.'down', $selectIntervalUp, $selectIntervalDown); +$table->head[2] = "".__('S.').''.ui_get_sorting_arrows( + $url_server.'up', + $url_server.'down', + $selectServerUp, + $selectServerDown +); +$table->head[3] = __('Type').ui_get_sorting_arrows( + $url_type.'up', + $url_type.'down', + $selectTypeUp, + $selectTypeDown +); +$table->head[4] = __('Interval').ui_get_sorting_arrows( + $url_interval.'up', + $url_interval.'down', + $selectIntervalUp, + $selectIntervalDown +); $table->head[5] = __('Description'); $table->head[6] = __('Status'); $table->head[7] = __('Warn'); @@ -690,7 +793,16 @@ if ($checked) { } foreach ($modules as $module) { - if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && ! check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) { + if (! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AW' + ) && ! check_acl_one_of_groups( + $config['id_user'], + $all_groups, + 'AD' + ) + ) { continue; } @@ -712,7 +824,9 @@ foreach ($modules as $module) { if (!$checked) { if ($module['id_module_group'] != $last_modulegroup) { $last_modulegroup = $module['id_module_group']; - $data[0] = ''.modules_get_modulegroup_name($last_modulegroup).''; + $data[0] = ''.modules_get_modulegroup_name( + $last_modulegroup + ).''; $i = array_push($table->data, $data); $table->rowstyle[($i - 1)] = 'text-align: center'; $table->rowclass[($i - 1)] = 'datos3'; @@ -727,14 +841,23 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - $data['checkbox'] = html_print_checkbox('id_delete[]', $module['id_agente_modulo'], false, true); + $data['checkbox'] = html_print_checkbox( + 'id_delete[]', + $module['id_agente_modulo'], + false, + true + ); } $data[0] = ''; if (isset($module['deep']) && ($module['deep'] != 0)) { $data[0] .= str_repeat('    ', $module['deep']); - $data[0] .= html_print_image('images/icono_escuadra.png', true, ['style' => 'padding-bottom: inherit;']).'  '; + $data[0] .= html_print_image( + 'images/icono_escuadra.png', + true, + ['style' => 'padding-bottom: inherit;'] + ).'  '; } if ($module['quiet']) { @@ -754,17 +877,38 @@ foreach ($modules as $module) { } if ($module['disabled']) { - $data[0] .= ''.ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt').''; + $data[0] .= ''.ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ).''; } else { - $data[0] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '[…]', 'font-size: 7.2pt'); + $data[0] .= ui_print_truncate_text( + $module['nombre'], + 'module_medium', + false, + true, + true, + '[…]', + 'font-size: 7.2pt' + ); } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { $data[0] .= ''; } - // The access to the policy is granted only with AW permission - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl($config['id_user'], $agent['id_grupo'], 'AW')) { + // The access to the policy is granted only with AW permission. + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && check_acl( + $config['id_user'], + $agent['id_grupo'], + 'AW' + ) + ) { $policyInfo = policies_info_module_policy($module['id_agente_modulo']); if ($policyInfo === false) { $data[1] = ''; @@ -798,17 +942,27 @@ foreach ($modules as $module) { } } - // Module type (by server type ) + // Module type (by server type ). $data[2] = ''; if ($module['id_modulo'] > 0) { $data[2] = servers_show_type($module['id_modulo']); } - $module_status = db_get_row('tagente_estado', 'id_agente_modulo', $module['id_agente_modulo']); + $module_status = db_get_row( + 'tagente_estado', + 'id_agente_modulo', + $module['id_agente_modulo'] + ); - modules_get_status($module['id_agente_modulo'], $module_status['estado'], $module_status['datos'], $status, $title); + modules_get_status( + $module['id_agente_modulo'], + $module_status['estado'], + $module_status['datos'], + $status, + $title + ); - // This module is initialized ? (has real data) + // This module is initialized ? (has real data). if ($status == STATUS_MODULE_NO_DATA) { $data[2] .= html_print_image( 'images/error.png', @@ -817,13 +971,13 @@ foreach ($modules as $module) { ); } - // Module type (by data type) + // Module type (by data type). $data[3] = ''; if ($type) { $data[3] = ui_print_moduletype_icon($type, true); } - // Module interval + // Module interval. if ($module['module_interval']) { $data[4] = human_time_description_raw($module['module_interval']); } else { @@ -831,12 +985,23 @@ foreach ($modules as $module) { } if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) { - $data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true); + $data[4] .= ui_print_help_tip( + __('The policy modules of data type will only update their intervals when policy is applied.'), + true + ); } - $data[5] = ui_print_truncate_text($module['descripcion'], 'description', false); + $data[5] = ui_print_truncate_text( + $module['descripcion'], + 'description', + false + ); - $data[6] = ui_print_status_image($status, htmlspecialchars($title), true); + $data[6] = ui_print_status_image( + $status, + htmlspecialchars($title), + true + ); // MAX / MIN values. if ($module['id_tipo_modulo'] != 25) { @@ -884,7 +1049,7 @@ foreach ($modules as $module) { ); $data[8] .= ' '; - // Make a data normalization + // Make a data normalization. if (isset($numericModules[$type])) { if ($numericModules[$type] === true) { $data[8] .= ''; @@ -904,7 +1069,7 @@ foreach ($modules as $module) { $data[8] .= '  '; } - // create network component action + // Create network component action. if ((is_user_admin($config['id_user'])) && ($module['id_modulo'] == MODULE_NETWORK) ) { @@ -927,7 +1092,7 @@ foreach ($modules as $module) { } if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { - // Delete module + // Delete module. $data[9] = ''; $data[9] .= html_print_image( @@ -959,7 +1124,12 @@ html_print_table($table); if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { echo '
'; html_print_input_hidden('multiple_delete', 1); - html_print_submit_button(__('Delete'), 'multiple_delete', false, 'class="sub delete"'); + html_print_submit_button( + __('Delete'), + 'multiple_delete', + false, + 'class="sub delete"' + ); echo '
'; echo ''; } diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 9948554591..b812e5b8b0 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -1290,7 +1290,7 @@ ui_require_jquery_file('json'); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index 533bc32caf..f9f8876e9c 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -363,7 +363,15 @@ function update_template($step) } -// We set here the number of steps +$is_central_policies_on_node = is_central_policies_on_node(); + +if ($is_central_policies_on_node === true) { + ui_print_warning_message( + __('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.') + ); +} + +// We set here the number of steps. define('LAST_STEP', 3); $step = (int) get_parameter('step', 1); @@ -579,27 +587,74 @@ if ($step == 2) { $show_matches = false; } - // Firing conditions and events + // Firing conditions and events. $table->colspan = []; - // $table->colspan[4][1] = 1; $table->data[0][0] = __('Days of week'); $table->data[0][1] = __('Mon'); - $table->data[0][1] .= html_print_checkbox('monday', 1, $monday, true); + $table->data[0][1] .= html_print_checkbox( + 'monday', + 1, + $monday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Tue'); - $table->data[0][1] .= html_print_checkbox('tuesday', 1, $tuesday, true); + $table->data[0][1] .= html_print_checkbox( + 'tuesday', + 1, + $tuesday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Wed'); - $table->data[0][1] .= html_print_checkbox('wednesday', 1, $wednesday, true); + $table->data[0][1] .= html_print_checkbox( + 'wednesday', + 1, + $wednesday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Thu'); - $table->data[0][1] .= html_print_checkbox('thursday', 1, $thursday, true); + $table->data[0][1] .= html_print_checkbox( + 'thursday', + 1, + $thursday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Fri'); - $table->data[0][1] .= html_print_checkbox('friday', 1, $friday, true); + $table->data[0][1] .= html_print_checkbox( + 'friday', + 1, + $friday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Sat'); - $table->data[0][1] .= html_print_checkbox('saturday', 1, $saturday, true); + $table->data[0][1] .= html_print_checkbox( + 'saturday', + 1, + $saturday, + true, + $is_central_policies_on_node + ); $table->data[0][1] .= __('Sun'); - $table->data[0][1] .= html_print_checkbox('sunday', 1, $sunday, true); + $table->data[0][1] .= html_print_checkbox( + 'sunday', + 1, + $sunday, + true, + $is_central_policies_on_node + ); $table->data[0][2] = __('Use special days list'); - $table->data[0][3] = html_print_checkbox('special_day', 1, $special_day, true); + $table->data[0][3] = html_print_checkbox( + 'special_day', + 1, + $special_day, + true, + $is_central_policies_on_node + ); $table->data[1][0] = __('Time from'); $table->data[1][1] = html_print_input_text( @@ -608,7 +663,18 @@ if ($step == 2) { '', 7, 8, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->data[1][2] = __('Time to'); $table->data[1][3] = html_print_input_text( @@ -617,7 +683,18 @@ if ($step == 2) { '', 7, 8, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->colspan['threshold'][1] = 3; @@ -629,7 +706,11 @@ if ($step == 2) { '', '', false, - true + true, + false, + true, + '', + $is_central_policies_on_node ); $table->data[3][0] = __('Min. number of alerts'); @@ -639,11 +720,32 @@ if ($step == 2) { '', 5, 7, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); - $table->data[3][2] = __('Reset counter for non-sustained alerts').ui_print_help_tip(__('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'), true); - $table->data[3][3] = html_print_checkbox('min_alerts_reset_counter', 1, $min_alerts_reset_counter, true); + $table->data[3][2] = __('Reset counter for non-sustained alerts'); + $table->data[3][2] .= ui_print_help_tip( + __('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'), + true + ); + $table->data[3][3] = html_print_checkbox( + 'min_alerts_reset_counter', + 1, + $min_alerts_reset_counter, + true, + $is_central_policies_on_node + ); $table->data[4][0] = __('Max. number of alerts'); $table->data[4][1] = html_print_input_text( @@ -652,39 +754,43 @@ if ($step == 2) { '', 5, 7, - true + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node ); $table->data[4][2] = __('Disable event'); - $table->data[4][3] = html_print_checkbox('disable_event', 1, $disable_event, true); + $table->data[4][3] = html_print_checkbox( + 'disable_event', + 1, + $disable_event, + true, + $is_central_policies_on_node + ); $table->data[5][0] = __('Default action'); - $usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true))); - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - $sql_query = sprintf( - ' - SELECT id, name - FROM talert_actions - WHERE id_group IN (%s) - ORDER BY name', - $usr_groups - ); - break; + $usr_groups = implode( + ',', + array_keys(users_get_groups($config['id_user'], 'LM', true)) + ); - case 'oracle': - $sql_query = sprintf( - ' - SELECT id, - dbms_lob.substr(name,4000,1) AS nombre - FROM talert_actions - WHERE id_group IN (%s) - ORDER BY dbms_lob.substr(name,4000,1)', - $usr_groups - ); - break; - } + $sql_query = sprintf( + ' + SELECT id, name + FROM talert_actions + WHERE id_group IN (%s) + ORDER BY name', + $usr_groups + ); $table->data[5][1] = html_print_select_from_sql( $sql_query, @@ -696,11 +802,12 @@ if ($step == 2) { true, false, false, - false, + $is_central_policies_on_node, false, false, 0 - ).ui_print_help_tip( + ); + $table->data[5][1] .= ui_print_help_tip( __('Unless they\'re left blank, the fields from the action will override those set on the template.'), true ); @@ -715,7 +822,9 @@ if ($step == 2) { 0, true, false, - false + false, + '', + $is_central_policies_on_node ); $table->data[6][1] .= ''; $table->data[6][1] .= ' '.html_print_checkbox('matches_value', 1, $matches, true); @@ -760,7 +869,7 @@ if ($step == 2) { $table->data['value'][1] .= ''; $table->colspan['value'][1] = 3; - // Min first, then max, that's more logical + // Min first, then max, that's more logical. $table->data['min'][0] = __('Min.'); $table->data['min'][1] = html_print_input_text( 'min', @@ -798,25 +907,12 @@ if ($step == 2) { $table->size[1] = '45%'; $table->size[2] = '45%'; - // Alert recover + // Alert recover. if (! $recovery_notify) { $table->cellstyle['label_fields'][2] = 'display:none;'; for ($i = 1; $i <= $config['max_macro_fields']; $i++) { $table->cellstyle['field'.$i][2] = 'display:none;'; } - - /* - $table->cellstyle['field1'][2] = 'display:none;'; - $table->cellstyle['field2'][2] = 'display:none;'; - $table->cellstyle['field3'][2] = 'display:none;'; - $table->cellstyle['field4'][2] = 'display:none;'; - $table->cellstyle['field5'][2] = 'display:none;'; - $table->cellstyle['field6'][2] = 'display:none;'; - $table->cellstyle['field7'][2] = 'display:none;'; - $table->cellstyle['field8'][2] = 'display:none;'; - $table->cellstyle['field9'][2] = 'display:none;'; - $table->cellstyle['field10'][2] = 'display:none;'; - */ } $table->data[0][0] = __('Alert recovery'); @@ -833,7 +929,9 @@ if ($step == 2) { '', true, false, - false + false, + '', + $is_central_policies_on_node ); $table->colspan[0][1] = 2; @@ -842,45 +940,98 @@ if ($step == 2) { $table->data['label_fields'][2] = __('Recovery fields'); for ($i = 1; $i <= $config['max_macro_fields']; $i++) { - if (isset($template[$name])) { + if (isset($template[$name]) === true) { $value = $template[$name]; } else { $value = ''; } - // $table->rowclass['field'.$i] = 'row_field'; $table->data['field'.$i][0] = sprintf(__('Field %s'), $i); - // TinyMCE - // triggering fields - // basic - $table->data['field'.$i][1] = '
'; - $table->data['field'.$i][1] .= __('Basic').'  '; - $table->data['field'.$i][1] .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."')", '', true); - // Advanced - $table->data['field'.$i][1] .= '    '; - $table->data['field'.$i][1] .= __('Advanced').'  '; - $table->data['field'.$i][1] .= html_print_radio_button_extended('editor_type_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."')", '', true); - $table->data['field'.$i][1] .= '
'; + // TinyMCE. + // triggering fields. + // Basic. + $table->data['field'.$i][1] = '
'; + $table->data['field'.$i][1] .= __('Basic').'  '; + $table->data['field'.$i][1] .= html_print_radio_button_extended( + 'editor_type_value_'.$i, + 0, + '', + false, + $is_central_policies_on_node, + "removeTinyMCE('textarea_field".$i."')", + '', + true + ); + // Advanced. + $table->data['field'.$i][1] .= '    '; + $table->data['field'.$i][1] .= __('Advanced').'  '; + $table->data['field'.$i][1] .= html_print_radio_button_extended( + 'editor_type_value_'.$i, + 0, + '', + true, + $is_central_policies_on_node, + "addTinyMCE('textarea_field".$i."')", + '', + true + ); + $table->data['field'.$i][1] .= '
'; - // Texarea - $table->data['field'.$i][1] .= html_print_textarea('field'.$i, 1, 1, isset($fields[$i]) ? $fields[$i] : '', 'style="min-height:40px;" class="fields"', true); + // Texarea. + $table->data['field'.$i][1] .= html_print_textarea( + 'field'.$i, + 1, + 1, + isset($fields[$i]) ? $fields[$i] : '', + 'style="min-height:40px;" class="fields"', + true, + '', + $is_central_policies_on_node + ); - // Recovery - // basic - $table->data['field'.$i][2] = '
'; - $table->data['field'.$i][2] .= __('Basic').'  '; - $table->data['field'.$i][2] .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_recovery')", '', true); - // advanced - $table->data['field'.$i][2] .= '    '; - $table->data['field'.$i][2] .= __('Advanced').'  '; - $table->data['field'.$i][2] .= html_print_radio_button_extended('editor_type_recovery_value_'.$i, 0, '', true, false, "addTinyMCE('textarea_field".$i."_recovery')", '', true); - $table->data['field'.$i][2] .= '
'; + // Recovery. + // Basic. + $table->data['field'.$i][2] = '
'; + $table->data['field'.$i][2] .= __('Basic').'  '; + $table->data['field'.$i][2] .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + false, + $is_central_policies_on_node, + "removeTinyMCE('textarea_field".$i."_recovery')", + '', + true + ); + // Advanced. + $table->data['field'.$i][2] .= '    '; + $table->data['field'.$i][2] .= __('Advanced').'  '; + $table->data['field'.$i][2] .= html_print_radio_button_extended( + 'editor_type_recovery_value_'.$i, + 0, + '', + true, + $is_central_policies_on_node, + "addTinyMCE('textarea_field".$i."_recovery')", + '', + true + ); + $table->data['field'.$i][2] .= '
'; - // Texarea - $table->data['field'.$i][2] .= html_print_textarea('field'.$i.'_recovery', 1, 1, isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', 'style="min-height:40px" class="fields"', true); + // Texarea. + $table->data['field'.$i][2] .= html_print_textarea( + 'field'.$i.'_recovery', + 1, + 1, + isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', + 'style="min-height:40px" class="fields"', + true, + '', + $is_central_policies_on_node + ); } } else { - // Step 1 by default + // Step 1 by default. $table->size = []; $table->size[0] = '20%'; $table->data = []; @@ -916,20 +1067,53 @@ if ($step == 2) { } $table->data[0][0] = __('Name'); - $table->data[0][1] = html_print_input_text('name', $name, '', 35, 255, true); + $table->data[0][1] = html_print_input_text( + 'name', + $name, + '', + 35, + 255, + true, + false, + false, + '', + '', + '', + '', + false, + '', + '', + '', + $is_central_policies_on_node + ); $table->data[0][1] .= '  '.__('Group'); $groups = users_get_groups(); $own_info = get_user_info($config['id_user']); - // Only display group "All" if user is administrator or has "PM" privileges + // Only display group "All" if user is administrator or has "PM" privileges. if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { $display_all_group = true; } else { $display_all_group = false; } - $table->data[0][1] .= ' '.html_print_select_groups(false, 'AR', $display_all_group, 'id_group', $id_group, '', '', 0, true); + $table->data[0][1] .= ' '; + $table->data[0][1] .= html_print_select_groups( + false, + 'AR', + $display_all_group, + 'id_group', + $id_group, + '', + '', + 0, + true, + false, + true, + '', + $is_central_policies_on_node + ); $table->data[1][0] = __('Description'); @@ -939,7 +1123,9 @@ if ($step == 2) { 30, $description, '', - true + true, + '', + $is_central_policies_on_node ); $table->data[2][0] = __('Priority'); @@ -952,7 +1138,9 @@ if ($step == 2) { 0, true, false, - false + false, + '', + $is_central_policies_on_node ); if (defined('METACONSOLE')) { @@ -1000,25 +1188,32 @@ if (!$create_alert && !$create_template) { } if (!$disabled) { - if ($step >= LAST_STEP) { - html_print_submit_button(__('Finish'), 'finish', false, 'class="sub upd"'); - } else { - html_print_input_hidden('step', ($step + 1)); - if ($step == 2) { - // Javascript onsubmit to avoid min = 0 and max = 0 + if ($is_central_policies_on_node === false) { + if ($step >= LAST_STEP) { html_print_submit_button( - __('Next'), - 'next', + __('Finish'), + 'finish', false, - 'class="sub next" onclick="return check_fields_step2();"' + 'class="sub upd"' ); } else { - html_print_submit_button( - __('Next'), - 'next', - false, - 'class="sub next"' - ); + html_print_input_hidden('step', ($step + 1)); + if ($step == 2) { + // Javascript onsubmit to avoid min = 0 and max = 0 + html_print_submit_button( + __('Next'), + 'next', + false, + 'class="sub next" onclick="return check_fields_step2();"' + ); + } else { + html_print_submit_button( + __('Next'), + 'next', + false, + 'class="sub next"' + ); + } } } } @@ -1041,7 +1236,7 @@ var matches_not = ')."'"; ?>; var is_not = ')."'"; ?>; var between = and ')."'"; ?>; -var between_not = and ").'"'; ?>; +var between_not = and ').'"'; ?>; var under = ')."'"; ?>; var over = ')."'"; ?>; var warning = ; diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 1f7284ca5b..ddb06070b5 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -35,12 +35,15 @@ global $config; check_login(); -enterprise_hook('open_meta_frame'); - require_once $config['homedir'].'/include/functions_groups.php'; require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_users.php'; -enterprise_include_once('meta/include/functions_agents_meta.php'); + +if (is_metaconsole()) { + enterprise_include_once('include/functions_metaconsole.php'); + enterprise_include_once('meta/include/functions_agents_meta.php'); + enterprise_hook('open_meta_frame'); +} if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'AR')) { @@ -714,7 +717,12 @@ if ($tab == 'tree') { foreach ($groups as $key => $group) { $url = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; - $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo']; + if (is_metaconsole()) { + $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups'; + } else { + $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo']; + } + $table->data[$key][0] = $group['id_grupo']; $table->data[$key][1] = '
'.$group['nombre'].''; if ($group['icon'] != '') { diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index 6b9ee73f5a..8431bd7973 100755 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -92,6 +92,12 @@ if ($satellite_options != ENTERPRISE_NOT_HOOK) { $options_satellite = array_merge($options_satellite, $satellite_options); } +$options_services = enterprise_hook('massive_services_options'); +if ($options_services === ENTERPRISE_NOT_HOOK) { + $options_services = []; +} + + if (in_array($option, array_keys($options_alerts))) { $tab = 'massive_alerts'; } else if (in_array($option, array_keys($options_agents))) { @@ -108,6 +114,8 @@ if (in_array($option, array_keys($options_alerts))) { $tab = 'massive_satellite'; } else if (in_array($option, array_keys($options_plugins))) { $tab = 'massive_plugins'; +} else if (in_array($option, array_keys($options_services))) { + $tab = 'massive_services'; } if ($tab == 'massive_agents' && $option == '') { @@ -173,6 +181,10 @@ switch ($tab) { $options = $options_plugins; break; + case 'massive_services': + $options = $options_services; + break; + default: // Default. break; @@ -241,6 +253,11 @@ if ($satellitetab == ENTERPRISE_NOT_HOOK) { $satellitetab = ''; } +$servicestab = enterprise_hook('massive_services_tab'); + +if ($servicestab == ENTERPRISE_NOT_HOOK) { + $servicestab = ''; +} $onheader = []; $onheader['massive_agents'] = $agentstab; @@ -254,6 +271,7 @@ $onheader['massive_alerts'] = $alertstab; $onheader['policies'] = $policiestab; $onheader['snmp'] = $snmptab; $onheader['satellite'] = $satellitetab; +$onheader['services'] = $servicestab; /* Hello there! :) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index dce8b584da..21584a5fd4 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -189,6 +189,7 @@ if (check_acl($config['id_user'], 0, 'AW')) { enterprise_hook('massivepolicies_submenu'); enterprise_hook('massivesnmp_submenu'); enterprise_hook('massivesatellite_submenu'); + enterprise_hook('massiveservices_submenu'); $sub['gmassive']['sub2'] = $sub2; } diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index 16a9cccaad..c4ba21febc 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -46,14 +46,15 @@ if (defined('METACONSOLE')) { $sec = 'gmodules'; } - -$create = (bool) get_parameter('create'); -$update = (bool) get_parameter('update'); -$delete = (bool) get_parameter('delete'); -$new = (bool) get_parameter('new'); -$id = (int) get_parameter('id'); -$multiple_delete = (bool) get_parameter('multiple_delete', 0); -$pure = get_parameter('pure', 0); +if (is_management_allowed() === true) { + $create = (bool) get_parameter('create'); + $update = (bool) get_parameter('update'); + $delete = (bool) get_parameter('delete'); + $new = (bool) get_parameter('new'); + $id = (int) get_parameter('id'); + $multiple_delete = (bool) get_parameter('multiple_delete', 0); + $pure = get_parameter('pure', 0); +} if ($create) { $name = (string) get_parameter('name'); @@ -186,7 +187,7 @@ if ($multiple_delete) { ); } -if (($id || $new) && !$delete && !$multiple_delete) { +if (($id || $new) && !$delete && !$multiple_delete && is_management_allowed() === true) { include_once 'manage_nc_groups_form.php'; return; } @@ -229,7 +230,10 @@ $table->class = 'info_table'; $table->head = []; $table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false); $table->head[0] = __('Name'); -$table->head[1] = __('Action'); +if (is_management_allowed() === true) { + $table->head[1] = __('Action'); +} + $table->style = []; $table->style[0] = 'font-weight: bold'; $table->align = []; @@ -258,31 +262,42 @@ foreach ($groups as $group) { } $table->cellclass[][1] = 'action_buttons'; - $data[1] = "".html_print_image('images/cross.png', true, ['title' => __('Delete')]).''; + } array_push($table->data, $data); } +if (is_management_allowed() === false) { + ui_print_warning_message(__('This node is configured with centralized mode. This page is for read only. Go to metaconsole to manage the component groups.')); +} + if (isset($data)) { echo "
"; html_print_input_hidden('multiple_delete', 1); html_print_table($table); - echo "
"; - html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); - echo '
'; + if (is_management_allowed() === true) { + echo "
"; + html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); + echo '
'; + } + echo '
'; } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined component groups') ]); } +if (is_management_allowed() === true) { + echo '
'; + echo '
'; + html_print_input_hidden('new', 1); + html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); + echo '
'; + echo '
'; +} -echo '
'; -echo '
'; -html_print_input_hidden('new', 1); -html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"'); -echo '
'; -echo '
'; enterprise_hook('close_meta_frame'); ?> diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index ed691af533..4b1995cd5e 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -47,6 +47,39 @@ require_once $config['homedir'].'/include/functions_categories.php'; enterprise_include_once('meta/include/functions_components_meta.php'); require_once $config['homedir'].'/include/functions_component_groups.php'; +// Header. +if (defined('METACONSOLE')) { + $sec = 'advanced'; + + $id_modulo = (int) get_parameter('id_component_type'); + $new_component = (bool) get_parameter('new_component'); +} else { + $id_modulo = (int) get_parameter('id_component_type'); + $new_component = (bool) get_parameter('new_component'); + if ($id_modulo == COMPONENT_TYPE_NETWORK || $id_modulo == COMPONENT_TYPE_PLUGIN || $id_modulo == COMPONENT_TYPE_WMI || $id_modulo == COMPONENT_TYPE_WIZARD) { + $help_header = 'local_module_tab'; + } else if (!$new_component) { + $help_header = 'network_component_tab'; + } else { + $help_header = 'network_component_tab'; + } + + ui_print_page_header( + __('Remote components'), + '', + false, + $help_header, + true, + '', + false, + 'modulemodal', + GENERIC_SIZE_TEXT, + '', + __('Configuration').' / '.__('Templates').' / '.__('Remote components') + ); + $sec = 'gmodules'; +} + $type = (int) get_parameter('type'); $name = (string) get_parameter('name'); $description = (string) get_parameter('description'); @@ -180,6 +213,68 @@ if ($duplicate_network_component) { $id = 0; } +// Wizard Common. +$module_enabled = get_parameter_switch('module_enabled'); +$module_protocol = get_parameter('module_protocol', 'snmp'); +$scan_type = (int) get_parameter('scan_type', SCAN_TYPE_FIXED); +$execution_type = (int) get_parameter('execution_type', EXECUTION_TYPE_NETWORK); +// Wizard SNMP. +$manufacturer_id = get_parameter('manufacturer_id'); +$name_oid = get_parameter('name_oid'); +$value = get_parameter('value_oid'); +// Other Wizard WMI fields. +$query_filter = ''; +$wmi_class = get_parameter('wmi_class'); +$query_key_field = get_parameter('query_key_field'); +// Enabled Module. +$enabled = get_parameter_switch('enabled'); + +if ($id_modulo === COMPONENT_TYPE_WIZARD) { + // Wizard Common extra fields. + $macros = []; + + $macros['satellite_execution'] = get_parameter('satellite_execution_'.$module_protocol); + $macros['value_operation'] = get_parameter('value_operation_'.$module_protocol); + $macros['server_plugin'] = get_parameter('server_plugin_'.$module_protocol); + + if ($module_protocol === 'snmp') { + // If not select any manufacturer_id, there is 'all'. + if (empty($manufacturer_id) === true) { + $manufacturer_id = 'all'; + } + } else if ($module_protocol === 'wmi') { + // Wizard WMI Query filters. + $query_filter = []; + $query_filter['scan'] = get_parameter('query_filter_scan'); + $query_filter['execution'] = get_parameter('query_filter_execution'); + $query_filter['field'] = get_parameter('field_value_filter'); + $query_filter['key_string'] = get_parameter('key_string_filter'); + $query_filter = json_encode($query_filter); + } + + // Default extra field. + $extra_fields = [ 'extra_field_1' => '' ]; + // If Plugin execution is selected. + if ($execution_type === EXECUTION_TYPE_PLUGIN || $module_protocol === 'wmi') { + // Search all parameters received with extra_fields. + foreach ($_REQUEST as $parameter => $thisValue) { + // Extra fields (OIDs Macros or WMI Extra fields) + if (preg_match('/extra_field_'.$module_protocol.'_/', $parameter) !== 0) { + $tmpParameter = explode('_', $parameter); + $extra_fields['extra_field_'.$tmpParameter[3]] = get_parameter($parameter); + } + + // The plugin macros. + if (preg_match('/'.$module_protocol.'_field/', $parameter) !== 0) { + $macros[$parameter] = io_safe_input($thisValue); + } + } + + // All of macros saved in the same array. + $macros = json_encode(array_merge($extra_fields, $macros)); + } +} + $custom_string_1 = ''; $custom_string_2 = ''; $custom_string_3 = ''; @@ -210,7 +305,7 @@ if (defined('METACONSOLE')) { $sec = 'gmodules'; } -if ($type >= 15 && $type <= 18) { +if ($type >= MODULE_TYPE_REMOTE_SNMP && $type <= MODULE_TYPE_REMOTE_SNMP_PROC) { // New support for snmp v3. $tcp_send = $snmp_version; $plugin_user = $snmp3_auth_user; @@ -219,7 +314,7 @@ if ($type >= 15 && $type <= 18) { $custom_string_1 = $snmp3_privacy_method; $custom_string_2 = $snmp3_privacy_pass; $custom_string_3 = $snmp3_security_level; -} else if ($type >= 34 && $type <= 37) { +} else if ($type >= MODULE_TYPE_REMOTE_CMD && $type <= MODULE_TYPE_REMOTE_CMD_INC) { $tcp_send = $command_text; $custom_string_1 = $command_credential_identifier; $custom_string_2 = $command_os; @@ -275,7 +370,6 @@ if ($create_component) { 'post_process' => $post_process, 'unit' => $unit, 'wizard_level' => $wizard_level, - 'macros' => $macros, 'critical_instructions' => $critical_instructions, 'warning_instructions' => $warning_instructions, 'unknown_instructions' => $unknown_instructions, @@ -289,6 +383,17 @@ if ($create_component) { 'min_ff_event_critical' => $ff_event_critical, 'ff_type' => $ff_type, 'each_ff' => $each_ff, + 'manufacturer_id' => $manufacturer_id, + 'protocol' => $module_protocol, + 'scan_type' => $scan_type, + 'execution_type' => $execution_type, + 'value' => $value, + 'query_class' => $wmi_class, + 'query_key_field' => $query_key_field, + 'query_filters' => $query_filter, + 'name_oid' => $name_oid, + 'module_enabled' => $module_enabled, + 'enabled' => $enabled, ] ); } else { @@ -298,9 +403,17 @@ if ($create_component) { if ($id === false || !$id) { db_pandora_audit( 'Module management', - 'Fail try to create network component' + 'Fail try to create remote component' ); - ui_print_error_message(__('Could not be created')); + + if ($name_check !== false) { + // If name exists, advice about it. + ui_print_error_message(__('Could not be created because the component exists')); + } else { + // Other cases. + ui_print_error_message(__('Could not be created')); + } + include_once 'godmode/modules/manage_network_components_form.php'; return; } @@ -356,7 +469,6 @@ if ($update_component) { 'post_process' => $post_process, 'unit' => $unit, 'wizard_level' => $wizard_level, - 'macros' => $macros, 'critical_instructions' => $critical_instructions, 'warning_instructions' => $warning_instructions, 'unknown_instructions' => $unknown_instructions, @@ -370,6 +482,17 @@ if ($update_component) { 'min_ff_event_critical' => $ff_event_critical, 'ff_type' => $ff_type, 'each_ff' => $each_ff, + 'manufacturer_id' => $manufacturer_id, + 'protocol' => $module_protocol, + 'scan_type' => $scan_type, + 'execution_type' => $execution_type, + 'value' => $value, + 'query_class' => $wmi_class, + 'query_key_field' => $query_key_field, + 'query_filters' => $query_filter, + 'name_oid' => $name_oid, + 'module_enabled' => $module_enabled, + 'enabled' => $enabled, ] ); } else { @@ -559,11 +682,6 @@ foreach ($component_groups as $component_group_key => $component_group_val) { ); } } - - // Only show component groups with local components. - if ($num_components == 0 && $num_components_childs == 0) { - unset($component_groups[$component_group_key]); - } } $table->data[0][1] = html_print_select( @@ -665,14 +783,16 @@ $table->head['checkbox'] = html_print_checkbox( false ); $table->head[0] = __('Module name'); -$table->head[1] = __('Type'); +$table->head[1] = __('Server'); +$table->head[2] = __('Type'); $table->head[3] = __('Description'); $table->head[4] = __('Group'); $table->head[5] = __('Max/Min'); $table->head[6] = __('Action'); $table->size = []; $table->size['checkbox'] = '20px'; -$table->size[1] = '75px'; +$table->size[1] = '40px'; +$table->size[2] = '50px'; $table->size[6] = '80px'; $table->align[6] = 'left'; $table->data = []; @@ -698,7 +818,6 @@ foreach ($components as $component) { $data[0] = ''; $data[0] .= io_safe_output($component['name']); $data[0] .= ''; - $data[1] = ui_print_moduletype_icon($component['type'], true); switch ($component['id_modulo']) { case MODULE_NETWORK: $data[1] .= html_print_image( @@ -724,11 +843,20 @@ foreach ($components as $component) { ); break; + case MODULE_WIZARD: + $data[1] .= html_print_image( + 'images/wand.png', + true, + ['title' => __('Wizard module')] + ); + break; + default: // Not possible. break; } + $data[2] = ui_print_moduletype_icon($component['type'], true); $data[3] = "".mb_strimwidth(io_safe_output($component['description']), 0, 60, '...').''; $data[4] = network_components_get_group_name($component['id_group']); $data[5] = $component['max'].' / '.$component['min']; @@ -777,9 +905,10 @@ echo '
'; html_print_input_hidden('new_component', 1); html_print_select( [ - 2 => __('Create a new network component'), - 4 => __('Create a new plugin component'), - 6 => __('Create a new WMI component'), + COMPONENT_TYPE_NETWORK => __('Create a new network component'), + COMPONENT_TYPE_PLUGIN => __('Create a new plugin component'), + COMPONENT_TYPE_WMI => __('Create a new WMI component'), + COMPONENT_TYPE_WIZARD => __('Create a new wizard component'), ], 'id_component_type', '', diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 53a4edbed1..2a63068b8d 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -110,56 +110,69 @@ if ($create_network_from_module) { if (isset($id)) { $component = network_components_get_network_component((int) $id); if ($component !== false) { - $id_component_type = $component['id_modulo']; - $name = $component['name']; - $type = $component['type']; - $description = $component['description']; - $max = $component['max']; - $min = $component['min']; - $module_interval = $component['module_interval']; - $tcp_port = $component['tcp_port']; - $tcp_rcv = $component['tcp_rcv']; - $tcp_send = $component['tcp_send']; - $snmp_community = $component['snmp_community']; - $snmp_oid = $component['snmp_oid']; - $id_module_group = $component['id_module_group']; - $id_group = $component['id_group']; - $id_plugin = $component['id_plugin']; - $plugin_user = $component['plugin_user']; - $plugin_pass = io_output_password($component['plugin_pass']); - $plugin_parameter = $component['plugin_parameter']; - $macros = $component['macros']; - $max_timeout = $component['max_timeout']; - $max_retries = $component['max_retries']; - $dynamic_interval = $component['dynamic_interval']; - $dynamic_max = $component['dynamic_max']; - $dynamic_min = $component['dynamic_min']; - $dynamic_two_tailed = $component['dynamic_two_tailed']; - $min_warning = $component['min_warning']; - $max_warning = $component['max_warning']; - $str_warning = $component['str_warning']; - $max_critical = $component['max_critical']; - $min_critical = $component['min_critical']; - $str_critical = $component['str_critical']; - $ff_event = $component['min_ff_event']; - $history_data = $component['history_data']; - $post_process = $component['post_process']; - $unit = $component['unit']; - $wizard_level = $component['wizard_level']; - $critical_instructions = $component['critical_instructions']; - $warning_instructions = $component['warning_instructions']; - $unknown_instructions = $component['unknown_instructions']; - $critical_inverse = $component['critical_inverse']; - $warning_inverse = $component['warning_inverse']; - $id_category = $component['id_category']; - $tags = $component['tags']; - $ff_event_normal = $component['min_ff_event_normal']; - $ff_event_warning = $component['min_ff_event_warning']; - $ff_event_critical = $component['min_ff_event_critical']; - $ff_type = $component['ff_type']; - $each_ff = $component['each_ff']; + $id_component_type = $component['id_modulo']; + $name = $component['name']; + $type = $component['type']; + $description = $component['description']; + $max = $component['max']; + $min = $component['min']; + $module_interval = $component['module_interval']; + $tcp_port = $component['tcp_port']; + $tcp_rcv = $component['tcp_rcv']; + $tcp_send = $component['tcp_send']; + $snmp_community = $component['snmp_community']; + $snmp_oid = $component['snmp_oid']; + $id_module_group = $component['id_module_group']; + $id_group = $component['id_group']; + $id_plugin = $component['id_plugin']; + $plugin_user = $component['plugin_user']; + $plugin_pass = io_output_password($component['plugin_pass']); + $plugin_parameter = $component['plugin_parameter']; + $macros = $component['macros']; + $max_timeout = $component['max_timeout']; + $max_retries = $component['max_retries']; + $dynamic_interval = $component['dynamic_interval']; + $dynamic_max = $component['dynamic_max']; + $dynamic_min = $component['dynamic_min']; + $dynamic_two_tailed = $component['dynamic_two_tailed']; + $min_warning = $component['min_warning']; + $max_warning = $component['max_warning']; + $str_warning = $component['str_warning']; + $max_critical = $component['max_critical']; + $min_critical = $component['min_critical']; + $str_critical = $component['str_critical']; + $ff_event = $component['min_ff_event']; + $history_data = $component['history_data']; + $post_process = $component['post_process']; + $unit = $component['unit']; + $wizard_level = $component['wizard_level']; + $critical_instructions = $component['critical_instructions']; + $warning_instructions = $component['warning_instructions']; + $unknown_instructions = $component['unknown_instructions']; + $critical_inverse = $component['critical_inverse']; + $warning_inverse = $component['warning_inverse']; + $id_category = $component['id_category']; + $tags = $component['tags']; + $ff_event_normal = $component['min_ff_event_normal']; + $ff_event_warning = $component['min_ff_event_warning']; + $ff_event_critical = $component['min_ff_event_critical']; + $ff_type = $component['ff_type']; + $each_ff = $component['each_ff']; + $manufacturer_id = $component['manufacturer_id']; + $module_protocol = $component['protocol']; + $scan_type = $component['scan_type']; + $execution_type = $component['execution_type']; + $value = $component['value']; + $wmi_class = $component['query_class']; + $query_key_field = $component['query_key_field']; + $query_Key_wmi = $component['key_string']; + $name_oid = $component['name_oid']; + $value_oid = $component['value_oid']; + $query_filter = $component['query_filters']; + $module_enabled = $component['module_enabled']; + $enabled = $component['enabled']; - if ($type >= 15 && $type <= 18) { + if ($type >= MODULE_TYPE_REMOTE_SNMP && $type <= MODULE_TYPE_REMOTE_SNMP_PROC) { // New support for snmp v3. $snmp_version = $component['tcp_send']; $snmp3_auth_user = $component['plugin_user']; @@ -170,7 +183,7 @@ if (isset($id)) { $component['custom_string_2'] ); $snmp3_security_level = $component['custom_string_3']; - } else if ($type >= 34 && $type <= 37) { + } else if ($type >= MODULE_TYPE_REMOTE_CMD && $type <= MODULE_TYPE_REMOTE_CMD_INC) { $command_text = $component['tcp_send']; $command_credential_identifier = $component['custom_string_1']; $command_os = $component['custom_string_2']; @@ -192,7 +205,7 @@ if (isset($id)) { $tcp_send = ''; $snmp_community = ''; $id_module_group = ''; - if ($id_component_type == 6) { + if ($id_component_type == COMPONENT_TYPE_WMI) { $id_group = 14; } else { $id_group = ''; @@ -238,28 +251,67 @@ if (isset($id)) { $command_text = ''; $command_os = 'inherited'; $command_credential_identifier = ''; + + $macros = ''; + $manufacturer_id = ''; + $module_protocol = 'snmp'; + $scan_type = SCAN_TYPE_FIXED; + $execution_type = EXECUTION_TYPE_NETWORK; + $value = ''; + $wmi_class = ''; + $query_key_field = ''; + $query_Key_wmi = ''; + $name_oid = ''; + $value_oid = ''; + $query_filter = ''; + $module_enabled = true; + $enabled = true; } } $table = new stdClass(); -if ($id_component_type == 6) { + +/** + * Common function for adding rows to main table + * + * @param array $row Array with the data for add. + * @param mixed $id If added, the DOM id for this block. + * + * @return void + */ +function push_table_row($row, $id=false) +{ + global $table; + + if ($id) { + $data = [$id => $row]; + } else { + $data = [$row]; + } + + $table->data = array_merge($table->data, $data); +} + + +$remote_components_path = $config['homedir'].'/godmode/modules/'; +if ($id_component_type == COMPONENT_TYPE_WMI) { $categories = [ 0, 1, 2, ]; - include $config['homedir'].'/godmode/modules/manage_network_components_form_common.php'; - include $config['homedir'].'/godmode/modules/manage_network_components_form_wmi.php'; -} else if ($id_component_type == 4) { + include $remote_components_path.'manage_network_components_form_common.php'; + include $remote_components_path.'manage_network_components_form_wmi.php'; +} else if ($id_component_type == COMPONENT_TYPE_PLUGIN) { $categories = [ 0, 1, 2, ]; - include $config['homedir'].'/godmode/modules/manage_network_components_form_common.php'; - include $config['homedir'].'/godmode/modules/manage_network_components_form_plugin.php'; -} else if ($id_component_type == 2 || $create_network_from_module) { + include $remote_components_path.'manage_network_components_form_common.php'; + include $remote_components_path.'manage_network_components_form_plugin.php'; +} else if ($id_component_type == COMPONENT_TYPE_WIZARD) { $categories = [ 3, 4, @@ -269,8 +321,19 @@ if ($id_component_type == 6) { $categories[] = 10; } - include $config['homedir'].'/godmode/modules/manage_network_components_form_common.php'; - include $config['homedir'].'/godmode/modules/manage_network_components_form_network.php'; + include $remote_components_path.'manage_network_components_form_wizard.php'; +} else if ($id_component_type == COMPONENT_TYPE_NETWORK || $create_network_from_module) { + $categories = [ + 3, + 4, + 5, + ]; + if (enterprise_installed()) { + $categories[] = 10; + } + + include $remote_components_path.'manage_network_components_form_common.php'; + include $remote_components_path.'manage_network_components_form_network.php'; } else { return; } @@ -291,15 +354,10 @@ if (defined('METACONSOLE')) { $table->headstyle[0] = 'text-align: center'; } -$table->colspan['description'][1] = 3; -$data = []; -$data[0] = __('Description'); -$data[1] = html_print_textarea('description', 2, 65, $description, '', true); -push_table_row($data, 'description'); - html_print_table($table); echo '
'; +html_print_button(__('Go back'), 'go_back', false, 'history.go(-1);', 'class="sub cancel"'); html_print_input_hidden('id_component_type', $id_component_type); if ($id) { html_print_input_hidden('update_component', 1); diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index 7efe7f21ba..35c5648db2 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -23,23 +23,6 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], return; } -include_javascript_d3(); - - -function push_table_row($row, $id=false) -{ - global $table; - - if ($id) { - $data = [$id => $row]; - } else { - $data = [$row]; - } - - $table->data = array_merge($table->data, $data); -} - - $table->id = 'network_component'; $table->width = '100%'; $table->class = 'databox'; @@ -323,7 +306,11 @@ $table->data[12][0] = __('Unknown instructions').ui_print_help_tip(__('Instructi $table->data[12][1] = html_print_textarea('unknown_instructions', 2, 65, $unknown_instructions, '', true); $table->colspan[12][1] = 3; -$next_row = 13; +$table->data[13][0] = __('Description'); +$table->data[13][1] = html_print_textarea('description', 2, 65, $description, '', true); +$table->colspan[13][1] = 3; + +$next_row = 14; if (check_acl($config['id_user'], 0, 'PM')) { $table->data[$next_row][0] = __('Category'); diff --git a/pandora_console/godmode/modules/manage_network_components_form_network.php b/pandora_console/godmode/modules/manage_network_components_form_network.php index 979b6d74b4..8382578681 100755 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -180,15 +180,28 @@ $data[1] = html_print_extended_select_for_post_process( 'post_process', $post_process, '', - __('Empty'), + '', '0', false, true, false, true ); -$data[2] = ''; -$data[3] = ''; + +$data[2] = __('Name OID').' '.ui_print_help_icon('xxx', true); +$data[3] = html_print_input_text_extended( + 'name_oid', + $name_oid, + 'name_oid', + '', + 30, + 10000, + '', + '', + '', + true +); + push_table_row($data, 'field_process'); // Advanced stuff. diff --git a/pandora_console/godmode/modules/manage_network_components_form_wizard.php b/pandora_console/godmode/modules/manage_network_components_form_wizard.php new file mode 100644 index 0000000000..c428e206f4 --- /dev/null +++ b/pandora_console/godmode/modules/manage_network_components_form_wizard.php @@ -0,0 +1,839 @@ + $field) { + // Avoid the not extra fields. + if (preg_match('/extra_field_/', $k) === 0) { + continue; + } else { + $cntFields++; + } + + // Get the number of extra field. + $tmpExtraField = explode('_', $k); + $idField = $tmpExtraField[2]; + + if ($protocol === 'snmp') { + $extraFieldText = '_oid_'.$idField.'_'; + $rowId = 'pluginRow-'.$protocol.'Row'; + } else if ($protocol === 'wmi') { + $extraFieldText = '_field_wmi_'.$idField.'_'; + $rowId = $protocol.'Row'; + } + + $data = []; + $data[0] = '
'.$extraFieldText.'
'; + $data[1] = html_print_input_text_extended( + 'extra_field_'.$protocol.'_'.$idField, + $field, + 'extra_field_'.$protocol.'_'.$idField, + '', + 100, + 10000, + '', + '', + '', + true + ); + + $table->colspan['oid-list-'.$rowId.'-row-'.$idField][1] = 3; + push_table_row($data, 'oid-list-'.$rowId.'-row-'.$idField); + } + + $data = []; + $image_add = html_print_div( + [ + 'id' => 'add_field_button', + 'class' => 'float-right clickable', + 'content' => html_print_image( + 'images/add.png', + true, + [ + 'title' => __('Add a macro oid'), + 'onclick' => 'manageComponentFields(\'add\', \'oid-list-'.$rowId.'\');', + ] + ), + ], + true + ); + + $image_del = html_print_div( + [ + 'id' => 'del_field_button', + 'class' => 'float-right', + 'style' => $cntFields <= 1 ? 'opacity: 0.5;' : '', + 'content' => html_print_image( + 'images/cross.png', + true, + [ + 'title' => __('Remove last macro oid'), + 'onclick' => 'manageComponentFields(\'del\', \'oid-list-'.$rowId.'\');', + 'style' => 'margin-left: 1em;', + ] + ), + ], + true + ); + + $data[0] = html_print_div( + [ + 'id' => 'combo_oid_button', + 'content' => $image_del.$image_add, + ], + true + ); + + push_table_row($data, 'manage-oid-list-'.$rowId); +} + + +// Get the data. +$module_type_list = [ + MODULE_TYPE_NUMERIC => __('Numeric'), + MODULE_TYPE_INCREMENTAL => __('Incremental'), + MODULE_TYPE_BOOLEAN => __('Boolean'), + MODULE_TYPE_ALPHANUMERIC => __('Alphanumeric'), +]; + +$module_protocol_list = [ + 'snmp' => 'SNMP', + 'wmi' => 'WMI', +]; + +$scan_type_list = [ + SCAN_TYPE_FIXED => 'Fixed', + SCAN_TYPE_DYNAMIC => 'Dynamic', +]; + +$execution_type_list = [ + EXECUTION_TYPE_NETWORK => 'Network', + EXECUTION_TYPE_PLUGIN => 'Plugin', +]; +// Establish module type value. +switch ($type) { + case MODULE_TYPE_REMOTE_SNMP: + case MODULE_TYPE_GENERIC_DATA: + $module_type = MODULE_TYPE_NUMERIC; + break; + + case MODULE_TYPE_REMOTE_SNMP_INC: + case MODULE_TYPE_GENERIC_DATA_INC: + $module_type = MODULE_TYPE_INCREMENTAL; + break; + + case MODULE_TYPE_REMOTE_SNMP_STRING: + case MODULE_TYPE_GENERIC_DATA_STRING: + $module_type = MODULE_TYPE_ALPHANUMERIC; + break; + + case MODULE_TYPE_REMOTE_SNMP_PROC: + case MODULE_TYPE_GENERIC_PROC: + $module_type = MODULE_TYPE_BOOLEAN; + break; + + default: + $module_type = MODULE_TYPE_NUMERIC; + break; +} + +if (empty($query_filter) === false) { + $query_filter = json_decode($query_filter, true); +} + +$component_group_list = network_components_get_groups(); + +// List of server plugins related with Wizard SNMP. +$server_plugin_data = []; +$server_plugin_list = []; +$plugins = db_get_all_rows_sql( + 'SELECT id, description, execute, name, macros, parameters FROM tplugin' +); +foreach ($plugins as $plugin) { + $server_plugin_list[$plugin['id']] = $plugin['name']; + $server_plugin_data[$plugin['id']] = [ + 'description' => $plugin['description'], + 'name' => $plugin['name'], + 'parameters' => $plugin['parameters'], + 'macros' => array_reverse(json_decode($plugin['macros'], true)), + 'execute' => $plugin['execute'], + 'macrosElement' => base64_encode(json_encode(io_safe_output(json_decode($macros, true)))), + ]; +} + +// Store the plugin data for JS managing in JSON format. +$hiddenPluginServers = ''; +foreach ($server_plugin_data as $index => $plugin) { + // Description can have special chars that would crash Javascript. + $plugin['description'] = mb_strimwidth(io_safe_output($plugin['description']), 0, 80, '...'); + $hiddenPluginServers .= html_print_input_hidden( + 'server_plugin_data_'.$index, + json_encode(io_safe_input($plugin)) + ); +} + +// Generate needed OID macros. +$extra_fields_names = []; +foreach ($extra_fields as $k => $field) { + $extra_fields_names[$k] = $module_protocol === 'snmp' ? '_oid_'.$k.'_' : $k; +} + +// Convert the string DB format of macros to JSON. +$macros = json_decode($macros); +// Only for extra field generate purposes. +if (empty($macros) === true) { + $macros = ['extra_field_1' => '']; +} + +// +// Construction of form. +// +$table->id = 'network_component'; +$table->width = '100%'; +$table->class = 'databox'; +$table->style = []; +$table->style[0] = 'font-weight: bold'; +$table->style[2] = 'font-weight: bold'; +$table->colspan = []; +if (!enterprise_installed()) { + $table->colspan[0][1] = 3; +} + +$table->data = []; + +$data = []; +$data[0] = __('Enabled'); +$data[1] = html_print_checkbox_switch( + 'enabled', + 1, + $enabled, + true, + false, + '', + false +); + +$data[2] = __('Add by default'); +$data[3] = html_print_checkbox_switch( + 'module_enabled', + 1, + $module_enabled, + true, + false, + '', + false +); + +push_table_row($data, 'module-enable-row'); + +$data = []; +$data[0] = __('Module name'); +$data[1] = html_print_input_text_extended( + 'name', + $name, + 'name', + '', + 50, + 255, + '', + '', + '', + true +); + +$data[2] = __('Module protocol'); +$data[3] = html_print_select( + $module_protocol_list, + 'module_protocol', + $module_protocol, + 'manageVisibleFields()', + '', + '', + true, + false, + false, + '' +).' '.html_print_image( + 'images/'.$module_protocol.'.png', + true, + [ + 'title' => strtoupper($module_protocol).' '.__('Protocol'), + 'class' => 'add_comments_button', + 'style' => 'width: 18px;', + 'id' => 'module_protocol_symbol', + ] +); +$type = 4; +$data[4] = html_print_input_hidden('type', $type, true); + +push_table_row($data, 'module-name-type-row'); + +$data = []; + +$data[0] = __('Name OID'); +$data[1] = html_print_input_text('name_oid', $name_oid, '', 50, 255, true); + +$data[2] = __('Manufacturer ID'); +$data[3] = html_print_select_from_sql( + 'SELECT manufacturer as `id`, manufacturer FROM tpen GROUP BY manufacturer', + 'manufacturer_id', + $manufacturer_id, + '', + 'All', + '', + true, + false, + false, + '' +); + +push_table_row($data, 'manufacturer-nameOID-snmpRow-row'); + +$data = []; + +$data[0] = __('Module type'); +$data[1] = html_print_select( + $module_type_list, + 'module_type', + $module_type, + 'changeModuleType()', + '', + '', + true, + false, + false, + '' +); + +$data[2] = __('Component Group'); +$data[3] = html_print_select( + $component_group_list, + 'id_group', + $id_group, + '', + '', + '', + true, + false, + false, + '' +); + +push_table_row($data, 'moduleType-blockName-row'); + +$data = []; + +$data[0] = __('Module unit'); +$data[1] = html_print_extended_select_for_unit( + 'unit', + $unit, + '', + '', + '0', + false, + true, + false, + false +); + +push_table_row($data, 'moduleUnit-blockName-row'); + +$data = []; +$data[0] = __('Warning'); +// Warning interval values. +$data[1] = ''; +$data[1] .= ''.__('Min.').' '; +$data[1] .= html_print_input_text('min_warning', $min_warning, '', 5, 15, true); +$data[1] .= '
'.__('Max.').' '; +$data[1] .= html_print_input_text('max_warning', $max_warning, '', 5, 15, true); +$data[1] .= '
'; +// Warning string values. +$data[1] .= ''.__('String').'  '; +$data[1] .= html_print_input_text('str_warning', $str_warning, '', 5, 1024, true).''; +// Warning inverse values. +$data[1] .= '
'.__('Inverse interval').' '; +$data[1] .= html_print_checkbox('warning_inverse', 1, $warning_inverse, true); + +$data[2] = ' '; +$table->colspan['warning-svg-row'][2] = 2; +$table->rowspan['warning-svg-row'][2] = 3; + +push_table_row($data, 'warning-svg-row'); + +$data = []; +$data[0] = __('Critical'); +// Critical interval values. +$data[1] = ''; +$data[1] .= ''.__('Min.').' '; +$data[1] .= html_print_input_text( + 'min_critical', + $min_critical, + '', + 5, + 15, + true +); +$data[1] .= '
'.__('Max.').' '; +$data[1] .= html_print_input_text( + 'max_critical', + $max_critical, + '', + 5, + 15, + true +); +$data[1] .= '
'; +// Critical string values. +$data[1] .= ''.__('String').'  '; +$data[1] .= html_print_input_text('str_critical', $str_critical, '', 5, 1024, true).''; +// Critical inverse values. +$data[1] .= '
'.__('Inverse interval').' '; +$data[1] .= html_print_checkbox('critical_inverse', 1, $critical_inverse, true); + +push_table_row($data, 'critical-row'); + +$data = []; +$data[0] = __('Description'); +$data[1] = html_print_textarea('description', 2, 65, $description, '', true); +$table->colspan['module-description-row'][1] = 3; + +push_table_row($data, 'module-description-row'); + +$data = []; +$data[0] = __('Scan Type'); +$data[1] = html_print_select( + $scan_type_list, + 'scan_type', + $scan_type, + '', + '', + '', + true, + false, + false, + '' +); + +$data[2] = __('Execution type'); +$data[3] = html_print_select( + $execution_type_list, + 'execution_type', + $execution_type, + 'manageVisibleFields()', + '', + '', + true, + false, + false, + '' +); + +push_table_row($data, 'scan-execution-row'); + +// +// SNMP rows. +// +$data = []; +$data[0] = __('Value OID'); +$data[1] = html_print_input_text_extended( + 'value_oid', + (string) $value, + 'value_oid', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['value-oid-networkRow-snmpRow'][1] = 3; +push_table_row($data, 'value-oid-networkRow-snmpRow'); + +$data = []; +$data[0] = __('Macros OID'); + +push_table_row($data, 'title-oid-macros-pluginRow-snmpRow'); + +// Generation of extra fields needed. +generateExtraFields($macros, 'snmp'); + +$data = []; +$data[0] = __('Value operation'); +$data[1] = html_print_input_text_extended( + 'value_operation_snmp', + $macros->value_operation, + 'value_operation_snmp', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['value-operation-pluginRow-snmpRow'][1] = 3; +push_table_row($data, 'value-operation-pluginRow-snmpRow'); + +$data = []; +$data[0] = __('Satellite execution'); +$data[1] = html_print_input_text_extended( + 'satellite_execution_snmp', + $macros->satellite_execution, + 'satellite_execution_snmp', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['satellite-execution-pluginRow-snmpRow'][1] = 3; +push_table_row($data, 'satellite-execution-pluginRow-snmpRow'); + +$data = []; +$data[0] = __('Server plugin'); +$data[1] = html_print_select( + $server_plugin_list, + 'server_plugin_snmp', + $macros->server_plugin, + 'changePlugin()', + '', + '', + true, + false, + false, + '' +).'   '; + +push_table_row($data, 'server-plugin-pluginRow-snmpRow'); + +// The creation of this fields will be dynamically. +$data = []; +$data[0] = 'field0'; +$data[1] = html_print_input_text_extended( + 'field0_snmp_field', + '', + 'field0_snmp_fields', + '', + 30, + 255, + '', + '', + '', + true +); + +push_table_row($data, 'plugin-snmp-fields-dynamicMacroRow-pluginRow-snmpRow-0'); + +// +// WMI Fields. +// +$data = []; +$data[0] = __('WMI class'); +$data[1] = html_print_input_text_extended( + 'wmi_class', + $wmi_class, + 'wmi_class', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['wmi-class-wmiRow'][1] = 3; +push_table_row($data, 'wmi-class-wmiRow'); + +$data = []; +$data[0] = __('Query key field').' (_field_wmi_0_)'; +$data[1] = html_print_input_text_extended( + 'query_key_field', + $query_key_field, + 'query_key_field', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['query-key-field-wmiRow'][1] = 3; +push_table_row($data, 'query-key-field-wmiRow'); + +$data = []; +$data[0] = __('Query extra fields'); + +push_table_row($data, 'title-extra-field-wmiRow'); + +// Generation of extra fields needed. +generateExtraFields($macros, 'wmi'); + +$data = []; +$data[0] = __('Query filters'); +$table->style[0] = 'font-weight: bold;'; + +push_table_row($data, 'title-query-filters-wmiRow'); + +$data = []; +$data[0] = '
'.__('Scan').'
'; +$data[1] = html_print_input_text_extended( + 'query_filter_scan', + $query_filter['scan'], + 'query_filter_scan', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['query-filter-scan-wmiRow'][1] = 3; +push_table_row($data, 'query-filter-scan-wmiRow'); + +if ($execution_type == EXECUTION_TYPE_NETWORK) { + $data = []; + $data[0] = '
'.__('Execution').'
'; + $data[1] = html_print_input_text_extended( + 'query_filter_execution', + $query_filter['execution'], + 'query_filter_execution', + '', + 100, + 10000, + '', + '', + '', + true + ); + $table->colspan['query-filter-execution-wmiRow'][1] = 3; + push_table_row($data, 'query-filter-execution-wmiRow'); +} + + +$data = []; +$data[0] = __('Field value'); +$data[1] = html_print_input_number( + [ + 'name' => 'field_value_filter', + 'value' => $query_filter['field'], + 'id' => 'field_value_filter', + 'min' => 0, + 'return' => true, + ] +); + +$data[2] = __('Key string'); +$data[3] = html_print_input_text_extended( + 'key_string_filter', + $query_filter['key_string'], + 'key_string_filter', + '', + 30, + 255, + '', + '', + '', + true +); + +push_table_row($data, 'filters-list-fields-networkRow-wmiRow'); + +$data = []; +$data[0] = __('Value operation'); +$data[1] = html_print_input_text_extended( + 'value_operation_wmi', + $macros->value_operation, + 'value_operation_wmi', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['value-operation-pluginRow-wmiRow'][1] = 3; +push_table_row($data, 'value-operation-pluginRow-wmiRow'); + +$data = []; +$data[0] = __('Satellite execution'); +$data[1] = html_print_input_text_extended( + 'satellite_execution_wmi', + $macros->satellite_execution, + 'satellite_execution_wmi', + '', + 100, + 10000, + '', + '', + '', + true +); +$table->colspan['satellite-execution-pluginRow-wmiRow'][1] = 3; +push_table_row($data, 'satellite-execution-pluginRow-wmiRow'); + +$data = []; +$data[0] = __('Server plugin'); +$data[1] = html_print_select( + $server_plugin_list, + 'server_plugin_wmi', + $macros->server_plugin, + 'changePlugin()', + '', + '', + true, + false, + false, + '' +).'   '; + +push_table_row($data, 'server-plugin-pluginRow-wmiRow'); + +// The creation of this fields will be dynamically. +$data = []; +$data[0] = 'field0'; +$data[1] = html_print_input_text_extended( + 'field0_wmi_field', + '', + 'field0_wmi_fields', + '', + 30, + 255, + '', + '', + '', + true +); + +push_table_row($data, 'plugin-wmi-fields-dynamicMacroRow-pluginRow-wmiRow-0'); + +?> + + \ No newline at end of file diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index d69729eac9..1227494e91 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -190,8 +190,20 @@ if ($editGraph) { $weights = implode(',', $weight_array); } + + +$count_module_array = count($module_array); +if ($count_module_array > 10) { + ui_print_warning_message( + __( + 'The maximum number of items in a chart is 10. You have %s elements, only first 10 will be displayed.', + $count_module_array + ) + ); +} + // Modules table. -if (count($module_array) > 0) { +if ($count_module_array > 0) { echo ""; echo ' @@ -202,7 +214,7 @@ if (count($module_array) > 0) { '; $color = 0; - for ($a = 0; $a < count($module_array); $a++) { + for ($a = 0; $a < $count_module_array; $a++) { // Calculate table line color. if ($color == 1) { $tdcolor = 'datos'; diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 70ac08216e..e6e0bcb862 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -164,9 +164,9 @@ echo ''; echo "'; echo "'; -echo "'; +echo "'; +echo "'; echo "'; echo "'; @@ -175,6 +175,7 @@ echo "'; echo "'; echo "'; +echo "'; echo ''; echo '
'.__('P.').''.__('Delete').' '.__('Sort').'
".__('Percentil').'".html_print_checkbox('percentil', 1, $percentil, true).'
".__('Equalize maximum thresholds').''; - html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, false, false, '', false); -echo '
".__('Equalize maximum thresholds').'".html_print_checkbox('threshold', CUSTOM_GRAPH_BULLET_CHART_THRESHOLD, $check, true, false, '', false); +echo '
".__('Add summatory series').'".html_print_checkbox('summatory_series', 1, $summatory_series, true)." ".__('Add average series').'
".__('Modules and series').'".html_print_checkbox('modules_series', 1, $modules_series, true).'".__('Show full scale graph (TIP)').'".html_print_checkbox('fullscale', 1, $fullscale, true).'
'; @@ -190,9 +191,9 @@ echo ''; echo ' @@ -779,4 +4907,6 @@ class AgentWizard extends HTML echo $str; return $str; } -} \ No newline at end of file + + +} diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 3c94816146..d881418611 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -226,6 +226,19 @@ class ConsoleSupervisor * NOTIF.HAMASTER.MESSAGE */ $this->checkHaStatus(); + + /* + * Check if the Pandora Console log + * file remains in old location. + */ + $this->checkPandoraConsoleLogOldLocation(); + + /* + * Check if the audit log file + * remains in old location. + */ + $this->checkAuditLogOldLocation(); + } @@ -463,6 +476,17 @@ class ConsoleSupervisor $this->checkHaStatus(); } + /* + * Check if the audit log file + * remains in old location. + */ + $this->checkAuditLogOldLocation(); + + /* + Check if AllowOverride is None or All. + */ + $this->checkAllowOverrideEnabled(); + } @@ -1197,6 +1221,9 @@ class ConsoleSupervisor // At this point there's no servers with issues. $this->cleanNotifications('NOTIF.SERVER.STATUS%'); return; + } else { + // Clean notifications. Only show notif for down servers. + $this->cleanNotifications('NOTIF.SERVER.STATUS%'); } foreach ($servers as $server) { @@ -2255,8 +2282,8 @@ class ConsoleSupervisor ui_get_full_url(false) ); $message_conf_cron .= ENTERPRISE_DIR.'/'.EXTENSIONS_DIR; - $message_conf_cron .= '/cron/cron.php >> '; - $message_conf_cron .= $config['homedir'].'/pandora_console.log'; + $message_conf_cron .= '/cron/cron.php >> '; + $message_conf_cron .= $config['homedir'].'/log/cron.log'; } if (isset($config['cron_last_run']) === true) { @@ -2485,4 +2512,77 @@ class ConsoleSupervisor } + /* + * Check if Pandora console log file remains in old location. + * + * @return void + */ + public function checkPandoraConsoleLogOldLocation() + { + global $config; + + if (file_exists($config['homedir'].'/pandora_console.log')) { + $title_pandoraconsole_old_log = __( + 'Pandora FMS console log file changed location', + $config['homedir'] + ); + $message_pandoraconsole_old_log = __( + 'Pandora FMS console log file has been moved to new location %s/log. Currently you have an outdated and inoperative version of this file at %s. Please, consider deleting it.', + $config['homedir'], + $config['homedir'] + ); + + $url = 'https://wiki.pandorafms.com/index.php?title=Pandora:QuickGuides_EN:General_Quick_Guide#Solving_problems._Where_to_look_and_who_to_ask'; + if ($config['language'] == 'es') { + $url = 'https://wiki.pandorafms.com/index.php?title=Pandora:QuickGuides_ES:Guia_Rapida_General#Soluci.C3.B3n_de_problemas._D.C3.B3nde_mirar.2C_a_qui.C3.A9n_preguntar'; + } + + $this->notify( + [ + 'type' => 'NOTIF.PANDORACONSOLE.LOG.OLD', + 'title' => __($title_pandoraconsole_old_log), + 'message' => __($message_pandoraconsole_old_log), + 'url' => $url, + ] + ); + } else { + $this->cleanNotifications('NOTIF.PANDORACONSOLE.LOG.OLD'); + } + } + + + /** + * Check if audit log file remains in old location. + * + * @return void + */ + public function checkAuditLogOldLocation() + { + global $config; + + if (file_exists($config['homedir'].'/audit.log')) { + $title_audit_old_log = __( + 'Pandora FMS audit log file changed location', + $config['homedir'] + ); + $message_audit_old_log = __( + 'Pandora FMS audit log file has been moved to new location %s/log. Currently you have an outdated and inoperative version of this file at %s. Please, consider deleting it.', + $config['homedir'], + $config['homedir'] + ); + + $this->notify( + [ + 'type' => 'NOTIF.AUDIT.LOG.OLD', + 'title' => __($title_audit_old_log), + 'message' => __($message_audit_old_log), + 'url' => '#', + ] + ); + } else { + $this->cleanNotifications('NOTIF.AUDIT.LOG.OLD'); + } + } + + } diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index bcf36551d7..82bf0487e3 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -1008,7 +1008,7 @@ class Diagnostics extends Wizard $pathErrLogs = '/var/log/pandora/pandora_server.error'; $errors = $this->getLogInfo($pathErrLogs); - $pathConsoleLogs = $config['homedir'].'/pandora_console.log'; + $pathConsoleLogs = $config['homedir'].'/log/console.log'; $console = $this->getLogInfo($pathConsoleLogs); $result = [ @@ -2079,7 +2079,7 @@ class Diagnostics extends Wizard ], 'text' => [ ui_print_error_message(__('Invalid cron task'), '', true), - ui_print_success_message(__('Cron task generated'), '', true), + ui_print_success_message(__('Sending of information has been processed'), '', true), ], ]; diff --git a/pandora_console/include/class/HTML.class.php b/pandora_console/include/class/HTML.class.php index 002c91f181..376afc4bfd 100644 --- a/pandora_console/include/class/HTML.class.php +++ b/pandora_console/include/class/HTML.class.php @@ -764,8 +764,10 @@ class HTML $output_head .= $data['pre-content']; } - $output_head .= '
'; + if (isset($data['form']) === true) { + $output_head .= ''; + } if ($return === false) { echo $output_head; diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index d9413521bb..a5f754866d 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -64,14 +64,22 @@ class Tree const TV_DEFAULT_AGENT_STATUS = -1; - public function __construct($type, $rootType='', $id=-1, $rootID=-1, $serverID=false, $childrenMethod='on_demand', $access='AR') - { + public function __construct( + $type, + $rootType='', + $id=-1, + $rootID=-1, + $serverID=false, + $childrenMethod='on_demand', + $access='AR', + $id_meta_server=0 + ) { $this->type = $type; $this->rootType = !empty($rootType) ? $rootType : $type; $this->id = $id; $this->rootID = !empty($rootID) ? $rootID : $id; $this->serverID = $serverID; - if (is_metaconsole()) { + if (is_metaconsole() && $id_meta_server == 0) { $this->serverName = metaconsole_get_server_by_id($serverID); } @@ -90,7 +98,7 @@ class Tree include_once $config['homedir'].'/include/functions_tags.php'; enterprise_include_once('include/functions_agents.php'); - if (is_metaconsole()) { + if (is_metaconsole() && $id_meta_server == 0) { enterprise_include_once('meta/include/functions_ui_meta.php'); } } diff --git a/pandora_console/include/class/TreeService.class.php b/pandora_console/include/class/TreeService.class.php index 38787e47f3..b9721b3eb0 100644 --- a/pandora_console/include/class/TreeService.class.php +++ b/pandora_console/include/class/TreeService.class.php @@ -1,32 +1,112 @@ 0) { + $this->metaID = $id_server_meta; + $this->serverID = $id_server_meta; + } + + parent::__construct( + $type, + $rootType, + $id, + $rootID, + $serverID, + $childrenMethod, + $access, + $id_server_meta + ); $this->L1fieldName = 'id_group'; $this->L1extraFields = [ @@ -41,25 +121,60 @@ class TreeService extends Tree $this->L2inner = 'LEFT JOIN tservice_element tse ON tse.id_agent = ta.id_agente'; - $this->L2condition = 'AND tse.id_service='.$this->id; + $this->L2condition = sprintf( + ' AND tse.id_service=%d AND tse.id_server_meta=0 ', + $this->id + ); } + /** + * Setter (propagate counters). + * + * @param boolean $value Set. + * + * @return void + */ public function setPropagateCounters($value) { $this->propagateCounters = (bool) $value; } + /** + * Set display all groups. + * + * @param boolean $value Set. + * + * @return void + */ public function setDisplayAllGroups($value) { $this->displayAllGroups = (bool) $value; } + /** + * Generates tree data. + * + * @return void + */ protected function getData() { + if (is_metaconsole() === true && $this->metaID > 0) { + // Impersonate node. + \enterprise_include_once('include/functions_metaconsole.php'); + \enterprise_hook( + 'metaconsole_connect', + [ + null, + $this->metaID, + ] + ); + $this->connectedToNode = true; + } + if ($this->id == -1) { $this->getFirstLevel(); } else if ($this->type == 'services') { @@ -67,9 +182,19 @@ class TreeService extends Tree } else if ($this->type == 'agent') { $this->getThirdLevel(); } + + if (is_metaconsole() === true && $this->metaID > 0) { + // Restore connection. + \enterprise_hook('metaconsole_restore_db'); + } } + /** + * Generates first level data. + * + * @return void + */ protected function getFirstLevel() { global $config; @@ -118,10 +243,13 @@ class TreeService extends Tree } + /** + * Retrieve root services. + * + * @return array Of root services. + */ protected function getProcessedServices() { - $fields = $this->getFirstLevelFields(); - $is_favourite = $this->getServiceFavouriteFilter(); if (users_can_manage_group_all('AR')) { @@ -131,29 +259,32 @@ class TreeService extends Tree } $sql = sprintf( - "SELECT t1.* - FROM tservice_element tss - RIGHT JOIN - (SELECT ts.id, ts.id_agent_module, ts.name, ts.name AS `alias`, ts.id AS `rootID`, - 'services' AS rootType, 'services' AS type, - 0 AS quiet, - SUM(if((tse.id_agent<>0), 1, 0)) AS `total_agents`, - SUM(if((tse.id_agente_modulo<>0), 1, 0)) AS `total_modules`, - SUM(if((tse.id_service_child<>0), 1, 0)) AS `total_services` - FROM tservice ts - LEFT JOIN tservice_element tse - ON ts.id=tse.id_service - WHERE - 1=1 - %s - %s - GROUP BY id - ) as t1 - ON tss.id_service_child = t1.id - WHERE tss.id_service_child IS NULL - ", - $groups_acl, - $is_favourite + 'SELECT + ts.id, + ts.id_agent_module, + ts.name, + ts.name as `alias`, + ts.id as `rootID`, + "services" as `rootType`, + "services" as `type`, + ts.quiet, + SUM(if((tse.id_agent<>0), 1, 0)) AS `total_agents`, + SUM(if((tse.id_agente_modulo<>0), 1, 0)) AS `total_modules`, + SUM(if((tse.id_service_child<>0), 1, 0)) AS `total_services`, + SUM(if((tse.rules != ""), 1, 0)) AS `total_dynamic` + FROM tservice ts + LEFT JOIN tservice_element tse + ON tse.id_service = ts.id + WHERE ts.id NOT IN ( + SELECT DISTINCT id_service_child + FROM tservice_element + WHERE id_server_meta = 0 + ) + %s + %s + GROUP BY ts.id', + $is_favourite, + $groups_acl ); $stats = db_get_all_rows_sql($sql); @@ -161,8 +292,13 @@ class TreeService extends Tree $services = []; foreach ($stats as $service) { - $services[$service['id']] = $this->getProcessedItem($services[$service['id']]); - if (($service['total_services'] + $service['total_agents'] + $service['total_modules']) > 0) { + $services[$service['id']] = $this->getProcessedItem( + $services[$service['id']] + ); + $n_items = ($service['total_services'] + $service['total_agents']); + $n_items += ($service['total_modules'] + $service['total_dynamic']); + + if ($n_items > 0) { $services[$service['id']]['searchChildren'] = 1; } else { $services[$service['id']]['searchChildren'] = 0; @@ -182,6 +318,13 @@ class TreeService extends Tree } + /** + * Retrieve first level fields. + * + * @deprecated 746. + * + * @return string With a first level fields. + */ protected function getFirstLevelFields() { $fields = []; @@ -190,187 +333,349 @@ class TreeService extends Tree } + /** + * Retrieves elements (second level) from selected rootID. + * + * @return void + */ protected function getSecondLevel() { - $data = []; - $data_agents = []; - $data_modules = []; - $data_services = []; + $service = new Service($this->id, true); - $sql = $this->getSecondLevelSql(); - $data_agents = db_process_sql($sql); + $output = []; + foreach ($service->children() as $item) { + $tmp = []; - if (empty($data_agents)) { - $data_agents = []; - } - - $this->processAgents($data_agents); - - foreach ($data_agents as $key => $agent) { - $data_agents[$key]['showEventsBtn'] = 1; - $data_agents[$key]['eventAgent'] = $agent['id']; - } - - $sql = $this->getSecondLevelModulesSql(); - $data_modules = db_process_sql($sql); - - if (empty($data_modules)) { - $data_modules = []; - } else { - foreach ($data_modules as $key => $module) { - switch ($module['estado']) { - case '0': - $module_status = 'ok'; - $module_title = 'NORMAL'; - break; - - case '1': - $module_status = 'critical'; - $module_title = 'CRITICAL'; - break; - - case '2': - $module_status = 'warning'; - $module_title = 'WARNING'; - break; - - case '3': - $module_status = 'down'; - $module_title = 'UNKNOWN'; - break; - - case '4': - $module_status = 'no_data'; - $module_title = 'NOT INITIALIZED'; - break; - - default: - $module_status = 'down'; - $module_title = 'UNKNOWN'; - break; - } - - $data_modules[$key]['statusImageHTML'] = ''.$module_title.' status.'; - $data_modules[$key]['showEventsBtn'] = 1; - $data_modules[$key]['eventModule'] = $module['id_agente_modulo']; - } - } - - $sql = $this->getSecondLevelServicesSql(); - $data_services = db_process_sql($sql); - - $service_stats = []; - - foreach ($data_services as $service) { - $service_stats[$service['id']]['id'] = (int) $service['id']; - $service_stats[$service['id']]['name'] = $service['name']; - $service_stats[$service['id']]['alias'] = $service['name']; - if (($service['total_services'] + $service['total_agents'] + $service['total_modules']) > 0) { - $service_stats[$service['id']]['searchChildren'] = 1; - } else { - $services[$service['id']]['searchChildren'] = 0; + if ($this->metaID > 0) { + $tmp['metaID'] = $this->metaID; + } else if ($item->id_server_meta() !== 0) { + $tmp['metaID'] = $item->id_server_meta(); } - $service_stats[$service['id']]['rootID'] = $service['rootID']; - $service_stats[$service['id']]['rootType'] = $service['rootType']; - $service_stats[$service['id']]['type'] = 'services'; - $service_stats[$service['id']]['children'] = []; - $service_stats[$service['id']]['serviceDetail'] = 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.(int) $service['id']; - $service_stats[$service['id']]['counters'] = [ - 'total_services' => $service['total_services'], - 'total_agents' => $service['total_agents'], - 'total_modules' => $service['total_modules'], - ]; - } + $tmp['serverID'] = $tmp['metaID']; - $own_info = get_user_info($config['id_user']); + switch ($item->type()) { + case SERVICE_ELEMENT_AGENT: + if ($item->agent() === null) { + // Skip item. + continue 2; + } - if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) { - $display_all_services = true; - } else { - $display_all_services = false; - } + $tmp['id'] = $item->agent()->id_agente(); + $tmp['name'] = $item->agent()->nombre(); + $tmp['alias'] = $item->agent()->alias(); + $tmp['fired_count'] = $item->agent()->fired_count(); + $tmp['normal_count'] = $item->agent()->normal_count(); + $tmp['warning_count'] = $item->agent()->warning_count(); + $tmp['critical_count'] = $item->agent()->critical_count(); + $tmp['unknown_count'] = $item->agent()->unknown_count(); + $tmp['notinit_count'] = $item->agent()->notinit_count(); + $tmp['total_count'] = $item->agent()->total_count(); - $services = services_get_services($filter, false, $display_all_services); + if ($item->agent()->quiet() > 0 + || $item->agent()->cps() > 0 + ) { + $tmp['quiet'] = 1; + } else { + $tmp['quiet'] = 0; + } - foreach ($services as $row) { - if (!array_key_exists($row['id'], $service_stats)) { - continue; - } + $tmp['state_critical'] = $tmp['critical_count']; + $tmp['state_warning'] = $tmp['warning_count']; + $tmp['state_unknown'] = $tmp['unknown_count']; + $tmp['state_notinit'] = $tmp['notinit_count']; + $tmp['state_normal'] = $tmp['normal_count']; + $tmp['state_total'] = $tmp['total_count']; + $tmp['type'] = SERVICE_ELEMENT_AGENT; + $tmp['rootID'] = $this->rootID; + $tmp['rootType'] = $this->rootType; + $tmp['counters'] = [ + 'alerts' => $item->agent()->fired_count(), + 'ok' => $item->agent()->normal_count(), + 'warning' => $item->agent()->warning_count(), + 'critical' => $item->agent()->critical_count(), + 'unknown' => $item->agent()->unknown_count(), + 'not_init' => $item->agent()->notinit_count(), + 'total' => $item->agent()->total_count(), + ]; - $status = services_get_status($row, true); + switch ($item->agent()->lastStatus()) { + case AGENT_STATUS_NORMAL: + $tmp['statusImageHTML'] = 'NORMAL status.'; + break; - switch ($status) { - case SERVICE_STATUS_NORMAL: - $service_stats[$row['id']]['statusImageHTML'] = 'NORMAL status.'; + case AGENT_STATUS_CRITICAL: + case AGENT_STATUS_ALERT_FIRED: + $tmp['statusImageHTML'] = 'CRITICAL status.'; + break; + + case AGENT_STATUS_WARNING: + $tmp['statusImageHTML'] = 'WARNING status.'; + break; + + case AGENT_STATUS_UNKNOWN: + default: + $tmp['statusImageHTML'] = 'UNKNOWN status.'; + break; + } + + $tmp['children'] = []; + $tmp['searchChildren'] = 1; + $tmp['showEventsBtn'] = 1; + $tmp['eventAgent'] = $item->agent()->id_agente(); break; - case SERVICE_STATUS_CRITICAL: - $service_stats[$row['id']]['statusImageHTML'] = 'CRITICAL status.'; + case SERVICE_ELEMENT_MODULE: + if ($item->module() === null) { + // Skip item. + continue 2; + } + + $tmp['id'] = $item->module()->id_agente_modulo(); + $tmp['name'] = $item->module()->nombre(); + $tmp['id_tipo_modulo'] = $item->module()->id_tipo_modulo(); + $tmp['id_modulo'] = $item->module()->id_modulo(); + $tmp['estado'] = $item->module()->lastStatus(); + $tmp['datos'] = $item->module()->lastValue(); + $tmp['parent'] = $item->module()->parent_module_id(); + $alerts = alerts_get_alerts_module_name( + $item->module()->id_agente_modulo() + ); + if ($alerts !== false) { + // Seems to be used as 'flag'. + $tmp['alerts'] = $alerts[0]['id']; + } + + $tmp['unit'] = $item->module()->unit(); + $tmp['type'] = SERVICE_ELEMENT_MODULE; + $tmp['id_module_type'] = $item->module()->id_tipo_modulo(); + $tmp['server_type'] = $tmp['id_module_type']; + $tmp['status'] = $item->module()->lastStatus(); + $tmp['value'] = modules_get_agentmodule_data_for_humans( + array_merge( + $item->module()->toArray(), + [ 'datos' => $item->module()->lastValue() ] + ) + ); + + $title = $item->module()->lastStatusTitle(); + + if (is_numeric($item->module()->lastValue())) { + $divisor = get_data_multiplier($item->module()->unit()); + $title .= ' : '.format_for_graph( + $item->module()->lastValue(), + 1, + '.', + ',', + $divisor + ); + } else { + $title .= ' : '.substr( + io_safe_output( + $item->module()->lastValue() + ), + 0, + 42 + ); + } + + $tmp['serverName'] = $item->module()->agent()->server_name(); + $tmp['serverID'] = $tmp['metaID']; + $tmp['statusText'] = $item->module()->lastStatusText(); + $tmp['showGraphs'] = 1; + $tmp['showEventsBtn'] = 1; + $tmp['eventAgent'] = $item->module()->id_agente(); + + $html = 'module()->lastStatusTitle().'" />'; + $tmp['statusImageHTML'] = $html; + $tmp = array_merge( + $tmp, + $this->getModuleGraphLinks( + $tmp + ) + ); break; - case SERVICE_STATUS_WARNING: - $service_stats[$row['id']][$key]['statusImageHTML'] = 'WARNING status.'; + case SERVICE_ELEMENT_SERVICE: + if ($item->service() === null) { + // Skip item. + continue 2; + } + + $tmp['id'] = (int) $item->service()->id(); + $tmp['name'] = $item->service()->name(); + $tmp['alias'] = $item->service()->name(); + + if ($this->connectedToNode === false + && is_metaconsole() === true + && $tmp['metaID'] > 0 + ) { + // Impersonate node. + \enterprise_include_once('include/functions_metaconsole.php'); + \enterprise_hook( + 'metaconsole_connect', + [ + null, + $tmp['metaID'], + ] + ); + } + + $grandchildren = $item->service()->children(); + + if ($this->connectedToNode === false + && is_metaconsole() === true + && $tmp['metaID'] > 0 + ) { + // Restore connection. + \enterprise_hook('metaconsole_restore_db'); + } + + $counters = [ + 'total_modules' => 0, + 'total_agents' => 0, + 'total_services' => 0, + 'total_dynamic' => 0, + 'total' => 0, + ]; + + if (is_array($grandchildren) === true) { + $counters = array_reduce( + $grandchildren, + function ($carry, $item) { + if ($item->type() === SERVICE_ELEMENT_MODULE) { + $carry['total_modules']++; + } else if ($item->type() === SERVICE_ELEMENT_AGENT) { + $carry['total_agents']++; + } else if ($item->type() === SERVICE_ELEMENT_SERVICE) { + $carry['total_services']++; + } else if ($item->type() === SERVICE_ELEMENT_DYNAMIC) { + $carry['total_dynamic']++; + } + + $carry['total']++; + + return $carry; + }, + $counters + ); + } + + if ($counters['total'] > 0) { + $tmp['searchChildren'] = 1; + } + + $tmp['type'] = 'services'; + $tmp['rootType'] = 'services'; + $tmp['children'] = []; + $tmp['serviceDetail'] = ui_get_full_url( + 'index.php?sec=network&sec2=enterprise/operation/services/services&tab=service_map&id_service='.$item->service()->id() + ); + $tmp['counters'] = $counters; + $tmp['rootID'] = $this->rootID; + switch ($item->service()->lastStatus()) { + case SERVICE_STATUS_NORMAL: + $tmp['statusImageHTML'] = 'NORMAL status.'; + break; + + case SERVICE_STATUS_CRITICAL: + $tmp['statusImageHTML'] = 'CRITICAL status.'; + break; + + case SERVICE_STATUS_WARNING: + $tmp['statusImageHTML'] = 'WARNING status.'; + break; + + case SERVICE_STATUS_UNKNOWN: + default: + $tmp['statusImageHTML'] = 'UNKNOWN status.'; + break; + } break; - case SERVICE_STATUS_UNKNOWN: default: - $service_stats[$row['id']]['statusImageHTML'] = 'UNKNOWN status.'; - break; + // Unknown type. + continue 2; } + + $output[] = $tmp; } - $data_services = array_values($service_stats); - - $data = array_merge($data_services, $data_agents, $data_modules); - - if (empty($data)) { - $this->tree = []; - return; - } - - $this->tree = $data; + $this->tree = $output; } + /** + * SQL query to retrieve second level items. + * + * @return string SQL. + */ protected function getSecondLevelServicesSql() { $group_acl = $this->getGroupAclCondition(); - $sql = "SELECT ts.id, ts.name, tse1.id_service AS `rootID`, 'services' AS rootType, 'services' AS type, 0 AS quiet, SUM(if((tse2.id_agent<>0), 1, 0)) AS `total_agents`, SUM(if((tse2.id_agente_modulo<>0), 1, 0)) AS `total_modules`, SUM(if((tse2.id_service_child<>0), 1, 0)) AS `total_services`, 0 AS fired_count, 0 AS normal_count, 0 AS warning_count, 0 AS critical_count, 0 AS unknown_count, 0 AS notinit_count, 0 AS state_critical, 0 AS state_warning, 0 AS state_unknown, 0 AS state_notinit, 0 AS state_normal, 0 AS state_total, '' AS statusImageHTML, '' AS alertImageHTML - FROM tservice_element tse1 - LEFT JOIN tservice_element tse2 ON tse1.id_service_child=tse2.id_service - LEFT JOIN tservice ts ON tse1.id_service_child=ts.id - WHERE tse1.id_service=$this->id AND tse1.id_service_child<>0 - GROUP BY tse1.id_service_child - "; + $sql = sprintf( + 'SELECT + ts.id, + ts.id_agent_module, + ts.name, + ts.name as `alias`, + tse.id_service as `rootID`, + "services" as `rootType`, + "services" as `type`, + ts.quiet, + tse.id_server_meta, + SUM(if((tse.id_agent<>0), 1, 0)) AS `total_agents`, + SUM(if((tse.id_agente_modulo<>0), 1, 0)) AS `total_modules`, + SUM(if((tse.id_service_child<>0), 1, 0)) AS `total_services` + FROM tservice ts + INNER JOIN tservice_element tse + ON tse.id_service_child = ts.id + WHERE + tse.id_service = %d + %s + GROUP BY ts.id', + $this->id, + $group_acl + ); return $sql; } - protected function getSecondLevelModulesSql() - { - $sql = "SELECT tse.id_agente_modulo, nombre AS `name`, nombre AS `alias`, tse.id_service AS `rootID`, 'services' AS `rootType`, 'modules' AS `type`, estado - FROM tservice_element tse - INNER JOIN tagente_modulo tam ON tse.id_agente_modulo=tam.id_agente_modulo - INNER JOIN tagente_estado tae ON tam.id_agente_modulo=tae.id_agente_estado - WHERE tse.id_service=$this->id AND tse.id_agente_modulo<>0 - "; - - return $sql; - } - - - protected function getAgentStatusFilter($status=self::TV_DEFAULT_AGENT_STATUS) - { - return ''; - } - - + /** + * Retrieve SQL filter for current filte.r + * + * @return string SQL filter. + */ protected function getServiceFavouriteFilter() { - if (isset($this->filter['is_favourite']) && !empty($this->filter['is_favourite'])) { + if (isset($this->filter['is_favourite']) === true + && empty($this->filter['is_favourite']) === false + ) { return ' AND is_favourite = 1'; } @@ -378,4 +683,70 @@ class TreeService extends Tree } + /** + * Overwrites partial functionality of general Tree.class. + * + * @param array $module Data of given module. + * + * @return array Complementary information. + */ + protected function getModuleGraphLinks(array $module) + { + $graphType = return_graphtype($module['id_module_type']); + $url = ui_get_full_url( + 'operation/agentes/stat_win.php', + false, + false, + false + ); + $winHandle = dechex(crc32($module['id'].$module['name'])); + + $graph_params = [ + 'type' => $graphType, + 'period' => SECONDS_1DAY, + 'id' => $module['id'], + 'refresh' => SECONDS_10MINUTES, + ]; + + if (is_metaconsole() === true) { + // Set the server id. + $graph_params['server'] = $module['serverID']; + } + + $graph_params_str = http_build_query($graph_params); + $moduleGraphURL = $url.'?'.$graph_params_str; + + return [ + 'moduleGraph' => [ + 'url' => $moduleGraphURL, + 'handle' => $winHandle, + ], + 'snapshot' => ui_get_snapshot_link( + [ + 'id_module' => $module['id'], + 'interval' => $module['current_interval'], + 'module_name' => $module['name'], + 'id_node' => (($module['serverID'] > 0) ? $module['serverID'] : 0), + ], + true + ), + ]; + + } + + + /** + * Needs to be defined to maintain Tree view functionality. + * + * @param integer $status Status. + * + * @return string Fixed string. + */ + protected function getAgentStatusFilter( + $status=self::TV_DEFAULT_AGENT_STATUS + ) { + return ''; + } + + } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 4831f7935a..f1ed013487 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,8 +20,8 @@ /** * Pandora build version and version */ -$build_version = 'PC200624'; -$pandora_version = 'v7.0NG.746'; +$build_version = 'PC200811'; +$pandora_version = 'v7.0NG.748'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); @@ -51,8 +51,6 @@ if ($develop_bypass != 1) { } ini_set('display_errors', 0); - ini_set('log_errors', 1); - ini_set('error_log', $config['homedir'].'/pandora_console.log'); } else { // Develop mode, show all notices and errors on Console (and log it) if (version_compare(PHP_VERSION, '5.3.0') >= 0) { @@ -62,8 +60,6 @@ if ($develop_bypass != 1) { } ini_set('display_errors', 1); - ini_set('log_errors', 1); - ini_set('error_log', $config['homedir'].'/pandora_console.log'); } // Check if mysqli is available diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 1217677bb5..0104a1fd5a 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -50,7 +50,9 @@ define('EVENT_NO_VALIDATED', 3); define('AGENT_ENABLED', 0); define('AGENT_DISABLED', 1); - +// Module disabled status. +define('MODULE_ENABLED', 0); +define('MODULE_DISABLED', 1); // Error report codes. define('NOERR', 11111); @@ -259,17 +261,27 @@ define('SERVICE_STATUS_NORMAL', 0); define('SERVICE_STATUS_CRITICAL', 1); define('SERVICE_STATUS_WARNING', 2); define('SERVICE_STATUS_ALERT', 4); -// Default weights. +// Default service weights. define('SERVICE_WEIGHT_CRITICAL', 1); define('SERVICE_WEIGHT_WARNING', 0.5); +define('SERVICE_SMART_WEIGHT_CRITICAL', 50); +define('SERVICE_SMART_WEIGHT_WARNING', 30); +// Default service element weights. define('SERVICE_ELEMENT_WEIGHT_CRITICAL', 1); define('SERVICE_ELEMENT_WEIGHT_WARNING', 0.5); define('SERVICE_ELEMENT_WEIGHT_OK', 0); define('SERVICE_ELEMENT_WEIGHT_UNKNOWN', 0); +define('SERVICE_ELEMENT_SMART_CRITICAL', 100); +define('SERVICE_ELEMENT_SMART_WARNING', 50); +// Service element types. +define('SERVICE_ELEMENT_AGENT', 'agent'); +define('SERVICE_ELEMENT_MODULE', 'module'); +define('SERVICE_ELEMENT_SERVICE', 'service'); +define('SERVICE_ELEMENT_DYNAMIC', 'dynamic'); + // Modes. define('SERVICE_MODE_MANUAL', 0); -define('SERVICE_MODE_AUTO', 1); -define('SERVICE_MODE_SIMPLE', 2); +define('SERVICE_MODE_SMART', 1); @@ -347,6 +359,7 @@ define('MODULE_PREDICTION', 5); define('MODULE_WMI', 6); define('MODULE_WEB', 7); define('MODULE_WUX', 8); +define('MODULE_WIZARD', 9); // Type of Modules of Prediction. define('MODULE_PREDICTION_SERVICE', 2); @@ -674,3 +687,54 @@ define('W_CREATE_MODULE', 3); define('W_CREATE_ALERT', 4); define('W_CREATE_TASK', 5); define('WELCOME_FINISHED', -1); + +// Fixed tnetwork_component values. +define('MODULE_TYPE_NUMERIC', 1); +define('MODULE_TYPE_INCREMENTAL', 2); +define('MODULE_TYPE_BOOLEAN', 3); +define('MODULE_TYPE_ALPHANUMERIC', 4); +define('SCAN_TYPE_FIXED', 1); +define('SCAN_TYPE_DYNAMIC', 2); +define('EXECUTION_TYPE_NETWORK', 1); +define('EXECUTION_TYPE_PLUGIN', 2); + +// Id of component type. +define('COMPONENT_TYPE_NETWORK', 2); +define('COMPONENT_TYPE_PLUGIN', 4); +define('COMPONENT_TYPE_WMI', 6); +define('COMPONENT_TYPE_WIZARD', 9); + +// Wizard Internal Plugins. +define('PLUGIN_WIZARD_SNMP_MODULE', 1); +define('PLUGIN_WIZARD_SNMP_PROCESS', 2); +define('PLUGIN_WIZARD_WMI_MODULE', 3); + +// Module Types. +define('MODULE_TYPE_GENERIC_DATA', 1); +define('MODULE_TYPE_GENERIC_PROC', 2); +define('MODULE_TYPE_GENERIC_DATA_STRING', 3); +define('MODULE_TYPE_GENERIC_DATA_INC', 4); +define('MODULE_TYPE_GENERIC_DATA_INC_ABS', 5); +define('MODULE_TYPE_REMOTE_ICMP_PROC', 6); +define('MODULE_TYPE_REMOTE_ICMP', 7); +define('MODULE_TYPE_REMOTE_TCP', 8); +define('MODULE_TYPE_REMOTE_TCP_PROC', 9); +define('MODULE_TYPE_REMOTE_TCP_STRING', 10); +define('MODULE_TYPE_REMOTE_TCP_INC', 11); +define('MODULE_TYPE_REMOTE_SNMP', 15); +define('MODULE_TYPE_REMOTE_SNMP_INC', 16); +define('MODULE_TYPE_REMOTE_SNMP_STRING', 17); +define('MODULE_TYPE_REMOTE_SNMP_PROC', 18); +define('MODULE_TYPE_ASYNC_PROC', 21); +define('MODULE_TYPE_ASYNC_DATA', 22); +define('MODULE_TYPE_ASYNC_STRING', 23); +define('MODULE_TYPE_WEB_ANALYSIS', 25); +define('MODULE_TYPE_WEB_DATA', 30); +define('MODULE_TYPE_WEB_PROC', 31); +define('MODULE_TYPE_WEB_CONTENT_DATA', 32); +define('MODULE_TYPE_WEB_CONTENT_STRING', 33); +define('MODULE_TYPE_REMOTE_CMD', 34); +define('MODULE_TYPE_REMOTE_CMD_PROC', 35); +define('MODULE_TYPE_REMOTE_CMD_STRING', 36); +define('MODULE_TYPE_REMOTE_CMD_INC', 37); +define('MODULE_TYPE_KEEP_ALIVE', 100); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 1855997f11..7d5af653cb 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3209,7 +3209,7 @@ function get_refresh_time_array() } -function date2strftime_format($date_format) +function date2strftime_format($date_format, $timestamp=null) { $replaces_list = [ 'D' => '%a', @@ -3232,11 +3232,14 @@ function date2strftime_format($date_format) 'A' => '%p', 'i' => '%M', 's' => '%S', - 'u' => '%s', 'O' => '%z', 'T' => '%Z', '%' => '%%', 'G' => '%k', + 'z' => '%j', + 'U' => '%s', + 'c' => '%FT%T%z', + 'r' => '%d %b %Y %H:%M:%S %z', ]; $return = ''; @@ -3249,7 +3252,30 @@ function date2strftime_format($date_format) if (isset($replaces_list[$c])) { $return .= $replaces_list[$c]; } else { - $return .= $c; + // Check extra formats. + switch ($date_format) { + default: $return .= date($date_format, $timestamp); + break; + + case 'n': + if (stristr(PHP_OS, 'win')) { + $return .= '%#m'; + } else { + $return .= '%-m'; + } + + case 'u': + if (preg_match('/^[0-9]*\\.([0-9]+)$/', $timestamp, $reg)) { + $decimal = substr(str_pad($reg[1], 6, '0'), 0, 6); + } else { + $decimal = '000000'; + } + + $return .= $decimal; + break; + + break; + } } } @@ -3623,6 +3649,14 @@ function color_graph_array() } +/** + * Label graph Sparse. + * + * @param array $data Data chart. + * @param array $show_elements_graph Data visual styles chart. + * + * @return array Array label. + */ function series_type_graph_array($data, $show_elements_graph) { global $config; @@ -3645,7 +3679,13 @@ function series_type_graph_array($data, $show_elements_graph) $color_series = color_graph_array(); if ($show_elements_graph['id_widget_dashboard']) { - $opcion = unserialize(db_get_value_filter('options', 'twidget_dashboard', ['id' => $show_elements_graph['id_widget_dashboard']])); + $opcion = unserialize( + db_get_value_filter( + 'options', + 'twidget_dashboard', + ['id' => $show_elements_graph['id_widget_dashboard']] + ) + ); if ($show_elements_graph['graph_combined']) { foreach ($show_elements_graph['modules_id'] as $key => $value) { $color_series[$key] = [ @@ -3674,13 +3714,15 @@ function series_type_graph_array($data, $show_elements_graph) if (strpos($key, 'summatory') !== false) { $data_return['series_type'][$key] = $type_graph; - $data_return['legend'][$key] = __('Summatory series').' '.$str; - $data_return['color'][$key] = $color_series['summatory']; + $data_return['legend'][$key] = __('Summatory series').' '.$str; + $data_return['color'][$key] = $color_series['summatory']; } else if (strpos($key, 'average') !== false) { $data_return['series_type'][$key] = $type_graph; - $data_return['legend'][$key] = __('Average series').' '.$str; - $data_return['color'][$key] = $color_series['average']; - } else if (strpos($key, 'sum') !== false || strpos($key, 'baseline') !== false) { + $data_return['legend'][$key] = __('Average series').' '.$str; + $data_return['color'][$key] = $color_series['average']; + } else if (strpos($key, 'sum') !== false + || strpos($key, 'baseline') !== false + ) { switch ($value['id_module_type']) { case 21: case 2: @@ -3702,28 +3744,56 @@ function series_type_graph_array($data, $show_elements_graph) && (count($show_elements_graph['labels']) > 0) ) { if ($show_elements_graph['unit']) { - $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; - $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']]; + $name_legend .= ' / '; + $name_legend .= __('Unit ').' '; + $name_legend .= $show_elements_graph['unit'].': '; } else { $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; - $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].': '; } } else { if (strpos($key, 'baseline') !== false) { if ($value['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].'Baseline '; + $name_legend = $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name']; + $name_legend .= ' / '; + $name_legend .= __('Unit ').' '; + $name_legend .= $value['unit'].'Baseline '; } else { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].'Baseline '; + $name_legend = $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name'].'Baseline '; } } else { + $name_legend = ''; + if ((int) $config['type_mode_graph'] === 1) { + $name_legend .= 'Avg: '; + } + if ($value['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': '; + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name']; + $name_legend .= ' / '; + $name_legend .= __('Unit ').' '; + $name_legend .= $value['unit'].': '; } else { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name'].': '; } } } + if (isset($value['weight']) === true + && empty($value['weight']) === false + ) { + $name_legend .= ' ('.__('Weight'); + $name_legend .= ' * '.$value['weight'].') '; + } + + $data_return['legend'][$key] = $name_legend; if ((int) $value['min'] === PHP_INT_MAX) { $value['min'] = 0; } @@ -3749,36 +3819,63 @@ function series_type_graph_array($data, $show_elements_graph) ) ).' '.$str; - if ($show_elements_graph['compare'] == 'overlapped' && $key == 'sum2') { + if ($show_elements_graph['compare'] == 'overlapped' + && $key == 'sum2' + ) { $data_return['color'][$key] = $color_series['overlapped']; } else { $data_return['color'][$key] = $color_series[$i]; $i++; } - } else if (!$show_elements_graph['fullscale'] && strpos($key, 'min') !== false - || !$show_elements_graph['fullscale'] && strpos($key, 'max') !== false + } else if (!$show_elements_graph['fullscale'] + && strpos($key, 'min') !== false + || !$show_elements_graph['fullscale'] + && strpos($key, 'max') !== false ) { $data_return['series_type'][$key] = $type_graph; + $name_legend = ''; + if ((int) $config['type_mode_graph'] === 1) { + if (strpos($key, 'min') !== false) { + $name_legend .= 'Min: '; + } + + if (strpos($key, 'max') !== false) { + $name_legend .= 'Max: '; + } + } + if ($show_elements_graph['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name']; + $name_legend .= ' / '; + $name_legend .= __('Unit ').' '; + $name_legend .= $show_elements_graph['unit'].': '; } else { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; + $name_legend .= $value['agent_alias']; + $name_legend .= ' / '; + $name_legend .= $value['module_name'].': '; } $data_return['legend'][$key] = $name_legend; if ($show_elements_graph['type_mode_graph']) { - $data_return['legend'][$key] .= __('Min:').remove_right_zeros( + $data_return['legend'][$key] .= __('Min:'); + $data_return['legend'][$key] .= remove_right_zeros( number_format( $value['min'], $config['graph_precision'] ) - ).' '.__('Max:').remove_right_zeros( + ); + $data_return['legend'][$key] .= ' '.__('Max:'); + $data_return['legend'][$key] .= remove_right_zeros( number_format( $value['max'], $config['graph_precision'] ) - ).' '._('Avg:').remove_right_zeros( + ); + $data_return['legend'][$key] .= ' '._('Avg:'); + $data_return['legend'][$key] .= remove_right_zeros( number_format( $value['avg'], $config['graph_precision'] @@ -3786,7 +3883,9 @@ function series_type_graph_array($data, $show_elements_graph) ).' '.$str; } - if ($show_elements_graph['compare'] == 'overlapped' && $key == 'sum2') { + if ($show_elements_graph['compare'] == 'overlapped' + && $key == 'sum2' + ) { $data_return['color'][$key] = $color_series['overlapped']; } else { $data_return['color'][$key] = $color_series[$i]; @@ -4011,7 +4110,7 @@ function generate_hash_to_api() * @param string Key to identify the profiler run. * @param string Way to display the result * "link" (default): Click into word "Performance" to display the profilling info. - * "console": Display with a message in pandora_console.log. + * "console": Display with a message in console.log. */ function pandora_xhprof_display_result($key='', $method='link') { diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 6c1bcbc331..22e2f72612 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1631,8 +1631,10 @@ function agents_get_alias($id_agent, $case='none') } // Check cache. - if (isset($cache[$case][$id_agent])) { - return $cache[$case][$id_agent]; + if (!is_metaconsole()) { + if (isset($cache[$case][$id_agent])) { + return $cache[$case][$id_agent]; + } } $alias = (string) db_get_value( @@ -1656,7 +1658,61 @@ function agents_get_alias($id_agent, $case='none') break; } - $cache[$case][$id_agent] = $alias; + if (!is_metaconsole()) { + $cache[$case][$id_agent] = $alias; + } + + return $alias; +} + + +/** + * Get alias of an agent in metaconsole (cached function). + * + * @param integer $id_agent Agent id. + * @param string $case Case (upper, lower, none). + * @param integer $id_server server id. + * + * @return string Alias of the given agent. + */ +function agents_get_alias_metaconsole($id_agent, $case='none', $id_server=false) +{ + global $config; + // Prepare cache. + static $cache = []; + if (empty($case)) { + $case = 'none'; + } + + // Check cache. + if (isset($cache[$case][$id_server][$id_agent])) { + return $cache[$case][$id_server][$id_agent]; + } + + $alias = (string) db_get_value_filter( + 'alias', + 'tmetaconsole_agent', + [ + 'id_tagente' => $id_agent, + 'id_tmetaconsole_setup' => $id_server, + ] + ); + + switch ($case) { + case 'upper': + $alias = mb_strtoupper($alias, 'UTF-8'); + break; + + case 'lower': + $alias = mb_strtolower($alias, 'UTF-8'); + break; + + default: + // Not posible. + break; + } + + $cache[$case][$id_server][$id_agent] = $alias; return $alias; } @@ -2011,36 +2067,33 @@ function agents_get_addresses($id_agent) function agents_get_status_from_counts($agent) { // Check if in the data there are all the necessary values - if (!isset($agent['normal_count']) - && !isset($agent['warning_count']) - && !isset($agent['critical_count']) - && !isset($agent['unknown_count']) - && !isset($agent['notinit_count']) - && !isset($agent['total_count']) + if (isset($agent['normal_count']) === false + && isset($agent['warning_count']) === false + && isset($agent['critical_count']) === false + && isset($agent['unknown_count']) === false + && isset($agent['notinit_count']) === false + && isset($agent['total_count']) === false ) { return -1; } - // Juanma (05/05/2014) Fix: This status is not init! 0 modules or all not init + // Juanma (05/05/2014) Fix: This status is not init! 0 modules or all not init. if ($agent['notinit_count'] == $agent['total_count']) { - return AGENT_MODULE_STATUS_NOT_INIT; + return AGENT_STATUS_NOT_INIT; } if ($agent['critical_count'] > 0) { - return AGENT_MODULE_STATUS_CRITICAL_BAD; + return AGENT_STATUS_CRITICAL; } else if ($agent['warning_count'] > 0) { - return AGENT_MODULE_STATUS_WARNING; + return AGENT_STATUS_WARNING; } else if ($agent['unknown_count'] > 0) { - return AGENT_MODULE_STATUS_UNKNOWN; + return AGENT_STATUS_UNKNOWN; } else if ($agent['normal_count'] == $agent['total_count']) { - return AGENT_MODULE_STATUS_NORMAL; + return AGENT_STATUS_NORMAL; } else if (($agent['normal_count'] + $agent['notinit_count']) == $agent['total_count']) { - return AGENT_MODULE_STATUS_NORMAL; + return AGENT_STATUS_NORMAL; } - // ~ else if($agent['notinit_count'] == $agent['total_count']) { - // ~ return AGENT_MODULE_STATUS_NORMAL; - // ~ } return -1; } diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index d045577f4e..328848fc7e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -10723,7 +10723,7 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db $data['type'] = 'array'; $data['data'] = $result; - // returnData($returnType, $data, $separator); + returnData($returnType, $data, $separator); if (empty($result)) { return false; } @@ -10840,6 +10840,8 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db=null) returnError('ERROR_API_PANDORAFMS', $returnType); } } + + return; } if ($other['type'] == 'string') { @@ -12284,12 +12286,29 @@ function api_set_create_event($id, $trash1, $other, $returnType) return; } + if (!empty($other['data'][17]) && is_metaconsole()) { + $id_server = db_get_row_filter('tmetaconsole_setup', ['id' => $other['data'][17]]); + if ($id_server === false) { + returnError('error_create_event', __('Server id does not exist in database.')); + return; + } + + $values['server_id'] = $other['data'][17]; + } else { + $values['server_id'] = 0; + } + $error_msg = ''; if ($other['data'][2] != '') { $id_agent = $other['data'][2]; if (is_metaconsole()) { // On metaconsole, connect with the node to check the permissions - $agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent); + if (empty($values['server_id'])) { + $agent_cache = db_get_row('tmetaconsole_agent', 'id_tagente', $id_agent); + } else { + $agent_cache = db_get_row_filter('tmetaconsole_agent', ['id_tagente' => $id_agent, 'id_tmetaconsole_setup' => $values['server_id']]); + } + if ($agent_cache === false) { returnError('id_not_found', 'string'); return; @@ -12418,12 +12437,6 @@ function api_set_create_event($id, $trash1, $other, $returnType) $values['custom_data'] = ''; } - if ($other['data'][17] != '') { - $values['server_id'] = $other['data'][17]; - } else { - $values['server_id'] = 0; - } - if ($other['data'][18] != '') { $values['id_extra'] = $other['data'][18]; $sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";'; @@ -13121,6 +13134,9 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) $quiet = $other['data'][11]; $cascade_protection = $other['data'][12]; $evaluate_sla = $other['data'][13]; + $is_favourite = $other['data'][14]; + $unknown_as_critical = $other['data'][15]; + $server_name = $other['data'][16]; if (empty($name)) { returnError('error_create_service', __('Error in creation service. No name')); @@ -13187,24 +13203,40 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) $evaluate_sla = 0; } - $result = services_create_service( - $name, - $description, - $id_group, - $critical, - $warning, - SECONDS_5MINUTES, - $mode, - $id_agent, - $sla_interval, - $sla_limit, - $id_warning_module_template, - $id_critical_module_template, - $id_unknown_module_template, - $id_critical_module_sla, - $quiet, - $cascade_protection, - $evaluate_sla + if (empty($is_favourite)) { + $is_favourite = false; + } + + if (empty($unknown_as_critical)) { + $unknown_as_critical = false; + } + + if (empty($server_name)) { + $server_name = null; + } + + $result = enterprise_hook( + 'services_create_service', + [ + $name, + $description, + $id_group, + $critical, + $warning, + false, + SECONDS_5MINUTES, + $mode, + $id_agent, + $sla_interval, + $sla_limit, + $id_warning_module_template, + $id_critical_module_template, + $id_unknown_module_template, + $id_critical_module_sla, + $quiet, + $cascade_protection, + $evaluate_sla, + ] ); if ($result) { @@ -13223,7 +13255,7 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) * @param array $other it's array, $other as param is ;;;; * ;;;;; * ;;; - * ;; + * ;;;;; * in this order and separator char (after text ; ) and separator * (pass in param othermode as othermode=url_encode_separator_) * @param $thrash3 Don't use @@ -13340,25 +13372,46 @@ function api_set_update_service($thrash1, $thrash2, $other, $thrash3) $evaluate_sla = $service['evaluate_sla']; } - $result = services_update_service( - $id_service, - $name, - $description, - $id_group, - $critical, - $warning, - SECONDS_5MINUTES, - $mode, - $id_agent, - $sla_interval, - $sla_limit, - $id_warning_module_template, - $id_critical_module_template, - $id_unknown_module_template, - $id_critical_module_sla, - $quiet, - $cascade_protection, - $evaluate_sla + $is_favourite = $other['data'][14]; + if (empty($is_favourite)) { + $is_favourite = $service['is_favourite']; + } + + $unknown_as_critical = $other['data'][15]; + if (empty($unknown_as_critical)) { + $unknown_as_critical = $service['unknown_as_critical']; + } + + $server_name = $other['data'][16]; + if (empty($server_name)) { + $server_name = $service['server_name']; + } + + $result = enterprise_hook( + 'services_update_service', + [ + $id_service, + $name, + $description, + $id_group, + $critical, + $warning, + SECONDS_5MINUTES, + $mode, + $id_agent, + $sla_interval, + $sla_limit, + $id_warning_module_template, + $id_critical_module_template, + $id_unknown_module_template, + $id_critical_module_sla, + $quiet, + $cascade_protection, + $evaluate_sla, + $is_favourite, + $unknown_as_critical, + $server_name, + ] ); if ($result) { @@ -16109,3 +16162,38 @@ function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType) return; } } + + +/** + * Function to set events in progress status. + * + * @param [int] $event_id Id event (Node or Meta). + * @param [string] $trash2 don't use. + * @param [string] $returnType + * + * Example + * http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&apipass=1234&user=admin&pass=pandora + * + * @return void + */ +function api_set_event_in_progress($event_id, $trash2, $returnType) +{ + global $config; + if (is_metaconsole()) { + $table = 'tmetaconsole_event'; + } else { + $table = 'tevento'; + } + + $event = db_process_sql_update( + $table, + ['estado' => 2], + ['id_evento' => $event_id] + ); + + if ($event !== false) { + returnData('string', ['data' => $event]); + } else { + returnError('id_not_found', 'string'); + } +} diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index b579f0cd8c..3554f091ed 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -287,6 +287,10 @@ function config_update_config() $error_update[] = __('Command Snapshot'); } + if (!config_update_value('use_custom_encoding', get_parameter('use_custom_encoding', 0))) { + $error_update[] = __('Use custom encoding'); + } + if (!config_update_value('server_log_dir', io_safe_input(strip_tags(io_safe_output(get_parameter('server_log_dir')))))) { $error_update[] = __('Server logs directory'); } @@ -319,8 +323,12 @@ function config_update_config() $error_update[] = __('alias_as_name'); } - if (!config_update_value('auditdir', get_parameter('auditdir'))) { - $error_update[] = __('Audit log directory'); + if (!config_update_value('console_log_enabled', get_parameter('console_log_enabled'))) { + $error_update[] = __('Console log enabled'); + } + + if (!config_update_value('audit_log_enabled', get_parameter('audit_log_enabled'))) { + $error_update[] = __('Audit log enabled'); } if (!config_update_value('unique_ip', get_parameter('unique_ip'))) { @@ -1332,6 +1340,10 @@ function config_update_config() $error_update[] = __('CSV divider'); } + if (!config_update_value('csv_decimal_separator', (string) get_parameter('csv_decimal_separator', '.'))) { + $error_update[] = __('CSV decimal separator'); + } + if (!config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'))) { $error_update[] = __('Use data multiplier'); } @@ -1926,14 +1938,12 @@ function config_process_config() config_update_value('alias_as_name', 0); } - if (!isset($config['auditdir'])) { - $auditdir = '/var/www/html/pandora_console'; - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - // Windows. - $auditdir = $config['homedir']; - } + if (!isset($config['console_log_enabled'])) { + config_update_value('console_log_enabled', 0); + } - config_update_value('auditdir', $auditdir); + if (!isset($config['audit_log_enabled'])) { + config_update_value('audit_log_enabled', 0); } if (!isset($config['elasticsearch_ip'])) { @@ -2797,6 +2807,10 @@ function config_process_config() config_update_value('event_storm_protection', 0); } + if (!isset($config['use_custom_encoding'])) { + config_update_value('use_custom_encoding', 0); + } + if (!isset($config['server_log_dir'])) { config_update_value('server_log_dir', ''); } @@ -2865,6 +2879,10 @@ function config_process_config() config_update_value('csv_divider', ';'); } + if (!isset($config['csv_decimal_separator'])) { + config_update_value('csv_decimal_separator', '.'); + } + if (!isset($config['use_data_multiplier'])) { config_update_value('use_data_multiplier', '1'); } diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index a99ab2e41e..7b4525b408 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -251,10 +251,8 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info $valor = ''.$values['fecha'].' - '.io_safe_output($id).' - '.io_safe_output($accion).' - '.$ip.' - '.io_safe_output($descripcion)."\n"; - if (empty($config['auditdir'])) { - file_put_contents($config['homedir'].'/audit.log', $valor, FILE_APPEND); - } else { - file_put_contents($config['auditdir'].'/audit.log', $valor, FILE_APPEND); + if ($config['audit_log_enabled']) { + file_put_contents($config['homedir'].'/log/audit.log', $valor, FILE_APPEND); } enterprise_include_once('include/functions_audit.php'); diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index a5b442d69c..9e620e70ef 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2118,7 +2118,7 @@ function events_comment( switch ($comments_format) { case 'new': - $comment_for_json['comment'] = $comment; + $comment_for_json['comment'] = io_safe_input($comment); $comment_for_json['action'] = $action; $comment_for_json['id_user'] = $config['id_user']; $comment_for_json['utimestamp'] = time(); @@ -2141,7 +2141,7 @@ function events_comment( $comment = str_replace(["\r\n", "\r", "\n"], '
', $comment); if ($comment != '') { - $commentbox = '
'.$comment.'
'; + $commentbox = '
'.io_safe_input($comment).'
'; } else { $commentbox = ''; } @@ -3377,7 +3377,7 @@ function events_page_responses($event, $childrens_ids=[]) ); if ($strict_user) { $user_name = db_get_value( - 'fullname', + 'id_user', 'tusuario', 'id_user', $config['id_user'] @@ -3395,14 +3395,14 @@ function events_page_responses($event, $childrens_ids=[]) } foreach ($users as $u) { - $owners[$u['id_user']] = $u['fullname']; + $owners[$u['id_user']] = $u['id_user']; } if ($event['owner_user'] == '') { $owner_name = __('None'); } else { $owner_name = db_get_value( - 'fullname', + 'id_user', 'tusuario', 'id_user', $event['owner_user'] @@ -3424,7 +3424,7 @@ function events_page_responses($event, $childrens_ids=[]) 'owner_button', false, 'event_change_owner();', - 'class="sub next"', + 'class="sub next w70p"', true ); @@ -3504,7 +3504,7 @@ function events_page_responses($event, $childrens_ids=[]) 'status_button', false, 'event_change_status(\''.$event['similar_ids'].'\');', - 'class="sub next"', + 'class="sub next w70p"', true ); } @@ -3520,7 +3520,7 @@ function events_page_responses($event, $childrens_ids=[]) 'comment_button', false, '$(\'#link_comments\').trigger(\'click\');', - 'class="sub next"', + 'class="sub next w70p"', true ); @@ -3544,7 +3544,7 @@ function events_page_responses($event, $childrens_ids=[]) 'delete_button', false, 'if(!confirm(\''.__('Are you sure?').'\')) { return false; } this.form.submit();', - 'class="sub cancel"', + 'class="sub cancel w70p"', true ); $data[2] .= html_print_input_hidden('delete', 1, true); @@ -3599,7 +3599,7 @@ function events_page_responses($event, $childrens_ids=[]) 'custom_response_button', false, 'execute_response('.$event['id_evento'].','.$server_id.')', - "class='sub next'", + "class='sub next w70p'", true ); } diff --git a/pandora_console/include/functions_forecast.php b/pandora_console/include/functions_forecast.php index 4dcf08db73..a7e5545d55 100644 --- a/pandora_console/include/functions_forecast.php +++ b/pandora_console/include/functions_forecast.php @@ -36,7 +36,8 @@ function forecast_projection_graph( $prediction_period, $max_value=false, $min_value=false, - $csv=false + $csv=false, + $server_name='' ) { global $config; @@ -55,7 +56,7 @@ function forecast_projection_graph( 'projection' => true, ]; - $module_data = grafico_modulo_sparse($params); + $module_data = grafico_modulo_sparse($params, $server_name); if (empty($module_data)) { return []; @@ -252,12 +253,13 @@ function forecast_prediction_date( $module_id, $period=SECONDS_2MONTHS, $max_value=0, - $min_value=0 + $min_value=0, + $server_name='' ) { // Checks interval if ($min_value > $max_value) { return false; } - return forecast_projection_graph($module_id, $period, false, $max_value, $min_value); + return forecast_projection_graph($module_id, $period, false, $max_value, $min_value, false, $server_name); } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d462929cff..bf09416cba 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -616,7 +616,7 @@ function grafico_modulo_sparse_data( * * @return string html Content graphs. */ -function grafico_modulo_sparse($params) +function grafico_modulo_sparse($params, $server_name='') { global $config; @@ -812,6 +812,12 @@ function grafico_modulo_sparse($params) $date_array['final_date'] = $params['date']; $date_array['start_date'] = ($params['date'] - $params['period']); + if (is_metaconsole()) { + $id_meta = metaconsole_get_id_server($server_name); + $server = metaconsole_get_connection_by_id($id_meta); + metaconsole_connect($server); + } + if ($agent_module_id) { $module_data = db_get_row_sql( 'SELECT * FROM tagente_modulo @@ -1022,6 +1028,10 @@ function grafico_modulo_sparse($params) } } + if (is_metaconsole()) { + metaconsole_restore_db(); + } + return $return; } @@ -1275,9 +1285,22 @@ function graphic_combined_module( } if ($count_modules > 0) { - $sources = true; + foreach ($module_list as $key => $value) { + $sources[$key]['id_server'] = $value['server']; + $sources[$key]['id_agent_module'] = $value['module']; + $sources[$key]['weight'] = $weights[$key]; + $sources[$key]['label'] = $params_combined['labels']; + } } } else { + if (is_metaconsole()) { + metaconsole_restore_db(); + $server = metaconsole_get_connection_by_id($params['server_id']); + if (metaconsole_connect($server) != NOERR) { + return false; + } + } + $sources = db_get_all_rows_field_filter( 'tgraph_source', 'id_graph', @@ -1285,8 +1308,18 @@ function graphic_combined_module( 'field_order' ); + if (is_metaconsole()) { + if (isset($sources) && is_array($sources)) { + foreach ($sources as $key => $value) { + $sources[$key]['id_server'] = $params['server_id']; + } + } + } + $series = db_get_all_rows_sql( - 'SELECT summatory_series,average_series, modules_series + 'SELECT summatory_series, + average_series, + modules_series FROM tgraph WHERE id_graph = '.$params_combined['id_graph'] ); @@ -1295,45 +1328,76 @@ function graphic_combined_module( $average = $series[0]['average_series']; $modules_series = $series[0]['modules_series']; + if (is_metaconsole()) { + metaconsole_restore_db(); + } + } + + if (isset($sources) && is_array($sources)) { $weights = []; $labels = []; $modules = []; - - if (isset($sources) && is_array($sources)) { - foreach ($sources as $source) { - array_push($modules, $source['id_agent_module']); - array_push($weights, $source['weight']); - if ($source['label'] != '' || $params_combined['labels']) { - $id_agent = agents_get_module_id( - $source['id_agent_module'] - ); - $agent_description = agents_get_description($id_agent); - $agent_group = agents_get_agent_group($id_agent); - $agent_address = agents_get_address($id_agent); - $agent_alias = agents_get_alias($id_agent); - $module_name = modules_get_agentmodule_name( - $source['id_agent_module'] - ); - - $module_description = modules_get_agentmodule_descripcion( - $source['id_agent_module'] - ); - - $items_label = [ - 'type' => 'custom_graph', - 'id_agent' => $id_agent, - 'id_agent_module' => $source['id_agent_module'], - 'agent_description' => $agent_description, - 'agent_group' => $agent_group, - 'agent_address' => $agent_address, - 'agent_alias' => $agent_alias, - 'module_name' => $module_name, - 'module_description' => $module_description, - ]; - - $labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($items_label, $source['label']) : reporting_label_macro($item, $params_combined['labels']); + foreach ($sources as $source) { + if (is_metaconsole() === true) { + $server = metaconsole_get_connection_by_id($source['id_server']); + if (metaconsole_connect($server) != NOERR) { + continue; } } + + $modulepush = [ + 'server' => (isset($source['id_server']) === true) ? $source['id_server'] : 0, + 'module' => $source['id_agent_module'], + ]; + + array_push($modules, $modulepush); + array_push($weights, $source['weight']); + if ($source['label'] != '' || $params_combined['labels']) { + $id_agent = agents_get_module_id( + $source['id_agent_module'] + ); + $agent_description = agents_get_description($id_agent); + $agent_group = agents_get_agent_group($id_agent); + $agent_address = agents_get_address($id_agent); + $agent_alias = agents_get_alias($id_agent); + $module_name = modules_get_agentmodule_name( + $source['id_agent_module'] + ); + + $module_description = modules_get_agentmodule_descripcion( + $source['id_agent_module'] + ); + + $items_label = [ + 'type' => 'custom_graph', + 'id_agent' => $id_agent, + 'id_agent_module' => $source['id_agent_module'], + 'agent_description' => $agent_description, + 'agent_group' => $agent_group, + 'agent_address' => $agent_address, + 'agent_alias' => $agent_alias, + 'module_name' => $module_name, + 'module_description' => $module_description, + ]; + + if ($source['label'] != '') { + $lab = reporting_label_macro( + $items_label, + $source['label'] + ); + } else { + $lab = reporting_label_macro( + $items_label, + $params_combined['labels'] + ); + } + + $labels[$source['id_agent_module']] = $lab; + } + + if (is_metaconsole() === true) { + metaconsole_restore_db(); + } } } @@ -1429,15 +1493,22 @@ function graphic_combined_module( continue; } - if (is_metaconsole() && $params_combined['type_report'] == 'automatic_graph') { - $server = metaconsole_get_connection_by_id($agent_module_id['server']); + // Only 10 item for chart. + if ($i > 9) { + break; + } + + if (is_metaconsole()) { + $server = metaconsole_get_connection_by_id( + $agent_module_id['server'] + ); if (metaconsole_connect($server) != NOERR) { continue; } - - $agent_module_id = $agent_module_id['module']; } + $agent_module_id = $agent_module_id['module']; + $module_data = db_get_row_sql( 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = '.$agent_module_id @@ -1504,19 +1575,28 @@ function graphic_combined_module( foreach ($value['data'] as $k => $v) { if ($v[1] != false) { $array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); + $array_data[$key]['slice_data'][$v[0]]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['max'] *= $params_combined['weight_list'][$i]; } } + + $array_data[$key]['max'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['weight'] = $params_combined['weight_list'][$i]; } } - $max = $array_data['sum'.$i]['max']; - $min = $array_data['sum'.$i]['min']; - $avg = $array_data['sum'.$i]['avg']; - if ($config['fixed_graph'] == false) { $water_mark = [ 'file' => $config['homedir'].'/images/logo_vertical_water.png', - 'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false), + 'url' => ui_get_full_url( + 'images/logo_vertical_water.png', + false, + false, + false + ), ]; } @@ -1525,9 +1605,7 @@ function graphic_combined_module( $i++; - if (is_metaconsole() - && $params_combined['type_report'] == 'automatic_graph' - ) { + if (is_metaconsole()) { metaconsole_restore_db(); } } @@ -1763,28 +1841,23 @@ function graphic_combined_module( } foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { + if (is_metaconsole() === true) { // Automatic custom graph from the report // template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } + $module = $module_item['module']; $search_in_history_db = db_search_in_history_db($datelimit); - $temp[$module] = io_safe_output(modules_get_agentmodule($module)); + $temp[$module] = io_safe_output( + modules_get_agentmodule($module) + ); + $query_last_value = sprintf( ' SELECT datos @@ -1849,12 +1922,8 @@ function graphic_combined_module( $temp[$module]['min'] = ($temp_min === false) ? 0 : $temp_min; - if ($config['metaconsole']) { - // Automatic custom graph from the - // report template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + if (is_metaconsole() === true) { + metaconsole_restore_db(); } } @@ -1899,25 +1968,15 @@ function graphic_combined_module( $i = 0; $number_elements = count($module_list); foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from - // the report template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; + if (is_metaconsole() === true) { + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } + $module = $module_item['module']; $temp[$module] = modules_get_agentmodule($module); $query_last_value = sprintf( ' @@ -1973,12 +2032,8 @@ function graphic_combined_module( $temp[$module]['gauge'] = uniqid('gauge_'); - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + if (is_metaconsole() === true) { + metaconsole_restore_db(); } $i++; @@ -2003,6 +2058,12 @@ function graphic_combined_module( } } + if (isset($params['pdf']) === true && $params['pdf'] === true) { + $transitionDuration = 0; + } else { + $transitionDuration = 500; + } + $output = stacked_gauge( $graph_values, $new_width, @@ -2018,7 +2079,8 @@ function graphic_combined_module( $config['fontpath'], $fixed_font_size, '', - $homeurl + $homeurl, + $transitionDuration ); break; @@ -2026,25 +2088,15 @@ function graphic_combined_module( case CUSTOM_GRAPH_VBARS: $label = ''; foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; if (is_metaconsole() === true) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[$i]) === true) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta === true) { - $module = $module_item['module']; - } else { - $module = $module_item; + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } + $module = $module_item['module']; $module_data = modules_get_agentmodule($module); $query_last_value = sprintf( 'SELECT datos @@ -2093,11 +2145,7 @@ function graphic_combined_module( } if (is_metaconsole() === true) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0]) === true) { - metaconsole_restore_db(); - } + metaconsole_restore_db(); } } @@ -2167,29 +2215,18 @@ function graphic_combined_module( case CUSTOM_GRAPH_PIE: $total_modules = 0; foreach ($module_list as $module_item) { - $automatic_custom_graph_meta = false; - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[$i])) { - $server = metaconsole_get_connection_by_id( - $module_item['server'] - ); - metaconsole_connect($server); - $automatic_custom_graph_meta = true; - } - } - - if ($automatic_custom_graph_meta) { - $module = $module_item['module']; - } else { - $module = $module_item; + if (is_metaconsole() === true) { + $server = metaconsole_get_connection_by_id( + $module_item['server'] + ); + + metaconsole_connect($server); } + $module = $module_item['module']; $data_module = modules_get_agentmodule($module); $query_last_value = sprintf( - ' - SELECT datos + 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d @@ -2234,12 +2271,9 @@ function graphic_combined_module( 'value' => $value, 'unit' => $data_module['unit'], ]; - if ($config['metaconsole']) { - // Automatic custom graph from the report - // template in metaconsole. - if (is_array($module_list[0])) { - metaconsole_restore_db(); - } + + if (is_metaconsole() === true) { + metaconsole_restore_db(); } } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index e3afbb8ded..5143643beb 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -737,7 +737,11 @@ function html_print_select_multiple_filtered( array $sections=[] ) { ui_require_css_file('multiselect_filtered'); - ui_require_javascript_file('multiselect_filtered'); + if (is_ajax() === true) { + ui_require_javascript_file('multiselect_filtered', 'include/javascript/', true); + } else { + ui_require_javascript_file('multiselect_filtered'); + } if (empty($name) === true) { $rid = uniqid(); @@ -794,7 +798,7 @@ function html_print_select_multiple_filtered( } // Main container. - $output .= '
'; + $output = '
'; // Left box. $output .= '
'; @@ -941,7 +945,7 @@ function html_print_select_multiple_filtered( $output .= '
'; - // Left box. + // Right box. $output .= '
'; // Filtering. @@ -1062,6 +1066,151 @@ function html_print_select_multiple_filtered( } +/** + * Form multiple inputs for slect groups. + * + * @param array $data Data inputs. + * + * @return string Html output. + */ +function html_print_select_multiple_modules_filtered(array $data):string +{ + if (is_ajax() === true) { + ui_require_javascript_file( + 'multiselect_filtered', + 'include/javascript/', + true + ); + } else { + ui_require_javascript_file('multiselect_filtered'); + } + + $uniqId = $data['uniqId']; + + // Group. + $output = '
'; + $output .= html_print_input( + [ + 'label' => __('Group'), + 'name' => 'filtered-module-group-'.$uniqId, + 'returnAllGroup' => true, + 'privilege' => 'AR', + 'type' => 'select_groups', + 'return' => true, + 'script' => 'fmAgentChange(\''.$uniqId.'\')', + 'selected' => $data['mGroup'], + ] + ); + + // Recursion. + $output .= html_print_input( + [ + 'label' => __('Recursion'), + 'type' => 'switch', + 'name' => 'filtered-module-recursion-'.$uniqId, + 'value' => (empty($data['mRecursion']) === true) ? false : true, + 'checked' => (empty($data['mRecursion']) === true) ? false : true, + 'return' => true, + 'id' => 'filtered-module-recursion-'.$uniqId, + 'onchange' => 'fmAgentChange(\''.$uniqId.'\')', + ] + ); + + // Groups module. + $module_groups = db_get_all_rows_sql( + 'SELECT * FROM tmodule_group ORDER BY name' + ); + $module_groups = array_reduce( + $module_groups, + function ($carry, $item) { + $carry[$item['id_mg']] = $item['name']; + return $carry; + } + ); + + $output .= html_print_input( + [ + 'label' => __('Module group'), + 'type' => 'select', + 'fields' => $module_groups, + 'name' => 'filtered-module-module-group-'.$uniqId, + 'selected' => $data['mModuleGroup'], + 'return' => true, + 'nothing' => __('All'), + 'nothing_value' => 0, + 'script' => 'fmModuleChange(\''.$uniqId.'\')', + ] + ); + $output .= '
'; + + $output .= '
'; + // Agent. + $agents = agents_get_group_agents($data['mGroup']); + if ((empty($agents)) === true || $agents == -1) { + $agents = []; + } + + $output .= html_print_input( + [ + 'label' => __('Agents'), + 'type' => 'select', + 'fields' => $agents, + 'name' => 'filtered-module-agents-'.$uniqId, + 'selected' => explode(',', $data['mAgents']), + 'return' => true, + 'multiple' => true, + 'style' => 'min-width: 200px;max-width:200px;', + 'script' => 'fmModuleChange(\''.$uniqId.'\')', + ] + ); + + // Show common modules. + $selection = [ + 0 => __('Show common modules'), + 1 => __('Show all modules'), + ]; + $output .= html_print_input( + [ + 'label' => __('Show common modules'), + 'type' => 'select', + 'fields' => $selection, + 'name' => 'filtered-module-show-common-modules-'.$uniqId, + 'selected' => $data['mShowCommonModules'], + 'return' => true, + 'script' => 'fmModuleChange(\''.$uniqId.'\')', + ] + ); + + $all_modules = select_modules_for_agent_group( + $data['mModuleGroup'], + explode(',', $data['mAgents']), + $data['mShowCommonModules'], + false + ); + + $output .= html_print_input( + [ + 'label' => __('Modules'), + 'type' => 'select', + 'fields' => $all_modules, + 'name' => 'filtered-module-modules-'.$uniqId, + 'selected' => explode(',', $data['mModules']), + 'return' => true, + 'multiple' => true, + 'style' => 'min-width: 200px;max-width:200px;', + ] + ); + + $output .= '
'; + + if ($data['return'] === false) { + echo $output; + } + + return $output; +} + + /** * Prints an array of fields in a popup menu of a form based on a SQL query. * The first and second columns of the query will be used. @@ -1615,6 +1764,55 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*', } +/** + * Prints an input slide. + * + * @param string $name Name. + * @param integer $value Value. + * @param string $id Id. + * @param boolean $return Return. + * @param integer $min Min. + * @param integer $max Max. + * @param integer $step Step. + * @param string $class Class. + * @param string $oninput Oninput. + * + * @return string HTML code for input. + */ +function html_print_input_range( + $name, + $value, + $id='', + $return=true, + $min=0, + $max=100, + $step=1, + $class='', + $oninput='' +) { + $output = ' $attr_value) { if (! in_array($attribute, $valid_attrs)) { @@ -1797,6 +2000,7 @@ function html_print_div($options, $return=false) 'id', 'style', 'class', + 'title', ]; if (isset($options['hidden'])) { @@ -1907,7 +2111,7 @@ function html_print_input_text( $size=50, $maxlength=255, $return=false, - $disabled=false, + $readonly=false, $required=false, $function='', $class='', @@ -1916,7 +2120,8 @@ function html_print_input_text( $autofocus=false, $onKeyDown='', $formTo='', - $onKeyUp='' + $onKeyUp='', + $disabled=false ) { if ($maxlength == 0) { $maxlength = 255; @@ -1968,12 +2173,14 @@ function html_print_input_text( $alt, $size, $maxlength, - $disabled, + $readonly, '', $attr, $return, false, - $function + $function, + 'off', + $disabled ); } @@ -2224,21 +2431,36 @@ function html_print_input_image($name, $src, $value, $style='', $return=false, $ * * The element will have an id like: "hidden-$name" * - * @param string $name Input name. - * @param string $value Input value. - * @param boolean $return Whether to return an output string or echo now (optional, echo by default). - * @param string $class Set the class of input. + * @param string $name Input name. + * @param string $value Input value. + * @param boolean $return Whether to return an output string or echo now + * (optional, echo by default). + * @param string $class Set the class of input. + * @param string $attributes String with the needed attributes to add. + * @param string $id Specific id. * * @return string HTML code if return parameter is true. */ -function html_print_input_hidden($name, $value, $return=false, $class=false) -{ +function html_print_input_hidden( + $name, + $value, + $return=false, + $class=false, + $attributes=false, + $id='' +) { if ($class !== false) { $classText = 'class="'.$class.'"'; } else { $classText = ''; } + if ($attributes !== false) { + $otherAttributes = $attributes; + } else { + $otherAttributes = ''; + } + $separator = '"'; if (is_string($value)) { @@ -2247,7 +2469,12 @@ function html_print_input_hidden($name, $value, $return=false, $class=false) } } - $output = ''; + $idInput = 'hidden-'.$name; + if (empty($id) === false) { + $idInput = $id; + } + + $output = ''; if ($return) { return $output; @@ -2446,8 +2673,16 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $ * * @return string HTML code if return parameter is true. */ -function html_print_textarea($name, $rows, $columns, $value='', $attributes='', $return=false, $class='', $disable=false) -{ +function html_print_textarea( + $name, + $rows, + $columns, + $value='', + $attributes='', + $return=false, + $class='', + $disable=false +) { $disabled = ($disable) ? 'disabled' : ''; $output = '