hermanekt / zabbix-fail2ban-discovery-

51 stars 27 forks source link

proc.num[fail2ban-server] returns 0 on Ubuntu 20.04.1 LTS #9

Closed altmas5 closed 4 years ago

altmas5 commented 4 years ago

Hi,

This is the second box with Ubuntu 20.04 that I'm deploying with this template, I got this behavior on both of them.
zabbix_agentd -t proc.num[fail2ban-server] returns zero even when fail2ban is running and the autodiscovery rule is working fine, so no misconfiguration here. I have used this template a lot in the past (thank you BTW).

This in the environment:

Running the item

zabbix_agentd -t proc.num[fail2ban-server]
proc.num[fail2ban-server]                     [u|0]

Workaround 1:

zabbix_agentd -t proc.num[,,,fail2ban-server]
proc.num[,,,fail2ban-server]                  [u|2]

Workaround 2 (more precise):

zabbix_agentd -t proc.num[python3,,,fail2ban-server]
proc.num[python3,,,fail2ban-server]           [u|1]
fail2ban-server -V
0.11.1
zabbix_agentd -V
zabbix_agentd (daemon) (Zabbix) 4.0.17
Revision a528a0a4bc 28 January 2020, compilation time: Feb  4 2020 04:03:41

Copyright (C) 2020 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

Compiled with GnuTLS 3.6.11
Running with GnuTLS 3.6.13
Ubuntu 20.04.1 LTS

How does the output of a ps -Af|grep fail2ban look? :

/usr/bin/python3 /usr/bin/fail2ban-server -xf start

How does the output use to be under Fail2Ban v0.10.2:

/usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid
hermanekt commented 4 years ago

Hi Man,

i have bad news, this is only ubuntu problems, i check this on my latest debian, centos 7, centos 8 but all works fine:(

Tom

altmas5 commented 4 years ago

Do you know a way of having separate items based on the distro? I guess that would require LLD or autodiscovery rules

ghost commented 4 years ago

Hi Altmas5,

Same problem here. So if you have updates, please let me know!

Tim

altmas5 commented 4 years ago

Hi Altmas5,

Same problem here. So if you have updates, please let me know!

Tim

I think I'll have it by next week @twesterbeek .

hermanekt commented 4 years ago

Hi,

everyone i do make fix for ubuntu right now.

Tom

hermanekt commented 4 years ago

Please test template with name Template Fail2ban Ubuntu 20.04 i hope version with key: zabbix_agentd -t proc.num[python3,,,fail2ban-server] works well. Problem is with systemd. In future with Zabbix Agent 2 you can use: systemd.unit.info["fail2ban.service"]

altmas5 commented 4 years ago

Yes, that solves it. Thanks @hermanekt