2019-06-12

Zabbix agent installation

There are many good tutorials how to install Zabbix-agent to Ubuntu machine and how to interconnect it with Zabbix-server. I am adding some notes since I had troubles.

If you do
sudo apt-get install zabbix-agent
You can get error
zabbix-agent : Depends: libcurl4 (>= 7.16.2) but it is not installable
How to fix it?
sudo nano /etc/apt/sources.list
 and append to end following paragraph
###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic main universe 
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main universe 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main universe 
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main universe 
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-security main universe 
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main universe 
After that just 
sudo apt-get update
It should be ready for install now, so do again
sudo apt-get install zabbix-agent
When it's done, you can configure zabbix agent by adding server address and match hostname name in WebUI and your agent machine. Don't forget to use encryption!
sudo nano /etc/zabbix/zabbix_agentd.conf
You need to restart the server after configuration
sudo systemctl restart zabbix-agent
If troubles continue check log file
cat /var/log/zabbix-agent/zabbix_agentd.log
Following error I received mostly when configuration was wrong. It helps to comment new modification and try to start the service again.
Job for zabbix-agent.service failed because the control process exited with error code. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details.
invoke-rc.d: initscript zabbix-agent, action "start" failed.
OK, these are my notes if I need to install it and configure ever again.

If it doesn't help, just install older version
sudo apt-get install zabbix-agent=1:3.0.12+dfsg-1