Global Enriched Network Interfaces Status (EventTrigger)

Dell.WindowsServer.Enriched.NIGroup.EventUnitMonitor (UnitMonitor)

Knowledge Base article:

Summary

Enriched Network interface Group Event Unit Monitor monitors the state of network interfaces on the Dell Server. The status can be one of the following three types:

Success: If the status is success, all network interfaces has returned to a normal value.

Warning: If the status is warning, one or more network interface is noncritical.

Critical: If the status is critical, one or more network interface status is critical.

Causes

Warning: A Warning status is displayed if one or more network interfaces are in warning state. This can happen when the network interface status is initializing or is in the process of connecting to the network.

Critical: A Critical status is displayed if one or more network interface in the specified system is in critical state. This can happen when the network cable is not connected, NIC hardware fails, network link is down, connection is disabled manually or, has limited or no connectivity to network.

Resolutions

Perform the following steps for the Warning and Critical status:

Warning: A Warning status indicates one or more network interfaces is initializing or is in the process of connecting to the network. Wait for some time and retry.

Critical: A Critical status indicates limited or no network connectivity for one or more network interfaces. If the problem persists, check if the network cable is connected, Network interface drivers are configured properly, trouble shoot for any NIC hardware failures from the Windows Event Log and check if network configuration is correct.

Element properties:

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

Source Code:

<UnitMonitor ID="Dell.WindowsServer.Enriched.NIGroup.EventUnitMonitor" Accessibility="Public" Target="Dell.WindowsServer.NICGroup.ExtOMSA" 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>
<RegExExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>MatchesRegularExpression</Operator>
<Pattern>(b57w2k|b57nd60x|b57nd60a|l2nd|e1express|e1qexpress|ixgbe|b06bdrv|ebdrv|e1000)</Pattern>
</RegExExpression>
</EventExpression>
<ScriptName>DellServerNICExtOMSAUnitEventTrigger2.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Config/Computer$</Arguments>
<ScriptBody><Script>
'**********************************************************************************
' Script Name - DellServerNICUnit
' Author: Vignesh Pandian
'
' Description:
' Determine Unit Monitor health for ServerNICs ConnStatus, LinkStatus, AdminStatus, OperStatus
'
' (c) Copyright &#xA9; 2009&#x2013; 2017 Dell Inc, or its subsidiaries. All Rights Reserved.
'**********************************************************************************
Option Explicit
On Error Resume Next
SetLocale("en-us")

Dim oArgs
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
Wscript.Quit -1
End If

Dim strComputer, prmDeviceID, i, logMessage
strComputer = "."

Dim interfaceDesc, interfaceDescVal, monitorStatus
Dim operStatus, operStatusVal, adminStatus, adminStatusVal, connStatus, connStatusVal, linkStatus, linkStatusVal, tmpStatus, osVendor, osVendorVal
monitorStatus = "OK"
tmpStatus = ""
GetGlobalNICHealth

Function GetGlobalNICHealth()
Dim OMSABinPath ' Store Path from Registry key
Dim drive ' Drive letter
Dim version, regError, rc
regError = 0
' Get OMSA Lib Path
rc = GetOMABinPath(OMSABinPath, regError)
If rc &lt;&gt; 0 Then
logMessage = "GetOMSAHealth:GetOMABinPath Error"
MOMDebugLog 1, logMessage
Err.Clear
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
logMessage = "GetOMSAHealth:GetOMInstallRoot Error"
MOMDebugLog 1, logMessage
Err.Clear
WScript.Quit()
End If
If regError = 1 Then
logMessage = "Task Fail: OMSA not installed / OMSA Registry Value not found."
MOMDebugLog 1, logMessage
Err.Clear
WScript.Quit()
End If

Dim guid1, wintemp_path, nicFilePath
GetTempFolderPath wintemp_path, drive
GetOMReportFileGUID guid1

