fix catalog_status_threshold

This commit is contained in:
Colin Gagnaire 2019-07-04 11:15:47 +02:00
parent d3aaad0bb3
commit 4aae329d78
1 changed files with 4 additions and 4 deletions

View File

@ -38,17 +38,17 @@ sub catalog_status_threshold {
my $label = $self->{label};
$label =~ s/-/_/g;
if (defined($self->{instance_mode}->{option_results}->{ok_status}) && $self->{instance_mode}->{option_results}->{ok_status} ne '' &&
eval "$self->{instance_mode}->{option_results}->{ok_status}") {
if (defined($self->{instance_mode}->{option_results}->{'ok_' . $label}) && $self->{instance_mode}->{option_results}->{'ok_' . $label} ne '' &&
eval "$self->{instance_mode}->{option_results}->{'ok_' . $label}") {
$status = 'ok';
} elsif (defined($self->{instance_mode}->{option_results}->{'critical_' . $label}) && $self->{instance_mode}->{option_results}->{'critical_' . $label} ne '' &&
eval "$self->{instance_mode}->{option_results}->{'critical_' . $label}") {
$status = 'critical';
} elsif (defined($self->{instance_mode}->{option_results}->{'warning_' . $label}) && $self->{instance_mode}->{option_results}->{'warning_' . $label} ne '' &&
eval "$self->{instance_mode}->{option_results}->{'warning_' . $label}") {
eval "$self->{instance_mode}->{option_results}->{'warning_' . $label}") {
$status = 'warning';
} elsif (defined($self->{instance_mode}->{option_results}->{'unknown_' . $label}) && $self->{instance_mode}->{option_results}->{'unknown_' . $label} ne '' &&
eval "$self->{instance_mode}->{option_results}->{'unknown_' . $label}") {
eval "$self->{instance_mode}->{option_results}->{'unknown_' . $label}") {
$status = 'unknown';
}
};