This is a translation of the original English documentation page. Help us make it better.

Sidebar

Table of Contents

#9 Lopende agent als root

Vanaf versie 5.0.0 het systemd-servicebestand voor Zabbix agent in officieel pakketten is bijgewerkt om expliciet richtlijnen voor 'Gebruiker' en 'Groep' op te nemen. Beide zijn ingesteld op zabbix.

Dit betekent dat de oude functionaliteit van het configureren van welke gebruiker Zabbix agent draait als via zabbix_agentd.conf bestand wordt omzeild en agent zal altijd uitvoeren als de gebruiker die is opgegeven in het systemd-servicebestand.

Om dit nieuwe gedrag te negeren, maakt u een /etc/systemd/system/zabbix-agent.service.d/override.conf bestand met de volgende inhoud:

[Service]
       User=root
       Group=root

Laad daemons opnieuw en start de zabbix-agent-service opnieuw:

systemctl daemon-reload
       systemctl herstart zabbix-agent

Voor Zabbix agent2 bepaalt dit volledig de gebruiker die het uitvoert net zo.

Voor oude agent activeert dit alleen de functionaliteit van configureren gebruiker in het bestand zabbix_agentd.conf. Daarom om zabbix uit te voeren agent als root moet je de agent nog bewerken configuratie file en specificeer User=root als evenals AllowRoot=1 opties.

Zabbix agent

To override the default user and group for Zabbix agent, run:

systemctl edit zabbix-agent

Then, add the following content:

[Service]
       User=root
       Group=root

Reload daemons and restart the zabbix-agent service:

systemctl daemon-reload
       systemctl restart zabbix-agent

For Zabbix agent this re-enables the functionality of configuring user in the zabbix_agentd.conf file. Now you need to set User=root and AllowRoot=1 configuration parameters in the agent configuration file.

Zabbix agent 2

To override the default user and group for Zabbix agent 2, run:

systemctl edit zabbix-agent2

Then, add the following content:

[Service]
       User=root
       Group=root

Reload daemons and restart the zabbix-agent service:

systemctl daemon-reload
       systemctl restart zabbix-agent2

For Zabbix agent2 this completely determines the user that it runs as. No additional modifications are required.