Introduction
This page describes how AlexisHuxley installed Zabbix server and client on several Debian systems (see Computing for a list of systems). Ultimately, I removed Zabbix due to the bad features listed below.
Zabbix has the following good features:
- configuration done via web interface
- alerts and trending in one package
- a cleaner "look" than Nagios
Zabbix has the following bad features:
- inconvenient object hierarchy (e.g. tests can only be defined within a template, but hosts are clearly expected to use only one template, which leads to difficulty providing per-host thresholds or application for the tests)
- dashboard not very configurable
- Debian squeeze package fails to install cleanly
- confusing terminology
Procedures
zabbix-server/sqlite3
This method was not successful, but is recorded in case I ever solve it and want to repeat this.
Nominate a system running Debian squeeze as the server.
- Download zabbix-1.8.3.tar.gz.lenny
As root run:
grep zabbix /etc/services
and verify if entries are displayed. (This is because I am not sure of the installation and removal of the native Debian packages created these entries or if they were there already.)Run:
groupadd --system zabbix useradd --home-dir=/var/local/zabbix --gid=zabbix --shell=/bin/bash --system --create-home zabbix apt-get install libsqlite3-dev libjabberd2-dev libiksemel-dev libcurl4-gnutls-dev libsnmp-dev libopenipmi-dev
Su to zabbix and run:
tar xzf ~alexis/zabbix-1.8.3.tar.gz cd zabbix-1.8.3/ mkdir -p ~/sqlite sqlite3 ~/sqlite/zabbix.db < create/schema/sqlite.sql ./configure --prefix=/usr/local/opt/zabbix-1.8.3 --sysconfdir=/usr/local/opt/zabbix-1.8.3/etc --enable-server --with-sqlite3 --with-net-snmp --with-jabber --with-libcurl --enable-agent --with-openipmi make
As root run:
cd ~zabbix/zabbix-1.8.3/ make install cp -r ~zabbix/zabbix-1.8.3/frontends/php /usr/local/opt/zabbix-1 ln -s /usr/local/opt/zabbix-1.8.3/share/php /var/www/zabbix
If necessary (see above commands), as root, run:
echo -e zabbix-agent 10050/tcp Zabbix Agent\nzabbix-agent 10050/udp Zabbix Agent\nzabbix-trapper 10051/tcp Zabbix Trapper\nzabbix-trapper 10051/udp Zabbix Trapper" >> /etc/services
As root run:
cp ~zabbix/zabbix-1.8.3/misc/conf/zabbix_agentd.conf /usr/local/opt/zabbix-1.8.3/etc cp ~zabbix/zabbix-1.8.3/misc/conf/zabbix_server.conf /usr/local/opt/zabbix-1.8.3/etc # The '--sysconfdir' setting above does not work, so run this. ln -s /usr/local/opt/zabbix-1.8.3/etc /etc/zabbix
Edit the zabbix_server.conf file and change:
DBName=/var/local/zabbix/sqlite/zabbix.db
As zabbix run:
/usr/local/opt/zabbix-1.8.3/sbin/zabbix_server /usr/local/opt/zabbix-1.8.3/sbin/zabbix_agentd
As root run:
apt-get install php5 php5-gd php5-sqlite # PHP won't work without this service apache2 reload
Visit http://ziti/zabbix and, once you are past the license acceptance screens, you see several settings that need to be be fixed.
Edit /etc/php5/apache2/php.ini and set:
memory_limit = 256M post_max_size = 32M upload_max_filesize = 16M max_execution_time = 600 max_input_time = 600 date.timezone = Europe/Berlin
this will leave only this failing:
PHP databases support no Fail
- Download the PHP module sources sqlite3-0.5.tgz.
As root run:
apt-get install libsqlite3-dev php5-dev
Run:
cd tar xzf ~sqlite3-0.5.tgz cd sqlite3-0.5/ phpize ./configure make
but this will fail with something like:
/var/local/zabbix/sqlite3-0.5/php_sqlite3.c:4:1: warning: "COMPILE_DL_SQLITE3" redefined In file included from /usr/include/php5/TSRM/tsrm_config.h:1, from /usr/include/php5/TSRM/tsrm_config_common.h:17, from /usr/include/php5/TSRM/tsrm_virtual_cwd.h:26, from /usr/include/php5/main/php.h:414, from /var/local/zabbix/sqlite3-0.5/php_sqlite3.c:1: /usr/include/php5/main/../main/php_config.h:233:1: warning: this is the location of the previous definition /var/local/zabbix/sqlite3-0.5/php_sqlite3.c: In function ‘zif_sqlite3_bind_text’: /var/local/zabbix/sqlite3-0.5/php_sqlite3.c:474: error: ‘zval’ has no member named ‘refcount’ /var/local/zabbix/sqlite3-0.5/php_sqlite3.c: In function ‘zif_sqlite3_bind_blob’: /var/local/zabbix/sqlite3-0.5/php_sqlite3.c:507: error: ‘zval’ has no member named ‘refcount’ make: *** [php_sqlite3.lo] Error 1(I suspect that this is because sqlite3-0.5 is quite old.)
zabbix-server/mysql
This procedure was done prior to the submission of BTS#607449, which the correct way to install Debian's zabbix-mysql-server package.
Nominate a system running Debian squeeze as the server.
- Download zabbix-1.8.3.tar.gz.
As root run:
grep zabbix /etc/services
and verify if entries are displayed. (This is because I am not sure of the installation and removal of the native Debian packages created these entries or if they were there already.)Run:
groupadd --system zabbix useradd --home-dir=/var/local/zabbix --gid=zabbix --shell=/bin/bash --system --create-home zabbix apt-get install mysql-server mysql-client libjabberd2-dev libiksemel-dev libcurl4-gnutls-dev libsnmp-dev libopenipmi-dev php5 php5-gd # PHP won't work without this service apache2 reload
Create the database by running:
apt-get install mysql-server mysql-client libmysqld-dev mysql CREATE DATABASE zabbix character set utf8; CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbix'; GRANT ALL ON zabbix.* TO 'zabbix'@'localhost'; quit
Populate the database by running:
mysql -uzabbix -pzabbix zabbix < create/schema/mysql.sql mysql -uzabbix -pzabbix zabbix < create/data/data.sql mysql -uzabbix -pzabbix zabbix < create/data/images_mysql.sql
Su to zabbix and run:
tar xzf ~alexis/zabbix-1.8.3.tar.gz cd zabbix-1.8.3/ ./configure --prefix=/usr/local/opt/zabbix-1.8.3 --sysconfdir=/usr/local/opt/zabbix-1.8.3/etc --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --enable-agent --with-openipmi make
As root run:
cd ~zabbix/zabbix-1.8.3/ make install # Fix the '--sysconfdir' problem mkdir -p /usr/local/opt/zabbix-1.8.3/etc ln -s /usr/local/opt/zabbix-1.8.3/etc /etc/zabbix mkdir -p /usr/local/opt/zabbix-1.8.3/share/frontends cp -r frontends/php /usr/local/opt/zabbix-1.8.3/share/frontends/php # the web interface will want to save a config file so ensure right ownership chown -R www-data:www-data /usr/local/opt/zabbix-1.8.3/share/frontends/php ln -s /usr/local/opt/zabbix-1.8.3/share/frontends/php /var/www/zabbix
If necessary (see above commands), as root, run:
echo -e zabbix-agent 10050/tcp Zabbix Agent\nzabbix-agent 10050/udp Zabbix Agent\nzabbix-trapper 10051/tcp Zabbix Trapper\nzabbix-trapper 10051/udp Zabbix Trapper" >> /etc/services
As root run:
cp ~zabbix/zabbix-1.8.3/misc/conf/zabbix_agentd.conf /usr/local/opt/zabbix-1.8.3/etc cp ~zabbix/zabbix-1.8.3/misc/conf/zabbix_server.conf /usr/local/opt/zabbix-1.8.3/etc
Edit /usr/local/opt/zabbix-1.8.3/etc/zabbix_server.conf file and change:
DBUser=zabbix DBPassword=zabbix
As zabbix run:
/usr/local/opt/zabbix-1.8.3/sbin/zabbix_server /usr/local/opt/zabbix-1.8.3/sbin/zabbix_agentd
As root run:
apt-get install php5 php5-gd php5-mysql # PHP won't work without this service apache2 reload
Visit http://<'hostname'>/zabbix and, once you are past the license acceptance screens, you see several settings that need to be be fixed.
Edit /etc/php5/apache2/php.ini and set:
memory_limit = 256M post_max_size = 32M upload_max_filesize = 16M max_execution_time = 600 max_input_time = 600 date.timezone = Europe/Berlin
this will leave only this failing:
Set up the init.d scripts to start the server by running:
cp ~zabbix/zabbix-1.8.3/misc/init.d/debian/zabbix-server /etc/init.d/ perl -pi -e 's@/home/zabbix@/usr/local/opt/zabbix-1.8.3@g' /etc/init.d/zabbix-server perl -pi -e 's@^(DAEMON=.*)/bin/(.*)@$1/sbin/$2@g' /etc/init.d/zabbix-server perl -pi -e 's@^(#!.*)@$1\n### BEGIN INIT INFO\n# Provides: zabbix-server\n# Required-Start: mysql\n# Required-Stop: mysql\n# Should-Start:\n# Should-Stop:\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: Start and stop the Zabbix server daemon\n### END INIT INFO@' /etc/init.d/zabbix-server update-rc.d zabbix-server defaults
zabbix-server/postgres
Not covered.
zabbix-agent on the zabbix server
Edit /etc/zabbix/zabbix_agentd.conf and set:
Server=ziti.pasta.net Hostname=noodle.pasta.net
As root run:
service zabbix-agent restart
Set up the init.d scripts to start the agent by running:
cp ~zabbix/zabbix-1.8.3/misc/init.d/debian/zabbix-agent /etc/init.d/ perl -pi -e 's@/home/zabbix@/usr/local/opt/zabbix-1.8.3@g' /etc/init.d/zabbix-agent perl -pi -e 's@^(DAEMON=.*)/bin/(.*)@$1/sbin/$2@g' /etc/init.d/zabbix-agent perl -pi -e 's@^(#!.*)@$1\n### BEGIN INIT INFO\n# Provides: zabbix-agent\n# Required-Start:\n# Required-Stop:\n# Should-Start: zabbix-server\n# Should-Stop: zabbix-server\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: Start and stop the Zabbix agent daemon\n### END INIT INFO@' /etc/init.d/zabbix-agent update-rc.d zabbix-agent defaults
zabbix-agent on all other systems
As root run:
apt-get install zabbix-agent
Edit /etc/zabbix/zabbix_agentd.conf and set:
Server=ziti.pasta.net Hostname=noodle.pasta.net
