3

does anyone have a solution for logging an error/critical entry to the event log in 2008 R2 when RAID has an issue? I really want to set up email alerts for when this happens. I'm using the MS builtin software RAID, not hardware RAID.

There's a thread here that beggars belief.. an MS rep states

"it won't be a significant improvement for the user to notice the degraded array"

so it sounds like they don't ever intend to support it. Has anyone got a solution for this?

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
benpage
  • 185
  • 1
  • 9
  • 2
    Wow, that is incredibly irresponsible of Microsoft. This seems to be a very good reason to avoid their software RAID like the plague. – Shane Madden May 20 '11 at 00:54
  • Windows Server 2012 R2 has the same issue, this is a breaking change from Windows Server 2003. – Tal Aloni Jun 09 '19 at 10:02

3 Answers3

2

This is indeed quite surprising, leave it Microsoft to make a feature worse. In some ways this is not a surprise.

I believe that you can "monitor" the status of the RAID using the diskpart utility. For some example commands see http://www.techotopia.com/index.php/Creating_and_Managing_Windows_Server_2008_Mirrored_%28RAID_1%29_Volumes.

I don't have a 2008 software raid myself unfortunately, but I can only imagine that the output of list volume will indicate when a drive is offline or in a faulty state. An example output of list volume looks like this

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
----------  ---  -----------  -----  ----------  -------  ---------  --------
Volume 0     E   DATA         NTFS   Simple       931 GB  Healthy
Volume 1     D                       DVD-ROM         0 B  No Media
Volume 2         System Rese  NTFS   Partition    100 MB  Healthy    System
Volume 3     C   BOOT         NTFS   Partition    138 GB  Healthy    Boot
Volume 4     F   FreeAgent G  NTFS   Partition   1863 GB  Healthy

You simply create an text file with the content being

list volume

and then run it like

diskpart /s file.txt

You could then pipe the output to a file and parse it with a script, and generate an email or event log entry. You would need to run this script every X minutes, e.g. with the task scheduler.

You could use EventSentry (free version available) and its application scheduler to execute this script, and generate an event/email, but you would still have parse the output from diskpart to determine whether there is a problem or not.

Edit: The status of a failed RAID in Windows is "Failed Rd" opposed to "Healthy". As such, searching for "Failed Rd" should work. Example:

Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
----------  ---  -----------  -----  ----------  -------  ---------  --------
Volume 0     C   BOOT         NTFS   Mirror       931 GB  Failed Rd  Boot

I'll do some experimenting with this in the future to come up with a better answer and write a blog entry, I had no idea that Microsoft dropped the ball on this.

Lucky Luke
  • 1,634
  • 1
  • 11
  • 12
  • 1
    I've written a blog article since then which outlines, step-by-step, how to go about this. http://www.eventlogblog.com/blog/2012/02/how-to-make-the-windows-softwa.html. – Lucky Luke Apr 15 '13 at 13:13
1

Here's a simple batch script that will log an event on failure to system:

echo list volume | diskpart > c:\RAID_STATUS.TXT
FINDSTR "Failed" C:\RAID_STATUS.TXT
IF ERRORLEVEL 1 GOTO OK
GOTO FAILED

:FAILED
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
FINDSTR "Failed" C:\RAID_STATUS.TXT > C:\FAILED_RAID.TXT
set eventtext=
for /f "delims=" %%l in (C:\FAILED_RAID.TXT) do set eventtext=!eventtext! %%l
eventcreate /ID 999 /L SYSTEM /T ERROR  /SO SW_RAID /D "%eventtext%"
GOTO OK

:OK
HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
user206025
  • 11
  • 1
0

I don't have a MS software raid array system set up but can't you just query for availability? Win32_logicaldisk has an availability property and a status property. On my system it's blank but I would hope that in a raid set at least one of those would be populated with the state values listed in the table.

Jim B
  • 24,081
  • 4
  • 36
  • 60