SCOM: How to get Health state of a monitor with PowerShell.

Recently I got a request to generate a Critical Alert only when the state of a specific monitor on all servers in a Group was different than healthy. It’s possible to create PowerShell based monitors in SCOM (more on that topic later on..)

Anyway, here is my piece of code to get the monitor state:

Import-Module OperationsManager
#Specify SCOM Group
$Group = Get-SCOMGroup -DisplayName "TEST GROUP"
$Members = $Group.GetRelatedMonitoringObjects()
foreach ($member in $Members)
{
#get the server object.
$alertobject = Get-SCOMMonitoringobject -Name $member
#get the monitor, in this example DisplayName is used as parameter.
$alertmonitor = Get-SCOMMonitor -DisplayName "Run As Account Verification"
 #If the server is not healthy, available and the monitor is enabled then..
 If (($alertobject) -and ($alertobject.HealthState -ne "Success" -and $alertobject.IsAvailable -eq "True") -and ($alertmonitor.enabled -eq "True")) {
 #HealthState from OperationalStateCollection and only return the first line.   
 $alertmonitor.OperationalStateCollection | select HealthState -First 1
 }
}

System Center 2012 Operations Manager Technical Documentation

Looking for technical documentation for System Center Operations Manager? It’s published by Microsoft here: http://www.microsoft.com/en-us/download/details.aspx?id=29256

OM12R2_Upgrade.docx 86 KB
OM12R2_Upgrade.pdf 427 KB
SC2012_OpsMgr_Authoring.docx 4.3 MB
SC2012_OpsMgr_Authoring.pdf 6.1 MB
SC2012_OpsMgr_CompleteDocumentation.docx 9.9 MB
SC2012_OpsMgr_CompleteDocumentation.pdf 17.8 MB
SC2012_OpsMgr_Deployment.docx 553 KB
SC2012_OpsMgr_Deployment.pdf 2.1 MB
SC2012_OpsMgr_GetStarted.docx 59 KB
SC2012_OpsMgr_GetStarted.pdf 248 KB
SC2012_OpsMgr_KeyConcepts.docx 182 KB
SC2012_OpsMgr_KeyConcepts.pdf 360 KB
SC2012_OpsMgr_Operations.docx 5.1 MB
SC2012_OpsMgr_Operations.pdf 8.8 MB
SC2012_OpsMgr_SuppConfig.docx 109 KB
SC2012_OpsMgr_SuppConfig.pdf 667 KB
SC2012_OpsMgr_WhatsNew.docx 170 KB
SC2012_OpsMgr_WhatsNew.pdf 405 KB

 

 

System Center 2012 R2: Update Rollup 1

Update Rollup 1 for System Center 2012 R2 is available. Following components are fixed in this update:

  • App Controller
  • Orchestrator
  • Data Protection Manager
  • Operations Manager
  • Service Manager
  • Service Provider Foundation
  • Virtual Machine Manager

Get it here: http://support.microsoft.com/kb/2904734

SCOM: “Mass create” management packs with powershell

Need create multiple (mass create) management packs for System Center Operations Manager 2012 r2? PowerShell is your friend. Run this script in the Operations Manager Shell (no warranties given).

The archive consists of two files:

masscreateMP

  • CreateMP.PS1.txt – Actual script, rename to .PS1 and run in the Operations Manager Shell or edit the script to load the Operations Manager Powershell Module.
  • CreateMps.txt – List of management packs to be created.

See the code below, or download the script here

