mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7765 from Icinga/bugfix/opentsdb-graphite-reconnect
Graphite/OpenTSDB: Ensure that Reconnect failure is detected
This commit is contained in:
commit
e1939368b2
|
@ -194,6 +194,10 @@ void GraphiteWriter::ReconnectInternal()
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Log(LogWarning, "GraphiteWriter")
|
Log(LogWarning, "GraphiteWriter")
|
||||||
<< "Can't connect to Graphite on host '" << GetHost() << "' port '" << GetPort() << ".'";
|
<< "Can't connect to Graphite on host '" << GetHost() << "' port '" << GetPort() << ".'";
|
||||||
|
|
||||||
|
SetConnected(false);
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConnected(true);
|
SetConnected(true);
|
||||||
|
|
|
@ -115,8 +115,10 @@ void OpenTsdbWriter::ReconnectTimerHandler()
|
||||||
if (GetConnected())
|
if (GetConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
double startTime = Utility::GetTime();
|
||||||
|
|
||||||
Log(LogNotice, "OpenTsdbWriter")
|
Log(LogNotice, "OpenTsdbWriter")
|
||||||
<< "Reconnect to OpenTSDB TSD on host '" << GetHost() << "' port '" << GetPort() << "'.";
|
<< "Reconnecting to OpenTSDB TSD on host '" << GetHost() << "' port '" << GetPort() << "'.";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We're using telnet as input method. Future PRs may change this into using the HTTP API.
|
* We're using telnet as input method. Future PRs may change this into using the HTTP API.
|
||||||
|
@ -129,9 +131,16 @@ void OpenTsdbWriter::ReconnectTimerHandler()
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
Log(LogWarning, "OpenTsdbWriter")
|
Log(LogWarning, "OpenTsdbWriter")
|
||||||
<< "Can't connect to OpenTSDB on host '" << GetHost() << "' port '" << GetPort() << ".'";
|
<< "Can't connect to OpenTSDB on host '" << GetHost() << "' port '" << GetPort() << ".'";
|
||||||
|
|
||||||
|
SetConnected(false);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetConnected(true);
|
SetConnected(true);
|
||||||
|
|
||||||
|
Log(LogInformation, "OpenTsdbWriter")
|
||||||
|
<< "Finished reconnecting to OpenTSDB in " << std::setw(2) << Utility::GetTime() - startTime << " second(s).";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue