Dell Server Memory Redundancy Status(Periodic)

Dell.WindowsServer.MemoryRedundancyUnitMonitor (UnitMonitor)

Unit Monitor to calculate Dell Server Memory Redundancy Status Periodically.

Knowledge Base article:

Summary

This Health Monitor fetches the Status of the Dell Memory Redundancy. The status can be one of the following three types:

Success: If the status is success, the memory redundancy has returned to a normal value or memory redundancy is not configured.

Warning: If the status is warning, the memory redundancy status is in a non-critical state.

Critical: If the status is critical, the memory redundancy status is critical.

Causes

Warning: The cause for a Warning status may be that a memory device correction rate has exceeded an acceptable value.

Critical: The cause for a Critical status may be that a memory device correction rate exceeded an acceptable value, a memory spare bank was activated, or a multibit ECC error has occurred.

Resolutions

Replace the memory module identified in the message during the system's next scheduled maintenance. Clear the memory error or the multibit ECC error.

When the issue has been resolved, the status changes to Success in the next polling cycle.

Element properties:

TargetDell.WindowsServer.Memory
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Windows.TimedScript.ThreeStateMonitorType
RemotableTrue
AccessibilityInternal
RunAsDefault

Source Code:

<UnitMonitor ID="Dell.WindowsServer.MemoryRedundancyUnitMonitor" Accessibility="Internal" Enabled="true" Target="Dell.WindowsServer.Memory" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Windows!Microsoft.Windows.TimedScript.ThreeStateMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Dell.WindowsServer.MemoryUnitSuccess" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Dell.WindowsServer.MemoryUnitWarning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Dell.WindowsServer.MemoryUnitFailure" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>21600</IntervalSeconds>
<SyncTime/>
<ScriptName>DellServerMemoryRedundancy.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Config/Computer$ $Target/Host/Property[Type="Dell.WindowsServer.Server"]/ServerType$</Arguments>
<ScriptBody><Script>
'**********************************************************************************
' Script Name - DellServerMemoryRedundancy
' Author: Thomas Jacob
'
' Description:
' Determine Unit Monitor health for ServerMemory redundancy
'
' (c) Copyright Dell Inc. 2007-2014. All rights reserved
'**********************************************************************************
Option Explicit
On Error Resume Next
SetLocale("en-us")

Dim RedundancyStatus, ServerType
RedundancyStatus = "Warning"

Dim oArgs
Set oArgs = WScript.Arguments
ServerType = oArgs(3) ' "MonolithicServer" or "ModularBlade"

Dim oAPI
Set oAPI = CreateObject("MOM.ScriptAPI")

Const WAIT_LOOP = 1000000
Const SCRIPT_NAME = "Dell Agents State Monitoring"
Const OM_REPORT_STORAGE_CONTR = "Storage"
Const DEF_OMSA_BIN_PATH = "C:\Program Files\Dell\OpenManage\oma\bin"
Const OMSA_REG_INTALL_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Dell Computer Corporation\Dell OMA\InstallPath"
Const OMSA64_REG_INTALL_PATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Dell Computer Corporation\Dell OMA\InstallPath"
Dim ObjectStatus

Dim s
Set s = New DellMemory
s.GetObjectHealth()

Dim cAPI, oBag
Set cAPI = CreateObject("MOM.ScriptAPI")
Set oBag = cAPI.CreatePropertyBag()
Call oBag.AddValue("Status", ObjectStatus)
Call cAPI.Return(oBag)

Set cAPI = Nothing
Set oBag = Nothing

Class DellMemory
Dim regError, logMessage, Message
Dim a, b

Dim rc, fileSpec, oShell
Dim strCommand, strRepFilePath, winTempPath

Function GetObjectHealth()
Dim OMSABinPath ' Store Path from Registry key
Dim drive ' Drive letter
Dim version
regError = 0

' Get OMSA Lib Path
rc = GetOMABinPath(OMSABinPath)
If rc &lt;&gt; 0 Then
WScript.Quit()
End If

' Get Install root path
rc = GetOMInstallRoot(drive, OMSABinPath) ' return the current absolute path or the root path for the OMSA Install
If rc &lt;&gt; 0 Then
WScript.Quit()
End If
If regError = 1 Then
Message = "Task Fail: OMSA not installed / OMSA Registry Value not found."
MOMDebugLog Message
WScript.Quit()
End If

' Check VBScript engine version
version = CheckVBScriptEngine()
If version = True OR version = False Then
RunCLI drive, OMSABinPath
Else
Message = "Error: VBScript corrupted/absent. Please Re-Install Windows Script 5.6 on the Agent"
MOMDebugLog Message
WScript.Quit()
End If
End Function

'*****************************************************************
'Function RunCLI
'Routine For CLI VB.Run (For Version &lt; 5.6)
'*****************************************************************
Function RunCLI(ByVal targetDrive, ByVal strOMSABinPath)
Dim guid1
GetTempFolderPath winTempPath, targetDrive
GetOMReportFileGUID guid1

RunStorageCLI targetDrive, strOMSABinPath
End Function

'*****************************************************************
'GetOMABinPath
'Routine to read the registry to query the OMA Install Path
'*****************************************************************
Function GetOMABinPath(o_sPath)
Dim oShell, tmp

Set oShell = CreateObject ("WScript.Shell")
o_sPath = ""
On Error Resume Next
o_sPath = oShell.RegRead(OMSA_REG_INTALL_PATH)
If o_sPath = "" Then
o_sPath = oShell.RegRead(OMSA64_REG_INTALL_PATH)
End If
If o_sPath = "" Then
tmp = DEF_OMSA_BIN_PATH &amp; "\omreport.exe"
If(bFileExists(tmp)) Then
o_sPath = DEF_OMSA_BIN_PATH
Message = "GetOMABinPath - OMSABinPath is empty, Using Default Existing Path" &amp; DEF_OMSA_BIN_PATH
MOMDebugLog Message
Else
regError = 1
End If
Else
o_sPath = o_sPath &amp; "\bin"
End If
If Err &lt;&gt; 0 Then
GetOMSABinPath = Err.Number
End If
End Function

'*****************************************************************
'GetOMInstallRoot
'Routine to determine the Drive letter where OMSA is installed
'*****************************************************************
Private Function GetOMInstallRoot(ByRef path, ByVal OMSAInstallPath)
On Error Resume Next
Err.Clear
' Return the root drive of the OMInstall Path
path = Left(OMSAInstallPath, 2)
End Function

'*****************************************************************
'bFileExists
'Routine to determine if the OMSA Report file is created
'*****************************************************************
Function bFileExists(filespec1)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
bFileExists = (fso.FileExists(filespec1))
Set fso = Nothing
End Function

'*****************************************************************
'DelFile
'Routine to delete the OMSA Report file
'*****************************************************************
Function DelFile(ByVal filespec2)
Dim fso
If bFileExists(filespec2) Then
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile filespec2, True
Set fso = Nothing
End If
If Err &lt;&gt; 0 Then
DelFile = Err.Number
End If
End Function

'**********************************************************
' CheckVBScriptEngine()
' Check VBScript engine version:
'**********************************************************
Function CheckVBScriptEngine()
On Error Resume Next
Dim bIsCompatV, var
Const VBSCRIPT_MIN_VERSION = 56
var = ((ScriptEngineMajorVersion * 10) + ScriptEngineMinorVersion)
If ((var) &lt; VBSCRIPT_MIN_VERSION) Then
bIsCompatV = False
Else
bIsCompatV = True
End If
If Err &lt;&gt; 0 Then
CheckVBScriptEngine = Err.Number
Err.Clear
Else
CheckVBScriptEngine = bIsCompatV
End If
End Function

'*****************************************************************
'Function RunStorageCLI - Called from RunCLI
'Routine For VB.Run (For Version &lt; 5.6)
'*****************************************************************
Function RunStorageCLI (ByVal Drive2, ByVal OMSABinPath)
Dim guid22
GetTempFolderPath winTempPath, Drive2
GetOMReportFileGUID guid22
a = 1
b = 0
strRepFilePath = winTempPath &amp; "\" &amp; OM_REPORT_STORAGE_CONTR &amp; guid22 &amp; ".xml"

If StrComp(ServerType,"ModularBlade",1)=0 Then
strCommand = "cmd /C " &amp; chr(34) &amp; OMSABinPath &amp; "\" &amp; "omreport.exe" &amp; Chr(34) &amp; " mainsystem memory -fmt xml -outc " &amp; strRepFilePath
Else
'Will be "MonolithicServer"
strCommand = "cmd /C " &amp; chr(34) &amp; OMSABinPath &amp; "\" &amp; "omreport.exe" &amp; Chr(34) &amp; " chassis memory -fmt xml -outc " &amp; strRepFilePath
End If

fileSpec = strRepFilePath
Set oShell = CreateObject ("WScript.Shell")
rc = oShell.run (strCommand,0,true)
If rc &lt;&gt; 0 Then
DelFile(strRepFilePath)
Else
' Infinite Loop Until file OM_REPORT_FILE_NAME is created
Do While bFileExists(fileSpec) &lt;&gt; -1
WScript.Sleep(0)
a = a + 1
b = a Mod WAIT_LOOP
If b = 0 Then
MOMDebugLog "Exit RunCmd. Reason: OMREPORT STORAGE not responding for " &amp; WAIT_LOOP &amp; " loops."
Exit Do
End If
Loop
' Parse XML File
ParseStorageXML fileSpec

