With Christmas, new year and my wedding over I figured it was time to add another tutorial.

One of the things many would like is a decent monitoring solution for their server and after trying and using many of the available free packages around (some are ntop, Munin, Cacti, Monit, Zabbix, Zenoss and Nagios) I decided on Zabbix as the best/easiest all-around solution for my goals.

This guide will show you how to get a basic Zabbix server and frontend running on your FreeBSD 8.1 – as always I assume you know basic FreeBSD to use the guide.

First we install Zabbix server from ports with the options that suit your goals.

cd /usr/ports/net-mgmt/zabbix-server
make install clean

Next up you create a database and a user for it in your preferred backend. Once the database and the user is ready it’s time to populate the database with the default layout and data. Remember to change where needed according to your backend.

cd /usr/local/share/zabbix/server/create
cat schema/mysql.sql data/data.sql data/images_mysql.sql | mysql -u zabbix -p zabbix

That takes a short while up next is configuration of your Zabbix server

cd /usr/local/etc/zabbix
cp zabbix_server.conf.sample zabbix_server.conf

Now edit the zabbix_server.conf – by default it is geared towards monitoring small networks so adjust accordingly. Most importantly adjust the backend settings. Then we add the startup value to rc.conf and start the server.

echo "zabbix_server_enable=\"YES\"" >> /etc/rc.conf
/usr/local/etc/rc.d/zabbix_server start

Second to last part is the Zabbix agent

cd /usr/ports/net-mgmt/zabbix-agent
make install clean
echo "zabbix_agentd_enable=\"YES\"" >> /etc/rc.conf
/usr/local/etc/rc.d/zabbix_agentd start

Now we want the frontend (php webpage) installed – again chose the same backend type you used for the server.

cd /usr/ports/net-mgmt/zabbix-frontend
make install clean

Add /usr/local/www/zabbix as a vhost or move it to suit your setup/webserver. Then access the webpage and the frontend setup will start. Just follow the install and edit your php.ini accordingly to at least the minimum requirements.

There you go – login with admin/zabbix and you have a working Zabbix system. For detail about the options in the frontend go to the official documentation.

Did you like this? Share it: