How do you monitor the health of a mirrored disk in Windows?

Solution 1:

I had the same question a while ago. The first thing I thought of was using WMI, but for some weird reason, WMI doesn't expose the health of a RAID volume through any of the normal Win32_* classes.

I eventually stumbled across the script in this article and made a few modifications to suit my requirements. It parses the output of diskpart.exe's "LIST VOLUME" command. This may seem a little dirty and ugly, but right now its the best option I've seen.

The script as it appears on the linked page is ready to be used with Nagios / NSClient++. If you know a bit of VBScript it's easy enough to modify this to send e-mail instead of printing status information.

If you don't know VBScript, I'll gladly give you a modified version which will do whatever you want it to.

Solution 2:

for /f "tokens=4,9 delims= " %a IN ('echo list volume ^| diskpart ^| find "SSD"') do echo %a %b

Replace find "SSD" with "mirror"(or stripe... whatever) or your volume name. (my volumes are named SSD1 + SSD2)

Stick in a batch file with @echo off and ur done. :)

@echo off
for /f "tokens=4,9 delims= " %%a IN ('echo list volume ^| diskpart ^| find "SSD"') do echo %%a %%b

Above line is needed for batch. =)

Notes

  • You need to have a volume name for this to work, else change tokens to tokens=8