Commit e79c7861 authored by David Boucher's avatar David Boucher
Browse files

fix(config/applier/host): When a host is disabled, so on for its services

parent 4c4d5463
......@@ -18,7 +18,9 @@
*/
#include "com/centreon/engine/configuration/applier/host.hh"
#include <algorithm>
#include "com/centreon/engine/broker.hh"
#include "com/centreon/engine/common.hh"
#include "com/centreon/engine/config.hh"
......@@ -426,12 +428,19 @@ void applier::host::remove_object(configuration::host const& obj) {
// Remove events related to this host.
applier::scheduler::instance().remove_host(obj.key());
//remove host from hostgroup->members
for (auto& it_h: it->second->get_parent_groups())
// remove host from hostgroup->members
for (auto& it_h : it->second->get_parent_groups())
it_h->members.erase(it->second->get_name());
// Notify event broker.
timeval tv(get_broker_timestamp(nullptr));
for (auto it_s = it->second->services.begin();
it_s != it->second->services.end(); ++it_s)
broker_adaptive_service_data(NEBTYPE_SERVICE_DELETE, NEBFLAG_NONE,
NEBATTR_NONE, it_s->second, CMD_NONE,
MODATTR_ALL, MODATTR_ALL, &tv);
broker_adaptive_host_data(NEBTYPE_HOST_DELETE, NEBFLAG_NONE, NEBATTR_NONE,
it->second.get(), CMD_NONE, MODATTR_ALL,
MODATTR_ALL, &tv);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment