Jump to content

How to Set Up a Raspberry Pi Network Monitor?


Linux Hint

Recommended Posts

Zabbix is an open-source monitoring tool in which you can monitor your servers, virtual machines, networks, cloud services, and many more. It is a very useful tool for small, medium, and large IT organizations.

You can install the Zabbix on the Raspberry Pi and monitor the network of other computers/servers in your home network using it.

In this article, I am going to show you how to set up Zabbix on your Raspberry Pi to monitor the network of other computers/servers in your home network.

Things You Will Need

To follow this article, you need a Raspberry Pi single-board computer with Zabbix 5 installed on it.

If you need any assistance on installing Zabbix 5 on your Raspberry Pi single-board computer, read my article on How to Install Zabbix 5 on Raspberry Pi 4.

I have installed Zabbix 5 on my Raspberry Pi (running the Raspberry Pi OS). The IP address of my Raspberry Pi is 192.168.0.106. So, I will be accessing the Zabbix 5 web app using the URL http://192.168.0.106/zabbix. The IP address of your Raspberry Pi will be different. So make sure to replace it with yours from now on.

What is Zabbix Agent?

Zabbix has 2 components: 1) Zabbix Server and 2) Zabbix Agent.

If you want to monitor your computer/server with Zabbix, you must have the Zabbix Agent installed and running on your computer/server. It will communicate and send necessary data to the Zabbix Server (running on your Raspberry Pi).

Installing Zabbix Agent on Ubuntu/Debian/Raspberry Pi OS

Zabbix Agent is available in the official package repository of Ubuntu/Debian/Raspberry Pi OS. So, it is easy to install.

First, update the APT package repository cache with the following command:

$ sudo apt update

image44-1.png
You can install the Zabbix Agent with the following command:

$ sudo apt install zabbix-agent -y

image46-1.png
Zabbix Agent should be installed.

Open the Zabbix Agent configuration file /etc/zabbix/zabbix_agentd.conf with the following command:

$ sudo nano /etc/zabbix/zabbix_agentd.conf

image48-1.png
Change the Server variable to the IP address of your Zabbix Server (the IP address of your Raspberry Pi).

image47-1.png
Also, make sure that the Hostname variable is set to the hostname of your computer/server. If you don’t know the hostname of your computer/server, you can run the hostname command and find it out.

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the /etc/zabbix/zabbix_agentd.conf file.

image52-1.png
For the changes to take effect, restart the zabbix-agent service with the following command:

$ sudo systemctl restart zabbix-agent

image51-1.png
The zabbix-agent should be running, as you can see in the screenshot below.

$ sudo systemctl status zabbix-agent

image57-1.png

Installing Zabbix Agent on CentOS/RHEL 8

To install Zabbix Agent on CentOS/RHEL 8, you must add the Zabbix package repository to your CentOS/RHEL 8 computer/server.

To add the Zabbix package repository to your CentOS/RHEL 8, run the following command:

$ sudo rpm -Uvh https://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/zabbix-release-5.2-1.el8.noarch.rpm

image55-1.png
The Zabbix Package repository should be added.

image62.png
Update the DNF package repository cache with the following command:

$ sudo dnf makecache

image58.png
To install Zabbix Agent, run the following command:

$ sudo dnf install zabbix-agent

image60.png
To confirm the installation, press Y, and then press <Enter>.

image63.png
To accept the GPG key, press Y, and then press <Enter>.

image65.png
Zabbix Agent should be installed.

Open the Zabbix Agent configuration file /etc/zabbix/zabbix_agentd.conf with the following command:

$ sudo nano /etc/zabbix/zabbix_agentd.conf

image68.png
Change the Server variable to the IP address of your Zabbix Server (the IP address of your Raspberry Pi).

image70.png
Also, make sure that the Hostname variable is set to the hostname of your computer/server. If you don’t know the hostname of your computer/server, you can run the hostname command and find it out.

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the /etc/zabbix/zabbix_agentd.conf file.

image71.png
Start the zabbix-agent systemd service with the following command:

$ sudo systemctl start zabbix-agent.service

image72.png
The zabbix-agent service should be running, as you can see in the screenshot below.

$ sudo systemctl status zabbix-agent.service

image73.png
Add the zabbix-agent service to the system startup so that it starts automatically on system boot:

$ sudo systemctl enable zabbix-agent.service

image29-2.png
Run the following command to configure the firewall to allow access to the Zabbix Agent port 10050:

$ sudo firewall-cmd --add-service=zabbix-agent --permanent

image30-2.png
For the firewall changes to take effect, run the following command:

$ sudo firewall-cmd --reload

image32-2.png

Installing Zabbix Agent on Windows 10

On Windows 10, you have to download the Zabbix Agent software from the official website of Zabbix.

First, visit the official download page of Zabbix Agent from a web browser.

Once the page loads, select the Windows MSI package as marked in the screenshot below.

image34-2.png
Then, scroll down a little bit, and click on the first DOWNLOAD link as marked in the screenshot below.

