mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 15:44:11 +02:00
parent
5cfac1f643
commit
7cf01008e6
@ -1538,7 +1538,11 @@ $ curl -k -s -u root:icinga -H 'Accept: application/json' \
|
|||||||
### execute-command <a id="icinga2-api-actions-execute-command"></a>
|
### execute-command <a id="icinga2-api-actions-execute-command"></a>
|
||||||
|
|
||||||
Executes a particular check/notification/event-command on a particular
|
Executes a particular check/notification/event-command on a particular
|
||||||
endpoint in the context of a particular checkable.
|
endpoint in the context of a particular checkable. Example use cases:
|
||||||
|
|
||||||
|
* Test a check command without actually triggering notifications
|
||||||
|
* Reboot a node via an event command
|
||||||
|
* Test a notification command without actually reproducing the notification reason
|
||||||
|
|
||||||
Send a `POST` request to the URL endpoint `/v1/actions/execute-command`.
|
Send a `POST` request to the URL endpoint `/v1/actions/execute-command`.
|
||||||
|
|
||||||
@ -1548,7 +1552,7 @@ Send a `POST` request to the URL endpoint `/v1/actions/execute-command`.
|
|||||||
command_type | String | **Optional.** The command type: `CheckCommand` or `EventCommand` or `NotificationCommand`. Default: `EventCommand`
|
command_type | String | **Optional.** The command type: `CheckCommand` or `EventCommand` or `NotificationCommand`. Default: `EventCommand`
|
||||||
command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it's either `$check_command$`, `$event_command$` or `$notification_command$`
|
command | String | **Optional.** The command to execute. Its type must the same as `command_type`. It can be a macro string. Default: depending on the `command_type` it's either `$check_command$`, `$event_command$` or `$notification_command$`
|
||||||
endpoint | String | **Optional.** The endpoint to execute the command on. It can be a macro string. Default: `$command_endpoint$`.
|
endpoint | String | **Optional.** The endpoint to execute the command on. It can be a macro string. Default: `$command_endpoint$`.
|
||||||
macros | Dictionary | **Optional**. Macro overrides. Default: `{}`
|
macros | Dictionary | **Optional.** Macro overrides. Default: `{}`
|
||||||
user | String | **Optional.** The user used for the notification command.
|
user | String | **Optional.** The user used for the notification command.
|
||||||
notification | String | **Optional.** The notification used for the notification command.
|
notification | String | **Optional.** The notification used for the notification command.
|
||||||
|
|
||||||
@ -1573,6 +1577,8 @@ Send a `POST` request to the URL endpoint `/v1/actions/execute-command`.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You may poll the state of the execution by [querying](#icinga2-api-config-objects-query) the checkable's attribute `executions`.
|
||||||
|
|
||||||
## Event Streams <a id="icinga2-api-event-streams"></a>
|
## Event Streams <a id="icinga2-api-event-streams"></a>
|
||||||
|
|
||||||
Event streams can be used to receive check results, downtimes, comments,
|
Event streams can be used to receive check results, downtimes, comments,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user