{"id":2398,"date":"2011-06-17T07:16:30","date_gmt":"2011-06-17T05:16:30","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2398"},"modified":"2011-06-17T12:20:21","modified_gmt":"2011-06-17T10:20:21","slug":"windows-computer-and-associated-health-service-watcher-in-a-dynamic-group","status":"publish","type":"post","link":"https:\/\/contoso.se\/blog\/?p=2398","title":{"rendered":"Windows Computer and associated Health Service watcher in a dynamic group"},"content":{"rendered":"<p>A common scenario is that\u00c2\u00a0you want\u00c2\u00a0to group computers in groups based on SLA, responsibility or server teams. Groups are used to\u00c2\u00a0for example filter views and boundary in notifications. When looking at the Windows computer object you see everything you are monitoring on that machine (that rolls-up health to the Windows computer object). But you don\u00e2\u20ac\u2122t get heartbeat missing alerts, as these are generated by the health service watcher for that machine. In the console you can build a group and dynamically include windows computer objects and health service objects. But an challenge is that for the health service objects there are not many attributes to filter on, and there is no feature in the console to do \u00e2\u20ac\u0153put these machines and associated health service watchers in this group\u00e2\u20ac\u009d. The Windows Computer class we can extend with new attributes and it also includes a lot of attributes out of the box, but we cant do the same with health service.\u00c2\u00a0Building a suitable dynamic formula for the Windows Computer class is often not a challenge, the issue is to get associated health service watcher in there.<\/p>\n<p>In this post I will group Windows computer objects and\u00c2\u00a0associated health service watcher together in a group, based on a registry string.\u00c2\u00a0The goal is to build one dynamic group for each SLA level. Each group should contain all machines that has that SLA level and also associated health service watchers. These groups can later be used of views and notification. I will start by extending the Windows Computer class with a new attribute. This attribute will be populated with a register string from each machine.<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA06.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2411\" title=\"20110616_SLA06\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA06-300x152.jpg\" alt=\"\" width=\"300\" height=\"152\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA06-300x152.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA06.jpg 541w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u00c2\u00a0To extend the Windows Class to discover a SLA string follow these steps<\/p>\n<ol>\n<li>In the Operations Manager Console navigate to Authoring, Management Pack Objects, Attributes<\/li>\n<li>Right-click Attributes and select Create a New Attribute&#8230;<\/li>\n<li>In the Create Attribute Wizard, General Properties, input a name, for example Contoso &#8211; SLA attribute<\/li>\n<li>In the Create Attribute Wizard, Discovery Method, select Registry as discovery type. Select Windows Computer as Target. Select suitable management pack or create a new management pack, for example Contoso &#8211; SLA<\/li>\n<li>In the Create Attribute Wizard, Registry Probe Configuration, input a path to the registry key and change attribute type to string.<br \/>\n<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2402\" title=\"20110616_SLA01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA01-300x159.jpg\" alt=\"\" width=\"300\" height=\"159\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA01-300x159.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA01.jpg 667w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In production you should not run the discovery to often, often per 12 hour or 24 hours is fine. In a sandbox you could change it a bit to avoid waitning.<\/li>\n<li>Click Finish and close the Create Attribute Wizard<\/li>\n<li>Navigate to the Monitoring workspace. Create a new state view in the same management pack as you stored the new attribute. Configure the state view to show data related to Windows Computer_Extended, in my example from the Contoso &#8211; SLA management pack. Make sure you select to display the SLA attribute, Contoso &#8211; SLA Attribute, on the Display tab.<\/li>\n<li>Verify that you see your servers\u00c2\u00a0 and a value in the Contoso &#8211; SLA column<\/li>\n<\/ol>\n<p>The next step is to create a dynamic group, that includes all windows computers with Gold as SLA.<\/p>\n<ol>\n<li>Navigate to the Authroing workspace, select Groups, right-click and select Create a new Group<\/li>\n<li>In the Create Group Wizard, General Properties, input a name, for example Contoso &#8211; Gold Servers. Select the same management pack as your attribute<\/li>\n<li>In the Create Group Wizard, Dynamic Members, click Create\/Edit rules<\/li>\n<li>In the Create Group Wizard &#8211; Query Builder, input the same settings as in the image below<br \/>\n<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2404\" title=\"20110616_SLA02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA02-300x115.jpg\" alt=\"\" width=\"300\" height=\"115\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA02-300x115.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA02.jpg 553w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/li>\n<li>In the Create Group Wizard, Exclude Members,\u00c2\u00a0click Create<\/li>\n<li>Right-click the new group, View Group Members,\u00c2\u00a0verify that all your gold servers are in the group<\/li>\n<\/ol>\n<p>The next step is a bit more complicated. We now need to export the new management pack, edit the XML code and import it again. Export the management pack under Management Packs in the Administration workspace. Make an extra copy of the XML file to make sure you have a backup. Open the exported management pack, the XML file, and search for &lt;MembershipRules&gt;.\u00c2\u00a0 We need to add a second membership rule\u00c2\u00a0that groups associated health service watchers with computers already grouped by first membership rule. This second membership rule will add Health Service Watcher objects\u00c2\u00a0associated with\u00c2\u00a0a computer that is contained by this group. The management pack should look like this when you export it<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2406\" title=\"20110616_SLA03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA03-300x78.jpg\" alt=\"\" width=\"300\" height=\"78\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA03-300x78.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA03.jpg 905w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>we add the second discovery rule (see attached MP for code)<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA04.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2407\" title=\"20110616_SLA04\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA04-300x93.jpg\" alt=\"\" width=\"300\" height=\"93\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA04-300x93.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA04-1024x319.jpg 1024w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA04.jpg 1070w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Save the management pack and import it into Operations Manager again. Repeat all steps for servers with silver SLA level. After you have imported the management pack, wait a couple of minutes (to let\u00c2\u00a0RMS re-calc group members)\u00c2\u00a0and then look at the members in the group.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA05.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2409\" title=\"20110616_SLA05\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA05-300x57.jpg\" alt=\"\" width=\"300\" height=\"57\" srcset=\"https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA05-300x57.jpg 300w, https:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/20110616_SLA05.jpg 804w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You know have two groups, one for servers with silver SLA and one for servers with gold SLA. Both groups contains windows computer objects and health service watcher objects. You can use your new groups for example notification and views.You can download my MP here, <a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/06\/Contoso.SLA_.zip\">Contoso.SLA<\/a>\u00c2\u00a0\u00c2\u00a0, please note that this is provided \u00e2\u20ac\u0153as is\u00e2\u20ac\u009d with no warranties at all. Thanks to <a href=\"http:\/\/blogs.msdn.com\/b\/steverac\/\">Steve<\/a> for ideas.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A common scenario is that\u00c2\u00a0you want\u00c2\u00a0to group computers in groups based on SLA, responsibility or server teams. Groups are used to\u00c2\u00a0for example filter views and boundary in notifications. When looking at the Windows computer object you see everything you are monitoring on that machine (that rolls-up health to the Windows computer object). But you don\u00e2\u20ac\u2122t &hellip; <a href=\"https:\/\/contoso.se\/blog\/?p=2398\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2398"}],"collection":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2398"}],"version-history":[{"count":16,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions"}],"predecessor-version":[{"id":2421,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2398\/revisions\/2421"}],"wp:attachment":[{"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}