mirror of
https://github.com/Icinga/icinga2.git
synced 2025-05-30 03:10:19 +02:00
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();
|
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;
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user