createMaintenanceWindow
A Workflow Engine function that calls the MoogDb createMaintenanceWindow
API call, using the same parameters.
This function can be used to enable events to generate maintenance windows on-the-fly. It can also be used as a CEvent triggered action (ex. in the Alert Workflows) or in an Eventless mode (ex. in the Alert Inform Engine), using details passed into the workflowContext
.
This function is available as a feature of the Add-ons v2.4 download and later.
This function is available for event, alert, and Situation workflows.
Back to Workflow Engine Functions Reference.
Note
Before using this function, ensure that the Maintenance Window Manager Moolet configuration is changed to support standalone mode. The following line needs to be added to the file $MOOGSOFT_HOME/config/moolets/maintenance_window_manager.conf
. Insert a comma at the end of the previous line if needed:
{ ... , standalone_moolet : true }
If you do not have access to this file, please raise a support ticket for this change. Future releases will have this change made permanently.
Note
As with any maintenance window, make sure that the filter for the window applies only to the desired alerts. If the filter is being created programmatically (ex. via substitution), use wildcards and regular expressions with caution.
Arguments
Workflow Engine function createMaintenanceWindow
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| yes | string | The name of the maintenance window. Note: This has a max size of 30 characters. Any name longer than 30 characters will be truncated. |
| yes | string | Description of the maintenance window. |
| yes | string | An SQL-like filter that alerts must match to be included in the maintenance window. |
| yes | string | Start time of the maintenance window. This must be in Unix epoch time and may be up to 5 years in the future. Note: This is a UTC epoch. |
| yes | string | Duration of the maintenance window in seconds. The minimum duration is 1 second and the maximum is 157784630 seconds (5 years). |
| yes | string | Whether or not alerts should be forwarded to the next Moolet in the processing chain. |
| no | string | Whether or not this is a recurring maintenance window. Set this to:
Note: "true" or "false" are also accepted as valid inputs. |
| no | string | The recurring period of the maintenance window, in days, weeks or months. Valid values are:
Default value is 0 if Note: String values of "daily", "weekly", and "monthly" will also be accepted. |
Example
The following example demonstrates typical use of Workflow Engine function createMaintenanceWindow
.
An alert is generated when an event source is entering a maintenance period. We want all alerts for that source to be ignored for the next hour.
Create a workflow in the Alert Workflows with a suitable entry filter to scope the action to the appropriate alert description.
If necessary, add actions to the workflow to extract the required data from the event or alert.
Use the
createMaintenanceWindow
action with appropriate parameters:name - “Maintenance : $(source)”
Note: A name needs to be 30 characters or less.
description - “Automatically created maintenance window from alert $(alert_id) from source $(source)”
filter - “source = ‘$(source)’”
startDateTime - $(moog_now)
Start the window immediately
duration - 3600
This would appear in the UI as:
{"name":"Maintenance : $(source)","description":"Automatically created maintenance window from alert $(alert_id) from source $(source)","filter":"source = '$(source)'","startDateTime":"$(moog_now)","duration":"3600","forwardAlerts":"false"}