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

Method ChangeCustomSvcVar

lib/icinga/externalcommandprocessor.cpp:2116–2128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2114}
2115
2116void ExternalCommandProcessor::ChangeCustomSvcVar(double, const std::vector<String>& arguments)
2117{
2118 Service::Ptr service = Service::GetByNamePair(arguments[0], arguments[1]);
2119
2120 if (!service)
2121 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change custom var for non-existent service '" + arguments[1] + "' on host '" + arguments[0] + "'"));
2122
2123 Log(LogNotice, "ExternalCommandProcessor")
2124 << "Changing custom var '" << arguments[2] << "' for service '" << arguments[1] << "' on host '"
2125 << arguments[0] << "' to value '" << arguments[3] << "'";
2126
2127 service->ModifyAttribute("vars." + arguments[2], arguments[3]);
2128}
2129
2130void ExternalCommandProcessor::ChangeCustomUserVar(double, const std::vector<String>& arguments)
2131{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected