"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/perfdata/elasticsearchwriter.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.

elasticsearchwriter.cpp  (icinga2-2.11.5):elasticsearchwriter.cpp  (icinga2-2.12.0)
skipping to change at line 173 skipping to change at line 173
String escapedKey = pdv->GetLabel(); String escapedKey = pdv->GetLabel();
boost::replace_all(escapedKey, " ", "_"); boost::replace_all(escapedKey, " ", "_");
boost::replace_all(escapedKey, ".", "_"); boost::replace_all(escapedKey, ".", "_");
boost::replace_all(escapedKey, "\\", "_"); boost::replace_all(escapedKey, "\\", "_");
boost::algorithm::replace_all(escapedKey, "::", "."); boost::algorithm::replace_all(escapedKey, "::", ".");
String perfdataPrefix = prefix + "perfdata." + escapedKey ; String perfdataPrefix = prefix + "perfdata." + escapedKey ;
fields->Set(perfdataPrefix + ".value", pdv->GetValue()); fields->Set(perfdataPrefix + ".value", pdv->GetValue());
if (pdv->GetMin()) if (!pdv->GetMin().IsEmpty())
fields->Set(perfdataPrefix + ".min", pdv->GetMin( )); fields->Set(perfdataPrefix + ".min", pdv->GetMin( ));
if (pdv->GetMax()) if (!pdv->GetMax().IsEmpty())
fields->Set(perfdataPrefix + ".max", pdv->GetMax( )); fields->Set(perfdataPrefix + ".max", pdv->GetMax( ));
if (pdv->GetWarn()) if (!pdv->GetWarn().IsEmpty())
fields->Set(perfdataPrefix + ".warn", pdv->GetWar n()); fields->Set(perfdataPrefix + ".warn", pdv->GetWar n());
if (pdv->GetCrit()) if (!pdv->GetCrit().IsEmpty())
fields->Set(perfdataPrefix + ".crit", pdv->GetCri t()); fields->Set(perfdataPrefix + ".crit", pdv->GetCri t());
if (!pdv->GetUnit().IsEmpty()) if (!pdv->GetUnit().IsEmpty())
fields->Set(perfdataPrefix + ".unit", pdv->GetUni t()); fields->Set(perfdataPrefix + ".unit", pdv->GetUni t());
} }
} }
} }
void ElasticsearchWriter::CheckResultHandler(const Checkable::Ptr& checkable, co nst CheckResult::Ptr& cr) void ElasticsearchWriter::CheckResultHandler(const Checkable::Ptr& checkable, co nst CheckResult::Ptr& cr)
{ {
skipping to change at line 591 skipping to change at line 591
OptionalTlsStream ElasticsearchWriter::Connect() OptionalTlsStream ElasticsearchWriter::Connect()
{ {
Log(LogNotice, "ElasticsearchWriter") Log(LogNotice, "ElasticsearchWriter")
<< "Connecting to Elasticsearch on host '" << GetHost() << "' por t '" << GetPort() << "'."; << "Connecting to Elasticsearch on host '" << GetHost() << "' por t '" << GetPort() << "'.";
OptionalTlsStream stream; OptionalTlsStream stream;
bool tls = GetEnableTls(); bool tls = GetEnableTls();
if (tls) { if (tls) {
std::shared_ptr<boost::asio::ssl::context> sslContext; Shared<boost::asio::ssl::context>::Ptr sslContext;
try { try {
sslContext = MakeAsioSslContext(GetCertPath(), GetKeyPath (), GetCaPath()); sslContext = MakeAsioSslContext(GetCertPath(), GetKeyPath (), GetCaPath());
} catch (const std::exception&) { } catch (const std::exception&) {
Log(LogWarning, "ElasticsearchWriter") Log(LogWarning, "ElasticsearchWriter")
<< "Unable to create SSL context."; << "Unable to create SSL context.";
throw; throw;
} }
stream.first = std::make_shared<AsioTlsStream>(IoEngine::Get().Ge stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetIoC
tIoContext(), *sslContext, GetHost()); ontext(), *sslContext, GetHost());
} else { } else {
stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get().G etIoContext()); stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().GetIo Context());
} }
try { try {
icinga::Connect(tls ? stream.first->lowest_layer() : stream.secon d->lowest_layer(), GetHost(), GetPort()); icinga::Connect(tls ? stream.first->lowest_layer() : stream.secon d->lowest_layer(), GetHost(), GetPort());
} catch (const std::exception&) { } catch (const std::exception&) {
Log(LogWarning, "ElasticsearchWriter") Log(LogWarning, "ElasticsearchWriter")
<< "Can't connect to Elasticsearch on host '" << GetHost( ) << "' port '" << GetPort() << "'."; << "Can't connect to Elasticsearch on host '" << GetHost( ) << "' port '" << GetPort() << "'.";
throw; throw;
} }
 End of changes. 7 change blocks. 
8 lines changed or deleted 9 lines changed or added

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