check_drbd.pl
changeset 3 738d4b8f3a0f
parent 1 9542011381ce
child 5 6175731081b0
--- 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},