MCPcopy Create free account
hub / github.com/Icinga/icinga2 / EnableHostSvcChecks

Method EnableHostSvcChecks

lib/icinga/externalcommandprocessor.cpp:578–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578void ExternalCommandProcessor::EnableHostSvcChecks(double, const std::vector<String>& arguments)
579{
580 Host::Ptr host = Host::GetByName(arguments[0]);
581
582 if (!host)
583 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot enable host service checks for non-existent host '" + arguments[0] + "'"));
584
585 for (const Service::Ptr& service : host->GetServices()) {
586 Log(LogNotice, "ExternalCommandProcessor")
587 << "Enabling active checks for service '" << service->GetName() << "'";
588
589 service->ModifyAttribute("enable_active_checks", true);
590 }
591}
592
593void ExternalCommandProcessor::DisableHostSvcChecks(double, const std::vector<String>& arguments)
594{

Callers

nothing calls this directly

Calls 4

LogClass · 0.85
ModifyAttributeMethod · 0.80
GetServicesMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected