Permalink
Browse files

Allow multiple check_multi perfdata labels

service::checkcommand::label=1 service::checkcommand::foo=2 etc

More details at https://dev.icinga.org/issues/8183

Signed-off-by: Dirk Goetz <dirk.goetz@netways.de>
  • Loading branch information...
dnsmichi authored and dgoetz committed Sep 12, 2015
1 parent fdbc48b commit d1296d168dc8a8924cf2711a77c38d6bb275a701
Showing with 12 additions and 0 deletions.
  1. +12 −0 scripts/process_perfdata.pl.in
@@ -1044,6 +1044,7 @@ sub parse_perfstring {
my $check_multi_blockcount = 0;
my $multi_parent = cleanup( $NAGIOS{SERVICEDESC} );
my $auth_servicedesc = $NAGIOS{DISP_SERVICEDESC};
my $seen_multi_label = "";
while ($perfstring) {
( $perfstring, %p ) = _parse($perfstring);
if ( !$p{label} ) {
@@ -1052,8 +1053,19 @@ sub parse_perfstring {
@perfs = ();
last;
}
if ( $p{label} =~ /$seen_multi_label/ ) {
# multi label format for each perfdata item (e.g Icinga2)
# we're in a sub tree of a multi block, adjust label for further processing
my $tmp_prefix = $seen_multi_label."::";
$p{label} =~ s/$tmp_prefix//;
}
if ( $p{label} =~ /^[']?([a-zA-Z0-9\.\-_\s\/\#]+)::([a-zA-Z0-9\.\-_\s]+)::([^=]+)[']?$/ ) {
@multi = ( $1, $2, $3 );
$seen_multi_label = $multi[0]."::".$multi[1];
if ( $count == 0 ) {
print_log( "DEBUG: First check_multi block", 3 );

0 comments on commit d1296d1

Please sign in to comment.