开发者

How do I monitor the status of a RAID array on an Intel controller from a Windows application? [closed]

开发者 https://www.devze.com 2023-01-11 05:38 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

Closed 10 months ago.

Improve this question

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 qu开发者_StackOverflowestion ‘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?


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".

        EventLog eLog = new EventLog("Application");
        eLog.EntryWritten += new EntryWrittenEventHandler(OnEntryWrittenEvent);
        eLog.EnableRaisingEvents = true;

and

    public static void OnEntryWrittenEvent(object source, EntryWrittenEventArgs e)
    {
        if (e.Entry.Source == "IAANTmon")
        {
         ...
        }
    }


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.


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:

private static void OnEntryWrittenEvent(object source, EntryWrittenEventArgs e)
      {
         if (e.Entry.Source == "IAStorDataMgrSvc"
            && (e.Entry.Message.Contains("Degraded")
            || e.Entry.Message.Contains("Rebuilding")))
         {
            // Show status message
         }
      }

At startup I also checked logs from previous few days incase a drive was flagged degraded while my program was not running -

foreach (var entry in eLog.Entries.Cast<EventLogEntry>()
               .Where(x => x.Source == "IAStorDataMgrSvc" 
                      && (x.TimeWritten - DateTime.Today).TotalDays < 3))
            {
               if (entry.Message.Contains("Degraded")
                  || entry.Message.Contains("Rebuilding"))
               {
                  // Show status message
               }
            }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号