This FreeBSD howto was written when I was asked to find a solution for monitoring applications, networks, and servers. I decided on Zabbix, it allows to monitor multiple servers at a time, using a Zabbix server that comes with a web interface and Zabbix agents installed on the systems to be monitored. The Zabbix agents deliver the desired data to the Zabbix server. This tutorial shows how you can install Zabbix monitoring system on OS FreeBSD. Let’s start:

- Update ports tree.
- Install zabbix (no need in LDAP support, disable it during installation)
cd /usr/ports/net-mgmt/zabbix ; make WITHOUT_LDAP=yes install clean ; echo ‘zabbix_server_enable=”YES”‘ >> rc.conf - Create database for zabbix
mysqladmin -u root -p create zabbix - Create a MySQL user and grant rights to DB
echo “GRANT SELECT, INSERT, UPDATE, LOCK TABLES, CREATE, DROP, DELETE, INDEX ON zabbix.* TO zabbix@localhost IDENTIFIED BY ‘3<:po~mv’” | mysql -u root -p mysql - Create a structure of tables
cd /usr/local/share/zabbix/create
cat schema/mysql.sql data/data.sql data/images_mysql.sql | mysql -u zabbix -p zabbix - Configure Zabbix Server
cd /usr/local/etc/zabbix
cp zabbix_server.conf.sample zabbix_server.conf
By default, the values are suitable for small networks monitoring. In my configuration I changed the following values only:
StartHTTPPollers=10
LogFileSize=10
FpingLocation=/usr/local/sbin/fping
DBName=zabbix
DBUser=zabbix
DBPassword=3<:po~mv
DBSocket=/tmp/mysql.sock - Run Zabbix
/usr/local/etc/rc.d/zabbix_server start - Check if Zabbix runs or not
ps xa | grep zabbix_server
Zabbix runs properly if the command is like this:
89213 ?? SN 0:00.01 zabbix_server: main process (zabbix_server)
89214 ?? SN 0:00.03 zabbix_server: poller [sleeping for 5 seconds] (zabbix_server)
89215 ?? SN 0:00.03 zabbix_server: poller [sleeping for 5 seconds] (zabbix_server)
………………………………..
89238 ?? SN 0:00.00 zabbix_server: http poller [sleeping for 5 seconds] (zabbix_server)
89239 ?? SN 0:00.00 zabbix_server: http poller [sleeping for 5 seconds] (zabbix_server)
89240 ?? IN 0:00.03 zabbix_server: discoverer [sleeping for 600 seconds] (zabbix_server)
89241 ?? SN 0:00.00 zabbix_server: escalator [sleeping for 3 seconds] (zabbix_server)
Everything works properly.
- Copy web interface files and change a files owner to the name with which the web server was run.
mkdir -p /usr/local/www/vhosts/zabbix
cp -R /usr/local/share/zabbix/php/* /usr/local/www/vhosts/zabbix/
chown -R www:www /usr/local/www/vhosts/zabbix/ - Create alias in the web server configuration (I have apache installed) for zabbix interface:
Alias /zabbix /usr/local/www/vhosts/zabbix/
<Directory /usr/local/www/vhosts/zabbix>
Order allow,deny
Allow from all
</Directory> - Reboot apache
apachectl graceful - Type http://<site name>/zabbix in the browser and go on with installation:









- To access the system, enter Login name: Admin Password: zabbix
- Change default password for user Admin. To do this go to menu Administration->Users, in the field Alias select Admin, and then Change password.
- Zabbix installation is completed successfully, now we can add hosts for monitoring via menu Configuration->Hosts.



Recent Comments