SCOM Recovery Task recalculate health

Woody1150 1 Reputation point
2021-11-04T17:53:25.217+00:00

I have a monitor with a recovery task configured that runs a powershell script. Looking in Health Explorer I can see when the monitor alerts that the recovery task runs successfully and the script does what it is supposed to. However, even though I have the recovery task configured to recalculate the health when it is finished, it doesn't seem to. The monitor will stay in a warning/critical state until the next interval when the monitor checks again (15 mins later) and it then changes back to healthy. My assumption was that having the recovery recalculate health would be done immediately so if the task fixed the issue it would close the alert right then, not on the next interval... is this not correct?

Looking for input on how I may be able to correct this. Have people now checking servers that have alerted only to find there is no issue because the recovery already corrected the problem but the 15 min interval hasn't passed to update the state.

Thanks.

System Center Operations Manager
System Center Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AlexZhu-MSFT 6,596 Reputation points Moderator
    2021-11-05T07:46:26.403+00:00

    Hi,

    Sorry for dispointing you, it seems this is the expected behavior. Since you've already used powershell script for the recovery task, we may consider to add resetting monitor functionality to the existing script.

    Here's the example script to illustrate how it works and you may need to add more to suit for the actual environment.

    For the script with credential, we may refer to this guide.

    	import-module operationsManager  
    	  
    	New-SCOMManagementGroupConnection -computername "the management server"  
    	  
    	$monitorName = "neptune01"  
    	$alerts = get-scomalert | where-object {$_.ResolutionState -eq "0" -and $_.Name -eq "$monitorName"}  
      
    	ForEach($alert in $alerts)   
    	{  
    		$monitor = get-ScomMonitor -Id $alert.MonitoringRuleId  
    		Get-SCOMClassInstance -id $alert.MonitoringObjectId | foreach {$_.ResetMonitoringState($monitor)}  
    	}  
    

    test screenshot for your reference:
    146700-scom-reset-monitor.png

    Alex
    If the response is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.