no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | monitors:dellsystemcheck [2009/11/23 05:45] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Dell System Check ====== | ||
+ | |||
+ | ^ Author | [[ craig.boyce@rodney.govt.nz | Craig Boyce ]] | | ||
+ | ^ Compatibility | Xymon 4.2 | | ||
+ | ^ Requirements | Windows, BBWin, Dell Open Manage | | ||
+ | ^ Download | None | | ||
+ | ^ Last Update | 2007-08-06 | | ||
+ | |||
+ | ===== Description ===== | ||
+ | The script reports the status of the hardware on Dell Servers running Windows and Dell OpenManage 5.0 or greater and alerts upon any failure reported. | ||
+ | The information is gathered using the commandline interface omreport. | ||
+ | The script has successfully reported on power supply and disk failures but I have not had any other hardware failures. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | === Client side === | ||
+ | - Copy the script to the bbwin\ext directory or any sub directory you would prefer. | ||
+ | - Update the bbwin\etc\bbwin.cfg externals section to include the script as per below making sure the path is correct.< | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <load value=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The script allows the changing of the test column name and uptime duration before alerting by changing the following lines in the script. | ||
+ | |||
+ | | strTestName = " | ||
+ | | strUpTime = " | ||
+ | |||
+ | === Server side === | ||
+ | * None | ||
+ | |||
+ | ===== Source ===== | ||
+ | |||
+ | ==== SystemCheck.vbs ==== | ||
+ | <hidden onHidden=" | ||
+ | <code vb> | ||
+ | ' | ||
+ | ' NAME: Server System check.vbs | ||
+ | ' COMMENT: Report Information from Dell OpenManage | ||
+ | ' AUTHOR: Craig Boyce, Rodney District Council | ||
+ | ' EMAIL: craig.boyce@rodney.govt.nz | ||
+ | ' HISTORY | ||
+ | ' VERSION : 1.00 13/08/2006 Initial Development | ||
+ | ' VERSION : 2.00 20/7/2007 Production Release | ||
+ | ' VERSION : 2.10 1/8/2007 Updated by Sigurður Guðbrandsson (sigurdur@raforninn.is) to report detailed information for Physical Disk, Memory, NIC and Temp | ||
+ | ' Now Requires OpenManage 5.2 to display the Physical disk information | ||
+ | ' VERSION : 2.20 3/8/2007 Resolved issue with a non green status changing all the following statuses to the non green status | ||
+ | ' VERSION : 2.30 7/8/2007 Added the ability to turn off individual status checks if not wanted. | ||
+ | |||
+ | ' Requires Dell OpenManage 5.0 or greater to be installed on the Dell Servers | ||
+ | ' | ||
+ | |||
+ | On Error Resume Next | ||
+ | |||
+ | Dim objShell, | ||
+ | Dim typelib, | ||
+ | Dim logmessage, | ||
+ | Dim strLayout, | ||
+ | Dim shChassis, | ||
+ | |||
+ | ' Set Variables and get the Server Name | ||
+ | |||
+ | Set objShell = WScript.CreateObject(" | ||
+ | Set WSHNetwork = WScript.CreateObject(" | ||
+ | |||
+ | ServerName = objShell.ExpandEnvironmentStrings(" | ||
+ | |||
+ | ' User definable section | ||
+ | |||
+ | strTestName = " | ||
+ | shChassis = 1 ' | ||
+ | shStorageVirtual = 1 ' Change this to 0 to disable the Storage Virtual status check | ||
+ | shStoragePhysical = 1 ' Change this to 0 to disable the Storage Physical status check | ||
+ | shMemory = 1 ' | ||
+ | shNetwork = 1 ' | ||
+ | shTemp = 1 ' | ||
+ | |||
+ | strAlarmState = " | ||
+ | strOutput | ||
+ | cntrlnum = 0 | ||
+ | indexnum = 0 | ||
+ | Set oShell = WScript.CreateObject(" | ||
+ | ' Check to see If used with BBWin or Big Brother client and set extPath. | ||
+ | extPath = oShell.RegRead(" | ||
+ | If extPath = "" | ||
+ | extPath = oShell.RegRead(" | ||
+ | End If | ||
+ | |||
+ | ' ======================================== | ||
+ | ' Main Code Starts Here | ||
+ | |||
+ | Set WinMgt = GetObject(" | ||
+ | Set CompSys = WinMgt.ExecQuery(" | ||
+ | For Each Item In CompSys | ||
+ | strmake = rtrim(item.manufacturer) | ||
+ | strmodel = rtrim(item.model) | ||
+ | strram = Clng(Item.TotalPhysicalMemory /1048576) + 1 | ||
+ | Next | ||
+ | |||
+ | Set CompSys = WinMgt.ExecQuery(" | ||
+ | For Each Item In CompSys | ||
+ | strproc = Item.Name | ||
+ | Next | ||
+ | |||
+ | Set CompSys = WinMgt.ExecQuery(" | ||
+ | For Each Item In CompSys | ||
+ | strSerial = rtrim(item.SerialNumber) | ||
+ | Next | ||
+ | |||
+ | strOutput = strOutput & " | ||
+ | strOutput = strOutput & strmake & vbtab & strmodel & vbtab & " | ||
+ | strOutput = strOutput & " | ||
+ | strOutput = strOutput & " | ||
+ | |||
+ | |||
+ | |||
+ | If Left(strmake, | ||
+ | omapath = oShell.RegRead(" | ||
+ | omaver = oShell.RegRead(" | ||
+ | omreportpath = omapath & " | ||
+ | |||
+ | strOutput = strOutput & "<a href=https://" | ||
+ | |||
+ | If shChassis = 1 Then | ||
+ | strOutput = strOutput & " | ||
+ | |||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | |||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | strOutput = strOutput & "& | ||
+ | End If | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | If shStorageVirtual = 1 Then | ||
+ | strOutput = strOutput & vbcrlf & " | ||
+ | |||
+ | ' Determine the number of storage controllers in the server and loop through them displaying the virtual disk status | ||
+ | |||
+ | lastcntrlnum = DELLStorageCntrlNum() | ||
+ | While CInt(cntrlnum) <= CInt(lastcntrlnum) | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | DELLStorageStatus cntrlnum | ||
+ | cntrlnum = cntrlnum + 1 | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | If shStoragePhysical = 1 Then | ||
+ | strOutput = strOutput & vbcrlf & " | ||
+ | |||
+ | ' Determine the number of storage controllers in the server and loop through them displaying the physical disk status | ||
+ | | ||
+ | cntrlnum = 0 | ||
+ | lastcntrlnum = DELLStorageCntrlNum() | ||
+ | While CInt(cntrlnum) <= CInt(lastcntrlnum) | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | DELLStorageStatus cntrlnum | ||
+ | cntrlnum = cntrlnum + 1 | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | If shMemory = 1 Then | ||
+ | strOutput = strOutput & vbcrlf & " | ||
+ | |||
+ | ' Determine the number of memory indexes in the server and loop through them displaying the memory index status | ||
+ | strCmd = " chassis memory" | ||
+ | lastindexnum = DELLIndexNum | ||
+ | while CInt(indexnum) <= CInt(lastindexnum) | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | DELLMemoryStatus indexnum | ||
+ | indexnum = indexnum + 1 | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | indexnum = 0 ' Reset the indexnum variable | ||
+ | |||
+ | If shNetwork = 1 Then | ||
+ | strOutput = strOutput & vbcrlf & " | ||
+ | |||
+ | ' Determine the number of nic indexes in the server and loop through them displaying the nic index status | ||
+ | strCmd = " chassis nics" | ||
+ | lastindexnum = DELLIndexNum | ||
+ | while CInt(indexnum) <= CInt(lastindexnum) | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | DELLNetworkStatus indexnum | ||
+ | indexnum = indexnum + 1 | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | indexnum = 0 ' Reset the indexnum variable | ||
+ | |||
+ | If shTemp = 1 Then | ||
+ | strOutput = strOutput & vbcrlf & " | ||
+ | |||
+ | ' Determine the number of nic indexes in the server and loop through them displaying the nic index status | ||
+ | strCmd = " chassis temps" | ||
+ | lastindexnum = DELLIndexNum | ||
+ | while CInt(indexnum) <= CInt(lastindexnum) | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | DELLTemperatureStatus indexnum | ||
+ | indexnum = indexnum + 1 | ||
+ | Wend | ||
+ | End If | ||
+ | |||
+ | |||
+ | End If | ||
+ | |||
+ | |||
+ | If strmake = " | ||
+ | ' For future development, | ||
+ | End If | ||
+ | |||
+ | |||
+ | ' Write the file for BB | ||
+ | WriteFile extPath, strTestName, | ||
+ | |||
+ | ' | ||
+ | ' FUNCTIONS and SUBS start here | ||
+ | |||
+ | ' This SUB is used for outputting the file to the external' | ||
+ | SUB WriteFile(strExtPath, | ||
+ | Set fso = CreateObject(" | ||
+ | strOutput = strAlarmState & " " & Date & " " & Time & vbcrlf & vbcrlf & strOutput & vbcrlf | ||
+ | Set f = fso.OpenTextFile(strExtPath & " | ||
+ | f.Write strOutput | ||
+ | f.Close | ||
+ | Set fso = Nothing | ||
+ | END Sub | ||
+ | |||
+ | ' This Function is used for determining the number of storage controllers in the server | ||
+ | ' NEW: vdisk controllers should be the same amount as pdisk controllers (virtual == physical) | ||
+ | Function DELLStorageCntrlNum | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | Wend | ||
+ | End If | ||
+ | Wend | ||
+ | End Function | ||
+ | |||
+ | ' This function is used for determining the number of indexes, this is almost identical to the storage function above | ||
+ | ' TODO: I assume that there is only one memory array .. however I do not have a server with more arrays so this is defaulted to Array 1. | ||
+ | Function DELLIndexNum | ||
+ | strcommand = Chr(34) & | ||
+ | Set objWshScriptExec = objShell.Exec(strcommand) | ||
+ | Set objStdOut = objWshScriptExec.StdOut | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | DELLIndexNum = Right(strLine, | ||
+ | End If | ||
+ | Wend | ||
+ | End Function | ||
+ | |||
+ | ' This SUB is used for determining the status and information of the Dell Storage components | ||
+ | Sub DELLStorageStatus(strcntrl) | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | End If | ||
+ | | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | ' ADDED: difference between physical and virtual includes added if statements. | ||
+ | ' ADDED: predicted failure notice. | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | intStart = InStr(strLine, | ||
+ | intstart = intStart + 2 | ||
+ | strFail = Mid(strLine, | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | strOutput = strOutput & vbtab & vbtab & " | ||
+ | End If | ||
+ | Wend | ||
+ | Wend | ||
+ | End Sub | ||
+ | |||
+ | ' This SUB is used for determining the status and information of the Dell Memory components | ||
+ | ' The reason I read the next line after finding the line I want is that when I run omreport chassis memory index=NUM I get an attribute line and a value line. | ||
+ | Sub DELLMemoryStatus(strmemindex) | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | End If | ||
+ | | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | strLine = objStdOut.ReadLine | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | ' Let us display all the useful information now that we have the status. | ||
+ | If Right(strLine, | ||
+ | strLine = objStdOut.ReadLine | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Right(strLine, | ||
+ | strLine = objStdOut.ReadLine | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Right(strLine, | ||
+ | strLine = objStdOut.ReadLine | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Right(strLine, | ||
+ | strLine = objStdOut.ReadLine | ||
+ | intStart = InStr(strLine, | ||
+ | intstart = intStart + 2 | ||
+ | strFail = Mid(strLine, | ||
+ | | ||
+ | End If | ||
+ | Wend | ||
+ | Wend | ||
+ | End Sub | ||
+ | |||
+ | ' This SUB is used for determining the status and information of the Dell Network Interfaces | ||
+ | Sub DELLNetworkStatus(strnicindex) | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | End If | ||
+ | boolValid = 0 | ||
+ | | ||
+ | | ||
+ | ' We cant get status information from NIC's | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' Let us display all the useful information we need | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | If Right(strLayout, | ||
+ | boolValid = 1 | ||
+ | End If | ||
+ | | ||
+ | If boolvalid = 1 Then | ||
+ | | ||
+ | End If | ||
+ | End If | ||
+ | Wend | ||
+ | Wend | ||
+ | strOutput = strOutput & vbcrlf | ||
+ | End Sub | ||
+ | |||
+ | ' This SUB is used for determining the status and information of the Dell Chassis Temperatures | ||
+ | Sub DELLTemperatureStatus(strtempindex) | ||
+ | While Not objStdOut.AtEndOfStream | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | End If | ||
+ | | ||
+ | | ||
+ | If InStr(strLine," | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | ' Let us display all the useful information now that we have the status. | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | If Left(strLine, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | End If | ||
+ | Wend | ||
+ | Wend | ||
+ | End Sub | ||
+ | </ | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | Download source: {{: | ||
+ | |||
+ | ===== Screenshot ===== | ||
+ | {{: | ||
+ | |||
+ | ===== Known Bugs and Issues ===== | ||
+ | * None | ||
+ | |||
+ | ===== To Do ===== | ||
+ | Please let me know of any issues with the script and I will attempt to resolve them. | ||
+ | |||
+ | ===== Credits ===== | ||
+ | The script is in part based upon a batch script called openmanage.cmd written by Dave Sobel (dave@evolvetech.com) | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | |||
+ | * **2006-08-13** | ||
+ | * 1.00 - Initial Development | ||
+ | * **2007-07-20** | ||
+ | * 2.00 - Production Release | ||
+ | * **2007-08-01** | ||
+ | * 2.10 - Updated by Sigurður Guðbrandsson (sigurdur@raforninn.is) to report detailed information for Physical Disk, Memory, NIC and Temp | ||
+ | * Now Requires OpenManage 5.2 to display the Physical disk information | ||
+ | * **2007-08-03** | ||
+ | *2.20 - Resolved issue with a non green status changing all the following statuses to the non green status | ||
+ | * **2007-08-07** | ||
+ | * 2.30 - Added the ability to turn off individual status checks if not wanted. | ||
+ | |||