Install Zabbix Agent on FreeBSD 12

|
Last Updated:
|
|

Learn how to install Zabbix Agent on FreeBSD 12 for Zabbix monitoring.

Install and configure Zabbix server on Debian 10 Buster.

Install Zabbix 4.x from Sources on Debian 10 Buster

Install Zabbix Server from APT on Debian 10 Buster

Installing Zabbix Agent on FreeBSD 12

In order to monitor Linux hosts with Zabbix, you need to install Zabbix agents on them. In this guide, we are use FreeBSD 12 as our host for monitoring.

Run system update

pkg update
pkg upgrade

Install Zabbix Agent

Zabbix is available on the default FreeBSD 12 repositories. To check whether the latest stable version of Zabbix agent is available.

pkg search zabbix | grep agent

zabbix22-agent-2.2.23_1        Enterprise-class open source distributed monitoring (agent) LTS
zabbix22-libzbxpgsql-1.1.0_2   Zabbix agent module for comprehensive monitoring of PostgreSQL servers
zabbix3-agent-3.0.28_1         Enterprise-class open source distributed monitoring (agent) LTS
zabbix3-libzbxpgsql-1.1.0_2    Zabbix agent module for comprehensive monitoring of PostgreSQL servers
zabbix4-agent-4.0.10           Enterprise-class open source distributed monitoring (agent) LTS
zabbix42-agent-4.2.4           Enterprise-class open source distributed monitoring (agent)

As you can see, Zabbix 4.2 agent which is the current stable release is available. Hence, install it by running the command below;

pkg install zabbix42-agent-4.2.4

Configure Zabbix Agent

Once the installation is done, proceed to configure Zabbix agent in order for it to communicate with Zabbix server for monitoring.

FreeBSD installs a sample Zabbix Agent configuration file as /usr/local/etc/zabbix42/zabbix_agentd.conf.sample.

Copy the sample configuration and rename it in place as;

cp /usr/local/etc/zabbix42/zabbix_agentd.conf{.sample,}

Next, edit the configuration file and set the Zabbix server IP for both the passive and active checks and Zabbix agent hostname.

vim /usr/local/etc/zabbix42/zabbix_agentd.conf
...
Server=192.168.43.62             ## IP for Zabbix Server
...
ServerActive=192.168.43.62        
...
Hostname=freebsd12.example.com

Running Zabbix Agent

After the configuration, enable and start Zabbix agent to run on system boot.

echo 'zabbix_agentd_enable="yes"' >> /etc/rc.conf
service zabbix_agentd start

To check the status;

service zabbix_agentd status
zabbix_agentd is running as pid 2996.

Add FreeBSD 12 Host to Zabbix Server

The Zabbix agent is installed and running on FreeBSD 12 host server. The step is to add it to Zabbix server for monitoring.

Login to Zabbix server and navigate to Configuration > Hosts > Create host to add your host.

Configure the Host details like the hostname, visible (if you want), Groups (Linux Servers for example), IP address. Other details are optional.

Install Zabbix Agent on FreeBSD 12

Next, you need to configure host template. Click on Templates > Link new templates. Click select button and choose Template OS FreeBSD. Once selected, click the add button to add the template.

Zabbix FreeBSD OS template

When templated is added and linked to your host, it should look like;

Zabbix FreeBSD 12 OS template

Next, click Add to add the host to Zabbix server. The list of hosts is then displayed. You can learn more about Zabbix templates on Zabbix Documentation page.

Add FreeBSD 12 Zabbix Host

FreeBSD 12 is now added to Zabbix server for monitoring. To check for the data collected from the host, click Monitoring > Latest data. Select the host and click Apply.

FreeBSD OS Zabbix data

You can also check the data graphs. Click Monitoring > Graphs > Group (Linux Servers) > Graph (say, CPU Load) > Host (freebsd12.example.com) > View as (Graph). Select the time range, last 1 hour

FreeBSD zabbix CPU Load

You can also add the graphs to Zabbix Screens. Click on Screens > Edit Screens. Click the plus (+) on wherever you want to add your graph and click change. Screen configuration wizard opens up. Choose the graph to add to your screen, for example, CPU Load.

Add FreeBSD Zabbix Graph

You can leave other settings as default and click Add to create the graph. You can add as many resources to your screen as possible.

FreeBSD 12 Zabbix Screen

Related Tutorials;

Install Zabbix Agent on Debian 10 Buster

Install Zabbix Agent on CentOS 7 for Zabbix Monitoring

How to Install Nagios Plugins and NRPE agents on CentOS 7/RHEL 7/Fedora 29

How to Install Nagios Plugins From Source RHEL/CentOS/Oracle Linux

Install Elastic Stack 7 on Fedora 30/Fedora 29/CentOS 7

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

1 thought on “Install Zabbix Agent on FreeBSD 12”

  1. Thanks for this information. I found it very helpful installing the Zabbix agent on my my XigmasNAS server (FreeBSD v.11). My Zabbix server runs the prebuilt VHD appliance on Win Server 2012R2.

    Reply

Leave a Comment