<p>Hey all,</p>
<p>Here is a quick note how to install and activate MK Livestatus (Check_MK) API for your Icinga2 installation.</p>
<p>More info about livestatus on the official website: <a href="https://mathias-kettner.de/checkmk_livestatus.html">https://mathias-kettner.de/checkmk_livestatus.html</a></p>
<p>So, check if it’s already activated:</p>
<pre class="EnlighterJSRAW" data-enlighter-theme="minimal"># icinga2 feature list
Disabled features: compatlog debuglog gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker command ido-mysql mainlog notification</pre>
<p>As we can see <strong>livestatus</strong> is currently disabled</p>
<p>Let’s enable it using the following command:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null"># icinga2 feature enable livestatus
Enabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect.
</pre>
<p>Now we need to add one more LivestatusListener object and fix the existing one to support livestatus on local unix socket and on TCP socket.</p>
<p>Open <strong>/etc/icinga2/features-enabled/livestatus.conf</strong> and edit it as following:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">library "livestatus"
object LivestatusListener "livestatus-tcp" {
socket_type = "tcp"
bind_host = "0.0.0.0"
bind_port = "6666"
}
object LivestatusListener "livestatus-unix" {
socket_type = "unix"
socket_path = "/var/run/icinga2/cmd/livestatus"
}
</pre>
<p>You can bind it to some specific IP and/or change port to another one if you need, also make sure that your socket_path is exists</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null"># ls -la /var/run/icinga2/cmd/livestatus
srw-rw---- 1 icinga icingacmd 0 Oct 30 10:51 /var/run/icinga2/cmd/livestatus
</pre>
<p>Let me know if you have any questions</p>
<p>Thanks!</p>
<p> </p>
<p> </p>
Hey all,
Here is a quick note how to install and activate MK Livestatus (Check_MK) API for your Icinga2 installation.
More info about livestatus on the official website: https://mathias-kettner.de/checkmk_livestatus.html
So, check if it’s already activated:
# icinga2 feature list
Disabled features: compatlog debuglog gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker command ido-mysql mainlog notification
As we can see livestatus is currently disabled
Let’s enable it using the following command:
# icinga2 feature enable livestatus
Enabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect.
Now we need to add one more LivestatusListener object and fix the existing one to support livestatus on local unix socket and on TCP socket.
Open /etc/icinga2/features-enabled/livestatus.conf and edit it as following:
library "livestatus"
object LivestatusListener "livestatus-tcp" {
socket_type = "tcp"
bind_host = "0.0.0.0"
bind_port = "6666"
}
object LivestatusListener "livestatus-unix" {
socket_type = "unix"
socket_path = "/var/run/icinga2/cmd/livestatus"
}
You can bind it to some specific IP and/or change port to another one if you need, also make sure that your socket_path is exists
# ls -la /var/run/icinga2/cmd/livestatus
srw-rw---- 1 icinga icingacmd 0 Oct 30 10:51 /var/run/icinga2/cmd/livestatus
Let me know if you have any questions
Thanks!