Home » System Center Operations Manager 2007 » Notification and reporting for maintenance mode

Contoso.se

Welcome to contoso.se! My name is Anders Bengtsson and this is my blog about Azure infrastructure and system management. I am a senior engineer in the FastTrack for Azure team, part of Azure Engineering, at Microsoft.  Contoso.se has two main purposes, first as a platform to share information with the community and the second as a notebook for myself.

Everything you read here is my own personal opinion and any code is provided "AS-IS" with no warranties.

Anders Bengtsson

MVP
MVP awarded 2007,2008,2009,2010

My Books
Service Manager Unleashed
Service Manager Unleashed
Orchestrator Unleashed
Orchestrator 2012 Unleashed
OMS
Inside the Microsoft Operations Management Suite

Notification and reporting for maintenance mode

When a monitored object, such as a computer or distributed application, goes offline for maintenance, Operations Manager 2007 detects that no agent heartbeat is being received and, as a result, might generate numerous alerts and notifications. To prevent alerts and notifications, place the monitored object into maintenance mode. In maintenance mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts are suppressed at the agent.
More info about maintenance mode here (source).

Boris Yanushpolsk wrote a power shell script to use to see what is actually in maintenance mode. You run the script in Operations Manager command shell. If you want to publish this information to a web page, for example to share it between colleagues, you can use this modified version of the script. You could also schedule the script to make sure you have an updated web page all the time.

mm01

 

mm02

If you want to get notified when a new maintenance window starts you could use the following script to get a notification. This script will send you an e-mail with information regarding new maintenance windows. It will also log the information to a logfile that you later can use to generate reports for maintenance windows within your environment. Read this post about generating reports based on logfiles. Download the script here. Remember to rename the file to .ps1 and run it from Operations Manager command shell. The following picture shows a notification e-mail from the script.

mm03

With default settings the script will look for maintenance windows created in “now-72 hours”. You can change this with the $seconds, $hours and $hours variable. For example if you schedule the script to run every two minute you want to change it to $minutes=2. If you want the script to generate a logfile you will need to change $log to $true. If you want to get notified with e-mail you need to specify $e-mail=$true and then smtphost, from, to and subject.

Big thanks to Marco Shaw (power shell MVP), read his blog here.


1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.