Converged Network Switch Unit Monitor

UCPManagementPack.ConvergedSwitchUnitMonitor (UnitMonitor)

Description for the new unit monitor.

Knowledge Base article:

Summary

This monitor is an availability monitor for Converged switch port in a UCP Director. If the state is Warning or Error, there could be an issue with the port.

Causes

A warning or error for the Converged Switch Port can be caused by a problem with its operational status or UCP monitor mode.

Resolutions

Please check specific Converged Switch port connectivity or check UCP monitor mode on the port.

Element properties:

TargetUCPManagementPack.ConvergedSwitchPort
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeUCPManagementPack.TimedPowerShell.UnitMonitor
RemotableTrue
AccessibilityInternal
Alert Message
Converged Network Switch failed health check
RunAsSystem.PrivilegedMonitoringAccount

Source Code:

<UnitMonitor ID="UCPManagementPack.ConvergedSwitchUnitMonitor" Accessibility="Internal" Enabled="true" Target="UCPManagementPack.ConvergedSwitchPort" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="UCPManagementPack.TimedPowerShell.UnitMonitor" ConfirmDelivery="false" RunAs="System!System.PrivilegedMonitoringAccount">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="UCPManagementPack.ConvergedSwitchUnitMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>400</IntervalSeconds>
<SyncTime/>
<ScriptName>MonitorConvergedSwitch.ps1</ScriptName>
<ScriptBody><Script>

param($sourceId, $managedEntityId, $managementIps, $domain, $username, $password)

$api = new-object -comObject 'MOM.ScriptAPI'

$bag = $api.CreatePropertyBag()

# Make sure credentials are set
if ($username -and $password) {

add-type "using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { return true; } }"

[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy

$secstr = New-Object -TypeName System.Security.SecureString
$password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "$domain`\$username", $secstr

$url = "https://$managementIps/monitoring/monitorStates?resourceType=ConvergedNetwork"
$resourceName = "$Target/Property[Type='UCPManagementPack.ConvergedSwitchPort']/Name$"

$api.LogScriptEvent("MonitorConvergedSwitch.ps1", 103, 0, "Getting converged switch health data from $url for $resourceName")

$results = Invoke-RestMethod -Uri $url -Credential $cred

$result = $results | where { $_.GlobalResourceId -eq $resourceName }

if ($result.ResourceState -eq "Ok") {
$bag.AddValue("Status","HEALTHY")
} elseif ($result.ResourceState -eq "Error") {
$bag.AddValue("Status","ERROR")
} else {
$bag.AddValue("Status","WARNING")
}

$api.LogScriptEvent("MonitorConvergedSwitch.ps1", 103, 0, "Finished getting converged switch health data for $resourceName")
} else {
$api.LogScriptEvent("MonitorConvergedSwitch.ps1", 103, 0, "Credentials not provided!")
}

$bag

</Script></ScriptBody>
<ManagementIps>$Target/Host/Host/Host/Property[Type='UCPManagementPack.Pod']/ManagementIp$</ManagementIps>
<TimeoutSeconds>300</TimeoutSeconds>
<SourceId>$MPElement$</SourceId>
<ManagedEntityId>$Target/Id$</ManagedEntityId>
</Configuration>
</UnitMonitor>