Create maintenance rules
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- Event Management
Use maintenance rules to mark CIs in maintenance status. When in maintenance status, these CIs are excluded from impact calculation.
Before you begin
About this task
You can define rules to mark CIs that match the specified criteria as being in maintenance status. The marked CIs populate the Impact Maintenance CIs [em_impact_maint_ci] table.
The field flagged by this rule as being in maintenance status is the CMDB status field.
| Default maintenance rule | Description |
|---|---|
| CI in Change Window | Where the CI has an active change window, the matching CIs
are marked as being in maintenance status. The rule runs a
query against the change request [change_request] table to
determine whether the rule is applied. All these conditions
in the change_request table must be met:
Note: All these conditions
must be present for the CI to be placed in maintenance status by
this rule. For example, if the State of
the change request approval status is
Change is waiting
for approval, then the change is not added to the
em_impact_maint_ci table. |
| Maintenance status of CI | CIs whose CMDB status field is In
Maintenance are flagged by this rule as being in
maintenance status. By default, retired CIs are not included
in CIs that are In Maintenance. To
include retired CIs:
Note: Including thousands of retired CIs may decrease system performance. |
Procedure
Example
Assume that a company defines a CI as being in maintenance when the Operational Status of the CI is either Repair in Progress or DR Standby.

Example of a maintenance rule using a table other than CMDB.
Assume that a company uses Incident records to track maintenance. Any maintenance request is translated to an incident when it has a description that starts with “Performing maintenance on CI”. As long as the status of such an incident is open, this status indicates that the maintenance is in progress. For the CI field name field, specify a CI name from the table that was chosen, in this case Incident.

Example of a maintenance rule that uses the advanced script feature.
var now_GR = new GlideRecord('cmdb_ci');
gr.addQuery('name', 'your_name_here');
gr.query();
while (gr.next()){
result.push(gr.sys_id +'');}The
return value for this example script is a text string that represents an array of CI
IDs, for example, ['sys_id1','sys_id2','sys_id3'].
You can use this script as an example to prepare your own customized script.

Related Content
- How alerts work with CIs in maintenance
When a CI is in maintenance, the impact tree, the service map, and Alerts tab are updated based on various factors.
- Place an alert into maintenance
You can manually place any alert into maintenance to hide it from the Alerts list and Agent Workspace.