Showing posts with label Maintenance Mode. Show all posts
Showing posts with label Maintenance Mode. Show all posts

Thursday, June 26, 2014

[SCOM 2012] Maintenance Mode Scheduler V3 from Tim McFadden ( #MaintenanceMode #SCOM2012 )

Tim McFadden has released the SCOM 2012 Maintenance Mode Scheduler Version 3 on his blog post here.

http://www.scom2k7.com/scom-2012-maintenance-mode-scheduler-v3/


Here are the new features in V3 that will help address this problem:

  • Schedule Subscriptions for maintenance mode.  Most organizations only use the alerts from SCOM.  Now you can schedule your complex subscriptions into maintenance mode.  You can choose to send the alerts that were queued up or discard them.
  • International Date format of DD/MM/YYYY now supported
  • New Integrated Dashboard with the help of Tao Yang
  • Removed resource pools from the list of groups
  • Changed default start time to only 2 minutes ahead instead of 5
  • Check to verify start time hasn’t already passed
  • Minor bug fixes
    Download a free trial version on the post.
 

This posting is provided "AS IS" with no warranties.

Tuesday, November 27, 2012

[OpsMgr 2007 R2][OpsMgr 2012] Group Maintenance Mode PowerShell Script Updated by Tao Yang

Tao Yang have updated the script provided by Steve Rachui ( Place a Group in Maintenance Mode with PowerShell ) to use SDK rather than SCOM 2007 PS Snap-in so the script works on both SCOM 2007 and OM12.
He's also made few other changes including change the duration from number of hours to number of minutes to suit his needs.


You can read his full article on Tao's blog and download his modified script here.

This posting is provided "AS IS" with no warranties.

Monday, October 29, 2012

[OpsMgr 2012][Orchestartor 2012][SCSM 2012] System Center 2012–Extended OIP–Maintenance Mode POWER!! – Self Service portal

This week-end Oskar Landman has commented my post on LinkedIn and give me a link to one of his articles. The post explains the use of the Self Service Portal to set OpsMgr objects in maintenance mode.


He is giving a simple example with screenshots and shows how you can use the System Center 2012 Extended OIP in combination with SCSM and OpsMgr.

Very interesting way to proceed ! :)

Where to find System Center 2012 Extended OIP ? : Just follow this link !


This posting is provided "AS IS" with no warranties.

Friday, October 26, 2012

[OpsMgr 2012][Orchestartor 2012] SCOM 2012 – Maintenance Mode and Orchestrator

An interesting article related to maintenance mode in System Center Operations Managers 2012 using Orchestrator.


Brut force methode used in Operations Manager 2007 (see script below) has been tested in Operations Managers 2012 and since the cmdlet has changed, only the get-date is well working...

$class = get-monitoringclass -name:Microsoft.Windows.Computer
$computer = get-monitoringobject -monitoringclass:$class -criteria:”PrincipalName=’scottmusjm1.tpb.lab’”
$start = get-date
$end = $start.addminutes(30)
new-maintenanceWindow -startTime:$start -endTime:$end -monitoringobject:$computer -comment:”Testing”

New script for Operations manager 2012 should look like (note the use of | where for the get-scomclassinstance) :

$class = get-scomclass -name:’Microsoft.Windows.Computer’
$computer = get-scomclassinstance -class $class | where{$_.name -eq ‘SCOTTMUSJM2.tpb.lab’}
$start = get-date
$end = $start.addminutes(30)
start-scommaintenancemode -Instance:$computer -EndTime:$end -Comment:”Testing”
Result looks good when you execute the line in powershell but no so much : not only does the script not set MM on the health service and the health service watcher, it doesn’t put the objects contained by Windows Computer into MM.

The rest of the article explains how to use Orchestrator to put in maintenance mode and show that all objects have been removed from MM including the health service and the health service watcher.


This posting is provided "AS IS" with no warranties.

Thursday, August 9, 2012

[OpsMgr 2012] Put OM2012 Computer Group Members in Maintenance Mode with PowerShell

 has publish a powershell script to put computers from a group in maintenance mode.
read more on http://blogs.technet.com/b/stefan_stranger/archive/2012/07/06/put-om2012-computer-group-members-in-maintenance-mode-with-powershell.aspx

Very interesting !

This posting is provided "AS IS" with no warranties.

[OpsMgr 2007R2][OpsMgr 2012] Usefull reports

The reports provided with System Center Operations Manager (SCOM) may sometimes seem particularly poor in terms of daily operations on the product. Today, Jean-Sébastien DUCHÊNE offers some report that are very usefull when you are working on overrides when you upgrade Management Packs, on groups and agents

Do not forget to create a datasource targeting to the operational database with security rights necessary to generate the report. This reports works with System Center Operations Manager 2007 R2, System Center 2012 Operations Manager and SQL Server 2008 RTM/R2.

