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

Method AgentSatelliteSetup

lib/cli/nodewizardcommand.cpp:132–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132int NodeWizardCommand::AgentSatelliteSetup() const
133{
134 std::string answer;
135 String choice;
136 bool connectToParent = false;
137
138 std::cout << "Starting the Agent/Satellite setup routine...\n\n";
139
140 /* CN */
141 std::cout << ConsoleColorTag(Console_Bold)
142 << "Please specify the common name (CN)"
143 << ConsoleColorTag(Console_Normal)
144 << " [" << Utility::GetFQDN() << "]: ";
145
146 std::getline(std::cin, answer);
147
148 if (answer.empty())
149 answer = Utility::GetFQDN();
150
151 String cn = answer;
152 cn = cn.Trim();
153
154 std::vector<std::string> endpoints;
155
156 String endpointBuffer;
157
158 std::cout << ConsoleColorTag(Console_Bold)
159 << "\nPlease specify the parent endpoint(s) (master or satellite) where this node should connect to:"
160 << ConsoleColorTag(Console_Normal) << "\n";
161 String parentEndpointName;
162
163wizard_endpoint_loop_start:
164
165 std::cout << ConsoleColorTag(Console_Bold)
166 << "Master/Satellite Common Name" << ConsoleColorTag(Console_Normal)
167 << " (CN from your master/satellite node): ";
168
169 std::getline(std::cin, answer);
170
171 if (answer.empty()) {
172 Log(LogWarning, "cli", "Master/Satellite CN is required! Please retry.");
173 goto wizard_endpoint_loop_start;
174 }
175
176 endpointBuffer = answer;
177 endpointBuffer = endpointBuffer.Trim();
178
179 std::cout << "\nDo you want to establish a connection to the parent node "
180 << ConsoleColorTag(Console_Bold) << "from this node?"
181 << ConsoleColorTag(Console_Normal) << " [Y/n]: ";
182
183 std::getline (std::cin, answer);
184 boost::algorithm::to_lower(answer);
185 choice = answer;
186
187 String parentEndpointPort = "5665";
188
189 if (choice.Contains("n")) {

Callers

nothing calls this directly

Calls 15

ConsoleColorTagClass · 0.85
LogClass · 0.85
MkDirPFunction · 0.85
PathExistsFunction · 0.85
findFunction · 0.85
TrimMethod · 0.80
push_backMethod · 0.80
SplitMethod · 0.80
emptyMethod · 0.45
ContainsMethod · 0.45
sizeMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected