' Intel Matrix Fake RAID status check script: check_intel_fakeraid.vbs ' Vincent Tamet ' ' v0.1 2010-08-05 ' ' !!! The script is for ONE volume only, if not you must finish it !!! ' Still wondering if rebuilding is warning level !? ' 'command[check_raid]=c:\Windows\system32\cscript.exe //NoLogo C:\nrpe\plugins2\check_intel_fakeraid.vbs" ' ' ' Based on softraid http://www.anchor.com.au/hosting/dedicated/monitoring_windows_software_raid ' Bin: You need the same version of the raidcfg32 app and the drivers ' You could check this with any version of raidcfg32: RAIDCFG32.exe /I ' v7.8.0.1012: http://downloadcenter.intel.com/Detail_Desc.aspx?ProductID=2869&DwnldID=18324&lang=eng&iid=dc_rss ' v5.6.2.1002 v5.7.0.1011 v6.1.0.1002: http://driverscollection.com/?aid=24606005865EvJIbfCFtSmwZchn ' Version vs chipset: http://www.intel.com/support/chipsets/imsm/sb/CS-022693.htm ' ' Doc I do the folowing test : RAIDCFG32.exe /ST ' 'RAIDCFG32.exe /ST 'Intel(R) RAID Utility for Serial ATA - v7.8.0.1012 ICHx 'Copyright(C) 2003-07 Intel Corporation. All Rights Reserved. ' ' RAID Volumes: ' ID Name Level Strip Size Status Bootable ' 0 Volume0 RAID1(Mirror) N/A 149.0GB Updated Yes ' ' Physical Disks: ' Port Drive Model Serial # Size Type/Status(Vol ID) ' 0 GB0160EAFJE 9xxxxxxx 149.1GB Member Disk(0) ' 1 GB0160EAFJE 9xxxxxxx 149.1GB Member Disk(0) ' '"C:\Program Files\Intel\Intel Matrix Storage Manager\RAIDCFG32.exe" /STV ';Index,Level,StripSize,SizeinMB,Status,Bootable,Array,Name '0,1,64kB,152625,"Updated","Yes",0,"Volume0" ';Index,Level,StripSize,Size,Status,Bootable,Array,Name '0,1,64kB,976766976,"Rebuild","Yes",0,"Volume0" ';Index,Level,StripSize,Size,Status,Bootable,Array,Name '0,1,64kB,976766976,"Degraded","Yes",0,"Volume0" Option Explicit Dim WshShell, oExec Dim Line, RE0, RE1, RE2, RE3 Dim Failed Failed = -1 ' Simple variable to display status of all volumes: ' 0 = Healthy ' 1 = Rebuilding ' 2 = Failed ' 3 = Unknown ' Check version of WScript. Has to be >= 5.6 for WScript.Shell.Exec to work If Wscript.Version < 5.6 Then Failed = 3 Wscript.StdOut.WriteLine("UNKNOWN: WScript version < 5.6") WScript.Quit(Failed) End If Set WshShell = WScript.CreateObject("WScript.Shell") ' Execute the util program and grab the output Set oExec = WshShell.Exec("%ProgramFiles%\Intel\Intel Matrix Storage Manager\RAIDCFG32.exe /STV") ' Set up some regular expression objects Set RE0 = New RegExp Set RE1 = New RegExp Set RE2 = New RegExp Set RE3 = New RegExp RE0.Pattern = "Normal|Updated" RE1.Pattern = "Volume" RE2.Pattern = "Failed|Degraded" RE3.Pattern = "Rebuild" ' Check for no output If oExec.StdOut.AtEndOfStream Then Failed = 3 Else While Not oExec.StdOut.AtEndOfStream Line = oExec.StdOut.ReadLine 'Debug 'WScript.StdOut.WriteLine(Line) ' Tests for Raid volumes If RE1.Test(Line) Then ' Tests for Optimal volumes If RE0.Test(Line) Then If Failed = -1 Then Failed = 0 End If 'Rebuilding If RE3.Test(Line) Then If Failed < 1 Then Failed = 1 End If ' Tests for Failed RAID volumes If RE2.Test(Line) Then If Failed < 2 Then Failed = 2 End If End If WEnd End If ' If Failed is still -1, something bad has happened, or there is no RAID If Failed = -1 Then Failed = 3 ' Print out the appropriate test result Select Case Failed Case 0 WScript.StdOut.WriteLine("RAID OK: All volumes Optimal") Case 1 WScript.StdOut.WriteLine("RAID WARNING: Volume(s) Rebuilding") Case 2 WScript.StdOut.WriteLine("RAID CRITICAL: Volume(s) have Failed") Case 3 WScript.StdOut.WriteLine("RAID UNKNOWN: " + oExec.StdErr.ReadLine) End Select WScript.Quit(Failed)