Overrides stored in a non - sealed MP
Overrides stored in non sealed MPs for a dedicated MP
Overrides by type for a dedicated MP
Overrides stored in all non - sealed MPs
Overrides changes by date
Monitor, rule and discovery chages by date
Add, update and remove MPs by date
Agents state
Non accessible agents
Groups stored by MP
Groups for an agent
List alerts by computer for a Group
Summary and detailled alert report for an agent
Detailled performance (RAW) for an agent
Discovered entities for an agent
Maintenance mode history for an agent


Thanks to Jean-Sébastien - this helped me a lot in my all day work !

This posting is provided "AS IS" with no warranties.

Thursday, May 24, 2012

[OpsMgr 2007R2][OpsMgr 2012] Understanding Operations Manager Maintenance Mode

Article ID: 2704170 - Last Review: May 21, 2012 - Revision: 2.0

What is Maintenance Mode?
Maintenance mode is a feature in Operations Manager to suspend monitoring of an object during regular software or hardware maintenance activities like Software Update installations, Hardware replacements, etc.

What happens when an object is put into Maintenance Mode

When an object is placed into Maintenance Mode, all workflows targeted against that object are suspended during that specific interval. This prevents Alerts and Notifications from being generated by the workflows targeted against the object in Maintenance Mode and helps reduce alerting noise during a planned maintenance activity on the server. In Maintenance Mode, alerts, notifications, rules, monitors, automatic responses, state changes and new alerts are suppressed at the agent.

The following event is logged on the Operations Manager event log during starting and ending of Maintenance Mode for a monitored object:

=============================================

Log Name:      Operations Manager
Source:        HealthService
Date:         
vent ID:      1216
Task Category: Health Service
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      Server.Domain.COM
Description:
Resuming monitoring for instance "Database" with id:"{GUID}" as the instance maintenance mode is OFF. Management group "MG".

=============================================


IMPORTANT NOTE:
It is not recommend that you put management servers into Maintenance Mode. Configuration distribution, the heartbeat feature, and other features for the system might become unreliable. If you place a management server into Maintenance Mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts generated on the management server will be suppressed. The health service on the management server continues to run. Alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts from other agent-managed computers will be processed and displayed as appropriate.

How to put an object into Maintenance Mode

In Operations Manager, Monitoring is based on specific classes. A specific monitored object on an agent can be put into Maintenance Mode instead of putting the entire Computer into Maintenance Mode.

In the example below, the SQL Database Engine running on Server A will be updated to the current version. This software update maintenance is expected to take 30 minutes to complete. During this time, the default instance of the SQL Database engine running on this server will not be available.

In this case, we can put the SQL Database engine and its entire contained object into Maintenance Mode instead of putting the entire server into Maintenance Mode. This helps in monitoring the Operating System and other applications running on the server while SQL maintenance is performed.

The default instance of SQL running on Server A can be put into Maintenance mode as follows (Note that this article assumes that we have a working Operations Manager management group with the SQL management pack already installed and working):

1. Open the Operations Manager console. Under the Monitoring Pane, expand the folder named “Microsoft SQL Server”, then expand “Server Roles” and select the “Database Engines” State view.

2. This will list all monitored instances of SQL Database engine in this management group.

3. Select and right-click the default instance (MSSQLSERVER) whose Path value is Server A. In the Displayed menu, select ”Maintenance Mode”.

Choosing “Selected objects only” Puts only the Database engine into Maintenance Mode.

Choosing “Selected Objects and all their contained objects” puts the Database Engine and all the databases hosted by this instance of SQL database engine into Maintenance Mode.

An easier way to find the contained objects is to open the Diagram view for the specific object and drill down in the view.

You can select the Time interval for the Maintenance Mode using on the options under the “Duration” as required.

How to Schedule Maintenance Mode

Operations Manager does not allow scheduling Maintenance Mode for monitored objects from the console. However, Maintenance Mode can be scheduled for a future time with the help of the Maintenance Mode schedule tool that is part of the Operations Manager R2 Admin resource kit. Please see the link below for more information:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26139 (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=26139)

NOTE This tool does not work with System Center 2012 Operations Manager

The blog below from the Operations Manager community also has a tool for scheduling Maintenance Mode for monitored objects:

http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-2-0-r2-scripts/ (http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-2-0-r2-scripts/)

Additionally, you can use Orchestrator to put objects into Maintenance Mode on a schedule, and there are also third party tools/scripts available.

How to automate starting and Ending Maintenance Mode using SCOM SDK

The link below provides information on how to automate starting and ending Maintenance Mode of specific objects using Operations Manager 2007 R2 SDK:

http://msdn.microsoft.com/en-us/library/bb437532.aspx (http://msdn.microsoft.com/en-us/library/bb437532.aspx)

How to view the objects that are in MM

To view all objects of a specific class that are in Maintenance Mode using the Operations console, follow the steps below.

1. Open Operations console. Under the Monitoring pane create a state view named “Maintenance Mode” under the specific unsealed Management Pack folder or under the “Monitoring” folder at the root of the view tree. Creating the View under the “Monitoring” folder at the root of the view tree saves the view in the Default Management Pack.

