From b606f466f23e8ea29006fa901b2f0478c09acfe2 Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 9 Dec 2020 12:08:35 +0100 Subject: [PATCH] fix(servicediscovery): contact group is not working (#86) --- .../modules/centreon/autodiscovery/services/resources.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/centreon-gorgone/gorgone/modules/centreon/autodiscovery/services/resources.pm b/centreon-gorgone/gorgone/modules/centreon/autodiscovery/services/resources.pm index 55d7a2a7634..5eaf8544ecf 100644 --- a/centreon-gorgone/gorgone/modules/centreon/autodiscovery/services/resources.pm +++ b/centreon-gorgone/gorgone/modules/centreon/autodiscovery/services/resources.pm @@ -246,10 +246,10 @@ sub get_rules { } foreach my $row (@$datas2) { # Already add it - next if (defined($rules->{ $_->[0] }->{contact}->{ $row->[1] })); - if ((my $contact = get_contact(class_object_centreon => $options{class_object_centreon}, contact_id => $row->[1]))) { + next if (defined($rules->{ $_->[0] }->{contact}->{ $row->[0] })); + if ((my $contact = get_contact(class_object_centreon => $options{class_object_centreon}, contact_id => $row->[0]))) { $rules->{ $_->[0] }->{contact} = {} if (!defined($rules->{ $_->[0] }->{contact})); - $rules->{ $_->[0] }->{contact}->{$contact->{contact_id}} = { contact_email => $contact->{contact_email} }; + $rules->{ $_->[0] }->{contact}->{ $contact->{contact_id} } = { contact_email => $contact->{contact_email} }; } } }