]> granicus.if.org Git - icinga2/commitdiff
Add warning messages when performance data could not be parsed or not be sent to...
authorGerd von Egidy <gerd@egidy.de>
Mon, 4 Aug 2014 22:48:32 +0000 (00:48 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 5 Aug 2014 09:23:36 +0000 (11:23 +0200)
refs #6550

components/perfdata/graphitewriter.cpp
lib/icinga/perfdatavalue.cpp
lib/icinga/pluginutility.cpp

index ec8190d8ea376c6c61f7b6624728e684236e3aad..331f620842595d0addb12113e61566a1f902940f 100644 (file)
@@ -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;
 
index 19493807053e46c0f40acb7346ee9bb35a099914..e34d833ee7b7d1fbb4df465d8d8752e5fd3d964a 100644 (file)
@@ -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>
index 77f7cc7a7a22eee9594c1979c472ca81ddcfa68d..f2b28018446cc6e12b73d67ec48c968aa7321644 100644 (file)
@@ -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;
        }
 }