9 以 root 用户身份运行agent

    这将忽略旧的Zabbix agent 指定 zabbix_agentd.conf 运行的用户 ,而是将以启动文件中指定的用户运行。

    要覆盖上述行为,请创建一个包含以下内容的文件 /etc/systemd/system/zabbix-agent.service.d/override.conf :

    重新加载守护进程并重启 zabbix-agent 服务

    对于旧的agent,只会在 zabbix_agentd.conf 文件中重新启用配置用户的功能。因此,为了以 root 身份运行 zabbix agent,您仍然需要编辑 agent [配置文件](/manual/annex/config/zabbix_agentd)并指定 User=root 以及 AllowRoot=1 两个参数。

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

    Then, add the following content:

    1. [Service]

    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 .

    Zabbix agent 2

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

    1. systemctl edit zabbix-agent2

    Then, add the following content:

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