Select Page

Installing the Zabbix Agent on Ubuntu 18.04LTS

Installing the Zabbix Agent on Ubuntu 18.04LTS

About the Zabbix agent

The Zabbix agent extends the functionality of Zabbix server checks by giving a deeper insight into server metrics.  Whilst you can monitor an Ubuntu  server with a simple ping or SNMP, installing  the Zabbix agent on Ubuntu 18.04LTS gives much more information.  The agent also enables running scripts for custom checks.

We are installing the Zabbix agent on Ubuntu, but the Zabbix agent runs on a number of different Platforms.  Windows, IBM AIX, FreeBSD, OSX, HPUX are available pre-compiled.  Check out the list of pre-compiled Zabbix agents here.  Sources are also available to compile on other systems.

Active Versus Passive Checking

The Zabbix agent has two modes of operation, active and passive.  Checks are performed at specific intervals which can be defined on the Zabbix Server per item.

Active Checks (trapping)

  • The Zabbix agent requests a list of checks defined on the Zabbix server at agent startup.
  • The agent then sends the results of the checks periodically.

Passive Checks (polling)

  • Zabbix server requests a check result from the Zabbix agent
  • Agent processes the check request and returns the value to the Zabbix server.

Installing the Zabbix Agent

The first thing we need to do is download version 3.4 of the Zabbix repository.

> wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb

image

Next we want to add the Zabbix repository to our Ubuntu server.

> sudo dpkg -i zabbix-release_3.4-1+bionic_all.deb

image
With that done we can now proceed and install the Zabbix agent.

> sudo apt install zabbix-agent

image

Configuring Zabbix Agent

There are lots of different configuration options in the Zabbix agent config file.  We are only interested in three to start with.  The Zabbix Agent must know which IP address the Zabbix server is operating on.  This has two advantages.

  • For passive checks the Zabbix agent needs to know the authorised server IPs so that it doesn’t talk to unauthorised servers.
  • For active checks the Zabbix agent needs to know where to get the list of checks from.

We now need to edit the configuration file.

Using your favourite editor bring up the copied file so :

> sudo nano  /etc/zabbix/zabbix_agentd.conf

or my favourite editor

> sudo vi  /etc/zabbix/zabbix_agentd.conf

If you haven’t used vi before you may be better sticking with Nano.

Search for the following section (in my config line 95) to define the passive Zabbix server IP.

image

Change the server IP address to your Zabbix server IP address.

Now search for the following section (in my config line 136) to define the active Zabbix server IP (note usually same as passive).

image

Change the server IP address to your Zabbix server IP address.

To use active server checks successfully, you must define the host name used on the Zabbix server (not the FQDN).  Note this is case sensitive.

Search for the following section (in my config line 147)

image

Change the Hostname to be an exact match of the name you have given your host on your Zabbix server.

Save your file and exit.

Restart your Zabbix agent with the configuration changes.

> sudo service zabbix-agent restart

Installation is complete.

Leave a reply