mirror of https://github.com/Icinga/icinga2.git
Add warning messages when performance data could not be parsed or not be sent to Graphite
refs #6550
This commit is contained in:
parent
f3d55848f5
commit
a4b7984719
|
@ -142,7 +142,10 @@ void GraphiteWriter::SendPerfdata(const String& prefix, const CheckResult::Ptr&
|
|||
Value pdv = cr->GetPerformanceData();
|
||||
|
||||
if (!pdv.IsObjectType<Dictionary>())
|
||||
{
|
||||
Log(LogWarning, "GraphiteWriter", "Could not send performance data: unparsed data.");
|
||||
return;
|
||||
}
|
||||
|
||||
Dictionary::Ptr perfdata = pdv;
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/algorithm/string/classification.hpp>
|
||||
|
|
|
@ -252,7 +252,8 @@ Value PluginUtility::ParsePerfdata(const String& perfdata)
|
|||
}
|
||||
|
||||
return result;
|
||||
} catch (const std::exception&) {
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogWarning, "PluginUtility", "Error parsing performance data '" + perfdata + "': " + ex.what());
|
||||
return perfdata;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue