YunoHost-Apps / zabbix_ynh

Zabbix package for YunoHost
https://www.zabbix.com/
GNU General Public License v2.0
5 stars 5 forks source link

Improve ping zabbix script (add permissions for zabbix user) #35

Open jose1711 opened 2 years ago

jose1711 commented 2 years ago

Describe the bug

Zabbix app is using zabbix user which (unlike root) does not have required permissions to use it. This results in the following error when admin attempts to ping a monitored host from web console: image

Here's a suggested solution which could be integrated into the app:

cp /usr/bin/ping /usr/bin/zabbix_ping
chown zabbix:zabbix /usr/bin/zabbix_ping
setcap cap_net_raw+p /usr/bin/zabbix_ping
sudo -u zabbix zabbix_ping 127.0.0.1  # test if it works
# in zabbix: Administration/Scripts - change ping to zabbix_ping

Perhaps there should be an extra check (item maybe)/self-healing trigger if ping and zabbix_ping is always the same binary (in case of system upgrades).

Context