#usage .\CreateMP_.PS1
function CreateMP ($ManagementPackName)
{

function MPIDEncode ($MPID)
{
$s = $MPID
$s = $s.Replace(” “, “.”)
$s = $s.Replace(“-“, “.”)
$s = $s.Replace(“&”, “”)
$s = $s.Replace(“..”, “.”)
$s = $s.Replace(“…”, “.”)

return ,$s
}

$sManagementPackID = MPIDEncode -MPID $ManagementPackName
$MS = Get-SCOMManagementServer
$ManagementServer = $ms.DisplayName
$MG = New-Object Microsoft.EnterpriseManagement.ManagementGroup($ManagementServer)
$MPStore = New-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackFileStore
$MP = New-Object Microsoft.EnterpriseManagement.Configuration.ManagementPack($sManagementPackID, $ManagementPackName, (New-Object Version(1, 0, 0)), $MPStore)
Write-Host “Creating ManagementPack” + $ManagementPackName
$MG.ImportManagementPack($MP)
$MP = $MG.GetManagementPacks($sManagementPackID)[0]
$MP.DisplayName = $ManagementPackName
$MP.Description = “MP Created from Script”
$MP.Version = “1.0.0.0”
$MP.AcceptChanges()
write-host “Successfully created Management Pack”
}

ForEach ($mpname in Get-Content “CreateMPs.txt”)
{
CreateMP -ManagementPackName $mpname
}


					

SCOM 2012: Remove obsolete objects from the database!

When you override and disable a discovery for a class in SCOM you may notice that objects may persist in the database. For example if you exclude a SQL database after initial SQL DB discovery it will probably still appear in the console.

To clean up the objects you can run the Remove-SCOMDisabledClassInstance Powershell cmdlet. Then all the relationships that involve objects related to a disabled discovery is deleted.

Depending on your environment, this process can take some time and put load on your SQL server.

http://technet.microsoft.com/en-us/library/hh920257.aspx

Update Rollup 3 for System Center 2012 Configuration Manager Service Pack 1 is Available!

Update for Configuration Manager 2012 Sp1 is available.

This update adds support for Windows 8.1-based client computers in Microsoft System Center 2012 Configuration Manager Service Pack 1. Windows 8.1 is added to the supported platform list.

Download: http://support.microsoft.com/kb/2882125/en-us

If you are looking for Update Rollup 3 for System Center 2012 Service Pack 1 see the link below. A lot if issues is fixed in this update.

Create Service Manager Incidents from Operations Manager on demand!

Brody Kilpatrick has written a great blogpost on how to create SCSM Incidents on demand from SCOM. As you may know there is a connector in Service Manager that will automatically create incidents from scom alerts. The challenge is that there is a 1-1 ratio, you can create filters but still in my expirience most customers want more control and a “human” link in between.

Credit to Brody for this one 🙂

http://operationsmanager2012.blogspot.no/2013/05/create-and-assign-service-manager.html

 

SCOM 2012: How to create a dynamic group based on a WMI query.

As you may have experienced the only way to create object discoveries in System Center Operations Manager is trough Visual Studio. But still, sometimes you may need a quick way to gather all computers with a specific application installed, configuration, process running or anything else. Then you need to look at “Attributes” within the Authoring > Management Pack Objects tab. In this example I needed to create a group gathering all servers running the System Center Configuration Manager agent.

1. Navigate to: Authoring > Management Pack Objects > Attributes

SCOM Dynamic Group 1

2. Right Click “Attributes” and select “Create New Attribute”.

SCOM Dynamic Group 2

3. Select:

  • “Discovery Type: WMI Query”
  • “Target: Windows Server (it will add _extended for you)”
  • Management Pack: Select and existing one or create a new.

SCOM Dynamic Group 3

4. Enter values below, then click “Finish”:

  • WMI Namespace: root\cimv2
  • Query: Select * from win32_process where name = “CcmExec.exe”
  • Property Name: Handle (Select any property related to the wmi class).
  • Query Interval: 300

SCOM Dynamic Group 4

5. Next we need to create a group. Navigate to: Authoring > Groups > (Right Click) “Create a new group”.

SCOM Dynamic Group 5

6. On the Dynamic Members page in the wizard, click “Create/Edit rules…”

Locate the Windows Server _Extended class, select the “Configuration Manager Agent Running” attribute.

SCOM Dynamic Group 7

7. Set Operator to: “Greater than or equal to” and Value to “1”

