{"id":1016,"date":"2009-09-08T07:00:12","date_gmt":"2009-09-08T05:00:12","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=1016"},"modified":"2009-08-29T13:01:33","modified_gmt":"2009-08-29T11:01:33","slug":"notification-for-maintenance-mode","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=1016","title":{"rendered":"Notification and reporting for maintenance mode"},"content":{"rendered":"<blockquote><p>When a monitored object, such as a computer or distributed application, goes offline for maintenance, Operations Manager\u00c2\u00a02007 detects that no agent heartbeat is being received and, as a result, might generate numerous alerts and notifications. To prevent alerts and notifications, place the monitored object into maintenance mode. In maintenance mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts are suppressed at the agent.<br \/>\nMore info about maintenance mode <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dd440876.aspx\">here<\/a>\u00c2\u00a0(source).<\/p><\/blockquote>\n<p><a href=\"http:\/\/blogs.msdn.com\/boris_yanushpolsky\/archive\/2007\/08\/06\/so-what-is-in-maintenance-mode.aspx\">Boris Yanushpolsk<\/a>\u00c2\u00a0wrote a power shell script to use to see what is actually in maintenance mode. You run the script in Operations Manager command shell.\u00c2\u00a0If you want to publish this information to a web page, for example\u00c2\u00a0to share it between colleagues,\u00c2\u00a0you can use this <a rel=\"attachment wp-att-1047\" href=\"http:\/\/contoso.se\/blog\/?attachment_id=1047\">modified version<\/a> of the script. You could also\u00c2\u00a0schedule the script to make sure you have an updated web page all the time.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm01.PNG\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1042  aligncenter\" title=\"mm01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm01-300x85.PNG\" alt=\"mm01\" width=\"300\" height=\"85\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm01-300x85.PNG 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm01.PNG 968w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u00c2\u00a0<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm02.PNG\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1044    aligncenter\" title=\"mm02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm02-300x150.PNG\" alt=\"mm02\" width=\"300\" height=\"150\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm02-300x150.PNG 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm02-1024x512.PNG 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm02.PNG 1693w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If you want to get notified when a new maintenance window starts you could use the following script to get a notification. This script will send you an e-mail with information regarding new maintenance windows. It will also log the information to a logfile that you later can use to generate reports for maintenance windows within your environment. Read <a href=\"http:\/\/contoso.se\/blog\/?p=306\">this<\/a>\u00c2\u00a0post about generating reports based on logfiles. Download the script <a rel=\"attachment wp-att-1072\" href=\"http:\/\/contoso.se\/blog\/?attachment_id=1072\">here<\/a>. Remember to rename the file to .ps1 and run it from Operations Manager command shell. The following picture shows a notification e-mail from the script.<\/p>\n<p style=\"text-align: center;\"><a rel=\"attachment wp-att-1073\" href=\"http:\/\/contoso.se\/blog\/?attachment_id=1073\"><img decoding=\"async\" loading=\"lazy\" class=\"size-medium wp-image-1073  aligncenter\" title=\"mm03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm03-300x86.PNG\" alt=\"mm03\" width=\"300\" height=\"86\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm03-300x86.PNG 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm03-1024x296.PNG 1024w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2009\/08\/mm03.PNG 1893w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>With default settings the script will look for maintenance windows created in &#8220;now-72 hours&#8221;. You can change this with the $seconds, $hours and $hours variable. For example if you schedule the script to run every two minute you want to change it to $minutes=2. If you want the script to generate a logfile you will need to change $log to $true. If you want to get notified with e-mail you need to specify $e-mail=$true and then smtphost, from, to and subject.<\/p>\n<p>Big thanks to Marco Shaw (power shell MVP), read his blog <a href=\"http:\/\/marcoshaw.blogspot.com\/\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a monitored object, such as a computer or distributed application, goes offline for maintenance, Operations Manager\u00c2\u00a02007 detects that no agent heartbeat is being received and, as a result, might generate numerous alerts and notifications. To prevent alerts and notifications, place the monitored object into maintenance mode. In maintenance mode, alerts, notifications, rules, monitors, automatic &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=1016\">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":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1016"}],"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=1016"}],"version-history":[{"count":53,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":1084,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions\/1084"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}