'On Error Resume Next
Dim guid22, timer, filespec, oShell, strCommand, strRepFilePath
Const TIMEOUT = 20
GetOMReportFileGUID guid22
strRepFilePath = wintemp_path &amp; "\" &amp; "nic" &amp; guid22 &amp; ".xml"
strCommand = "cmd /C " &amp; chr(34) &amp; OMSABinPath &amp; "\" &amp; "omreport.exe" &amp; Chr(34) &amp; " chassis nics -fmt xml -outc " &amp; strRepFilePath
filespec = strRepFilePath
Set oShell = CreateObject ("WScript.Shell")
rc = oShell.run (strCommand,0,true)
If rc &lt;&gt; 0 Then
DelFile(strRepFilePath)
Err.Clear
Else
' Infinite Loop Until file OM_REPORT_FILE_NAME is created
timer = 0
Do While bFileExists(filespec) &lt;&gt; -1
WScript.Sleep(1000)
timer = timer + 1
if (timer &gt; TIMEOUT) Then
MOMDebugLog "Exit RunCmd. Reason: OMREPORT CHASSIS NICS not responding"
Exit Do
End If
Loop
' Parse XML block
nicFilePath = filespec
Dim xmlDoc, i, str

If(bFileExists(nicFilePath)) Then
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
If (IsObject(xmlDoc) = True) Then
xmlDoc.async = "false"
xmlDoc.load(nicFilePath)
If (xmlDoc.parseError.errorCode &lt;&gt; 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
logMessage = "XML Parse Error Reason: " &amp; myErr.reason
MOMDebugLog 1, logMessage
logMessage = "XML Parse Error Line: " &amp; myErr.line
MOMDebugLog 1, logMessage
logMessage = "XML Parse Error Character: " &amp; myErr.linepos
MOMDebugLog 1, logMessage
logMessage = "XML Parse Error Text: " &amp; myErr.srcText
MOMDebugLog 1, logMessage
DelFile(nicFilePath)
Exit Function
End If
Set interfaceDesc = xmlDoc.getElementsByTagName("IfDescription") 'NetConnectionID
Set linkStatus= xmlDoc.getElementsByTagName("linkStatus")
Set adminStatus= xmlDoc.getElementsByTagName("ifAdminStatus")
Set operStatus= xmlDoc.getElementsByTagName("ifOperStatus")
Set connStatus= xmlDoc.getElementsByTagName("nicStatus")
Set osVendor = xmlDoc.getElementsByTagName("OSAdapterVendor") ' Manufacturer

For i = 0 To (interfaceDesc.length - 1)
interfaceDescVal = interfaceDesc.Item(i).nodeTypedValue
If osVendor Is Nothing Or osVendor.Item(i) Is Nothing Then
osVendorVal = "Not Available"
continue
Else
osVendorVal = osVendor.Item(i).nodeTypedValue
'If ((Instr(LCase(osVendorVal),"broadcom")) OR (Instr(LCase(osVendorVal),"intel"))) Then
' Proceed further in the loop
' Else
' continue
' End If
End If

If linkStatus Is Nothing Or linkStatus.Item(i) Is Nothing Then
linkStatusVal = 0
Else
linkStatusVal = linkStatus.Item(i).nodeTypedValue
End If
If adminStatus Is Nothing Or adminStatus.Item(i) Is Nothing Then
adminStatusVal = 0
Else
adminStatusVal = adminStatus.Item(i).nodeTypedValue
End If
If operStatus Is Nothing Or operStatus.Item(i) Is Nothing Then
operStatusVal = 0
Else
operStatusVal = operStatus.Item(i).nodeTypedValue
End If
If connStatus Is Nothing Or connStatus.Item(i) Is Nothing Then
connStatusVal = 0
Else
connStatusVal = connStatus.Item(i).nodeTypedValue
End If

If connStatusVal = 4 Then 'Disabled NICstatus in OMSA
continue
End If

If linkStatusVal = 1 Then 'UpStatus
tmpStatus = "OK"
ElseIf linkStatusVal = 2 Then 'DownStatus
tmpStatus = "Error"
Else
tmpStatus = "Warning"
End If
If monitorStatus = "OK" Then
If tmpStatus = "Warning" Then
monitorStatus = "Warning"
ElseIf tmpStatus = "Error" Then
monitorStatus = "Error"
End If
ElseIf monitorStatus = "Warning" Then
If tmpStatus = "Error" Then
monitorStatus = "Error"
End If
End If
tmpStatus = ""

If adminStatusVal = 1 OR adminStatusVal = 3 Then 'UpStatus
tmpStatus = "OK"
ElseIf adminStatusVal = 2 Then 'DownStatus
tmpStatus = "Error"
Else
tmpStatus = "Warning"
End If
If monitorStatus = "OK" Then
If tmpStatus = "Warning" Then
monitorStatus = "Warning"
ElseIf tmpStatus = "Error" Then
monitorStatus = "Error"
End If
ElseIf monitorStatus = "Warning" Then
If tmpStatus = "Error" Then
monitorStatus = "Error"
End If
End If
tmpStatus = ""

If OperStatusVal = 1 OR OperStatusVal = 3 OR OperStatusVal = 5 Then 'UpStatus
tmpStatus = "OK"
ElseIf OperStatusVal = 2 OR OperStatusVal = 6 OR OperStatusVal = 7 Then 'DownStatus
tmpStatus = "Error"
Else
tmpStatus = "Warning"
End If
If monitorStatus = "OK" Then
If tmpStatus = "Warning" Then
monitorStatus = "Warning"
ElseIf tmpStatus = "Error" Then
monitorStatus = "Error"
End If
ElseIf monitorStatus = "Warning" Then
If tmpStatus = "Error" Then
monitorStatus = "Error"
End If
End If
tmpStatus = ""

If ConnStatusVal = "1" OR ConnStatusVal = "10" OR ConnStatusVal = "4" OR ConnStatusVal = "12" Then 'UpStatus
tmpStatus = "OK"
ElseIf ConnStatusVal = "2" OR ConnStatusVal = "13" Then 'DownStatus
tmpStatus = "Error"
Else 'Status = 11 or Status = 3
tmpStatus = "Warning"
End If
If monitorStatus = "OK" Then
If tmpStatus = "Warning" Then
monitorStatus = "Warning"
ElseIf tmpStatus = "Error" Then
monitorStatus = "Error"
End If
ElseIf monitorStatus = "Warning" Then
If tmpStatus = "Error" Then
monitorStatus = "Error"
End If
End If
tmpStatus = ""
Next
Else
logMessage = "Error: DOM object not created using CreateObject - Microsoft.XMLDOM"
MOMDebugLog 1, logMessage
End If
Else
logMessage = "NIC CLI XML Output File does not exist - " &amp; nicFilePath
MOMDebugLog 1, logMessage
End If

'end Parse XML block

' Clean up the CLI Output : Delete OM_REPORT_FILE_NAME for NICs
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

'*****************************************************************
'GetOMABinPath
'Routine to read the registry to query the OMA Install Path
'*****************************************************************
Function GetOMABinPath(o_sPath, ByRef regError)
On Error Resume Next
Dim strOMAKey
Dim oShell, tmp

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"

Set oShell = CreateObject ("WScript.Shell")
o_sPath = ""

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
logMessage = "GetOMABinPath - OMSABinPath is empty, Using Default Existing Path" &amp; DEF_OMSA_BIN_PATH
MOMDebugLog 1, logMessage
Else
regError = 1
End If
Else
o_sPath = o_sPath &amp; "\bin"
End If

If Err &lt;&gt; 0 Then
GetOMSABinPath = Err.Number
Err.Clear
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
' 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(ByVal filespec1)
On Error Resume Next
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)
On Error Resume Next
Dim fso, oFile
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
Err.Clear
End If
End Function

'*****************************************************************
'GetTempFolderPath
'Routine to Get Win Temp Folder path
'*****************************************************************
Function GetTempFolderPath(ByRef WinTempFolder, ByVal drive_letter)
On Error Resume Next
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
Err.Clear
End If
End Function

'*****************************************************************
'GetOMReportFileGUID
'Routine to generate unique GUIDs for OMREPORT FILE
'*****************************************************************
Function GetOMReportFileGUID(ByRef o_guid)
On Error Resume Next
Dim TypeLib, NewGUID
Set TypeLib = CreateObject("Scriptlet.TypeLib")
NewGUID = TypeLib.Guid
o_guid = (left(NewGUID, len(NewGUID)-2))
Set TypeLib = Nothing
End Function

Sub MOMDebugLog (ByVal num, ByVal msg)
End Sub

Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Call oBag.AddValue("Status",monitorStatus)

Call oAPI.Return(oBag)

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