Physical Network Interface (Enriched) Link Status Periodic Monitor

Dell.WindowsServer.EnrichedNIUnit.LinkStatus.PollUnitMonitor (UnitMonitor)

Knowledge Base article:

Summary

This Health Monitor monitors the link status of Physical network interface on the Dell Server. The status can be one of the following three types:

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

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

Critical: If the status is critical, network interface status is critical.

Causes

Warning: A Warning status is displayed if link status of the Physical network interface is 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 may display if link status of the physical 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 by the user, or has limited or no connectivity to network.

Resolutions

Perform the following steps for the Warning and Critical status:

Warning: A Warning status indicates link status of the Physical network interface 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 the physical network interface. Check if the network cable is connected, trouble shoot for any NIC hardware failures from the Windows Event Log and check if the network configuration is correct.

Element properties:

TargetDell.WindowsServer.EnrichedNetworkInterfaceUnit
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.Windows.TimedScript.ThreeStateMonitorType
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Dell.WindowsServer.EnrichedNIUnit.LinkStatus.PollUnitMonitor" Accessibility="Public" Enabled="true" Target="Dell.WindowsServer.EnrichedNetworkInterfaceUnit" 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.EnrichedNIUnit.Link.Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Dell.WindowsServer.EnrichedNIUnit.Link.Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Dell.WindowsServer.EnrichedNIUnit.Link.Failure" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>1800</IntervalSeconds>
<SyncTime/>
<ScriptName>DellServerNICUnitlink1.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Config/Computer$ $Target/Property[Type="Dell.WindowsServer.EnrichedNetworkInterfaceUnit"]/NetConnectionID$</Arguments>
<ScriptBody><Script>
'**********************************************************************************
' Script Name - DellServerNICUnit
' Author: Vignesh Pandian
'
' Description:
' Determine Unit Monitor health for ServerNICs
'
' (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; 4 Then
Wscript.Quit -1
End If

Dim strComputer, prmDeviceID, i, logMessage
strComputer = "."
prmDeviceID = ""
For i=3 to (oArgs.Count-1)
prmDeviceID = prmDeviceID &amp; " " &amp; oArgs(i)
Next
prmDeviceID = Trim(prmDeviceID)

Dim linkStatus, linkStatusVal, interfaceDesc, interfaceDescVal, monitorStatus
GetLinkStatus

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

Function GetLinkStatus()
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")
For i = 0 To (interfaceDesc.length - 1)
interfaceDescVal = interfaceDesc.Item(i).nodeTypedValue
If (StrComp(interfaceDescVal, prmDeviceID,1)=0) Then

If linkStatus Is Nothing Or linkStatus.Item(i) Is Nothing Then
linkStatusVal = 0
Else
linkStatusVal = linkStatus.Item(i).nodeTypedValue
End If
End If
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>
<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>