Skip to content

Commit

Permalink
MON-6317: services discovered flaps (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
garnier-quentin committed Nov 13, 2020
1 parent 02e6405 commit 0bad9e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ sub disable_services {
return if ($self->{discovery}->{rules}->{ $options{rule_id} }->{rule_disable} != 1 || !defined($self->{discovery}->{rules}->{ $options{rule_id} }->{linked_services}->{ $options{host_id} }));
foreach my $service (keys %{$self->{discovery}->{rules}->{ $options{rule_id} }->{linked_services}->{ $options{host_id} }}) {
my $service_description = $self->{discovery}->{rules}->{ $options{rule_id} }->{linked_services}->{ $options{host_id} }->{$service}->{service_description};
if (!defined($options{discovered_services}->{discovered_services}->{$service_description}) &&

if (!defined($options{discovery_svc}->{discovered_services}->{$service_description}) &&
$self->{discovery}->{rules}->{ $options{rule_id} }->{linked_services}->{ $options{host_id} }->{$service}->{service_activate} == 1) {
$self->{logger}->writeLogInfo("$options{logger_pre_message} -> disable service '" . $service_description . "'");
next if ($self->{discovery}->{dry_run} == 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ sub get_rules {
$rules->{ $_->[0] }->{linked_services} = {} if (!defined($rules->{ $_->[0] }->{linked_services}));
$rules->{ $_->[0] }->{linked_services}->{ $_->[1] } = {} if (!defined($rules->{ $_->[0] }->{linked_services}->{ $_->[1] }));
$rules->{ $_->[0] }->{linked_services}->{ $_->[1] }->{ $_->[2] } = {
service_activate => $_->[3], service_description => $_->[3]
service_activate => $_->[3], service_description => $_->[4]
};
}

Expand Down

0 comments on commit 0bad9e9

Please sign in to comment.