glensc / nagios-plugin-check_raid

Nagios/Icinga/Sensu plugin to check current server's RAID status ⛺
144 stars 84 forks source link

Feature Request mdstat: Warn when auto-read-only array detected #225

Open Napsty opened 10 months ago

Napsty commented 10 months ago

I noticed that check_raid.pl is currently not detecting mdadm raid array which are set to auto-read-only. IMHO it would be helpful to detect this and WARN about this.

Output of check_raid -d:

root@nas:~# ./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.
DEBUG EXEC: /proc/mdstat at ./check_raid.pl line 503.
OK: mdstat:[md0(2.73 TiB raid1):UU, md1(5.46 TiB raid1):UU]

Output of each command from check_raid -d

/sbin/dmsetup status --noflush

vgdata1-lvswap: 0 3899392 linear 
vgdata1-lvdata: 0 3903119360 linear 
vgdata1-lvdata: 3903119360 5860261888 linear 
vgdata1-lvdata: 9763381248 1677721600 linear 

root@nas:~# cat /proc/mdstat

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sda1[2] sdb1[3]
      2930264519 blocks super 1.2 [2/2] [UU]

md1 : active (auto-read-only) raid1 sdd1[3] sdc1[2]
      5860390471 blocks super 1.2 [2/2] [UU]

unused devices: <none>

Additional environment details: