Dell Server Memory Redundancy Status (Event Triggered)

Dell.WindowsServer.MemoryRedundancyEventUnitMonitor (UnitMonitor)

Unit Monitor to calculate Dell Server Memory Redundancy Status triggered on memory-related events.

Knowledge Base article:

Summary

This unit monitor is disabled. Refer to the IDRAC Console for Memory Redundancy status.

Element properties:

TargetDell.WindowsServer.Memory
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledFalse
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeDell.WindowsServer.EventTriggeredScriptMonitorType.3StateScriptMonitorType
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Dell.WindowsServer.MemoryRedundancyEventUnitMonitor" Accessibility="Public" Enabled="false" Target="Dell.WindowsServer.Memory" TypeID="Dell.WindowsServer.EventTriggeredScriptMonitorType.3StateScriptMonitorType" ParentMonitorID="SystemHealth!System.Health.AvailabilityState">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="Success" ID="HealthyState"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="Warning" ID="WarningState"/>
<OperationalState HealthState="Error" MonitorTypeStateID="Critical" ID="CriticalState"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$</ComputerName>
<LogName>System</LogName>
<EventExpression>
<And>
<Expression>
<Or>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">1400</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>LessEqual</Operator>
<ValueExpression>
<Value Type="Integer">1405</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">5400</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>LessEqual</Operator>
<ValueExpression>
<Value Type="Integer">5405</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Or>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Server Administrator</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</EventExpression>
<ScriptName>DellServerMemoryRedundancyEventTrigger.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 &#xA9; 2009&#x2013; 2017 Dell Inc, or its subsidiaries. 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>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">OK</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
<WarningExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Warning</Value>
</ValueExpression>
</SimpleExpression>
</WarningExpression>
<CriticalExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Status']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Error</Value>
</ValueExpression>
</SimpleExpression>
</CriticalExpression>
</Configuration>
</UnitMonitor>