{"id":2164,"date":"2011-02-15T17:20:34","date_gmt":"2011-02-15T16:20:34","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2164"},"modified":"2011-02-15T17:20:34","modified_gmt":"2011-02-15T16:20:34","slug":"start-maintenance-mode-with-opalis-2","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2164","title":{"rendered":"Start Maintenance Mode with Opalis"},"content":{"rendered":"<p>In this post I want to show you a example how you can start Operations Manager maintenance mode from Opalis. Operations Manager maintenance mode is used to prevent alerts and notifications from objects that you under maintenance. In maintenance mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts are suppressed at the agent. By design, Operations Manager 2007 monitor that the agent is functioning correctly even if the computer is in maintenance mode. If the Health Service and the Health Service Watcher for the agent are not in maintenance mode when you reboot the machine, you will get an alert saying heartbeat failure and failed to connect to computer. This example will put the Windows computer, the health service and the health service watcher into maintenance mode.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2153\" title=\"20110211_MM01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM01-300x107.jpg\" alt=\"\" width=\"300\" height=\"107\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM01-300x107.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM01.jpg 696w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The policy contains a number of objects<br \/>\n1.\tCustom Start.<br \/>\n2.\tStart maintenance mode for a windows computer<br \/>\n3.\tStart maintenance mode for a health service<br \/>\n4.\tQuery the Operations Manager database to get the computer GUID<br \/>\n5.\tStart maintenance mode for a health service watcher<br \/>\n6.\tGenerate a platform event including a summary<\/p>\n<p>The Start Maintenance Mode object puts an monitor in Operations Manager into maintenance mode. You can use the object to browse for a object.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM02.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM02-300x201.jpg\" alt=\"\" title=\"20110211_MM02\" width=\"300\" height=\"201\" class=\"aligncenter size-medium wp-image-2154\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM02-300x201.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM02.jpg 606w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To put the health service watcher into maintenance mode we need the GUID of the machine. The other two \u00e2\u20ac\u0153start maintenance mode\u00e2\u20ac\u009d objects are a bit easier as we can input the server FQDN. To get the server GUID we run a query against the OperationsManager database.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM03.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM03-300x275.jpg\" alt=\"\" title=\"20110211_MM03\" width=\"300\" height=\"275\" class=\"aligncenter size-medium wp-image-2155\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM03-300x275.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM03.jpg 385w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As you can see in the picture, the database query returns a bit more than the GUID. To filter out everything except the GUID we will use two of the data manipulation functions that Opalis have.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM04.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM04-300x102.jpg\" alt=\"\" title=\"20110211_MM04\" width=\"300\" height=\"102\" class=\"aligncenter size-medium wp-image-2156\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM04-300x102.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM04.jpg 560w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>We first split the result from the database query into two parts, split by the \u00e2\u20ac\u0153;\u00e2\u20ac\u009d. Then from the second part, in this example {B3278151-9AC8-5B3B-8924-5F1F7CE27DE7}, we use the MID feature and tells Opalis to get 36 characters starting at position 2. The result when we run this will be three maintenance modes, as shown in the picture below<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM05.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM05-300x254.jpg\" alt=\"\" title=\"20110211_MM05\" width=\"300\" height=\"254\" class=\"aligncenter size-medium wp-image-2158\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM05-300x254.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM05.jpg 511w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Because Operations Manager 2007 polls maintenance mode settings only once every 5 minutes, there can be a delay in an object\u00e2\u20ac\u2122s scheduled removal from maintenance mode. You can download my example here, <a href='http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/02\/20110211_MM.zip'>20110211_MM<\/a> . Remember that you need to edit the Query database object to configure which account to use when query the database.<\/p>\n<p>Please note that this is provided \u00e2\u20ac\u0153as is\u00e2\u20ac\u009d with no warranties at all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post I want to show you a example how you can start Operations Manager maintenance mode from Opalis. Operations Manager maintenance mode is used to prevent alerts and notifications from objects that you under maintenance. In maintenance mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts are suppressed at the &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2164\">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":[58,19],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2164"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2164"}],"version-history":[{"count":3,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2164\/revisions"}],"predecessor-version":[{"id":2168,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2164\/revisions\/2168"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2164"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}