SCOM Dynamic Group 6

8. Click “OK”, then “Next”, “Next”, “Create”.

9. Your dynamic group is now created.

SCOM Dynamic Group 8

System Center 2012 R2, Upgrade Path

Soon, Microsoft will release System Center 2012 R2. I get a lot of questions regarding upgrade paths.

The upgrade path to any System Center 2012 R2 component (SCCM,SCOM,SCSM,SCORCH, SCVMM etc.) is:

System Center 2012 RTM > System Center 2012 SP1 > System Center 2012 R2.

SCOM 2012: Windows Azure Management Pack

The Windows Azure Monitoring Pack enables you to monitor the availability and performance of applications that are running on Windows Azure.

  • Discovers Windows Azure applications.
  • Provides status of each role instance.
  • Collects and monitors performance information.
  • Collects and monitors Windows events.
  • Collects and monitors the .NET Framework trace messages from each role instance.
  • Grooms performance, event, and the .NET Framework trace data from Windows Azure storage account.
  • Changes the number of role instances via a task.

http://www.microsoft.com/en-us/download/details.aspx?id=11324 (old one)

http://www.microsoft.com/en-us/download/details.aspx?id=38414 (Preview with New features for SCOM 2012 SP1 or later)

Vote for an affordable alternative to MSDN subscriptions comparable to TechNet!

As you may know Microsoft is retiring the Technet Subscription. IT pro’s need access to Microsoft products other than trials, to be able to maintain the neccesary knowledge and provide the best service possible to Microsoft’s customers. The only comparable subscription (MSDN) costs $6120

Technet_MSDN

Sign the petition here

 

Follow TechEd Europe Madrid Live!

If you are not one of the lucky ones attending TechEd…. Don’t worry, you can still follow the sessions online! Navigate to: http://channel9.msdn.com/Events/TechEd/Europe/2013#fbid=wipqIKVlFpz

SCOM 2012: How to fix broken SP1 upgrade.

First of all, before upgrading your System Center Operations Manager environment please read the documentation. It’s really critical to do things in the right order. Start here: http://technet.microsoft.com/en-us/library/jj899854.aspx

I recently came across a broken System Center 2012 Operations Manager installation. What had happened was that the SP1 upgrade had been started on two management servers at the same time. The service pack installation makes changes to the Operations Manager database, as all of the management server share the same database these changes only need to be made when installing the Service Pack on the first server. The installation tries to determine if it need to run the SQL update or not. In this case the SQL update had not completed.

The management server was healthy, but I found the network discovery rules not able to run. In the Operations Manager EventLog I found, EventID: 33333Warning001

Data Access Layer rejected retry on SqlError:
Class: 16
Number: 8144
Message: Procedure or function p_JobStatusScheduled has too many arguments specified.

 

Nedless to say, this is really bad. Next I looked at the procedures stored in the OperationsManager database, I found parameters missing from the SP1 procedures found within the installation SQL scripts.

Broken(OLD) p_jobStatusScheduled:

Procedure001

SP1(Correct) p_jobStatusScheduled:

Procedure002

So to complete the OperationsManager database upgrade I did the following.

  • Stopped the System Center Operations Manager Services.

SCOMServices001

  • Executed SQL Command:
USE OperationsManager 
IF EXISTS (SELECT * FROM sysindexes where [name] = 'idx_StateDatabaseTimeModified' AND id = object_id(N'[dbo].[State]')) 
DROP INDEX [idx_StateDatabaseTimeModified] ON [dbo].[State]
  • Ran the build_mom_db.sql script against the OperationsManager database, this is located in the Setup\AMD64 folder within the System Center 2012 SP1 installation media.

 

SCOM 2012: Identify rule or monitor from workflow name with powershell.

Sometimes identifying a rule or a monitor related to a alert can be challenging. PowerShell can be a great tool. I’m sharing the syntax for future reference.

Example:

  • For a rule

Get-SCOMRule | where {$_.Name -eq “Microsoft.SystemCenter.DiscoveryWriteActionModule.AgentProxyingNotEnabled.Alert”}

  • For a monitor

Get-SCOMmonitor | where {$_.Name -eq “Microsoft.SystemCenter.DiscoveryWriteActionModule.AgentProxyingNotEnabled.Alert”}

  • For a NotificationSubscription

Get-NotificationSubscription | ? {$_.name -eq “Subscription911173b6_cd1f_3aff_9a6c_d536e2a3f152”}

 

SCOM: AD MP Configure or disable replication monitoring.

Jimmy Harper wrote a blog post in 2009 about how to configure or disable Replication Monitoring in the AD management pack.

“if you need to set overrides to configure or disable Replication Monitoring, they must be set on all of the following Rules:

AD Replication is occurring slowly (there are three rules with this name)     One or more domain controllers may not be replicating (there are three rules with this name)     DC has failed to synchronize naming context with its replication partner (there are three rules with this name)     All of the replication partners failed to replicate.      AD Replication Performance Collection – Metric Replication Latency      AD Replication Performance Collection – Metric Replication Latency:Minimum      AD Replication Performance Collection – Metric Replication Latency:Maximum      AD Replication Performance Collection – Metric Replication Latency:Average

Read the blogpost here: http://blogs.technet.com/b/jimmyharper/archive/2009/05/20/configuring-or-disabling-replication-monitoring-in-the-active-directory-management-pack.aspx

 

SCOM: Reports are not populated in the System Center 2012 Operations Manager Reporting Pane

To confirm this issue in the Operations Console, go to the Monitoring View and click on discovered inventory. Then change the Target type to Data Warehouse Synchronization server by completing the following:

1. Click Change Target Type on the right-hand task pane of the Operations Console
2. In the dialog that opens select View all targets
3. Locate and select Data Warehouse Synchronization Server in the list
4. Click OK

http://support.microsoft.com/kb/2771934?wa=wsignin1.0

 

SCOM: Get started the right way (overrides, groups, roles and subscriptions)

  • Always create an “overrides management pack” when you import a sealed MP from a vendor. Decide on a naming convention and follow it. I like to name it mp.name(overrides) or mp.name overrides to match the default names in SCOM for monitoring and discovery. 

SCOM_BP_1

  • Create Universal AD Groups for security delegation. Universal groups can be mail enabled, meaning that you can use them for subscriptions also. In this way you can easily manage access to roles in SCOM and with the same mechanisms manage notifications. All by populating users in AD Groups.

SCOM_BP_2

Got this tip from “Alex De Jong”, attending one of his classes, credit goes to him (AlexdeJong.com)

  • Create user roles for each management pack or service in your datacenter. Connect these roles to your ad groups created in the previous step. When you create the role, make sure you limit “Dashboards and Views” to what’s only related to the role.

SCOM_BP_3

SCOM_BP_4

SCOM_BP_5

Create subscriptions related to your roles. Then add your mail enabled groups as subscribers.

       SCOM_BP_6

For conditions, select all related classes for your role in the subscription. And select “High”   priority, Default nothing in SCOM is high priority, so by doing this you can choose what is critical to you by creating priority overrides.

 SCOM_BP_7

  • Create a group for each management pack, then disable the management pack for all computers but those who are members of your group. By doing this you can easily manage which computers you want to monitor “in dept”.

SCOM_BP_8

Go to the Authoring Pane > Management Pack Objects > Discoveries. Set your scope to your related management pack. Look for a discovery that targets a default class. Usually the Windows Server class is used. This is the initial discovery, to identify computers running a product, in this example Hyper-V, this discovery will trigger later discoveries so SCOM can learn more about the servers.

         SCOM_BP_9

Override and disable the initial discovery for all objects off the class.

SCOM_BP_10

Then create a new override targeting your group, and select the “Enforced option” to make this override a priority.

SCOM_BP_11

By doing this you will make sure that you only have in dept monitoring of the servers you populate in your groups. Then you can delegate the task of maintaining these groups to each operator.

System Center 2012: The order in witch you upgrade System Center 2012 components is very important.

“In an environment that includes two or more components of Microsoft System Center 2012, the order in which you upgrade those components to System Center 2012 Service Pack 1 (SP1) is very important.”

Personally I recommend using this order also for cumulative updates and update rollups.

Upgrade Path

Read more here: http://technet.microsoft.com/en-us/library/jj628203.aspx

System Center Online Community Resources

Looking for Microsoft Team Blogs, System Center MVPs, Twitter handles, System Center User Groups or Online communities? Chances are you will find it here:

http://social.technet.microsoft.com/wiki/contents/articles/11504.how-to-participate-in-the-system-center-community.aspx

 

SCOM 2012: Think about this before implementing a new monitoring solution.

  1. Own the solution! A monitoring solution represents the current state of your infrastructure. As an infrastructure owner you have to involve yourself in configuration of thresholds, monitor overrides etc. Consultants are great for best practices, presenting various options or as “doers” to save you time. But never let a consultant make decisions for you.
  2. Have a clear vision of what you need to monitor and what not to monitor. Do not let the products capabilities seduce you to do everything at once. Set a goal and identify steps to reach that goal. Make sure each step towards this goal is completed 100%.
  3. It will help you to be more proactive if you are willing to use the product in a proactive way. Update the product when you do changes in your infrastructure, tell the product before implementing changes or downtime (maintenance mode.). To get the reward you have to be willing to change the way you work.

 

 

MMS 2013: View sessions online

If you are not one of the lucky ones attending MMS 2013 …. Don’t worry, you can still follow the sessions online!

“The Microsoft Management Summit (MMS) brings together the brightest IT professionals from around the world to increase their technical expertise through an intensive week of training led by experts in desktop, device management, datacenter, and cloud technologies.”

http://channel9.msdn.com/Events/MMS/2013

System Center 2012 SP1 Cumulative Update 1 relased

Contains a lot of bug-fixes for System Center 2012 SP1…

Read more: http://support.microsoft.com/kb/2785682

For Configuration Manager SP1: http://support.microsoft.com/kb/2817245/en (includes updated powershell features).

 

SCOM 2012: Technical Documentation for implementation.

Steve Moore and Byron Ricks has written a document (documentation) for SCOM 2012 planning and implementation. Great document to review before installing System Center 2012 Operations Manager in your lab, demo or production environment.

http://download.microsoft.com/download/3/3/F/33F52373-3A75-422C-969B-61E05EEC5E72/SC2012_OpsMgr_Deployment.pdf

for more technical System Center 2012 Operations Manager documentation, please visit: http://www.microsoft.com/en-us/download/details.aspx?id=29256

SCOM 2012: Technical Documentation

Looking for Technical documentation for System Center 2012 Operations Manager? Microsoft have published it all.

Get it here: http://www.microsoft.com/en-us/download/details.aspx?id=29256

 
  • Complete Technical Documentation for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Authoring Guide for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Deployment Guide for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Getting Started Guide for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Key Concepts for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Operations Guide for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • Supported Configurations for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • What’s New for System Center 2012 SP1 – Operations Manager, last updated January 15, 2013 (pdf & docx)
  • System Center 2012 – Operations Manager Cmdlet Reference, last updated April 1, 2012 (pdf & docx)

System Center Marketplace: Great starting point to extentions, apps and resources.

The Microsoft System Center Marketplace is specifically designed to help business customers find trusted Microsoft System Center experts, and applications and services that enhance and easily integrate with Microsoft System Center products.

http://systemcenter.pinpoint.microsoft.com/en-US/home

Microsoft, Infrastructure planning and design guides

Yes! They exist, If you are planning an implementation of a Microsoft System Center 2012 or other Microsoft Products or just seeking information on what is new, recommended planning steps or an overview of the product architecture. The Infrastructure Planning and Design (IPD) Guide Series provides you with quick an concrete information specified to each Product.

