Monitor fail2ban with check mk 1.6

From Levy

Revision as of 07:34, 16 September 2021 by Louis (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

For monitoring the status of fail2ban with check_mk there is an external plugin, which can be found here. Follow the instructions on the site to install the plugin. This works fine on versions of check_mk up to 1.5.x.

However, in check_mk 1.6 a change is made to the inventory function of the check_mk plugin. In order to fix this, edit /omd/sites/Home/local/share/check_mk/checks/fail2ban, and make the following change:
def inventory_fail2ban(checkname, info):
to:
def inventory_fail2ban(info):

That should fix the issue and fail2ban monitoring is working again.

Update for check_mk 2.x
In check_mk 2.x the performance data will not show. This is because of some missing imports. In /omd/sites/<Site>/local/share/check_mk/web/plugins/perfometer/fail2ban.py add this at the beginning of the file:

from cmk.gui.plugins.views.perfometers import (
    perfometers,
    render_perfometer,
    perfometer_linear,
    perfometer_logarithmic,
    perfometer_logarithmic_dual,
    perfometer_logarithmic_dual_independent,
)