Better perfdata trailing semicolon cleanup.
authorGreg Sabino Mullane <[email protected]>
Wed, 9 Feb 2011 18:36:06 +0000 (13:36 -0500)
committerGreg Sabino Mullane <[email protected]>
Wed, 9 Feb 2011 18:36:06 +0000 (13:36 -0500)
check_postgres.pl

index d8f4773f35e3cde8b188d038e603f805ec82c9c2..5a75800b497f912dbb42014e1521761ae9ca0e4d 100755 (executable)
@@ -1087,7 +1087,8 @@ sub add_response {
         $perf .= sprintf '%s%s', length($perf) ? ' ' : '', $db->{perf};
     }
     ## Strip trailing semicolons as allowed by the Nagios spec
-    $perf =~ s/[; ]+$//;
+    $perf =~ s/; / /;
+    $perf =~ s/;$//;
     push @{$type->{$header}} => [$msg,$perf];
 
     return;