Great Tools whether you are a product specialist, receiving customer, a technical sales resource or project manager. Read up!

http://technet.microsoft.com/en-us/solutionaccelerators/ee395430

System Center 2012 Operations Manager: Service Pack 1 Beta

Service pack 1 beta for System Center 2012 Operations manager includes following new features:

  • Support for IIS 8
  • Monitoring of WCF, MVC and .NET NT services
  • Azure SDK support
  • Monitoring of SharePoint 2010 with APM (.NET application performance monitoring)
  • Integration with Team Foundation Server 2010 and Team Foundation Server 2012
  • Conversion of Application Performance Monitoring events to IntelliTrace format
  • Support for monitoring of CentOS, Debian, and Ubuntu Linux
  • Improved Heartbeat monitoring for Unix/Linux
  • ACS support for Dynamic Access Control in Windows Server 2012
  • Global Service Monitor – cloud based capability to monitor the health of your web applications from geo-distributed perspective
  • Additional network devices models supported
  • Visibility into virtual network switches in vicinity dashboard – thru integration with Virtual Machine Manager

Download the beta here: http://www.microsoft.com/en-us/download/details.aspx?id=34607

System Center 2012 Private Cloud

Microsoft has released a whitepaper where they compare private cloud solutions from Microsoft and VMware. If you are curious about private cloud technology and what Microsoft has to offer, i recommend reading this whitepaper.

Download it her: http://download.microsoft.com/download/F/3/6/F36D9AE8-6238-4EA3-9ABC-BF7BB848BF70/MicrosoftPrivateCloudWhitepaper.pdf

 

 

SCOM 2012: Operations Manager cannot connect to the Web service

Recently I got this error: “Operations Manager cannot connect to the Web service” when trying to connect to the management pack catalog in System Center 2012 Operations Manager.

First of all, Sysinternals Process monitor is a great tool to troubleshoot this. Filter out the SCOM console process and you will be able to see where it connects.

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

I did not find any good information on this, so I did some investigation and figured out where it tries to connect.

First it connects to ip: 65.55.58.195 over the http protocol next is 65.55.57.27 https. Put these ip adresses in your browser from the SCOM server and see if you are able to connect. If not, talk to your networking guys 🙂

Update: Seems like might also connect to other IP adresses. So far i’ve found these: 65.4.11.25 and 64.4.11.42.

SCOM 2007: Operations Manager 101

Kevin Holman have provided a PDF file that some of the Premier Field Engineers wrote to help customers getting started with SCOM. This is a great introduction to the product.

This is also also valid for the 2012 version, the basics are just about the same 🙂

Get it here: http://blogs.technet.com/b/kevinholman/archive/2010/09/02/operations-manager-101-download.aspx

SCOM 2012: Creating a network connectivity map and using color to represent state

Cameron Fuller have created a great guide on how to use color to represent state on a object in Visio with the System Center 2012 Operations Manager integration.

Read it here:

http://blogs.catapultsystems.com/cfuller/archive/2011/09/13/opsmgr-dashboard-integration-creating-a-network-connectivity-map-and-using-color-to-represent-state.aspx

 

SCOM 2012: Visio Add-in not loading

If you get this error: “Not loaded. A runtime error occurred during the loading of the COM Add-in.” after installing the Visio Add-in for System Center 2012 Operations Manager. Please check the requirements, you are probably missing the Visual Studio 2010 Tools for Office runtime.

Get it here: http://www.microsoft.com/en-us/download/details.aspx?id=20479

 

SCOM 2012: Visio 2010 Add-in and SharePoint 2010 Extensions for System Center 2012

Create and share custom diagrams showing current health state data for your IT environment with this Microsoft Visio 2010 add-in and Microsoft SharePoint 2010 extensions for Microsoft System Center 2012.

http://visio.microsoft.com/en-us/Samples_and_Downloads/Software_Add-ins/Pages/Visio-2010-Add-in-for-System-Center-2012.aspx