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

Method ChangeCustomHostVar

lib/icinga/externalcommandprocessor.cpp:2103–2114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2101}
2102
2103void ExternalCommandProcessor::ChangeCustomHostVar(double, const std::vector<String>& arguments)
2104{
2105 Host::Ptr host = Host::GetByName(arguments[0]);
2106
2107 if (!host)
2108 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change custom var for non-existent host '" + arguments[0] + "'"));
2109
2110 Log(LogNotice, "ExternalCommandProcessor")
2111 << "Changing custom var '" << arguments[1] << "' for host '" << arguments[0] << "' to value '" << arguments[2] << "'";
2112
2113 host->ModifyAttribute("vars." + arguments[1], arguments[2]);
2114}
2115
2116void ExternalCommandProcessor::ChangeCustomSvcVar(double, const std::vector<String>& arguments)
2117{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected