Skip to content

Maintenance

create_maintenance_definition

create_maintenance_definition <NAME> [OPTIONS]

Create a new one-time maintenance definition.

One can define an interval between two timestamps in ISO format or a time period in minutes, hours or days from the moment the definition is created. Periods are assumed to be in seconds if no unit is specified. If no period is specified, the default is 1 hour.

Examples

Create a maintenance for a host from now for 1 hour (default)

create_maintenance_definition 'My maintenance' --host 'My host'

Create a maintenance for a host group in a specific time period

create_maintenance_definition 'My maintenance' --hostgroup 'Linux servers' --period '2022-12-31T23:00 to 2023-01-01T01:00'

Create a maintenance definition with all options

create_maintenance_definition 'My maintenance' --hostgroup 'Linux servers' --period '2 hours 30 minutes 15 seconds' --description 'Maintenance for Linux servers' --data-collection ON

Arguments

NAME
Maintenance name.
Type: text
Required:

Options

--description <DESCRIPTION>
Description.
Type: text

--host <HOSTS>
Host(s). Comma-separated.
Type: text

--hostgroup <HOSTGROUPS>
Host group(s). Comma-separated.
Type: text

--period <PERIOD>
Time period in seconds, minutes, hours, days, or as ISO timestamp.
Type: text
Default: 1 hour

--data-collection <DATA_COLLECTION>
Enable or disable data collection.
Type: choice
Choices: on, off, 0, 1
Default: on


remove_maintenance_definition

remove_maintenance_definition <MAINTENANCE_ID>

Remove a maintenance definition.

Arguments

MAINTENANCE_ID
ID(s) of maintenance(s) to remove. Comma-separated.
Type: text
Required:


show_maintenance_definitions

show_maintenance_definitions [OPTIONS]

Show maintenance definitions for IDs, host groups or hosts.

At least one of --maintenance-id, --hostgroup, or --host is required.

Options

--maintenance-id <MAINTENANCE_ID>
Maintenance IDs. Comma-separated.
Type: text

--hostgroup <HOSTGROUP>
Host group names. Comma-separated.
Type: text

--host <HOST>
Host names. Comma-separated.
Type: text


show_maintenance_periods

show_maintenance_periods <MAINTENANCE_ID> [OPTIONS]

Show maintenance periods for one or more maintenance definitions.

Shows all maintenance definitions by default.

Arguments

MAINTENANCE_ID
Maintenance IDs. Comma-separated. Supports wildcards.
Type: text

Options

--limit, -n <LIMIT>
Limit the number of results. 0 to show all.
Type: integer
Default: 0