<h2>Event Management - Alert maintenance calculation explained.</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Summary</h3><section><style type="text/css"><!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } </style><div class="ns-kb-css-body-editor-container"><div class="mce-toc"> <h2>Table of Contents</h2> <ul><li><a href="#mcetoc_1gns00srcf">1. Introduction</a></li><li><a href="#mcetoc_1gns00srcf">2. What is Alert Maintenance Calculation?</a></li><li><a href="#mcetoc_1gns00srcf">3. How does it work OOTB?</a></li><li><a href="#mcetoc_1gns00srcf">4. Custom Rules</a></li><li><a href="#mcetoc_1gns00srcf">5. Relationship Logic</a></li><li><a href="#mcetoc_1gns00srcf">6. Alert Maintenance Logic for Grouped Alerts.</a></li></ul> </div> <h2 id="mcetoc_1gns00srcf">1. Introduction</h2> <ul style="list-style-position: inside;"><li>This article aims to help TSEs understand Maintenance Calculation functionality and its troubleshooting. </li></ul> <h2 id="mcetoc_1gns00srcf">2. What is Alert Maintenance Calculation?</h2> <ul style="list-style-position: inside;"><li>Usually, events/alerts are generated whenever the monitoring tools observe abnormalities with respect to the CI behavior. However, sometimes the abnormalities are caused because of planned activities at the CI level thus to avoid incident creation or any action on such known use cases, the system moves the alerts into maintenance mode.</li></ul> <h2 id="mcetoc_1gns00srcf">3. How does it work OOTB?</h2> <ul style="list-style-position: inside;"><li>OOTB, we have an official document that explains <a href="https://docs.servicenow.com/bundle/utah-it-operations-management/page/product/event-management/concept/c_EMHowImpactTree.html">How alerts work with CIs in maintenance</a> however this KB explains some detailed use cases and concepts that will help to clarify more information related to working on alert maintenance calculation.</li><li>We provide 2 default rules that take care of CI status and CI mapped with an active change use case</li><li>The scheduled job responsible for the calculation is "<strong>Event Management - Maintenance Calculator</strong>". This job is executed every 1 minute and will apply the rules created in the "<strong>em_maintenance_rule</strong>" table against the alerts.</li><li>The CIs that match the criteria/rule are populated in the Impact Maintenance CIs [<strong>em_impact_maint_ci</strong>] table.</li><li>One important rule to highlight here is that <span style="text-decoration: underline;">the CI binding to alert should be done using the OOTB mechanism, if the binding is performed using some custom BR or using a custom scheduled job then the maintenance calculation feature may not work as expected. </span></li></ul> <h2 id="mcetoc_1gns00srcf">4. Custom Rules</h2> <ul style="list-style-position: inside;"><li>If the OOTB-defined rules are not satisfying the business use case then the end-user is allowed to create maintenance rules as per their business requirement, however, this falls under customization thus the end user needs to work on the logic part of the rules.</li><li>The custom rules, if not defined properly may end up causing performance issues.</li></ul> <h2 id="mcetoc_1gns00srcf">5. Relationship Logic</h2> <ul style="list-style-position: inside;"><li>OOTB, the code runs the maintenance rules and gets all the CIs that should be in maintenance. If the "<strong>Flag CIs that run on this host</strong>" field is set to true, we will look for applications running on maintenance CI hosts to add them to maintenance.</li><li>The search for the relevant applications will be done in the <strong>CI Relationships ("cmdb_rel_ci")</strong> table. We are looking for Type "<strong>Runs on::Runs</strong>", which is typically between a CI that represents a software application, to the hosting hardware/VM.<br /><br /></li></ul> <h2 id="mcetoc_1gns00srcf">6. Alert Maintenance Logic for Grouped Alerts.</h2> <ul style="list-style-position: inside;"><li>Use Case- When the parent alert is closed with maintenance true, after closure if the CI comes out of maintenance, the parent alert still remains in maintenance mode.<br /><br /></li><li>Explanation: The above behavior you detailed and witnessed is the expected behavior, by design. This is because, the state of the group - the parent and its children, is Closed.</li><li>Since the group is closed, we intentionally don't update the parent alert, therefore you will not see *any* change in a closed parent alert, not only maintenance-related changes.</li><li>The behavior described before will apply to all virtual alerts, i.e. - Automated, CMDB, Text-based, Patterns, and Tag Cluster (coming in Vancouver).</li><li>The group's parent for Virtual Alerts is only a container for its children, so it's not a real alert, and since it's closed it means the group is closed - there's no issue and changes are irrelevant, so we don't need to waste resources on keeping it up to date with its children. As a container, it gets its data from the oldest child alert with the highest severity in its group, before it closed.</li><li> For the other type of parent alerts - rules-based, Log Analytics, and Component-based, maintenance changes and other changes will apply because those parent alerts are real alerts, not virtual alerts.</li></ul><span id="ns-kb-css-end-div-identifier" style="display: none; pointer-events: none;"></span></div></section></div></article></div>