{"id":3906,"date":"2019-08-10T11:49:52","date_gmt":"2019-08-10T08:49:52","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3906"},"modified":"2024-03-12T07:38:34","modified_gmt":"2024-03-12T04:38:34","slug":"install-zabbix-agent-on-freebsd-12","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-zabbix-agent-on-freebsd-12\/","title":{"rendered":"Install Zabbix Agent on FreeBSD 12"},"content":{"rendered":"\n<p>Learn how to install Zabbix Agent on FreeBSD 12 for Zabbix monitoring.<\/p>\n\n\n\n<p>Install and configure Zabbix server on Debian 10 Buster.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-zabbix-4-x-from-sources-on-debian-10-buster\/\" target=\"_blank\">Install Zabbix 4.x from Sources on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-zabbix-server-on-debian-10-buster\/\" target=\"_blank\">Install Zabbix Server from APT on Debian 10 Buster<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Zabbix Agent on FreeBSD 12<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run system update<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg update\npkg upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Zabbix Agent<\/h3>\n\n\n\n<p>Zabbix is available on the default FreeBSD 12 repositories. To check whether the latest stable version of Zabbix agent is available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg search zabbix | grep agent<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nzabbix22-agent-2.2.23_1        Enterprise-class open source distributed monitoring (agent) LTS\nzabbix22-libzbxpgsql-1.1.0_2   Zabbix agent module for comprehensive monitoring of PostgreSQL servers\nzabbix3-agent-3.0.28_1         Enterprise-class open source distributed monitoring (agent) LTS\nzabbix3-libzbxpgsql-1.1.0_2    Zabbix agent module for comprehensive monitoring of PostgreSQL servers\nzabbix4-agent-4.0.10           Enterprise-class open source distributed monitoring (agent) LTS\nzabbix42-agent-4.2.4           Enterprise-class open source distributed monitoring (agent)\n<\/code><\/pre>\n\n\n\n<p>As you can see, Zabbix 4.2 agent which is the current stable release is available. Hence, install it by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>pkg install zabbix42-agent-4.2.4<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Zabbix Agent<\/h3>\n\n\n\n<p>Once the installation is done, proceed to configure Zabbix agent in order for it to communicate with Zabbix server for monitoring.<\/p>\n\n\n\n<p>FreeBSD installs a sample Zabbix Agent configuration file as <strong>\/usr\/local\/etc\/zabbix42\/zabbix_agentd.conf.sample<\/strong>.<\/p>\n\n\n\n<p>Copy the sample configuration and rename it in place as;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>cp \/usr\/local\/etc\/zabbix42\/zabbix_agentd.conf{.sample,}<\/code><\/pre>\n\n\n\n<p>Next, edit the configuration file and set the Zabbix server IP for both the passive and active checks and Zabbix agent hostname.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/usr\/local\/etc\/zabbix42\/zabbix_agentd.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>...\nServer=192.168.43.62             ## IP for Zabbix Server\n...\nServerActive=192.168.43.62        \n...\nHostname=freebsd12.example.com<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Running Zabbix Agent<\/h3>\n\n\n\n<p>After the configuration, enable and start Zabbix agent to run on system boot.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo 'zabbix_agentd_enable=\"yes\"' &gt;&gt; \/etc\/rc.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service zabbix_agentd start<\/code><\/pre>\n\n\n\n<p>To check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>service zabbix_agentd status<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>zabbix_agentd is running as pid 2996.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Add FreeBSD 12 Host to Zabbix Server<\/h3>\n\n\n\n<p>The Zabbix agent is installed and running on FreeBSD 12 host server.  The step is to add it to Zabbix server for monitoring.<\/p>\n\n\n\n<p>Login to Zabbix server and navigate to <strong>Configuration &gt; Hosts &gt; Create host<\/strong> to add your host.<\/p>\n\n\n\n<p>Configure the Host details like the hostname, visible (if you want), Groups (Linux Servers for example), IP address. Other details are optional.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-agent-hosts-details.png\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"634\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/add-freebsd12-host.png\" alt=\"Install Zabbix Agent on FreeBSD 12\" class=\"wp-image-3907\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/add-freebsd12-host.png 897w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/add-freebsd12-host-768x543.png 768w\" sizes=\"(max-width: 897px) 100vw, 897px\" \/><\/a><\/figure><\/div>\n\n\n<p>Next, you need to configure host template. Click on <strong>Templates &gt; Link new templates<\/strong>. Click select button and choose <strong>Template OS FreeBSD<\/strong>. Once selected, click the <strong>add<\/strong> button to add the template.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/add-templates.png\"><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"331\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd12-host-template.png\" alt=\"Zabbix FreeBSD OS template\" class=\"wp-image-3908\" title=\"\"><\/a><\/figure><\/div>\n\n\n<p>When templated is added and linked to your host, it should look like;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/templates-added.png\"><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"333\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd12-host-template-added.png\" alt=\"Zabbix FreeBSD 12 OS template\" class=\"wp-image-3909\" title=\"\"><\/a><\/figure><\/div>\n\n\n<p>Next, click <strong>Add<\/strong> to add the host to Zabbix server. The list of hosts is then displayed. You can learn more about Zabbix templates on <a rel=\"noreferrer noopener\" href=\"https:\/\/www.zabbix.com\/documentation\/4.2\/manual\/config\/templates\" target=\"_blank\">Zabbix Documentation page<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-host-added.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1357\" height=\"562\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-12-host.png\" alt=\"Add FreeBSD 12 Zabbix Host\" class=\"wp-image-3910\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-12-host.png 1357w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-12-host-768x318.png 768w\" sizes=\"(max-width: 1357px) 100vw, 1357px\" \/><\/a><\/figure><\/div>\n\n\n<p>FreeBSD 12 is now added to Zabbix server for monitoring. To check for the data collected from the host, click <strong>Monitoring &gt; Latest data<\/strong>. Select the host and click <strong>Apply<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/host-data.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1341\" height=\"651\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd12-zabbix-data.png\" alt=\"FreeBSD OS Zabbix data\" class=\"wp-image-3911\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd12-zabbix-data.png 1341w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd12-zabbix-data-768x373.png 768w\" sizes=\"(max-width: 1341px) 100vw, 1341px\" \/><\/a><\/figure><\/div>\n\n\n<p>You can also check the data graphs. Click <strong>Monitoring &gt; Graphs &gt; Group <\/strong>(Linux Servers)<strong> &gt; Graph <\/strong>(say, CPU Load)<strong> &gt; Host <\/strong>(freebsd12.example.com) &gt; <strong>View as<\/strong> (Graph). Select the time range, <strong>last 1 hour<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-graphs.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1345\" height=\"634\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-data-graphs.png\" alt=\"FreeBSD zabbix CPU Load\" class=\"wp-image-3912\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-data-graphs.png 1345w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/freebsd-data-graphs-768x362.png 768w\" sizes=\"(max-width: 1345px) 100vw, 1345px\" \/><\/a><\/figure><\/div>\n\n\n<p>You can also add the graphs to Zabbix Screens. Click on <strong>Screens<\/strong> &gt; <strong>Edit Screens<\/strong>. Click the plus (<strong>+<\/strong>) on wherever you want to add your graph and click <strong>change<\/strong>. Screen configuration wizard opens up. Choose the graph to add to your screen, for example, CPU Load.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/screen-setting.png\"><img loading=\"lazy\" decoding=\"async\" width=\"614\" height=\"329\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/add-freebsd12-graph.png\" alt=\"Add FreeBSD Zabbix Graph\" class=\"wp-image-3913\" title=\"\"><\/a><\/figure><\/div>\n\n\n<p>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.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/screens.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1326\" height=\"646\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-screens.png\" alt=\"FreeBSD 12 Zabbix Screen\" class=\"wp-image-3914\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-screens.png 1326w, https:\/\/kifarunix.com\/wp-content\/uploads\/2019\/08\/zabbix-screens-768x374.png 768w\" sizes=\"(max-width: 1326px) 100vw, 1326px\" \/><\/a><\/figure><\/div>\n\n\n<p>Related Tutorials;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-zabbix-agent-on-debian-10-buster\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Zabbix Agent on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-zabbix-agent-on-centos-7-for-zabbix-monitoring\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Zabbix Agent on CentOS 7 for Zabbix Monitoring<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-nagios-plugins-and-nrpe-agents-on-centos-7-rhel-7-fedora-29\/\" target=\"_blank\">How to Install Nagios Plugins and NRPE agents on CentOS 7\/RHEL 7\/Fedora 29<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/how-to-install-nagios-plugins-from-source-rhel-centos-oracle-linux\/\" target=\"_blank\">How to Install Nagios Plugins From Source RHEL\/CentOS\/Oracle Linux<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-elastic-stack-7-on-fedora-30-fedora-29-centos-7\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Elastic Stack 7 on Fedora 30\/Fedora 29\/CentOS 7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<\/p>\n","protected":false},"author":1,"featured_media":12698,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,261],"tags":[1063,278,74,1052,1053,1062],"class_list":["post-3906","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-zabbix","tag-freebsd","tag-freebsd-12","tag-monitoring","tag-zabbix","tag-zabbix-4-2","tag-zabbix-agent","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3906"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3906"}],"version-history":[{"count":4,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3906\/revisions"}],"predecessor-version":[{"id":21183,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3906\/revisions\/21183"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12698"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}