Hi,
Do you mean that we use management pack templates to create a monitor and save it in a custom management pack as mentioned in the below article? If yes, we may configure recovery task as shown below. The recovery task can be a script, in which we can configure how many times it retries.
http://www.opsman.co.za/scom-basics-creating-a-service-monitor-with-automatic-recovery/
Note: this is NOT from MS, just for your reference.
Regards,
Alex
If the response is helpful, please click "Accept Answer" and upvote it.