icinga2/doc/3.08-external-commands.md

40 lines
1.6 KiB
Markdown
Raw Normal View History

## <a id="external-commands"></a> External Commands
2013-10-10 11:22:32 +02:00
Icinga 2 provides an external command pipe for processing commands
triggering specific actions (for example rescheduling a service check
through the web interface).
In order to enable the `ExternalCommandListener` configuration use the
following command and restart Icinga 2 afterwards:
# icinga2-enable-feature command
2013-10-31 16:42:08 +01:00
Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd`
using the default configuration.
Web interfaces and other Icinga addons are able to send commands to
Icinga 2 through the external command pipe, for example for rescheduling
a forced service check:
# /bin/echo "[`date +%s`] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;`date +%s`" >> /var/run/icinga2/cmd/icinga2.cmd
2013-10-31 16:42:08 +01:00
# tail -f /var/log/messages
2013-10-31 16:42:08 +01:00
Oct 17 15:01:25 icinga-server icinga2: Executing external command: [1382014885] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382014885
Oct 17 15:01:25 icinga-server icinga2: Rescheduling next check for service 'ping4'
> **Note**
>
> The command pipe file is owned by the group `icingacmd` with read/write
> permissions. Add your webserver's user to the group `icingacmd` to
> enable sending commands to Icinga 2 through your web interface.
# usermod -G -a icingacmd www-data
### <a id="external-command-list"></a> External Command List
A list of currently supported external commands can be found on the
[Icinga Wiki](https://wiki.icinga.org/display/icinga2/External+Commands).
Detailed information on the commands and their required parameters can be found
on the [Icinga 1.x documentation](http://docs.icinga.org/latest/en/extcommands2.html).