In SCOM usually we have a lot of requirements to create a windows computer groups of various application or custom applications like SQL, Clusters, SharePoint servers to perform actions like Maintenance Mode, Notification or Dashboards for state or performance view or might create a custom monitoring configuration like enabling Service or Process to servers that belong to this application.
Now achieving this feat from console is not easy or might I say is not possible, but can be done with a very little XML magic.
Let's look at one such scenario.
- Create a group of Windows computers objects that host Windows Server 2016 and 1709+ Monitoring Cluster Service.
- To achieve this create a New normal windows computer group give it a dynamic condition like below and save it in a New Management Pack, it doesn't matter what condition you give as it will be replaced later.
- Now export this management pack and open it in a text editor.
- The next step would be to find the Group discovery rule for the one that we just created and make some changes to it. This is how the Group discovery rule would look like.
- If we take a look at the rule it states that Principal name = Test, how about if we change this to Windows Computer class contained in Cluster Application, might sound wired let's try it.
- Remove the entire code in the Simple Expression.
- And the following lines of code.
- This is just essentially telling it to create a group of windows computer which Contains Cluster Class, the word Contains is very important here. There meaning an usage is something I will be sharing in next blog.
- Now before saving this MP , you need to ensure that proper referencing is made to the cluster class as it is a part of a Sealed Management Pack, if you are using any other class which is not a part of a Sealed management pack this MP shall be created in the same management pack as of the referred class.
- To do to referencing go to the Manifest section of the Management Pack and add the required alias as below.
- If you have trouble finding the Alias of a sealed MP, locate the MP's Management Pack for example here are using the class Windows Server 2016 and 1709+ Monitoring Cluster Service, Locate the MP that contains this Class export it using the SCOM Powershell commandlets.
- Go to the path where the Management Pack is exported open it and copy the alias from there to your New Management Pack.
- Now the change the version of your New Management Pack, say from 1.0.0.0 to 1.0.0.1 and save it.
- Now Import this MP from the MP Wizard.
- Go to authoring locate the New Group that we created and voila you would see computer objects populating the group in some time.
Now you can use this same method to create groups of not just windows computer but also other object like Health Service watcher or any other object.
In my next post we will be creating a group of Health Service Watcher objects that would be based on a Custom Windows Computer Group.
No comments:
Post a Comment