fix influxdb query mode
This commit is contained in:
parent
b6a0625b53
commit
dbec7823b1
|
@ -179,7 +179,7 @@ sub query {
|
||||||
$self->{output}->add_option_msg(short_msg => "API returns error '" . $results->{results}[0]->{error} . "'");
|
$self->{output}->add_option_msg(short_msg => "API returns error '" . $results->{results}[0]->{error} . "'");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
push @{$data}, @{$results->{results}[0]->{series}};
|
push @{$data}, @{$results->{results}[0]->{series}} if (defined($results->{results}[0]->{series}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
|
@ -125,7 +125,7 @@ sub check_options {
|
||||||
$self->{custom_keys} = [];
|
$self->{custom_keys} = [];
|
||||||
$self->{queries} = {};
|
$self->{queries} = {};
|
||||||
foreach my $query (@{$self->{option_results}->{query}}) {
|
foreach my $query (@{$self->{option_results}->{query}}) {
|
||||||
next if ($query !~ /^(.*),(.*)/);
|
next if ($query !~ /^(.*?),(.*)$/);
|
||||||
$self->{queries}->{$1} = $2;
|
$self->{queries}->{$1} = $2;
|
||||||
push @{$self->{maps_counters}->{queries_results}[0]->{set}->{key_values}}, { name => $1 };
|
push @{$self->{maps_counters}->{queries_results}[0]->{set}->{key_values}}, { name => $1 };
|
||||||
push @{$self->{custom_keys}}, $1;
|
push @{$self->{custom_keys}}, $1;
|
||||||
|
|
Loading…
Reference in New Issue