The Eye of Sauron
Add Machines to Monitor
Now that the infrastructure is all deployed and configured, you can put it to real use by setting up a client for monitoring. The first machine to monitor will be the one on which you’ve set up the Zabbix server.
Since you’ve already added the Zabbix repository in this Ubuntu 18.04 installation, you will simply pull in the Zabbix agent:
$ sudo apt install zabbix-agent
Once it’s installed, start the agent, and set it up to start automatically at boot:
$ sudo systemctl start zabbix-agent $ sudo systemctl enable zabbix-agent
All network devices that Zabbix monitors are known as hosts. The Zabbix server host that you’ve just installed the agent on is disabled by default; you’ll need to enable it manually before it can receive data from the agent. To do this head to Configuration | Hosts. The page will only list a single host named Zabbix server. Select the entry before clicking the Enable button to bring the monitoring server online.
Adding the local Zabbix server as a host is very simple and straightforward since there isn’t any real configuration installed. The agent is installed locally, so it requires no configuration, and there’s no need to take steps to send the data over an encrypted channel.
Zabbix Agent on a Remote Host
The process for monitoring a remote host is a little more involved. Begin the process by first adding the official Zabbix repository to the remote host you wish to monitor. Follow the instructions in the Zabbix manual to grab the relevant repository packages for either the RPM or DEB based distribution. Once you’ve installed the Zabbix repository, use the package management tools to pull in the zabbix-agent package.
After installing the packages, open the Zabbix agent’s configuration file:
$ sudo nano /etc/zabbix/zabbix_agentd.conf
Scroll the file to find lines mentioned below and uncomment them to point to your Zabbix server and give it a unique name:
Server=192.168.0.50 Hostname=FedoraWorkstation
Make sure you modify the entries as per your environment. After making the modification, start the agent and enable it just as you did earlier on the Zabbix server. Remember that if the remote host is behind a firewall, you’ll also need to open the 10050/TCP port for the agent to talk to the Zabbix server. On Ubuntu you can do this with:
$ sudo ufw allow 10050/tcp
In a production environment, it’s advisable to use certificates or pre-shared keys to encrypt the connection between the clients and the Zabbix server. Again, the Encryption chapter in the official Zabbix documentation covers the topic in detail. For now, I’ll just add the remote hosts without any encryption.
Head back to the Zabbix server and fire up the Zabbix front end. Login and navigate to Configuration | Hosts and click on the Create Host button in the top right corner. Here, you’ll need to enter the hostname of the monitored zabbix-agent machine. Make sure this is the same as the one you’ve mentioned in the agent configuration file earlier. Next, you’ll need to select the group in which you want to add the system. Since we are running the Zabbix agent to monitor a basic Linux server, we can choose the Linux server group. Enter the IP address of the remote host on which the Zabbix agent is running and also optionally enter a brief description of the host.
Now, switch to the new host interface's Template tab to add a template for the remote host. In this case, I’ll choose the Template OS Linux (Figure 5), which best describes our remote host. Click on Add to assign the template to the host. Once done, you can click the Add button to add the new host to the Zabbix server.
After a few minutes, the ZBX button under availability will turn green (Figure 6). This signifies that the host is available using the Zabbix agent and actively sending events from the host computer to the Zabbix server.
That’s it, you can now head to the monitoring tab to view all kinds of details about the server (Figure 7). I’ve just scratched the surface of the Zabbix monitoring app, and there’s a lot more you can do with it. For instance, manually adding agents isn’t feasible in a network with dozens of hosts. To aid mass deployment, here’s how you can automatically register Zabbix clients. Also make sure you read through the official Zabbix documentation to fully appreciate Zabbix's capabilities.
« Previous 1 2
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.