SCOM Snippet: The hidden nag mode
Posted by Jeremy D. Pavleck on September 10th, 2008
When it comes to notifications, we have many options - except one that people have asked about, a nag mode. Something that will re-send an email after a certain amount of time to make sure it’s taken care of.
Well, it does exist in OpsMgr.
Either intentionally or unintentionally as a bug, if you call the Update method on an alert without changing any criteria, the notification bound to the alert will re-fire. This will happen whether you add a comment with the update (Update(”Updating the alert”)) or not (Update(”")).
To enable this secret nag-mode, it’s as simple as writing a Powershell script that runs every X hours. In that script you’ll just need to do a Get-Alert with the criteria you’re looking for - in the example I’m just going to have it return all alerts older then 4 hours, and update them.
It’s very simple though - how simple? Like this:
ForEach($alert in $oldAlerts) {
$alert.Update("")
}
You can expand this as much as you’d like. Match against NetBiosComputerName to only nag for those critical core servers, match it against the monitoring object to ensure critical monitors are being addressed. Multiple management groups? Match against that. You see where I’m going with this. In fact, you can find out everything you can match against by just running Get-Alert | select -first 1 - there’s all the fields available.




September 22nd, 2008 at 7:43 am
It has one problem the last modified time changes when we run alert.update.