' Clean up the CLI Output : Delete OM_REPORT_FILE_NAME for STORAGE
DelFile(strRepFilePath)
End If ' End of If Condition for rc&lt;&gt;0 for oshell.run(omreport storage controller)
Set strRepFilePath = Nothing
Set strCommand = Nothing
Set oShell = Nothing
Set fileSpec = Nothing
End Function

'*****************************************************************
' Function ParseStorageXML
' Rollup GlobalStorageHealth from OMSS StorageController XML Output
'*****************************************************************
Function ParseStorageXML(ByVal storagefilepath)
Dim object_health, object_arr
Dim obj, obj_val
Dim xmlDoc, i
If(bFileExists(storagefilepath)) Then
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
If (IsObject(xmlDoc) = True) Then
xmlDoc.async = "false"
xmlDoc.load(storagefilepath)
If (xmlDoc.parseError.errorCode &lt;&gt; 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
Message = "XML Parse Error Reason: " &amp; myErr.reason
MOMDebugLog Message
Message = "XML Parse Error Line: " &amp; myErr.line
MOMDebugLog Message
Message = "XML Parse Error Character: " &amp; myErr.linepos
MOMDebugLog Message
Message = "XML Parse Error Text: " &amp; myErr.srcText
MOMDebugLog Message
DelFile(storagefilepath)
Exit Function
End If

Set object_arr = xmlDoc.getElementsByTagName("RedunStatus")
ObjectStatus = "OK"

object_health = 0

For i = 0 To (object_arr.length - 1)
object_health = object_arr.Item(i).nodeTypedValue
' obj_val = obj.Item(i).nodeTypedValue

If object_health = 6 Then
ObjectStatus = "Error"
Exit For
ElseIf object_health = 4 Then
If ObjectStatus = "Warning" Then
'Continue earlier status as worst status
Else
ObjectStatus = "OK"
End If
Else
ObjectStatus = "Warning"
End If
Next

Else
Message = "Error: DOM object not created using CreateObject - Microsoft.XMLDOM"
MOMDebugLog Message
End If
Else
Message = "Storage CLI XML Output File does not exist - " &amp; storagefilepath
MOMDebugLog Message
End If
End Function

'*****************************************************************
' Function MOMDebugLog
' Add logMessage Header - ScriptName and Time and Logging it.
'*****************************************************************
Function MOMDebugLog (ByVal strMessage)
logMessage = "(" &amp; SCRIPT_NAME &amp; ")" &amp; "-" &amp; "[" &amp; Now() &amp; "] --- "
logMessage = logMessage &amp; strMessage
End Function

'*****************************************************************
'GetTempFolderPath
'Routine to Get Win Temp Folder path
'*****************************************************************
Function GetTempFolderPath(ByRef WinTempFolder, ByVal drive_letter)
Dim fldrExistFlag, fso
fldrExistFlag = False
dim wshShell : Set wshShell = Createobject("WScript.Shell")
dim wshSysEnv : Set wshSysEnv = wshShell.Environment
dim strSysTempFolder : strSysTempFolder = wshSysEnv("TEMP")
dim wshPrcEnv : Set wshPrcEnv = wshShell.Environment("Process")
strSysTempFolder = Replace(strSysTempFolder, "%SystemRoot%", wshPrcEnv("SYSTEMROOT"), 1, -1, vbTextCompare)
WinTempFolder = strSysTempFolder

Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(WinTempFolder)) Then
fldrExistFlag = True
Else
fldrExistFlag = False
End If

If WinTempFolder = "" OR fldrExistFlag = False Then
WinTempFolder = drive_letter
End If

Set wshShell = Nothing
Set wshSysEnv = Nothing
Set strSysTempFolder = Nothing
Set wshPrcEnv = Nothing

If Err &lt;&gt; 0 Then
GetTempFolderPath = Err.Number
End If
End Function

'*****************************************************************
'GetOMReportFileGUID
'Routine to generate unique GUIDs for OMREPORT FILE
'*****************************************************************
Function GetOMReportFileGUID(ByRef o_guid)
Dim TypeLib, NewGUID
Set TypeLib = CreateObject("Scriptlet.TypeLib")
NewGUID = TypeLib.Guid
o_guid = (left(NewGUID, len(NewGUID)-2))
Set TypeLib = Nothing
End Function
End Class
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Error</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<WarningExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Warning</Value>
</ValueExpression>
</SimpleExpression>
</WarningExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">OK</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
</Configuration>
</UnitMonitor>