From e265c03925315ef5a045b1a6e827e704f5280c8b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 21 Sep 2020 18:12:54 +0200 Subject: [PATCH] Fix WMIServer, use default if not exists --- pandora_server/lib/PandoraFMS/WMIServer.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index 0733f20f4c..e08cdec00e 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -208,6 +208,11 @@ sub data_consumer ($$) { my @wmi_columns = split /\s*,\s*/, $1; my $selected_col = $wmi_columns[$module->{'tcp_port'}]; + if (!defined($selected_col)) { + logger($pa_config, 'Warning, WMI module ' . safe_output($module->{'name'}) . ' column missconfigured, using first available.', 10); + $selected_col = shift @wmi_columns; + } + # Get result col number my @output_col = split(/\|/, $output[1]);