icinga2/doc/2.4-setting-up-livestatus.md

47 lines
1.8 KiB
Markdown
Raw Normal View History

## <a id="setting-up-livestatus"></a> Setting up Livestatus
2013-10-01 15:33:34 +02:00
The [MK Livestatus](http://mathias-kettner.de/checkmk_livestatus.html) project
implements a query protocol that lets users query their Icinga instance for
status information. It can also be used to send commands.
> **Tip**
>
> Only install the Livestatus feature if your web interface or addon requires
> you to do so (for example, [Icinga Web 2](#setting-up-icingaweb2)).
> [Icinga Classic UI](#setting-up-icinga-classic-ui) and [Icinga Web](#setting-up-icinga-web)
> do not use Livestatus as backend.
2013-10-01 15:33:34 +02:00
The Livestatus component that is distributed as part of Icinga 2 is a
re-implementation of the Livestatus protocol which is compatible with MK
Livestatus.
Details on the available tables and attributes with Icinga 2 can be found
in the [Livestatus Schema](#schema-livestatus) section.
You can enable Livestatus using icinga2-enable-feature:
2013-10-01 15:33:34 +02:00
# icinga2-enable-feature livestatus
2013-10-01 15:33:34 +02:00
After that you will have to restart Icinga 2:
# /etc/init.d/icinga2 restart
2013-10-07 09:35:44 +02:00
By default the Livestatus socket is available in `/var/run/icinga2/cmd/livestatus`.
2013-10-01 15:33:34 +02:00
In order for queries and commands to work you will need to add your query user
2013-10-07 09:35:44 +02:00
(e.g. your web server) to the `icingacmd` group:
2013-10-01 15:33:34 +02:00
2013-10-02 09:50:26 +02:00
# usermod -a -G icingacmd www-data
2013-10-01 15:33:34 +02:00
2014-04-06 21:15:25 +02:00
The Debian packages use `nagios` as the user and group name. Make sure to change `icingacmd` to
`nagios` if you're using Debian.
2014-04-06 21:15:25 +02:00
Change "www-data" to the user you're using to run queries.
In order to use the historical tables provided by the livestatus feature (for example, the
`log` table) you need to have the `CompatLogger` feature enabled. By default these logs
are expected in `/var/log/icinga2/compat`. A different path can be set using the `compat_log_path`
configuration attribute.
# icinga2-enable-feature compatlog