Would you like to learn how to securely monitor Linux using Zabbix agent and PSK encryption? In this tutorial, we are going to show you how to install and configure the Zabbix agent software on a computer running Linux and how to use the PSK encryption feature to secure the communication between the Zabbix server and the Zabbix agent.
• Zabbix 4.2.6
Hardware List:
The following section presents the list of equipment used to create this Zabbix tutorial.
Every piece of hardware listed above can be found at Amazon website.
Zabbix Playlist:
On this page, we offer quick access to a list of videos related to Zabbix installation.
Don’t forget to subscribe to our youtube channel named FKIT.
Zabbix Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Zabbix installation.
Tutorial – Zabbix Agent Installation on Linux with PSK Encryption
First, you need to install the Zabbix agent on the Linux computer.
Use the following commands to install the required packages on a computer running Ubuntu Linux.
Download the Zabbix installation package.
Extract the Zabbix installation package, compile and install the Zabbix agent.
Find the location of the zabbix_agentd.conf file on your system.
Edit the zabbix_agentd.conf file.
Here is the original file, before our configuration.
Here is the new file with our configuration.
In our example, the Zabbix agent is configured to allow connections from the Zabbix server 192.168.15.10.
The server with the IP address 192.168.15.10 is allowed to request and receive information from the agent.
The Localhost, 127.0.0.1, is allowed to request and receive information from the agent.
Now, we need to create a file containing the PSK key to encrypt the communication.
Create a PSK key file on the Linux computer inside the Zabbix directory.
Insert a randomly generated PSK Key value inside this file.
If you don’t know how to create a randomly generated key value, use the following command:
Set the correct file permission to the file containing the PSK key.
The Zabbix installation package comes with a service startup script.
Copy the startup script using the commands below.
You can now use the following commands to start the Zabbix agent service.
Restart the Zabbix agent.
You have finished the Zabbix agent installation with PSK encryption enabled.
You can now use the Zabbix server dashboard to add this computer to the network monitoring service.
Tutorial – Zabbix Monitoring Linux using PSK Encryption
Now, we need to access the Zabbix server dashboard and add the Linux computer as a Host.
Open your browser and enter the IP address of your web server plus /zabbix.
In our example, the following URL was entered in the Browser:
• http://192.168.15.10/zabbix
On the login screen, use the default username and default password.
• Default Username: Admin
• Default Password: zabbix
After a successful login, you will be sent to the Zabbix Dashboard.
On the dashboard screen, access the Configuration menu and select the Host option.
On the top right of the screen, click on the Create host button.
On the Host configuration screen, you will have to enter the following information:
• Host Name – Enter a Hostname to identify the Linux server.
• Visible Hostname – Repeat the hostname.
• New group – Enter a name to identify a group of similar devices.
• Agent Interface – Enter the IP address of the Linux server.
Here is the original image, before our configuration.
Here is the new image with our configuration.
Next, we need to associate the host with a specific network monitor template.
By default, Zabbix comes with a large variety of monitoring templates.
Access the Templates tab on the top of the screen.
Click on the Select button and locate the template named: TEMPLATE OS Linux
Click on the Add option (1).
Next, we need to encrypt the communication between the Zabbix server and the Linux computer.
Access the Encryption tab on the top of the screen and perform the following configuration:
• Connectios to host – PSK
• Connections from host – PSK
• PSK identity – LINUX-SERVER-01
• PSK – fb6616cd582a2fa0aa161cab3423a9ca640c931b21c8c2e3b7132d6db75aadff
Click on the Add button to finish the configuration.
After a few minutes, you will be able to see the initial result on the Zabbix Dashboard.
The final result will take at least one hour.
By default, Zabbix will wait 1 hour to discover the number of interfaces available on the Linux computer.
By default, Zabbix will wait 1 hour before collect information from the network interfaces.
In order to test your configuration, access the Monitoring menu and click on the Graphs option.
On the top right of the screen, select the group named ALL.
Select your Linux computer host name.
Select the graph named: CPU UTILIZATION
You should be able to see the graphic of CPU utilization.
Congratulations! You have configured the Zabbix server to monitor a Linux computer using psk encryption.