2.Under the Name option, Type in “Maintenance Mode”

Change the Value under “Show data related to” from Entity to the Class of objects that you want to view.

Select “is in Maintenance Mode” check box under the “Select conditions”

Click Ok to create the view.

This view will display all objects of that specific class that are in Maintenance Mode currently.

Maintenance Mode Cmdlets

The following command lets are available for Managing Maintenance mode using the Operations Manager command shell in Operations Manager 2007 R2:

New-MaintenanceWindow – This cmdlet puts the Specified monitoring object into Maintenance Mode. More information about this cmdlet is here:

http://technet.microsoft.com/en-us/library/gg132214.aspx (http://technet.microsoft.com/en-us/library/gg132214.aspx)

Set-MaintenanceWindow – This cmdlet sets properties of a maintenance windows. It can be used to update end time, reason and comments on the current Maintenance Mode for the monitoring object specified by the Monitoringobject parameter.

More information about this cmdlet is here :

http://technet.microsoft.com/en-us/library/gg132242.aspx (http://technet.microsoft.com/en-us/library/gg132242.aspx)

Get-MaintenanceWindow – This cmdlet gets maintenance window information for a monitoring object that is currently in Maintenance Mode. The cmdlet can retrieve maintenance windows for top-level items, items at the current location or for specified monitoring objects.

More information about this cmdlet is here :

http://technet.microsoft.com/en-us/library/gg132195.aspx (http://technet.microsoft.com/en-us/library/gg132195.aspx)

How maintenance mode helps reporting

Starting and ending the Maintenance Mode for a specific object for a planned maintenance helps the Operations Manager administrator report accurately on the planned and unplanned downtime of an application or a service. This helps report the availability of a specific service or an application or a server accurately during a specific period of time.

Maintenance Mode Known issues:

1. A computer agent unexpectedly generates heartbeat alerts after you put it into Maintenance Mode in System Center Operations Manager 2007

This issue has been explained in the below KB article:

http://support.microsoft.com/kb/942866 (http://support.microsoft.com/kb/942866)

2. Configuration Manager and Operations Manager agent Maintenance Mode

System Center Configuration Manager 2007 supports Maintenance Mode for Operations Manager with its Software Distribution and Software Updates features. By placing the Agent into Maintenance Mode, alerts can be suppressed on computers running the Configuration Manager client.

This option works well if running MOM 2005 but does not operate as you may think with Operations Manager 2007 and later. When you set this option and Configuration Manager attempts ‘Maintenance Mode’ on an Operations Manager agent, the result is that the health service is paused. While the health service is paused you may get heartbeat failure errors, and when the health service is resumed all queued up actions will process at that time resulting in potential alerts. For this reason and others, we do not recommend using the Configuration Manager option for Operations Manager agents.

3. Alerts are generated by an agent while in Maintenance Mode

This issue could be caused due to the following reason:

- The object that was put into Maintenance Mode is not generating the actual alert. To verify this, right-click “Active Alerts” view on the Operations Manager console and select “Personalize view” from the menu. Select the check box next to “Class” under the “Columns to display” option.

You will see a new column “Class” under the Active Alerts view. Make sure the instance of this class for that agent is in Maintenance Mode.

- The alert was generated before monitoring was suspended on the agent. This can be verified by checking if the Event ID 1215 confirming the monitoring of the specific instance is suspended.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use (http://go.microsoft.com/fwlink/?LinkId=151500) for other considerations.

This posting is provided "AS IS" with no warranties.

Tuesday, April 24, 2012

[Powershell][OpsMgr 2007] Get All objects in Maintenance Mode using powershell

The need here is to be able to list all objects in Maintenance mode in a management group.

Here is also a very short powershell function you can use :

  1. function ListObjectsInMaintMode {
  2.  $criteria = new-object Microsoft.EnterpriseManagement.Monitoring.MonitoringObjectGenericCriteria("InMaintenanceMode=1")
  3.  $objectsInMM = (Get-ManagementGroupConnection).ManagementGroup.GetPartialMonitoringObjects($criteria)
  4.  $objectsInMM | select-object DisplayName, @{name="ObjectType";expression={foreach-object {$_.GetLeastDerivedNonAbstractMonitoringClass().DisplayName}}},@{name="StartTime";expression={foreach-object {$_.GetMaintenanceWindow().StartTime.ToLocalTime()}}},@{name="EndTime";expression={foreach-object {$_.GetMaintenanceWindow().ScheduledEndTime.ToLocalTime()}}},@{name="Path";expression={foreach-object {$_.Path}}},@{name="User";expression={foreach-object {$_.GetMaintenanceWindow().User}}},@{name="Reason";expression={foreach-object {$_.GetMaintenanceWindow().Reason}}},@{name="Comment";expression={foreach-object {$_.GetMaintenanceWindow().Comment}}}
  5. }
In a powershell shell, connect to a management group and just launch ListObjectsInMaintMode

Result be look like :



This can be really usefull ! :)

This posting is provided "AS IS" with no warranties.