From 673108c6cd8c84f72db0ddb2997b96cbe28ba5ea Mon Sep 17 00:00:00 2001 From: "tonvoon@users.sourceforge.net" Date: Fri, 5 Jun 2009 17:01:22 +0000 Subject: Fixed parsing when two = signs within the performance data portion --- lib/Nagios/Plugin/Performance.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/Nagios/Plugin/Performance.pm') diff --git a/lib/Nagios/Plugin/Performance.pm b/lib/Nagios/Plugin/Performance.pm index 6b85dc0..9248fea 100644 --- a/lib/Nagios/Plugin/Performance.pm +++ b/lib/Nagios/Plugin/Performance.pm @@ -87,7 +87,14 @@ sub parse_perfstring { # If there is more than 1 equals sign, split it out and parse individually if (@{[$perfstring =~ /=/g]} > 1) { $perfstring =~ s/^(.*?=.*?)\s//; - $obj = $class->_parse($1); + if (defined $1) { + $obj = $class->_parse($1); + } else { + # This could occur if perfdata was soemthing=value= + # Since this is invalid, we reset the string and continue + $perfstring = ""; + $obj = $class->_parse($perfstring); + } } else { $obj = $class->_parse($perfstring); $perfstring = ""; -- cgit v1.2.3-74-g34f1