WMI column now refer to query order WMIServer
This commit is contained in:
parent
386ab5ef91
commit
3176065ce2
|
@ -203,11 +203,30 @@ sub data_consumer ($$) {
|
|||
my @row = split(/\|/, $output[2]);
|
||||
|
||||
# Get the specified column
|
||||
$module_data = $row[$module->{'tcp_port'}] if (defined ($module->{'tcp_port'}) && defined ($row[$module->{'tcp_port'}]));
|
||||
if ($module_data =~ m/^ERROR/) {
|
||||
pandora_update_module_on_error ($pa_config, $module, $dbh);
|
||||
return;
|
||||
}
|
||||
if (defined ($module->{'tcp_port'})) {
|
||||
$wmi_query =~ m/SELECT\s(.+)\sFROM/ig;
|
||||
my @wmi_columns = split /\s*,\s*/, $1;
|
||||
my $selected_col = $wmi_columns[$module->{'tcp_port'}];
|
||||
|
||||
# Get result col number
|
||||
my @output_col = split(/\|/, $output[1]);
|
||||
|
||||
# Find column number
|
||||
my $col_number;
|
||||
|
||||
for(my $i = 0; $i < @output_col; $i++ ) {
|
||||
if( $output_col[$i] =~ /$selected_col/ ) {
|
||||
$col_number = $i;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$module_data = $row[$col_number] if (defined ($col_number) && defined ($row[$col_number]));
|
||||
if ($module_data =~ m/^ERROR/) {
|
||||
pandora_update_module_on_error ($pa_config, $module, $dbh);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# Regexp
|
||||
if ($module->{'snmp_community'} ne ''){
|
||||
|
|
Loading…
Reference in New Issue