diff options
| author | tonvoon@users.sourceforge.net <tonvoon@users.sourceforge.net> | 2009-06-05 17:01:22 +0000 |
|---|---|---|
| committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-06-06 02:16:11 -0400 |
| commit | 673108c6cd8c84f72db0ddb2997b96cbe28ba5ea (patch) | |
| tree | c981e66bd9ab75637a916f60ca955d42bb38f1eb /lib/Nagios/Plugin | |
| parent | b0ff1e4262fa7f09c9cdb91206b6d2a2a1aa06a7 (diff) | |
| download | monitoring-plugin-perl-673108c6cd8c84f72db0ddb2997b96cbe28ba5ea.tar.gz | |
Fixed parsing when two = signs within the performance data portion
Diffstat (limited to 'lib/Nagios/Plugin')
| -rw-r--r-- | lib/Nagios/Plugin/Functions.pm | 2 | ||||
| -rw-r--r-- | lib/Nagios/Plugin/Performance.pm | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm index 165aafa..9a8272a 100644 --- a/lib/Nagios/Plugin/Functions.pm +++ b/lib/Nagios/Plugin/Functions.pm | |||
| @@ -12,7 +12,7 @@ use Params::Validate qw(:types validate); | |||
| 12 | use Math::Calc::Units; | 12 | use Math::Calc::Units; |
| 13 | 13 | ||
| 14 | # Remember to update Nagios::Plugins as well | 14 | # Remember to update Nagios::Plugins as well |
| 15 | our $VERSION = "0.32"; | 15 | our $VERSION = "0.33"; |
| 16 | 16 | ||
| 17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); | 17 | our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT); |
| 18 | 18 | ||
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 { | |||
| 87 | # If there is more than 1 equals sign, split it out and parse individually | 87 | # If there is more than 1 equals sign, split it out and parse individually |
| 88 | if (@{[$perfstring =~ /=/g]} > 1) { | 88 | if (@{[$perfstring =~ /=/g]} > 1) { |
| 89 | $perfstring =~ s/^(.*?=.*?)\s//; | 89 | $perfstring =~ s/^(.*?=.*?)\s//; |
| 90 | $obj = $class->_parse($1); | 90 | if (defined $1) { |
| 91 | $obj = $class->_parse($1); | ||
| 92 | } else { | ||
| 93 | # This could occur if perfdata was soemthing=value= | ||
| 94 | # Since this is invalid, we reset the string and continue | ||
| 95 | $perfstring = ""; | ||
| 96 | $obj = $class->_parse($perfstring); | ||
| 97 | } | ||
| 91 | } else { | 98 | } else { |
| 92 | $obj = $class->_parse($perfstring); | 99 | $obj = $class->_parse($perfstring); |
| 93 | $perfstring = ""; | 100 | $perfstring = ""; |
