In the previous post, we explained how to install Zabbix on a server. In this post, we will explain how to add our servers to Zabbix so it can monitor them.
For Zabbix to check the status of our servers, we need to install a Zabbix agent on each of our servers. Below, we explain how to do this and how to configure those servers on the Zabbix Server. At the end of the post, there are additional instructions for installing the agent on operating systems other than Ubuntu, CentOS, or Windows.
Install the Zabbix agent on Ubuntu 16
# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb # dpkg -i zabbix-release_3.4-1+xenial_all.deb # apt update # apt install zabbix-agent # update-rc.d zabbix-agent enable # /etc/init.d/zabbix-agent start
Install the Zabbix agent on Ubuntu 18
# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb # dpkg -i zabbix-release_3.4-1+bionic_all.deb # apt update # apt install zabbix-agent # update-rc.d zabbix-agent enable # /etc/init.d/zabbix-agent start
Install the Zabbix agent on Centos 7
# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm # yum install zabbix-agent # service zabbix-agent start
Configure the Zabbix agent on Linux
To configure the Zabbix agent, we will edit the following file vi /etc/zabbix/zabbix_agentd.conf and add/modify:
Server=10.20.10.XX #Private IP address of the Zabbix server
Hostname=Zabbix server
Notes: The Hostname must match the Hostname of our Zabbix server, and you must allow the agent port through the firewall (10050 TCP by default).
Install the Zabbix agent on Windows
To install the Zabbix agent on Windows, we will go to http://www.suiviperf.com/zabbix/index.php and download the “zabbix_agent-3.2.6_x64” installer. We will run the installer and continue until we reach the following screen:
On that screen, we will enter the private IP address of our Zabbix server.
Now we will go to “Panel de control > Sistema y Seguridad” and, in the Firewall section, click “Permitir una aplicación a través de Firewall de Windows”. In the window that opens, we will click “Permitir otra aplicación” and locate our Zabbix agent by clicking the examinar button:
We will click the “Agregar” button and, on the next screen, enable Zabbix Agent on “Publicas” and “Privadas” networks and click the “Aceptar” button.
Add a Server to Zabbix Manually
To add a server to Zabbix, we will go to “Configuración > Equipos” and click the “Crear equipo” button at the top right. The following screens will appear:
We will fill in the requested information and enter the private IP address of our Cloud Server in “Interfaz del agente”. On the next screen, we will configure the “Linux OS” or “Windows OS” template
Other Zabbix agents
Ubuntu 14:
# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+trusty_all.deb # dpkg -i zabbix-release_3.4-1+trusty_all.deb # apt-get update # apt-get install zabbix-agent # update-rc.d zabbix-agent enable # /etc/init.d/zabbix-agent start
Debian 8:
# wget http://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+jessie_all.deb # dpkg -i zabbix-release_3.4-1+jessie_all.deb # apt-get install zabbix-agent # apt-get update # apt-get install zabbix-agent # update-rc.d zabbix-agent enable # /etc/init.d/zabbix-agent start
Debian 9:
# wget http://repo.zabbix.com/zabbix/3.4/debian/pool/main/z/zabbix-release/zabbix-release_3.4-1+stretch_all.deb # dpkg -i zabbix-release_3.4-1+stretch_all.deb # apt-get update # apt-get install zabbix-agent # update-rc.d zabbix-agent enable # /etc/init.d/zabbix-agent start
Windows: install the agent manually
If we have problems with the Windows installer, we can download the agent from the Zabbix website. You can find it under “Zabbix pre-compiled agents” and “Windows”. We will extract the downloaded file to C:\Zabbix\. Now we will edit the configuration file located at C:\Zabbix\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf and make the same changes as in “Configure the Zabbix agent on Linux”. We can now manage our agent from “símbolos de sistema” with these commands:
-Install Service:
C:\Zabbix\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --config C:\Zabbix\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf --install
-Start Service:
C:\Zabbix\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --start
-Stop Service:
C:\Zabbix\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --stop
-Delete Service:
C:\Zabbix\zabbix_agents_2.4.4.win\bin\win32\zabbix_agentd.exe --uninstall
The steps to open the Windows firewall are the same as in “Install the Zabbix agent on Windows”