fix alarm mode
This commit is contained in:
parent
db0fcd604d
commit
7c66939f40
|
@ -99,6 +99,7 @@ sub prefix_alarm_output {
|
||||||
sub manage_selection {
|
sub manage_selection {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
$self->{global} = { warning => 0, critical => 0 };
|
||||||
$self->{alarms} = {};
|
$self->{alarms} = {};
|
||||||
my $result = $options{custom}->get_alarms();
|
my $result = $options{custom}->get_alarms();
|
||||||
foreach my $alarm (values %{$result->{alarms}}) {
|
foreach my $alarm (values %{$result->{alarms}}) {
|
||||||
|
@ -119,11 +120,7 @@ sub manage_selection {
|
||||||
$self->{global}->{critical}++ if ($alarm->{status} =~ m/CRITICAL/);
|
$self->{global}->{critical}++ if ($alarm->{status} =~ m/CRITICAL/);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{global} = {
|
$self->{global}->{total} = scalar(keys %{$self->{alarms}});
|
||||||
total => scalar(keys %{$self->{alarms}}),
|
|
||||||
warning => 0,
|
|
||||||
critical => 0
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Reference in New Issue