I have zabbix_agentd running on Centos 8 and I have a UserParameter that checks the health of the ZFS pool. This always worked fine because the previous version of the agent I was using ran as root user so was allowed to run the zpool command. I noticed this is no longer the case.
I checked the docs and found this one: https://www.zabbix.com/documentation..._agent_as_root
I followed that guide but still the agent is run as user zabbix instead of root. I tried several things, first off, my configuration;
Location systemctl script: /usr/lib/systemd/system/zabbix-agent.service
Contents of that script:
As you can see I edited this one and changed User=zabbix and Groups=zabbix to root, doesn't work..
I tried adding the override.conf file both in /etc/systemd/system/zabbix-agent.service.d as well as /usr/lib/systemd/system/zabbix-agent.service.d but no dice, still running as user zabbix.
I also tried putting the systemctl scripts in /etc/systemd/system/zabbix-agent.service.d and it launches fine, but still as user zabbix..
I also added AllowRoot=1 to /etc/zabbix/zabbix_agentd.conf but still nothing..
I can't figure out why this is happening and I'm hoping someone can point me in the right direction..
UPDATE: I used the systemctl script above together with AllowRoot=1 in the conf file on Ubuntu 20 and that worked immediately? Something in CentOS maybe?
Thanks!
I checked the docs and found this one: https://www.zabbix.com/documentation..._agent_as_root
I followed that guide but still the agent is run as user zabbix instead of root. I tried several things, first off, my configuration;
Location systemctl script: /usr/lib/systemd/system/zabbix-agent.service
Contents of that script:
Code:
[Unit] Description=Zabbix Agent After=syslog.target After=network.target [Service] Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf" EnvironmentFile=-/etc/sysconfig/zabbix-agent Type=forking Restart=on-failure PIDFile=/run/zabbix/zabbix_agentd.pid KillMode=control-group ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE ExecStop=/bin/kill -SIGTERM $MAINPID RestartSec=10s [Install] WantedBy=multi-user.target
I tried adding the override.conf file both in /etc/systemd/system/zabbix-agent.service.d as well as /usr/lib/systemd/system/zabbix-agent.service.d but no dice, still running as user zabbix.
I also tried putting the systemctl scripts in /etc/systemd/system/zabbix-agent.service.d and it launches fine, but still as user zabbix..
I also added AllowRoot=1 to /etc/zabbix/zabbix_agentd.conf but still nothing..
I can't figure out why this is happening and I'm hoping someone can point me in the right direction..
UPDATE: I used the systemctl script above together with AllowRoot=1 in the conf file on Ubuntu 20 and that worked immediately? Something in CentOS maybe?
Thanks!
Comment