TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
host Salt execution module provides Icinga2 API integration for scheduling monitoring downtimes directly from Salt. Its primary use is suppressing alerts on hosts and all their associated services before a deployment or maintenance operation, preventing alert fatigue and on-call noise during intentional disruptions. All API calls go directly to the Icinga2 master over HTTPS.
Pillar Configuration
The module reads its connection settings from themonitoring pillar key. All keys must be set on the minion that will execute the function (i.e. the minion that Salt runs the module on, not necessarily the host being downtimed).
Hostname or IP address of the Icinga2 master node. The module constructs the API URL as
https://<icinga_api_host>:<icinga_api_port>/v1/....Icinga2 API username for HTTP Basic authentication. Defaults to
root.Icinga2 API password. A
CommandExecutionError is raised at call time if this key is missing or empty.TCP port of the Icinga2 API listener. Defaults to
5665.Functions
host.downtime(hostname, duration, reason)
Schedules a fixed downtime in Icinga2 for the named host and all of its services. Alerts are suppressed for the duration of the downtime. The all_services: 1 flag in the API payload ensures that every service check associated with the host is covered by a single API call — you do not need to schedule services individually.
The downtime is recorded as a “fixed” downtime (as opposed to flexible), meaning it starts immediately when scheduled and ends at now + duration regardless of whether the host state changes.
The Icinga2 host object name. This must match the
host.name attribute in Icinga2 exactly — typically the FQDN, e.g. mw-us-east-011.ovvin.wonet.Length of the downtime. Accepts:
- A plain integer or numeric string (interpreted as seconds):
3600,"3600" - A string with a unit suffix:
"30s","30m","2h","1d"
| Suffix | Unit | Example | Seconds |
|---|---|---|---|
s | seconds | "90s" | 90 |
m | minutes | "30m" | 1 800 |
h | hours | "2h" | 7 200 |
d | days | "1d" | 86 400 |
Free-text comment recorded against the downtime in Icinga2. Visible in the Icinga2 web interface and included in downtime notifications. Use a descriptive message so on-call staff can understand why the host was downtimed.
CommandExecutionError if:
monitoring:icinga_api_hostormonitoring:icinga_api_passwordare missing from pillar- The Icinga2 API returns a non-200 HTTP status
- The API returns an empty
resultslist (host not found in Icinga2) - Any result in the response has a non-200 Icinga2 status code
CLI Examples
The
salt '*' target in these examples refers to which Salt minion executes the module (and therefore which minion’s monitoring pillar is used for API credentials). It does not need to match the Icinga2 hostname being downtimed. You can run host.downtime from any minion that has the monitoring pillar keys set, including the Salt master itself via salt-call.Duration Format Reference
The_parse_duration helper tries the suffix format first, then falls back to bare integer parsing:
"2x", "abc") raises a CommandExecutionError immediately with the message:
Common Workflows
Downtime before a rolling deploy
Schedule downtime on every MediaWiki server before starting a deploy, then clear it after:Downtime before OS patching
Downtime from the Salt master with salt-call
If running interactively on the Salt master:API Payload Details
For reference, the module posts the following JSON payload tohttps://<icinga_api_host>:5665/v1/actions/schedule-downtime:
author field is set to icinga_api_user from pillar (default root). SSL certificate verification is disabled (verify_ssl: False) to support self-signed Icinga2 API certificates typical in internal deployments.