Permalink
Browse files

Fixed single quoted check_multi labels

Not only standard, also check_multi labels might be enclosed with
single quotes: 'service::plugin::perfdata'=123
parse_perfstring now supports these single quoted labels.
  • Loading branch information...
1 parent 779f2d3 commit 4d5d58e1925ea82124cce01c842321b163208437 @flackem flackem committed with Sep 26, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −0 ChangeLog
  2. +2 −2 scripts/process_perfdata.pl.in
View
@@ -1,4 +1,5 @@
**pnp-0.6.16 ??/??/2011**
+ * Bugfix: Fixed single quoted check_multi labels (reported by Matthias Flacke)
**pnp-0.6.15 09/15/2011**
* Bugfix: Fixed Overview link (reported by Stefan Triep)
@@ -986,7 +986,7 @@ sub parse_perfstring {
#
# check_multi
#
- if ( $perfstring =~ /^([a-zA-Z0-9\.\-_\s\/\#]+)::([a-zA-Z0-9\.\-_\s]+)::([^=]+)=/ ) {
+ if ( $perfstring =~ /^[']?([a-zA-Z0-9\.\-_\s\/\#]+)::([a-zA-Z0-9\.\-_\s]+)::([^=]+)[']?=/ ) {
$is_multi = 1;
print_log( "check_multi Perfdata start", 3 );
my $count = 0;
@@ -1001,7 +1001,7 @@ sub parse_perfstring {
@perfs = ();
last;
}
- if ( $p{label} =~ /^([a-zA-Z0-9\.\-_\s\/\#]+)::([a-zA-Z0-9\.\-_\s]+)::([^=]+)$/ ) {
+ if ( $p{label} =~ /^[']?([a-zA-Z0-9\.\-_\s\/\#]+)::([a-zA-Z0-9\.\-_\s]+)::([^=]+)[']?$/ ) {
@multi = ( $1, $2, $3 );
if ( $count == 0 ) {
print_log( "DEBUG: First check_multi block", 3 );

0 comments on commit 4d5d58e

Please sign in to comment.