"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/cli/nodesetupcommand.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

nodesetupcommand.cpp  (icinga2-2.11.5):nodesetupcommand.cpp  (icinga2-2.12.0)
skipping to change at line 47 skipping to change at line 47
void NodeSetupCommand::InitParameters(boost::program_options::options_descriptio n& visibleDesc, void NodeSetupCommand::InitParameters(boost::program_options::options_descriptio n& visibleDesc,
boost::program_options::options_description& hiddenDesc) const boost::program_options::options_description& hiddenDesc) const
{ {
visibleDesc.add_options() visibleDesc.add_options()
("zone", po::value<std::string>(), "The name of the local zone") ("zone", po::value<std::string>(), "The name of the local zone")
("endpoint", po::value<std::vector<std::string> >(), "Connect to remote endpoint; syntax: cn[,host,port]") ("endpoint", po::value<std::vector<std::string> >(), "Connect to remote endpoint; syntax: cn[,host,port]")
("parent_host", po::value<std::string>(), "The name of the parent host for auto-signing the csr; syntax: host[,port]") ("parent_host", po::value<std::string>(), "The name of the parent host for auto-signing the csr; syntax: host[,port]")
("parent_zone", po::value<std::string>(), "The name of the parent zone") ("parent_zone", po::value<std::string>(), "The name of the parent zone")
("listen", po::value<std::string>(), "Listen on host,port") ("listen", po::value<std::string>(), "Listen on host,port")
("ticket", po::value<std::string>(), "Generated ticket number for this request (optional)") ("ticket", po::value<std::string>(), "Generated ticket number for this request (optional)")
("trustedcert", po::value<std::string>(), "Trusted master certifi cate file") ("trustedcert", po::value<std::string>(), "Trusted parent certifi cate file as connection verification (received via 'pki save-cert')")
("cn", po::value<std::string>(), "The certificate's common name") ("cn", po::value<std::string>(), "The certificate's common name")
("accept-config", "Accept config from master") ("accept-config", "Accept config from parent node")
("accept-commands", "Accept commands from master") ("accept-commands", "Accept commands from parent node")
("master", "Use setup for a master instance") ("master", "Use setup for a master instance")
("global_zones", po::value<std::vector<std::string> >(), "The nam es of the additional global zones to 'global-templates' and 'director-global'.") ("global_zones", po::value<std::vector<std::string> >(), "The nam es of the additional global zones to 'global-templates' and 'director-global'.")
("disable-confd", "Disables the conf.d directory during the setup "); ("disable-confd", "Disables the conf.d directory during the setup ");
hiddenDesc.add_options() hiddenDesc.add_options()
("master_zone", po::value<std::string>(), "DEPRECATED: The name o f the master zone") ("master_zone", po::value<std::string>(), "DEPRECATED: The name o f the master zone")
("master_host", po::value<std::string>(), "DEPRECATED: The name o f the master host for auto-signing the csr; syntax: host[,port]"); ("master_host", po::value<std::string>(), "DEPRECATED: The name o f the master host for auto-signing the csr; syntax: host[,port]");
} }
std::vector<String> NodeSetupCommand::GetArgumentSuggestions(const String& argum ent, const String& word) const std::vector<String> NodeSetupCommand::GetArgumentSuggestions(const String& argum ent, const String& word) const
skipping to change at line 372 skipping to change at line 372
} }
/* Send a signing request to the parent immediately, or leave it to the u ser. */ /* Send a signing request to the parent immediately, or leave it to the u ser. */
if (connectToParent) { if (connectToParent) {
/* In contrast to `node wizard` the user must manually fetch /* In contrast to `node wizard` the user must manually fetch
* the trustedParentCert to prove the trust relationship (fetched with 'pki save-cert'). * the trustedParentCert to prove the trust relationship (fetched with 'pki save-cert').
*/ */
if (!vm.count("trustedcert")) { if (!vm.count("trustedcert")) {
Log(LogCritical, "cli") Log(LogCritical, "cli")
<< "Please pass the trusted cert retrieved from t he parent node (master or satellite)\n" << "Please pass the trusted cert retrieved from t he parent node (master or satellite)\n"
<< "(Hint: 'icinga2 pki save-cert --host <masterh ost> --port <5665> --key local.key --cert local.crt --trustedcert parent.crt')." ; << "(Hint: 'icinga2 pki save-cert --host <parenth ost> --port <5665> --key local.key --cert local.crt --trustedcert trusted-parent .crt').";
return 1; return 1;
} }
String trustedCert = vm["trustedcert"].as<std::string>(); String trustedCert = vm["trustedcert"].as<std::string>();
try{ try{
trustedParentCert = GetX509Certificate(trustedCert); trustedParentCert = GetX509Certificate(trustedCert);
} catch (const std::exception&) { } catch (const std::exception&) {
Log(LogCritical, "cli") Log(LogCritical, "cli")
<< "Can't read trusted cert at '" << trustedCert << "'."; << "Can't read trusted cert at '" << trustedCert << "'.";
return 1; return 1;
} }
try {
if (IsCa(trustedParentCert)) {
Log(LogCritical, "cli")
<< "The trusted parent certificate is NOT
a client certificate. It seems you passed the 'ca.crt' CA certificate via '--tr
ustedcert' parameter.";
return 1;
}
} catch (const std::exception&) {
/* Swallow the error and do not run the check on unsuppor
ted OpenSSL platforms. */
}
Log(LogInformation, "cli") Log(LogInformation, "cli")
<< "Verifying trusted certificate file '" << vm["trustedc ert"].as<std::string>() << "'."; << "Verifying trusted certificate file '" << vm["trustedc ert"].as<std::string>() << "'.";
Log(LogInformation, "cli", "Requesting a signed certificate from the parent Icinga node."); Log(LogInformation, "cli", "Requesting a signed certificate from the parent Icinga node.");
if (PkiUtility::RequestCertificate(parentHost, parentPort, key, c ert, ca, trustedParentCert, ticket) > 0) { if (PkiUtility::RequestCertificate(parentHost, parentPort, key, c ert, ca, trustedParentCert, ticket) > 0) {
Log(LogCritical, "cli") Log(LogCritical, "cli")
<< "Failed to fetch signed certificate from paren t Icinga node '" << "Failed to fetch signed certificate from paren t Icinga node '"
<< parentHost << ", " << parentHost << ", "
<< parentPort << "'. Please try again."; << parentPort << "'. Please try again.";
 End of changes. 4 change blocks. 
4 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)