Skip to content

[bug] with parsing mdadm output => Unexpected parse #199

Description

@aplufr

Plugin report an unexpected parse error when executing.

Tried with 4.0.9 (from Debian 10) and 4.0.10 (from this git).

Output of check_raid -d:

# perl ./check_raid.pl -d
check_raid 4.0.10
Visit <https://github.com/glensc/nagios-plugin-check_raid#reporting-bugs> how to report bugs
Please include output of **ALL** commands in bugreport

DEBUG EXEC: /sbin/dmsetup status --noflush at ./check_raid.pl line 503.
DEBUG EXEC: /proc/mdstat at ./check_raid.pl line 503.
Unexpected parse at ./check_raid.pl line 3578, <$fh> line 2.

Output of cat /proc/mdstat:

# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sda3[2] sdc3[3](W)(R) sdb3[0]
      976015360 blocks super 1.2 [2/3] [UU]
      [===>.................]  check = 15.6% (152996864/976015360) finish=153.2min speed=89504K/sec
      bitmap: 2/8 pages [8KB], 65536KB chunk

md1 : active raid1 sdc2[3](W)(S) sda2[2] sdb2[0]
      409280 blocks super 1.2 [2/2] [UU]

unused devices: <none>

After giving a look at the code, I suspect that's because disk sdc3 have two flags: W (write-mostly) and R (recovery) or S (spare) but I'm not good in perl.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions