Search the docs
Menu
Updated Edit on GitHub

neodesk maintenance

Copy as Markdown

Maintenance windows that hold the alerts of devices while they are worked on.

neodesk maintenance --help lists the same commands in the terminal. The flags every command takes are in the command reference.

neodesk maintenance devices

List the devices a maintenance window holds now.

neodesk maintenance devices [flags]
Flag What it is
--device DEVICE only this device

Needs device.view; only reads. Calls GET /api/maintenance/devices.

neodesk maintenance window

Show one maintenance window and the devices it holds now.

neodesk maintenance window <id> [flags]
Argument What it is
<id> The window ID

Needs device.view; only reads. Calls GET /api/maintenance/windows/{id}.

neodesk maintenance window-create

Create a maintenance window. While it runs, no alert rule sends an alert for its devices; the alerts are written as held.

The devices are named as a fleet task's targets: device IDs, group names, org:<id>, group:<name>, tag:<tag>, site:<id>, or all for the whole server (needs server.config). --minutes starts the window now. A window that runs once takes starts_at and ends_at (RFC 3339 times with their offset); a repeating one takes schedule weekly with days, start_time and duration_minutes, or schedule cron with cron and duration_minutes. Wall clock times are read in the server's time zone unless time_zone is set. grace_minutes (15 unless set) is how long after the end a device may still be offline before it alerts. Give the request body with -f key=value (text), -F key=json (numbers, true or false, lists) or --data JSON (or --data @file.json). The answer to a wrong body names what is missing.

neodesk maintenance window-create --name NAME [flags]
Flag What it is
--name NAME what the window is for (required)
--scope SCOPE the devices, groups, organizations, tags or sites, separated by commas
--minutes N start now and run this many minutes
--note NOTE a note for the people who see the window
--grace N the grace time in minutes

Needs org.manage_devices; changes something: needs a token with read and write access. Calls POST /api/maintenance/windows.

neodesk maintenance window-create --name "Patch night" --scope "group:Berlin office" --minutes 120
neodesk maintenance window-create --data '{"name":"Weekly updates","scope":"tag:servers","schedule":"weekly","days":["sat"],"start_time":"22:00","duration_minutes":480}'

neodesk maintenance window-delete

Delete a maintenance window. The alerts it held stay, with its name.

neodesk maintenance window-delete <id> [flags]
Argument What it is
<id> The window ID

Needs org.manage_devices; changes something: needs a token with read and write access; deletes or ends something for good, so it asks first unless --yes is given. Calls DELETE /api/maintenance/windows/{id}.

neodesk maintenance window-end

End the running maintenance window now. Its grace time follows.

neodesk maintenance window-end <id> [flags]
Argument What it is
<id> The window ID

Needs org.manage_devices; changes something: needs a token with read and write access. Calls POST /api/maintenance/windows/{id}/end.

neodesk maintenance window-extend

Extend the running maintenance window.

neodesk maintenance window-extend <id> --minutes N [flags]
Argument What it is
<id> The window ID
Flag What it is
--minutes N how many minutes longer it runs (required)

Needs org.manage_devices; changes something: needs a token with read and write access. Calls POST /api/maintenance/windows/{id}/extend.

neodesk maintenance window-extend mw_1a2b3c --minutes 30

neodesk maintenance window-update

Change a maintenance window. Give the fields to change.

Give the request body with -f key=value (text), -F key=json (numbers, true or false, lists) or --data JSON (or --data @file.json). The answer to a wrong body names what is missing.

neodesk maintenance window-update <id> [flags]
Argument What it is
<id> The window ID

Needs org.manage_devices; changes something: needs a token with read and write access. Calls PATCH /api/maintenance/windows/{id}.

neodesk maintenance windows

List the maintenance windows you see: running ones first, then upcoming, then past ones.

neodesk maintenance windows [flags]
Flag What it is
--state STATE running, upcoming or over

Needs device.view; only reads. Calls GET /api/maintenance/windows.

neodesk maintenance windows --state running

Type to search pages, sections, commands and settings.