Some feedback. I tested this plugin under centos 7.8/fail2ban v0.11.1-10. I did the following changes to make it working:
- module path:
import sys, string, os, logging
import socket
import collectd
from fail2ban.client.csocket import CSocket
from fail2ban.client.configurator import Configurator
-
grant some permissons for collectd:
r permission /etc/fail2ban/fail2ban.local
rw permisson for /var/run/fail2ban/fail2ban.sock
Every time, fail2ban service restart, the rw permission on /var/run/fail2ban/fail2ban.sock for collectd is lost. need to find some permanent, good and safe solution?
-
a conf example :
cat /etc/collectd.d/collectd.conf.d/fail2ban.conf
LoadPlugin python
<Plugin python>
ModulePath "/opt/collectd/lib_develop"
Import fail2ban2collectd
</Plugin>
Test your collectd.
ls -al /opt/collectd/lib_develop/fail2ban2collectd.py
-rwxr-xr-x 1 root root 3923 Oct 12 11:19 /opt/collectd/lib_develop/fail2ban2collectd.py
Some feedback. I tested this plugin under centos 7.8/fail2ban v0.11.1-10. I did the following changes to make it working:
import sys, string, os, loggingimport socketimport collectdfrom fail2ban.client.csocket import CSocketfrom fail2ban.client.configurator import Configuratorgrant some permissons for collectd:
r permission /etc/fail2ban/fail2ban.localrw permisson for /var/run/fail2ban/fail2ban.sockEvery time, fail2ban service restart, the
rwpermission on /var/run/fail2ban/fail2ban.sock for collectd is lost. need to find some permanent, good and safe solution?a conf example :
cat /etc/collectd.d/collectd.conf.d/fail2ban.confLoadPlugin python<Plugin python>ModulePath "/opt/collectd/lib_develop"Import fail2ban2collectd</Plugin>Test your collectd.
ls -al /opt/collectd/lib_develop/fail2ban2collectd.py-rwxr-xr-x 1 root root 3923 Oct 12 11:19 /opt/collectd/lib_develop/fail2ban2collectd.py