Zabbix 1.4.4 from source on Debian Etch

This guide will walk you through installing Zab­bix 1.4.4 from source on debian etch. 1.4.4 has many improve­ments over what is cur­rently avail­able in apt, and its not hard so you might as well do it this way. *Note: this walk­through assumes that you will be run­ning the zab­bix data­base on the same machine as the fron­tend. You dont have to obvi­ously, just do the mysql setup on what­ever db server you are using and point the nec­es­sary things to it.
Required Pack­ages: build-essential libmysqlclient-dev libssl-dev libsnmp-dev apache2 libapache2-mod-php5 php5-gd php5-mysql mysql-server

aptitude -y install build-essential libmysqlclient-dev libssl-dev libsnmp-dev apache2 libapache2-mod-php5 php5-gd php5-mysql mysql-server

Zab­bix needs to have its own user and group so lest cre­ate them. (you need to do this as root)

groupadd zabbix
useradd -c 'Zabbix' -d /home/zabbix -g zabbix -s /bin/bash zabbix
mkdir /home/zabbix
chown zabbix:zabbix /home/zabbix

Let’s setup the MySQL data­base for zab­bix.

mysql -p -u root
create database zabbix;
grant all on zabbix.* to 'zabbix'@'localhost' identified by 'PASSWORD';
quit;

Where pass­word is the pass­word your want zab­bix to con­nect to the data­base with

Let’s go ahead and grab the zab­bix source.

su - zabbix
wget http://internap.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.4.4.tar.gz
tar zxvf zabbix-1.4.4.tar.gz
cd zabbix-1.4.4

Now let’s build the source and install zabbix_server and zabbix_agentd

./configure --prefix=/usr --with-mysql --with-net-snmp --enable-server --enable-agent
make
exit
make install

We need to add the zab­bix ports to /etc/services, and cre­ate some con­fig files for zab­bix

echo "
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp" >> /etc/servicesmkdir -p /etc/zabbix
chown -R zabbix:zabbix /etc/zabbix
cp misc/conf/zabbix_* /etc/zabbix vim /etc/zabbix/zabbix_agentd.conf
ensure Server=127.0.0.1

vim /etc/zabbix/zabbix_server.confmax_execution_time = 300
date.timezone = UTC

ensure DBHost=localhost or your db host
ensure DBName=zabbix
ensure DBUser=zabbix
ensure DBPassword=ZABBIX_PASSWORD where ZABBIX_PASSWORD is the password you set when creating dbThe zabbix package has init scripts for debian and they only need minor modification to get working so lets use them.

cp /home/zabbix/zabbix-1.4.4/misc/init.d/debian/* /etc/init.d/

Now modify both of those scripts changing

DAEMON=/home/zabbix/bin/${NAME}

to

DAEMON=/usr/sbin/${NAME}

Great now we just need to get the database schema loaded, and then we need to setup the frontend. Let's load the database schema first.

mysql -u root -p zabbix < /home/zabbix/zabbix-1.4.4/create/schema/mysql.sql
mysql -u root -p zabbix < /home/zabbix/zabbix-1.4.4/create/data/data.sql
mysql -u root -p zabbix < /home/zabbix/zabbix-1.4.4/create/data/images_mysql.sql

Great now its just the frontend left. I like to put all of my webaps down in /var/www

mkdir -p /var/www/zabbix
cp -R /home/zabbix/zabbix-1.4.4/frontends/php/* /var/www/zabbix/
chown -R zabbix:zabbix /var/www/zabbix/*

Create /etc/apache2/sites-available/zabbix with the following content


ServerName zabbix.fqdn.tld
DocumentRoot /var/www/zabbix

Options FollowSymLinks
AllowOverride None



I disable the default site, and enable the zabbix site with a2ensite

a2ensite zabbix
a2dissite default

Just a few minor edits in /etc/php5/apache2/php.ini

max_execution_time = 300
date.timezone = UTC

Restart apache, zabbix-server, and zabbix-agent and you should be ready to rock and roll. You will need to browse to your zabbix frontend and complete the web-driven install which should be easy enough.

/etc/init.d/apache2 restart
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agent start
update-rc.d zabbix-server defaults
update-rc.d zabbix-agent defaults
* adapted and updated from http://www.howtoforge.com/zabbix_network_monitoring
Thanks to petey5000 for catching several typos.

8 Comments

Leave a Reply

Your email is never shared.Required fields are marked *

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha