[icinga-checkins] icinga.org: icinga2/feature/fiber-test: Accept invalid performance data.

git at icinga.org git at icinga.org
Sun Nov 17 13:23:05 CET 2013


Module: icinga2
Branch: feature/fiber-test
Commit: f9b107d0bff6c762fc607d60e0238f7a5a9f7928
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=f9b107d0bff6c762fc607d60e0238f7a5a9f7928

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Sun Nov 17 00:05:31 2013 +0100

Accept invalid performance data.

Refs #5082

---

 lib/icinga/perfdatavalue.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/icinga/perfdatavalue.cpp b/lib/icinga/perfdatavalue.cpp
index c00d1b4..549a7cd 100644
--- a/lib/icinga/perfdatavalue.cpp
+++ b/lib/icinga/perfdatavalue.cpp
@@ -93,16 +93,16 @@ Value PerfdataValue::Parse(const String& perfdata)
 		BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid performance data unit: " + unit));
 	}
 
-	if (tokens.size() > 1 && tokens[1] != "U")
+	if (tokens.size() > 1 && tokens[1] != "U" && tokens[1] != "")
 		warn = Convert::ToDouble(tokens[1]);
 
-	if (tokens.size() > 2 && tokens[2] != "U")
+	if (tokens.size() > 2 && tokens[2] != "U" && tokens[2] != "")
 		crit = Convert::ToDouble(tokens[2]);
 
-	if (tokens.size() > 3 && tokens[3] != "U")
+	if (tokens.size() > 3 && tokens[3] != "U" && tokens[3] != "")
 		min = Convert::ToDouble(tokens[3]);
 
-	if (tokens.size() > 4 && tokens[4] != "U")
+	if (tokens.size() > 4 && tokens[4] != "U" && tokens[4] != "")
 		max = Convert::ToDouble(tokens[4]);
 
 	return make_shared<PerfdataValue>(value, counter, unit, warn, crit, min, max);





More information about the icinga-checkins mailing list