From 498a9db9973714f7e7b8ab4e71f57b4e0f07cb89 Mon Sep 17 00:00:00 2001 From: alejandro Date: Mon, 3 Oct 2022 13:33:31 +0200 Subject: [PATCH] adding new parameter check_type for define types of modules --- pandora_plugins/MySQL/pandora_mysql.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_plugins/MySQL/pandora_mysql.pl b/pandora_plugins/MySQL/pandora_mysql.pl index ad9c4ebaa4..356db681e0 100644 --- a/pandora_plugins/MySQL/pandora_mysql.pl +++ b/pandora_plugins/MySQL/pandora_mysql.pl @@ -303,6 +303,10 @@ sub parse_config { if ($parametro =~ m/^check\_name\s(.*)/i) { $checks[$plugin_setup{"numchecks"}]{'check_name'} = trim($1); } + + if ($parametro =~ m/^check\_type\s(.*)/i) { + $checks[$plugin_setup{"numchecks"}]{'check_type'} = trim($1); + } if ($parametro =~ m/^check\_schema\s(.*)/i) { $checks[$plugin_setup{"numchecks"}]{'check_schema'} = trim($1); @@ -1015,6 +1019,7 @@ foreach (@checks) { my $check_show = $_->{'show'}; my $return_type = $_->{'return_type'}; my $check_name = $_->{'check_name'}; + my $check_type = $_->{'check_type'}; $result_check = 0; # Process check (System parameters) @@ -1156,7 +1161,7 @@ foreach (@checks) { print_module("MySQL_" . $type . '_' . $check_show, $module_type, $result_check, '', $check_status); } else { if (defined($check_name)) { - print_module("MySQL_" . $type . "_" . $check_name, $module_type, $result_check, '', $check_status); + print_module("MySQL_" . $type . "_" . $check_name, $check_type, $result_check, '', $check_status); } else { print_module("MySQL_" . $type, $module_type, $result_check, '', $check_status); } @@ -1186,3 +1191,4 @@ foreach (@checks) { } # type ne 'unknown' } +