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

Method ChangeCustomUserVar

lib/icinga/externalcommandprocessor.cpp:2130–2141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2128}
2129
2130void ExternalCommandProcessor::ChangeCustomUserVar(double, const std::vector<String>& arguments)
2131{
2132 User::Ptr user = User::GetByName(arguments[0]);
2133
2134 if (!user)
2135 BOOST_THROW_EXCEPTION(std::invalid_argument("Cannot change custom var for non-existent user '" + arguments[0] + "'"));
2136
2137 Log(LogNotice, "ExternalCommandProcessor")
2138 << "Changing custom var '" << arguments[1] << "' for user '" << arguments[0] << "' to value '" << arguments[2] << "'";
2139
2140 user->ModifyAttribute("vars." + arguments[1], arguments[2]);
2141}
2142
2143void ExternalCommandProcessor::ChangeCustomCheckcommandVar(double, const std::vector<String>& arguments)
2144{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
ModifyAttributeMethod · 0.80

Tested by

no test coverage detected