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
-
There's a New Open Source Terminal App in Town
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.