9 以 root 用户身份运行agent | 您所在的位置:网站首页 › zabbixagent2和agent › 9 以 root 用户身份运行agent |
Table of Contents
9 以 root 用户身份运行agent
Zabbix agent
Zabbix agent 2
9 以 root 用户身份运行agent
从版本 5.0.0 版本开始,Zabbix agent 服务的启动文件 official packages 已更新为显示包含 User 及 Group的参数. 两者都设置为 zabbix. 这将忽略旧的Zabbix agent 指定 zabbix_agentd.conf 运行的用户 ,而是将以启动文件中指定的用户运行。 要覆盖上述行为,请创建一个包含以下内容的文件 /etc/systemd/system/zabbix-agent.service.d/override.conf : [Service] User=root Group=root重新加载守护进程并重启 zabbix-agent 服务 systemctl daemon-reload systemctl restart zabbix-agent这完全决定了 Zabbix agent2 的运行用户 对于旧的agent,只会在 zabbix_agentd.conf 文件中重新启用配置用户的功能。因此,为了以 root 身份运行 zabbix agent,您仍然需要编辑 agent [配置文件](/manual/annex/config/zabbix_agentd)并指定 User=root 以及 AllowRoot=1 两个参数。 Zabbix agentTo override the default user and group for Zabbix agent, run: systemctl edit zabbix-agentThen, add the following content: [Service] User=root Group=rootReload daemons and restart the zabbix-agent service: systemctl daemon-reload systemctl restart zabbix-agentFor 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 2To override the default user and group for Zabbix agent 2, run: systemctl edit zabbix-agent2Then, add the following content: [Service] User=root Group=rootReload daemons and restart the zabbix-agent service: systemctl daemon-reload systemctl restart zabbix-agent2For Zabbix agent2 this completely determines the user that it runs as. No additional modifications are required. |
CopyRight 2018-2019 实验室设备网 版权所有 |