Install Zabbix Agent on a VM Behind a Firewall

Video Lecture

Install Zabbix Agent on a VM Behind a Firewall Install Zabbix Agent on a VM Behind a Firewall Install Zabbix Agent on a VM Behind a Firewall

Description

Zabbix agent can also be installed in VMs hosted on your local PC.

In this lecture I am using Oracle Virtual Box on Windows 10 with an Ubuntu 20.04 VM. I also provide the Centos 7 commands below.

Note

An important setting for VMs regards how they can be found on the network. In order for Zabbix-Server to communicate with it, it will need an IP address on your local network. In my setup, I configure the VMs network adapter as a bridged adapter and my routers DHCP auto assigns it an IP address.

This host is also behind a firewall so I will need to set up another port forwarding rule.

Since I have already set up a rule for the external IP, port 10050 and 10052, I will need to use another port. I use the external IP, and port 10053. This will then forward to the internal host with the agent running and listening on the default port of 10050.

Ubuntu 20.04

The detailed download instructions are at https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/debian_ubuntu

Install Repositories

1
2
3
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
dpkg -i zabbix-release_5.0-1+focal_all.deb
apt update

Install Zabbix Agent service

1
sudo apt install zabbix-agent

then configure it by editing parameters for Server, ServerActive and Hostname and save.

1
sudo nano /etc/zabbix/zabbix_agentd.conf

Then start it,

1
2
service zabbix-agent start
service zabbix-agent status

Then go to Zabbix-Server and create a new host.

Centos 7

The detailed download instructions are at https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/rhel_centos

The commands in this video are,

1
2
3
sudo rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
sudo yum clean all
sudo yum install zabbix-agent

then configure it,

1
sudo nano /etc/zabbix/zabbix_agentd.conf

Edit parameters for Server, ServerActive and Hostname and save.

Then,

1
2
sudo systemctl start zabbix-agent.service
sudo systemctl status zabbix-agent.service

Then go to Zabbix-Server and create a new host.

Centos 7 also has it's own internal firewall that will also need to be configured.

I need to allow TCP connections to port 10050

1
2
3
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload
firewall-cmd --list-ports