fix alarm mode

This commit is contained in:
garnier-quentin 2020-06-29 14:27:51 +02:00
parent db0fcd604d
commit 7c66939f40
1 changed files with 2 additions and 5 deletions

View File

@ -99,6 +99,7 @@ sub prefix_alarm_output {
sub manage_selection {
my ($self, %options) = @_;
$self->{global} = { warning => 0, critical => 0 };
$self->{alarms} = {};
my $result = $options{custom}->get_alarms();
foreach my $alarm (values %{$result->{alarms}}) {
@ -119,11 +120,7 @@ sub manage_selection {
$self->{global}->{critical}++ if ($alarm->{status} =~ m/CRITICAL/);
}
$self->{global} = {
total => scalar(keys %{$self->{alarms}}),
warning => 0,
critical => 0
};
$self->{global}->{total} = scalar(keys %{$self->{alarms}});
}
1;