check_drbd.pl
changeset 3 738d4b8f3a0f
parent 1 9542011381ce
child 5 6175731081b0
equal deleted inserted replaced
2:c8bcf8c24805 3:738d4b8f3a0f
    63     open( FH, $file )
    63     open( FH, $file )
    64       or print "$NAME CRITICAL: $file $!\n" and exit $ERRORS{CRITICAL};
    64       or print "$NAME CRITICAL: $file $!\n" and exit $ERRORS{CRITICAL};
    65     my $r;
    65     my $r;
    66     while (<FH>) {
    66     while (<FH>) {
    67         chomp;
    67         chomp;
    68         if (/^.*(?<line>(?<resource>\d+):\s+cs:(?<connection_state>\S+)\s+(?:st|ro):(?<roles>\S+)\s+(?:ds|ld):(?<disk_states>\S+))/) {
    68         if (/^\s*(?<line>(?<resource>\d+):\s+cs:(?<connection_state>\S+)\s+(?:st|ro):(?<roles>\S+)\s+(?:ds|ld):(?<disk_states>\S+))/) {
    69             $r = $+{resource};
    69             $r = $+{resource};
    70             $drbd{$r} = {
    70             $drbd{$r} = {
    71                 line             => $+{line},
    71                 line             => $+{line},
    72                 connection_state => $+{connection_state},
    72                 connection_state => $+{connection_state},
    73                 roles            => $+{roles},
    73                 roles            => $+{roles},