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

Method DisableHostSvcChecks

lib/icinga/externalcommandprocessor.cpp:593–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593void ExternalCommandProcessor::DisableHostSvcChecks(double, const std::vector<String>& arguments)
594{
595 Host::Ptr host = Host::GetByName(arguments[0]);
596
597 if (!host)
598 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot disable host service checks for non-existent host '" + arguments[0] + "'"));
599
600 for (const Service::Ptr& service : host->GetServices()) {
601 Log(LogNotice, "ExternalCommandProcessor")
602 << "Disabling active checks for service '" << service->GetName() << "'";
603
604 service->ModifyAttribute("enable_active_checks", false);
605 }
606}
607
608void ExternalCommandProcessor::AcknowledgeSvcProblem(double, const std::vector<String>& arguments)
609{

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