Add warning messages when performance data could not be parsed or not be sent to Graphite

refs #6550
This commit is contained in:
Gerd von Egidy 2014-08-05 00:48:32 +02:00 committed by Gunnar Beutner
parent f3d55848f5
commit a4b7984719
3 changed files with 6 additions and 1 deletions

View File

@ -142,7 +142,10 @@ void GraphiteWriter::SendPerfdata(const String& prefix, const CheckResult::Ptr&
Value pdv = cr->GetPerformanceData(); Value pdv = cr->GetPerformanceData();
if (!pdv.IsObjectType<Dictionary>()) if (!pdv.IsObjectType<Dictionary>())
{
Log(LogWarning, "GraphiteWriter", "Could not send performance data: unparsed data.");
return; return;
}
Dictionary::Ptr perfdata = pdv; Dictionary::Ptr perfdata = pdv;

View File

@ -19,6 +19,7 @@
#include "icinga/perfdatavalue.hpp" #include "icinga/perfdatavalue.hpp"
#include "base/convert.hpp" #include "base/convert.hpp"
#include "base/exception.hpp"
#include <boost/algorithm/string/case_conv.hpp> #include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>

View File

@ -252,7 +252,8 @@ Value PluginUtility::ParsePerfdata(const String& perfdata)
} }
return result; return result;
} catch (const std::exception&) { } catch (const std::exception& ex) {
Log(LogWarning, "PluginUtility", "Error parsing performance data '" + perfdata + "': " + ex.what());
return perfdata; return perfdata;
} }
} }