Teamed Network Interface (Basic) Connection Status Event triggered monitor

Dell.WindowsServer.TeamedBasicNetworkInterfaceUnitEventUnitMonitor (UnitMonitor)

Unit Monitor to calculate the Teamed Network Interface Status.

Knowledge Base article:

Summary

This Health Monitor monitors the state of Teamed 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 teamed network interfaces are in warning state. This happens 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 teamed network interface in the specified system is in critical state. This happens 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 one or more teamed 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 physical 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 the network configuration is correct.

Element properties:

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

Source Code:

<UnitMonitor ID="Dell.WindowsServer.TeamedBasicNetworkInterfaceUnitEventUnitMonitor" Accessibility="Public" Target="Dell.WindowsServer.TeamedBasicNetworkInterfaceUnit" 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/Host/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|iANSMiniport|e1iexpress|ixgbn|i40ea|ixgbi|qebdrv|bxois|bxfcoe|elrexpress|elsexpress|ixgbt|ixgbs)</Pattern>
</RegExExpression>
</EventExpression>
<ScriptName>DellNICUnitEventTriggerTeamed1.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Config/Computer$ $Target/Property[Type="Dell.WindowsServer.TeamedBasicNetworkInterfaceUnit"]/DeviceID$</Arguments>
<ScriptBody><Script>
'**********************************************************************************
' Script Name - DellServerNICUnit
' Author: Vignesh Pandian
'
' Description:
' Determine Unit Monitor health for ServerNICs Teamed basic
'
' (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, nicStatusVal, prmDeviceID, i, logMessage
strComputer = "."
prmDeviceID = ""
For i=3 to (oArgs.Count-1)
prmDeviceID = prmDeviceID &amp; " " &amp; oArgs(i)
Next
prmDeviceID = Trim(prmDeviceID)

Dim status, sqlstr
Dim WbemServices, wbemObjectSet, objItem
strComputer="."
Set WbemServices = GetObject("winmgmts:" &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")
If (WbemServices is Nothing) Or (IsEmpty(WbemServices)) Or (Err.Number &lt;&gt; 0) Then
logMessage = " ERROR: Unable to open WMI Namespace root-cimv2. Check to see if the WMI service is enabled and running, and ensure this WMI namespace exists." &amp; Err.Description
Err.Clear
Else
sqlstr = "Select * from Win32_NetworkAdapter WHERE DeviceID = '" &amp; prmDeviceID &amp; "'"
Set wbemObjectSet = GetObjectSetMod(wbemServices, sqlstr, "Win32_NetworkAdapter")

If Err.Number &lt;&gt; 0 Then
logMessage = " ERROR: Unable to retrieve Win32_NetworkAdapter . Err Number:" &amp; Err.Number &amp; "Description:" &amp; Err.Description
Err.Clear
End If
If wbemObjectSet is Nothing Then
logMessage = " ERROR: WMI object set to Nothing"
Err.Clear
Else
logMessage = "INFO: Network Adapter Broadcom/Intel adapter query for specific health retrieved successfully: "
For Each objItem in wbemObjectSet
'Error checking
If Err.Number &lt;&gt; 0 Then
logMessage = " ERROR: Object loop retrieval error. ErrNumber:" &amp; Err.Number &amp; "Description:" &amp; Err.Description
Err.Clear
End If
'Object Retrieval
If not objItem is nothing Then
status = objItem.NetConnectionStatus
If status = "6" OR status = "7" OR status = "10" OR status = "11" Then
nicStatusVal = "Error"
ElseIf status = "3" OR status = "12" Then
nicStatusVal = "Warning"
Else
nicStatusVal = "OK"
End If
End If
Next
Set objItem = Nothing
End If
Set wbemObjectSet = Nothing
End If
Set WbemServices = nothing

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

Call oAPI.Return(oBag)

' Modified Function to just check the handler is null or not
Function GetObjectSetMod(ByRef objDellConnection, SelectQuery, objName)
Dim retry, RetryFlag, logMessage
On Error Resume Next
RetryFlag = False
For retry = 0 To 1
MOMDebugLog 1, "Retrying for " &amp; retry &amp; " time..."
Set GetObjectSetMod = objDellConnection.ExecQuery(SelectQuery)
If (GetObjectSetMod is Nothing) Or (IsNull(GetObjectSetMod)) Then
logMessage = "INFO: Unable to retrieve " &amp; objName &amp; " Attributes"
MOMDebugLog 1, logMessage
WScript.Sleep(1000)
RetryFlag = True
Else
Exit For
End If
Next
End Function
</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>