Reset Dependency Monitors

Resetting the monitor that triggered an alert is the best option in SCOM as it will allow the monitor to alert again, if needed. Working programmatically this is easy for alerts that are generated from a Unit Monitor. A Dependency Monitor can be more challenging, which is what we'll address here.

To properly reset your Dependency Monitor you will need to find the underlying Unit Monitor(s) and reset them. The below PowerShell script will assist in identifying the monitors and allowing programmatic reset.

For an example we will use the above roll-up configuration monitor. I place the ID of the monitor in the script, but this would also be available on the alert as ProblemId.

# get the management group object
$ManagementGroup = Get-SCOMManagementGroup

# pick and example monitor and object, the Configuration roll up is used below
$exampleMonitor = Get-SCOMMonitor -Id 4fea8a72-7ed1-7621-c3a3-103ef0e91574
$exampleObject = Get-SCOMClassInstance -Id 60090855-19ea-0e20-5c3f-c4e0146bcd4d

# Start by getting all monitors that consider this monitor their parent
$monitorCriteria = [Microsoft.EnterpriseManagement.Configuration.ManagementPackMonitorCriteria]::new("ParentMonitorId = '" + $exampleMonitor.Id.ToString() + "'")
$monitorChildren = $ManagementGroup.Monitoring.GetMonitors($monitorCriteria)

# Filter this larger list of monitors to any class our target object has
$filteredChildren = $monitorChildren | ? {$_.Target.Id -in $exampleObject.MonitoringClassIds}

# We need to convert the PS object array into a typed list
$filteredMonitorList = [System.Collections.Generic.List[Microsoft.EnterpriseManagement.Configuration.ManagementPackMonitor]]::new()
$filteredChildren | % {$filteredMonitorList.Add($_)}

# Use the typed list against the object to get the state of all of the child monitors
$childMonitorStates = $exampleObject.GetMonitoringStates($filteredMonitorList)

# Show our results
$childMonitorStates | sort -Property MonitorDisplayName | select MonitorDisplayName, HealthState, MonitorId

Running the script outputs the below, in which you can see the two warning states. From this point you could recursively follow until a Unit Monitor is found.

Previous
Previous

Installing SCOM 2019 from the command-line

Next
Next

Update Rollup 7 for System Center 2016 has been released!