Learn how to install Zabbix Agent on FreeBSD 12 for Zabbix monitoring.
Install and configure Zabbix server on Debian 10 Buster.
Install 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 on FreeBSD 12
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;
Next, edit the configuration file and set the Zabbix server IP for both the passive and active checks and Zabbix agent hostname.
... 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.
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.
When templated is added and linked to your host, it should look like;
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.
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.
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
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.
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.
Well, that is just it on how to install Zabbix Agent on FreeBSD 12 for Zabbix monitoring.