Fix #1690
This commit is contained in:
parent
d4cc8cbf70
commit
9d7d6fd816
|
@ -90,13 +90,13 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"query:s@" => { name => 'query' },
|
'query:s@' => { name => 'query' },
|
||||||
"instance:s" => { name => 'instance' },
|
'instance:s' => { name => 'instance' },
|
||||||
"aggregation:s" => { name => 'aggregation', default => 'average' },
|
'aggregation:s' => { name => 'aggregation', default => 'average' },
|
||||||
"output:s" => { name => 'output' },
|
'output:s' => { name => 'output' },
|
||||||
"multiple-output:s" => { name => 'multiple_output' },
|
'multiple-output:s' => { name => 'multiple_output' },
|
||||||
"warning-status:s" => { name => 'warning_status', default => '' },
|
'warning-status:s' => { name => 'warning_status', default => '' },
|
||||||
"critical-status:s" => { name => 'critical_status', default => '' },
|
'critical-status:s' => { name => 'critical_status', default => '' },
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -153,11 +153,11 @@ sub manage_selection {
|
||||||
$value = $options{custom}->compute(aggregation => $self->{option_results}->{aggregation}, values => $result->{values}) if (defined($result->{values}));
|
$value = $options{custom}->compute(aggregation => $self->{option_results}->{aggregation}, values => $result->{values}) if (defined($result->{values}));
|
||||||
|
|
||||||
$self->{queries_results}->{$result->{tags}->{$self->{option_results}->{instance}}}->{instance} = $result->{tags}->{$self->{option_results}->{instance}};
|
$self->{queries_results}->{$result->{tags}->{$self->{option_results}->{instance}}}->{instance} = $result->{tags}->{$self->{option_results}->{instance}};
|
||||||
$self->{queries_results}->{$result->{tags}->{$self->{option_results}->{instance}}}->{$result->{columns}[1]} = $value;
|
$self->{queries_results}->{$result->{tags}->{$self->{option_results}->{instance}}}->{$result->{columns}[1]} = defined($value) ? $value : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scalar(keys %{$self->{queries_results}}) <= 0) {
|
if (scalar(keys %{$self->{queries_results}}) <= 0) {
|
||||||
$self->{output}->add_option_msg(short_msg => "No queries found.");
|
$self->{output}->add_option_msg(short_msg => 'No queries found.');
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue