0

We have some legacy servers which runs on ubuntu 14.04 and we need to execute zabbix-agentd as root for getting some performance information.

zabbix-agentd version = 5.0

I've followed this guide but it doesn't work because of the step systemctl daemon-reload cannot be executed on ubuntu 14.04

I have already set up those directives:

  • User=root
  • AllowRoot=1

But the user zabbix is still the owner of the process.

Juan-Kabbali
  • 111
  • 7

2 Answers2

0

Finally i could figure it out and it could be helpful for people with the same problem.

  • Edit the file or create it if doesn't exist /etc/default/zabbix-agent and add this line:
ZABBIX_AGENT_USER=root
  • After that, go to /lib/systemd/system/zabbix-agent.service and replace zabbix for root or the username that you need the agent service run.
[Service]
User=root
Group=root
  • Restart the agent service zabbix-agent restart

  • Check the process owner

> ps ux | grep zabbix_agentd
root     29931  0.0  0.0  92612  1316 usr/sbin/zabbix_agentd
root     29932  0.0  0.0  92612  1360 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
root     29933  0.0  0.1  97044  4032 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
root     29934  0.0  0.1  97044  4036 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
root     29935  0.0  0.1  97044  4036 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
root     29936  0.0  0.1  96900  2668 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Juan-Kabbali
  • 111
  • 7
0

Reconsider your requirements.
You want to keep control of your root environment.
First add a crontab that takes care of the performance measurements. Next you can choose between using zabbix_sender from your root job (possible security leak when you don't trust zabbix_sender) or write the results in a special new directory (maybe /etc/zabbix/cronresults) and make zabbix can read it. Next make a userdata call for fetching information from the cron results.

Addtional advantage: When you want to monitor Apache (something like "zapache"), you can get all data with one curl command and have the userdata get the different fields for different items with different calls using the cronresults as a cache.

Walter A
  • 151
  • 4