"Fossies" - the Fresh Open Source Software Archive  

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

influxdbwriter.cpp  (icinga2-2.11.5):influxdbwriter.cpp  (icinga2-2.12.0)
skipping to change at line 180 skipping to change at line 180
OptionalTlsStream InfluxdbWriter::Connect() OptionalTlsStream InfluxdbWriter::Connect()
{ {
Log(LogNotice, "InfluxdbWriter") Log(LogNotice, "InfluxdbWriter")
<< "Reconnecting to InfluxDB on host '" << GetHost() << "' port ' " << GetPort() << "'."; << "Reconnecting to InfluxDB on host '" << GetHost() << "' port ' " << GetPort() << "'.";
OptionalTlsStream stream; OptionalTlsStream stream;
bool ssl = GetSslEnable(); bool ssl = GetSslEnable();
if (ssl) { if (ssl) {
std::shared_ptr<boost::asio::ssl::context> sslContext; Shared<boost::asio::ssl::context>::Ptr sslContext;
try { try {
sslContext = MakeAsioSslContext(GetSslCert(), GetSslKey() , GetSslCaCert()); sslContext = MakeAsioSslContext(GetSslCert(), GetSslKey() , GetSslCaCert());
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
Log(LogWarning, "InfluxdbWriter") Log(LogWarning, "InfluxdbWriter")
<< "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(ssl ? stream.first->lowest_layer() : stream.secon d->lowest_layer(), GetHost(), GetPort()); icinga::Connect(ssl ? stream.first->lowest_layer() : stream.secon d->lowest_layer(), GetHost(), GetPort());
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
Log(LogWarning, "InfluxdbWriter") Log(LogWarning, "InfluxdbWriter")
<< "Can't connect to InfluxDB on host '" << GetHost() << "' port '" << GetPort() << "'."; << "Can't connect to InfluxDB on host '" << GetHost() << "' port '" << GetPort() << "'.";
throw; throw;
} }
skipping to change at line 300 skipping to change at line 301
<< checkable->GetName() << "' and command '" << checkable->GetName() << "' and command '"
<< checkCommand->GetName() << "' with value: " << val; << checkCommand->GetName() << "' with value: " << val;
continue; continue;
} }
} }
Dictionary::Ptr fields = new Dictionary(); Dictionary::Ptr fields = new Dictionary();
fields->Set("value", pdv->GetValue()); fields->Set("value", pdv->GetValue());
if (GetEnableSendThresholds()) { if (GetEnableSendThresholds()) {
if (pdv->GetCrit()) if (!pdv->GetCrit().IsEmpty())
fields->Set("crit", pdv->GetCrit()); fields->Set("crit", pdv->GetCrit());
if (pdv->GetWarn()) if (!pdv->GetWarn().IsEmpty())
fields->Set("warn", pdv->GetWarn()); fields->Set("warn", pdv->GetWarn());
if (pdv->GetMin()) if (!pdv->GetMin().IsEmpty())
fields->Set("min", pdv->GetMin()); fields->Set("min", pdv->GetMin());
if (pdv->GetMax()) if (!pdv->GetMax().IsEmpty())
fields->Set("max", pdv->GetMax()); fields->Set("max", pdv->GetMax());
} }
if (!pdv->GetUnit().IsEmpty()) { if (!pdv->GetUnit().IsEmpty()) {
fields->Set("unit", pdv->GetUnit()); fields->Set("unit", pdv->GetUnit());
} }
SendMetric(checkable, tmpl, pdv->GetLabel(), fields, ts); SendMetric(checkable, tmpl, pdv->GetLabel(), fields, 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)