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:

Zabbix has the following bad features:

Procedures

zabbix-server/sqlite3

This method was not successful, but is recorded in case I ever solve it and want to repeat this.

  1. Nominate a system running Debian squeeze as the server.

  2. Download zabbix-1.8.3.tar.gz.lenny
  3. 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.)
  4. 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 
  5. 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 
  6. 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 
  7. 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 
  8. 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 
  9. Edit the zabbix_server.conf file and change:

    DBName=/var/local/zabbix/sqlite/zabbix.db 
  10. As zabbix run:

    /usr/local/opt/zabbix-1.8.3/sbin/zabbix_server
    /usr/local/opt/zabbix-1.8.3/sbin/zabbix_agentd 
  11. As root run:

    apt-get install php5 php5-gd php5-sqlite
    #  PHP won't work without this
    service apache2 reload 
  12. Visit http://ziti/zabbix and, once you are past the license acceptance screens, you see several settings that need to be be fixed.

  13. 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 
  14. Download the PHP module sources sqlite3-0.5.tgz.
  15. As root run:

    apt-get install libsqlite3-dev php5-dev 
  16. 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.

  1. Nominate a system running Debian squeeze as the server.

  2. Download zabbix-1.8.3.tar.gz.
  3. 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.)
  4. 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 
  5. 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 
  6. 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 
  7. 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 
  8. 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 
  9. 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 
  10. 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 
  11. Edit /usr/local/opt/zabbix-1.8.3/etc/zabbix_server.conf file and change:

    DBUser=zabbix
    DBPassword=zabbix 
  12. As zabbix run:

    /usr/local/opt/zabbix-1.8.3/sbin/zabbix_server
    /usr/local/opt/zabbix-1.8.3/sbin/zabbix_agentd 
  13. As root run:

    apt-get install php5 php5-gd php5-mysql
    #  PHP won't work without this
    service apache2 reload 
  14. Visit http://<'hostname'>/zabbix and, once you are past the license acceptance screens, you see several settings that need to be be fixed.

  15. 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:

     
  16. 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

  1. Edit /etc/zabbix/zabbix_agentd.conf and set:

    Server=ziti.pasta.net
    Hostname=noodle.pasta.net 
  2. As root run:

    service zabbix-agent restart 
  3. 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

  1. As root run:

    apt-get install zabbix-agent 
  2. Edit /etc/zabbix/zabbix_agentd.conf and set:

    Server=ziti.pasta.net
    Hostname=noodle.pasta.net 

See also

CategoryProcedure

InstallingZabbix (last edited 2011-02-07 07:31:57 by AlexisHuxley)