Active10 months ago
A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32DiskDrive, Win32LogicalDisk or Win32Volume for unknown reason) or using the new PowerShell API introduced with Windows 8 (wrong target system as our customer uses a Windows 7 architecture).
I need to check the status of a RAID array on an Intel controller from my Windows application periodically (or be notified about a status change). Specifically, what I need is to find out whether a RAID 5 array is healthy or one of its disks is missing.
I tried parsing output of
raidcfg32
(available from the Intel site, see this readme), but it works only with one of servers my application need to monitor. On other servers raidcfg32
reports an ‘unsupported hardware’ error. I also tried CmdTool2
, but it was unable to find the controller altogether.The only remaining option of RAID array monitoring supplied by Intel is a bunch of GUI applications (Intel Matrix Storage Management Console, Intel Rapid Storage Technology).
The controllers in question are: ESB2, 631xESB/632xESB.
I believe I have read through the few posts here on Stack Overflow that are relevant to my problem, and none of them contains an answer. In an answer to the question ‘Can I get Raid disk status by using PS?’, for instance, what is suggested actually allows to check if the controller, not the array, is healthy (it always is).
What am I looking for is an automated way of accessing the status information (from a .NET application, to be specific). Any option is good, be it via WMI, a .NET or native API, console output parsing or whatever.
I find it confusing that the suggested way of monitoring RAID status is via a GUI application. What approaches are used in enterprise deployments with tens of servers to do this programmatically?
![Check Raid Status Windows Check Raid Status Windows](/uploads/1/2/4/8/124872658/286225736.jpg)
Community♦
HelgiHelgi5,18711 gold badge2626 silver badges4646 bronze badges
3 Answers
I've been looking for this also. I have ICHxxx series controllers and am trying to get a contact at Intel to respond about the existance of a public API, but I'm not optimistic.
Here's what I've come up with for the short-term. Intel records the RAID events to the Windows Event Log under 'IAANTmon'. So you can use System.Diagnostics.EventLog, hooking the EventWrittenEventHandler, then filtering for 'IAANTmon'.
and
EJAEJA65511 gold badge66 silver badges1010 bronze badges
I've been looking into this as well, seems like smartmontools is the best option.Unfortunately, I didn't find a package that suits my .NET-needs and as it is just something basic, I didn't spend hours on finding a proper solution.
I resorted to starting 'smartctl --scan' (part of smartmontools) at the start of my application (Process.Start), harvesting the list of devices from the output and then periodically starting 'smartctl -H device-name' for each device.
This will return the SMART overal health test-results of the disk, as long as 'PASSED' is returned, you should be safe.
While this is far from ideal, it does gives some indication of the health of my raid-disks.
How To Check Raid Status Windows
SprezlausSprezlaus
As of 11/16/18, Windows 10, I've run into the same issue, needing to check raid status for intel Raid 10.
EJA's answer mostly worked - I did not get any logs written to source 'IAANTmon', however.
At this point I used EJA's answer, but, filter by source 'IAStorDataMgrSvc'. This is where my raid event logs are written. Furthermore, I checked the messages contain either 'Degraded' or 'Rebuilding'. This will exclude the startup events and pull logs such as 'Volume Degraded', 'Volume Rebuilding in progress', 'Volume Rebuilding complete'.
I ended up with something like:
At startup I also checked logs from previous few days incase a drive was flagged degraded while my program was not running -
rw_rw_