fail2ban: output data format wrong on RPI4
PVasileff opened this issue · 1 comments
I've open that because ISSUE 283 is closed.
I have configured librenms to monitoring few servers. On two of them I have installed fail2ban and configured that snmp extend. On VM with Debian 11 and on rasberry pi 4 with rasbian 11.
I have installed libjson-perl and configured on both server on snmpd.conf:
extend fail2ban '/usr/bin/sudo /opt/snmp/fail2ban -c -U -f /usr/local/bin/fail2ban-client'
and in /etc/sudoers:
Debian-snmp ALL = NOPASSWD: /opt/snmp/fail2ban
When I have run with root on cli:
sudo -u Debian-snmp /usr/bin/sudo /opt/snmp/fail2ban -c -U -f /usr/local/bin/fail2ban-client
on VM with Debian 11 - reported:
{"data":{"jails":{"nginx-forbidden":"0","ssh":"206"},"total":206},"error":"0","errorString":"fail2ban-client exited with 0","version":"1"}
on RPI 4 with Rasbian - reported:
{"data":{"jails":{"openvpn":"0","ssh":"0"},"total":0},"error":"0","errorString":"fail2ban-client exited with 0","version":"1"}
BUT on librenms graphs for VM with Debian 11:
- graphs are OK
On RPI 4 - with rasbian 11 - NOT:
Any Ideas how to fix that on RPI 4?
Problem solved.
On RPI4 when I run Capture - Poller - I see:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
Fixed with:
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
and in /etc/locale.gen just enabled:
en_US.UTF-8 UTF-8
and then run:
locale-gen; reboot