"Fossies" - the Fresh Open Source Software Archive  

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

gelfwriter.cpp  (icinga2-2.11.5):gelfwriter.cpp  (icinga2-2.12.0)
skipping to change at line 166 skipping to change at line 166
if (GetConnected()) if (GetConnected())
return; return;
Log(LogNotice, "GelfWriter") Log(LogNotice, "GelfWriter")
<< "Reconnecting to Graylog Gelf on host '" << GetHost() << "' po rt '" << GetPort() << "'."; << "Reconnecting to Graylog Gelf on host '" << GetHost() << "' po rt '" << GetPort() << "'.";
bool ssl = GetEnableTls(); bool ssl = GetEnableTls();
if (ssl) { if (ssl) {
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& ex) { } catch (const std::exception& ex) {
Log(LogWarning, "GelfWriter") Log(LogWarning, "GelfWriter")
<< "Unable to create SSL context."; << "Unable to create SSL context.";
throw; throw;
} }
m_Stream.first = std::make_shared<AsioTlsStream>(IoEngine::Get(). m_Stream.first = Shared<AsioTlsStream>::Make(IoEngine::Get().GetI
GetIoContext(), *sslContext, GetHost()); oContext(), *sslContext, GetHost());
} else { } else {
m_Stream.second = std::make_shared<AsioTcpStream>(IoEngine::Get() .GetIoContext()); m_Stream.second = Shared<AsioTcpStream>::Make(IoEngine::Get().Get IoContext());
} }
try { try {
icinga::Connect(ssl ? m_Stream.first->lowest_layer() : m_Stream.s econd->lowest_layer(), GetHost(), GetPort()); icinga::Connect(ssl ? m_Stream.first->lowest_layer() : m_Stream.s econd->lowest_layer(), GetHost(), GetPort());
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
Log(LogWarning, "GelfWriter") Log(LogWarning, "GelfWriter")
<< "Can't connect to Graylog Gelf on host '" << GetHost() << "' port '" << GetPort() << ".'"; << "Can't connect to Graylog Gelf on host '" << GetHost() << "' port '" << GetPort() << ".'";
throw; throw;
} }
skipping to change at line 330 skipping to change at line 331
} }
String escaped_key = pdv->GetLabel(); String escaped_key = pdv->GetLabel();
boost::replace_all(escaped_key, " ", "_"); boost::replace_all(escaped_key, " ", "_");
boost::replace_all(escaped_key, ".", "_"); boost::replace_all(escaped_key, ".", "_");
boost::replace_all(escaped_key, "\\", "_"); boost::replace_all(escaped_key, "\\", "_");
boost::algorithm::replace_all(escaped_key, "::", "."); boost::algorithm::replace_all(escaped_key, "::", ".");
fields->Set("_" + escaped_key, pdv->GetValue()); fields->Set("_" + escaped_key, pdv->GetValue());
if (pdv->GetMin()) if (!pdv->GetMin().IsEmpty())
fields->Set("_" + escaped_key + "_min", p dv->GetMin()); fields->Set("_" + escaped_key + "_min", p dv->GetMin());
if (pdv->GetMax()) if (!pdv->GetMax().IsEmpty())
fields->Set("_" + escaped_key + "_max", p dv->GetMax()); fields->Set("_" + escaped_key + "_max", p dv->GetMax());
if (pdv->GetWarn()) if (!pdv->GetWarn().IsEmpty())
fields->Set("_" + escaped_key + "_warn", pdv->GetWarn()); fields->Set("_" + escaped_key + "_warn", pdv->GetWarn());
if (pdv->GetCrit()) if (!pdv->GetCrit().IsEmpty())
fields->Set("_" + escaped_key + "_crit", pdv->GetCrit()); fields->Set("_" + escaped_key + "_crit", pdv->GetCrit());
if (!pdv->GetUnit().IsEmpty()) if (!pdv->GetUnit().IsEmpty())
fields->Set("_" + escaped_key + "_unit", pdv->GetUnit()); fields->Set("_" + escaped_key + "_unit", pdv->GetUnit());
} }
} }
} }
SendLogMessage(checkable, ComposeGelfMessage(fields, GetSource(), ts)); SendLogMessage(checkable, ComposeGelfMessage(fields, GetSource(), ts));
} }
 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)