fixed match for resource numbers with more than one digit
authorMatthias Förste <foerste@schlittermann.de>
Mon, 09 Jan 2017 11:56:42 +0100
changeset 3 738d4b8f3a0f
parent 2 c8bcf8c24805
child 4 028c3fb7f04d
fixed match for resource numbers with more than one digit
check_drbd.pl
--- a/check_drbd.pl	Fri Aug 08 15:10:30 2014 +0200
+++ b/check_drbd.pl	Mon Jan 09 11:56:42 2017 +0100
@@ -65,7 +65,7 @@
     my $r;
     while (<FH>) {
         chomp;
-        if (/^.*(?<line>(?<resource>\d+):\s+cs:(?<connection_state>\S+)\s+(?:st|ro):(?<roles>\S+)\s+(?:ds|ld):(?<disk_states>\S+))/) {
+        if (/^\s*(?<line>(?<resource>\d+):\s+cs:(?<connection_state>\S+)\s+(?:st|ro):(?<roles>\S+)\s+(?:ds|ld):(?<disk_states>\S+))/) {
             $r = $+{resource};
             $drbd{$r} = {
                 line             => $+{line},