简体   繁体   English

如何从Windows应用程序监控Intel控制器上RAID阵列的状态?

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

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). 我需要定期从我的Windows应用程序检查Intel控制器上RAID阵列的状态(或者通知状态更改)。 Specifically, what I need is to find out whether a RAID 5 array is healthy or one of its disks is missing. 具体来说,我需要的是找出RAID 5阵列是否正常或其中一个磁盘丢失。

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. 我尝试解析raidcfg32输出(可从英特尔网站获得,请参阅本自述文件 ),但它仅适用于我的应用程序需要监视的服务器之一。 On other servers raidcfg32 reports an 'unsupported hardware' error. 在其他服务器上, raidcfg32报告“不支持的硬件”错误。 I also tried CmdTool2 , but it was unable to find the controller altogether. 我也试过CmdTool2 ,但它无法完全找到控制器。

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). 英特尔提供的唯一剩余RAID阵列监控选项是一系列GUI应用程序(英特尔矩阵存储管理控制台,英特尔快速存储技术)。

The controllers in question are: ESB2, 631xESB/632xESB. 有问题的控制器是: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. 我相信我已经阅读了Stack Overflow上与我的问题相关的几篇文章,但没有一篇文章包含答案。 In an answer to the question ' Can I get Raid disk status by using PS? 在回答问题' 我可以使用PS获取Raid磁盘状态吗? ', 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). 我在寻找的是一种自动访问状态信息的方式(从.NET应用程序来看,具体而言)。 Any option is good, be it via WMI, a .NET or native API, console output parsing or whatever. 任何选项都是好的,无论是通过WMI,.NET还是本机API,控制台输出解析等等。

I find it confusing that the suggested way of monitoring RAID status is via a GUI application. 我发现建议的监控RAID状态的方法是通过GUI应用程序让我感到困惑。 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. 我有ICHxxx系列控制器,我正试图与英特尔联系,以回应有关公共API的存在,但我并不乐观。

Here's what I've come up with for the short-term. 这就是我短期内提出的问题。 Intel records the RAID events to the Windows Event Log under "IAANTmon". 英特尔将RAID事件记录到“IAANTmon”下的Windows事件日志中。 So you can use System.Diagnostics.EventLog, hooking the EventWrittenEventHandler, then filtering for "IAANTmon". 因此,您可以使用System.Diagnostics.EventLog,挂钩EventWrittenEventHandler,然后过滤“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. 我一直在研究这个问题,看起来smartmontools是最好的选择。 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. 不幸的是,我没有找到适合我的.NET需求的软件包,因为它只是一些基本的东西,我没有花费数小时寻找合适的解决方案。

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. 我在我的应用程序(Process.Start)开始时使用“smartctl --scan”(smartmontools的一部分),从输出中获取设备列表,然后定期为每个设备启动“smartctl -H device-name ” 。

This will return the SMART overal health test-results of the disk, as long as "PASSED" is returned, you should be safe. 这将返回SMART整体健康测试 - 磁盘的结果,只要返回“PASSED”,您应该是安全的。

While this is far from ideal, it does gives some indication of the health of my raid-disks. 虽然这远非理想,但它确实显示了我的raid磁盘的健康状况。

As of 11/16/18, Windows 10, I've run into the same issue, needing to check raid status for intel Raid 10. 截至11月16日,Windows 10,我遇到了同样的问题,需要检查英特尔Raid 10的raid状态。

EJA's answer mostly worked - I did not get any logs written to source "IAANTmon", however. EJA的答案大部分都有效 - 但我没有将任何日志写入源“IAANTmon”。

At this point I used EJA's answer, but, filter by source "IAStorDataMgrSvc". 此时我使用了EJA的答案,但是按源“IAStorDataMgrSvc”进行过滤。 This is where my raid event logs are written. 这是写我的raid事件日志的地方。 Furthermore, I checked the messages contain either "Degraded" or "Rebuilding". 此外,我检查的邮件包含“Degraded”或“Rebuilding”。 This will exclude the startup events and pull logs such as "Volume Degraded", "Volume Rebuilding in progress", "Volume Rebuilding complete". 这将排除启动事件并拉出日志,例如“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
               }
            }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM