Reset Monitor State (in SCOM 2007)
By MadHatter on 8/12/2010 1:13:31 AM • Rank (31302) • Views 31815
1

1

 by OpsMgr MVP Scott Moss, This code will get a list of all alerts that are closed that were created by a monitor, that are older than 1 day, and reset the monitor that created the alert.

NOTE: Before running this script I would suggest getting a count of what your going to be resetting , so you've got an idea how long this script might take to run.

Only registered users may download. Registration is free.

Comments (1) - Comment RSS
Craig Pero wrote: on Aug 12, 2010 01:27 PM
I have not had the chance to work with the script yet but in looking over it, I was wondering if it would be feasible to make this script use a dictionary (hash table I think in PS). We have a large number of alerts (still tuning).

the script is a GREAT tool based on what it does. (Honestly, I'm looking to write a connector which processes closed alerts and checks the associated monitor. if the monitor does not show healthy, reset it. Of course that would be using the connector framework which is outside the scope of PS.)

When a monitor toggles (and we have some that do a lot of that here) the ProblemID is the same each time. So if you created a dictionary you could add a row for the problem ID and include the AlertID,and the date of the alert's last modification. If the date of the next alert for the same problem is newer, remove the old and add the new. Of course you would want to include the open alerts as well.

Once the dictionary is populated, you would only process the most current alerts. If the alert is open, you would skip processing it (why reset a monitor based on an older closed alert if a new open one exists). [worthy of note... if you have an alert open for a healthy monitor... it probably should be closed anyway unless the monitor is not set to autoclose.]

I think this would improve performance because if you have a toggling alert, you could potentially reset a monitor multiple times when you only need to reset it once.

I am looking forward to playing with your script in the lab. thanks for posting it. Nice work!!

I'd offer a code snippet but I'm fluent in visual basic, not PS. I do need to become more fluent in PS.

Add your Comment
Latest Media - View All Media (1)
   


Who Viewed
Who Reviewed
Categories
Related Pages
Shortened URL
http://tinyurl.com/3yg8etj

Top Contributors
Featured Members
Pete Zerger
Points: 72684
Level: System Center Expert
Tommy Gunn
Points: 47503
Level: System Center Expert
Simon Skinner
Points: 40804
Level: System Center Expert
Andreas Zuckerhut
Points: 30700
Level: System Center Expert
Stefan Koell
Points: 30179
Level: System Center Expert