Closed rightkick closed 4 years ago
Hi Alex,
this have reason, check this: https://github.com/hermanekt/zabbix-fail2ban-discovery-/issues/3 and follow issue 4 and check pull requests.
Tom
Hi Tom,
It is not granting root to zabbix-agent as zabbix-agent still runs as "zabbix" user. It is just granting elevated rights to run a single command (fail2ban-client) through sudo. This approach is followed with other modules also (for example smartctl tool).
The doc seems to recommend a convoluted setup. One can simply setup this template by following the below steps:
Add following line at sudoers file
zabbix ALL= (ALL) NOPASSWD: /usr/bin/fail2ban-client
Edit fail2ban.conf, and prepend sudo at the used commands. Example:
Copy fail2ban.conf at /etc/zabbix/zabbix_agentd.d
Restart zabbix-agent:
systemctl restart zabbix-agent
Note:
I had to amend the template to correctly detect status of fail2ban-server as following:
proc.num[python2,root,,fail2ban-server]
In case your fail2ban is running with another user then root, then replace root with your user.