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

发布于 2024-09-13 21:44:06 字数 1549 浏览 13 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

行至春深 2024-09-20 21:44:06

我也一直在找这个。我有 ICHxxx 系列控制器,并试图联系英特尔以回应公共 API 的存在,但我并不乐观。

以下是我针对短期的想法。 Intel 将 RAID 事件记录到 Windows 事件日志的“IAANTmon”下。因此,您可以使用 System.Diagnostics.EventLog,挂钩 EventWrittenEventHandler,然后过滤“IAANTmon”。

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

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

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")
        {
         ...
        }
    }
素罗衫 2024-09-20 21:44:06

我也一直在研究这个问题,似乎 smartmontools 是最好的选择。
不幸的是,我没有找到适合我的 .NET 需求的包,而且因为它只是一些基本的东西,所以我没有花几个小时来寻找合适的解决方案。

我在应用程序 (Process.Start) 启动时启动“smartctl --scan”(smartmontools 的一部分),从输出中获取设备列表,然后定期启动“smartctl -H device-name< /em>”对于每个设备。

这将返回磁盘的 SMART 整体健康测试结果,只要返回“PASSED”,您应该是安全的。

虽然这远非理想,但它确实给出了我的 raid 磁盘的健康状况的一些指示。

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.

坏尐絯℡ 2024-09-20 21:44:06

截至 18 年 11 月 16 日,Windows 10,我遇到了同样的问题,需要检查 intel Raid 10 的 raid 状态。EJA

的答案大部分有效 - 然而,我没有收到任何写入源“IAANTmon”的日志。

此时我使用了 EJA 的答案,但是按源“IAStorDataMgrSvc”进行过滤。这是我的袭击事件日志的写入位置。此外,我检查了消息是否包含“降级”或“重建”。这将排除启动事件和拉取日志,例如“卷降级”、“卷重建正在进行”、“卷重建完成”。

我最终得到了类似的结果:

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
         }
      }

在启动时,我还检查了前几天的日志,以防在我的程序未运行时驱动器被标记为降级 -

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
               }
            }

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
               }
            }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文