2014-02-05 15:53:22 +01:00
|
|
|
## <a id="external-commands"></a> External Commands
|
2013-10-10 11:22:32 +02:00
|
|
|
|
2013-10-17 18:12:52 +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:
|
|
|
|
|
2013-10-18 22:11:40 +02:00
|
|
|
# icinga2-enable-feature command
|
2013-10-31 16:42:08 +01:00
|
|
|
|
2013-10-17 18:12:52 +02: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
|
|
|
|
2013-10-17 18:12:52 +02: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'
|
|
|
|
|
2013-10-17 18:12:52 +02:00
|
|
|
> **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
|
|
|
|
|
2014-03-07 14:14:17 +01:00
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> Debian packages use `nagios` as default user/group. Therefore change `icingacmd` to
|
|
|
|
> `nagios`.
|
|
|
|
|
2014-02-05 15:53:22 +01:00
|
|
|
### <a id="external-command-list"></a> External Command List
|
2013-10-17 18:12:52 +02:00
|
|
|
|
|
|
|
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).
|