image36-2.png
Zabbix Agent installer should be downloaded. Run the installer.

image38-2.png
Click on Next.

image40-2.png
Check the I accept the terms in the License Agreement checkbox and click on Next.

image41-1.png
Make sure that the hostname is correct. Type in the Zabbix server IP address and check the Add agent location to the PATH checkbox.

Once you’re done, click on Next.

image42-1.png
Click on Next.

image43-1.png
Click on Install.

image13-3.png
Click on Yes.

image15-3.png

Zabbix Agent should be installed. Click on Finish.

image16-3.png

Adding a Linux Host to Zabbix

Once the Zabbix Agent is installed on your computer/server, you can add it to the Zabbix Server (running on your Raspberry Pi).

First, log in to the Zabbix web app and go to Configuration > Hosts. Then, click on Create host, as marked in the screenshot below.

image17-3.png
Type in the hostname of the computer/server you’re trying to add in the Host name field. Then, click on Select, as marked in the screenshot below.

image18-3.png
Check the Linux servers checkbox, and click on Select.

image19-3.png
Click on Add, as marked in the screenshot below.

image20-3.png
Click on Agent.

image21-3.png
Type in the IP address of the computer/server you’re trying to add to Zabbix.

image22-3.png
Once you’re done, click on Add.

image23-2.png
The Linux host should be added to Zabbix, as you can see in the screenshot below.

image1-13.png

Adding a Windows 10 Host to Zabbix

In this section, I am going to show you how to add a Windows 10 host to Zabbix. So, let’s get started.

Just to keep things organized, let’s create a new host group for Windows hosts.

To create a host group, go to Configuration > Host groups from the Zabbix web app. Then, click on the Create host group.

image2-13.png
Type in Windows Hosts, and click on Add.

image3-12.png
A new host group, Windows Hosts, should be added.

image4-13.png
To add your Windows 10 host to Zabbix, go to Configuration > Hosts. Then, click on Create host.

image5-11.png
Type in the hostname or computer name of your Windows 10 host in the Host name field. Then, click on Select, as marked in the screenshot below.

image6-9.png

Check the newly created group Windows Hosts, and click on Select.

image7-7.png
Click on Add, as marked in the screenshot below.

image8-5.png
Click on Agent.

image9-5.png
Type in the IP address of your Windows 10 host, and click on Add.

image10-5.png
Your Windows 10 host should be added to Zabbix.

image50-1.png

Monitoring Network Usage of Linux Hosts

In this section, I am going to show you how to monitor the network usage of Linux Hosts using Zabbix 5. So, let’s get started.

First, navigate to Configuration > Hosts and click on the Linux Host that you want to monitor network usage.

image53-1.png

Click on Templates.

image54-1.png
Click on Select, as marked in the screenshot below.

image56-1.png
Click on Select, as marked in the screenshot below.

image59.png
Click on Templates, as marked in the screenshot below.

image61.png
Check Linux network interfaces by Zabbix agent checkbox, and click on Select.

image64.png
Click on Update.

image66.png
The Linux host should be updated.

image67.png
After a while, the ZBX availability option should be highlighted, as you can see in the screenshot below.

image69.png
When the ZBX option is highlighted, navigate to Monitoring > Hosts and click on the Dashboards link of your Linux host, as you can see in the screenshot below.

image49-1.png
As you can see, the network usage graph is being displayed.

image26-2.png
You can change the timeline of the graph as well. As you can see, I have changed the graph time to the Last 15 minutes. The graph is being displayed nicely.

image27-1.png
This is how you monitor the network usage of a Linux host using Zabbix on your Raspberry Pi.

Monitoring Network Usage of Windows Hosts

In this section, I am going to show you how to monitor the network usage of Windows 10 Hosts using Zabbix 5. So, let’s get started.

First, navigate to Configuration > Hosts and click on the Windows 10 Host that you want to monitor network usage.

image28-1.png
Click on Templates.

Click on Select, as marked in the screenshot below.

image31-2.png
Click on Select, as marked in the screenshot below.

image33-2.png
Click on Templates, as marked in the screenshot below.

image35-2.png
Check Windows network by Zabbix agent, and click on Select.

image37-2.png
Click on Update.

image39-2.png
The Windows 10 host should be updated.

image24-2.png
After a while, the ZBX availability option should be highlighted, as you can see in the screenshot below.

image25-2.png
When the ZBX option is highlighted, navigate to Monitoring > Hosts and click on the Dashboards link of your Windows 10 host, as you can see in the screenshot below.

image11-5.png
As you can see, the network usage graph is being displayed.

image12-3.png
You can change the timeline of the graph as well. As you can see, I have changed the graph time to the Last 15 minutes. The graph is being displayed nicely.

image14-3.png
This is how you monitor the network usage of a Windows 10 host using Zabbix on your Raspberry Pi.

Conclusion

In this article, I have shown you how to create a Raspberry Pi network monitor using Zabbix 5. I have shown you how to use Zabbix to monitor the network usage of Linux and Windows hosts on your Raspberry Pi.

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...