Documentation / ZABBIX Manual v1.0 (old) / Installation /   
Installation
* Server
* Agent
Server

Server side

  • 1. Create the ZABBIX superuser account
  • This is the user the server will run as. For production use you should create a dedicated unprivileged account ('zabbix' is commonly used). Running ZABBIX as 'root','bin', or any other account with special rights is a security risk. Do not do it!

    Note: ZABBIX daemon processes (zabbix_suckerd and zabbix_trapperd) are protected from being run under root account.

  • 2. Untar ZABBIX sources
  • shell> gunzip zabbix.tar.gz && tar -xvf zabbix.tar

  • 3. Create the ZABBIX database.
  • ZABBIX comes with SQL scripts used to create the required database schema and also to insert a default configuration. There are separate scripts for MySQL and PostgreSQL.

    For MySQL:

    shell> mysql -u<username> -p<password>
    mysql> create database zabbix; 
    mysql> quit; 
    shell> cd create/mysql 
    shell> cat schema.sql |mysql -u<username> -p<password> zabbix
    shell> cd ../data 
    shell> cat data.sql |mysql -u<username> -p<password> zabbix
    shell> cat images.sql |mysql -u<username> -p<password> zabbix
    

    For PostgreSQL:

    shell> psql -U <username>
    psql> create database zabbix; 
    psql> \q 
    shell> cd create/postgresql 
    shell> cat schema.sql|psql -U <username> zabbix 
    shell> cd ../data 
    shell> cat data.sql|psql -U <username> zabbix
    

  • 4. Configure and compile the source code for your system
  • The sources must be compiled for both the server (monitoring machine) as well as the clients (monitored machines). To configure the source for the server, you must specify which database will be used.

    shell> ./configure—with-mysql –with-net-snmp # for MySQL 

    or

    shell> ./configure—with-pgsql –with-net-snmp # for PostgreSQL make 

    Note: Use flag --enable-static to statically link libraries. If you plan to distribute compiled binaries among different servers, you must use this flag to make these binaries work without required libraries. --enable-static does not work under Solaris. Flag --with-ucd-snmp can be used instead of --with-net-snmp. If no SNMP support required, both --with-net-snmp and --with-ucd-snmp may be skipped.

    However, if you want to compile client binaries only, run:

    shell> ./configure

    Parameter —enable-static may be used to force static linkage.

  • 5. Make everything:
  • shell> make

    Copy created binaries from bin/ to /opt/zabbix/bin or any other directory Other common directories are /usr/local/bin and /usr/local/zabbix/bin.

  • 6. Configure /etc/services
  • The step is not real requirement. However, it is recommended. On the client (monitored) machines, add the following lines to /etc/services:

    zabbix_agent 10000/tcp
    zabbix_trap 10001/tcp

  • 7. Configure /etc/inetd.conf
  • If you are going to use a non-daemon versions of ZABBIX trapper, add the following line to /etc/inetd.conf:

    zabbix_trap stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_trapper

    If you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:

    zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agent

    Restart inetd

    shell> killall -HUP inetd

Configure WEB interface

As user zabbix (or whatever you decided to name your dedicated ZABBIX account), do the following:

  • 9. Change these values in frontends/php/include/db.inc.php:
  • $DB_TYPE =”POSTGRESQL”; /* Or “MYSQL” for MySQL */
    $DB_SERVER =”localhost”;
    $DB_DATABASE =”zabbix”;
    $DB_USER =””;
    $DB_PWD =””

  • 10. Copy the PHP source files to a place where your web server can get to it. Perhaps /home/zabbix/html or /home/zabbix/public_html or /var/www/html/zabbix, etc.
  • For example:

    shell> mkdir /home/zabbix/html
    shell> cp -R frontends/php/* /home/zabbix/html/
    

  • 11. Configure /etc/zabbix/zabbix_agent.conf
  • You need to configure this file for every host having zabbix_agent installed. The file should contain IP address of ZABBIX server. Connections from other hosts will be denied. You may take misc/conf/zabbix_agent.conf as example.

  • 12. Configure /etc/zabbix/zabbix_agentd.conf
  • You need to configure this file for every host with zabbix_agentd installed. The file should contain the IP address of the ZABBIX server. Connectionsfrom other hosts will be denied. You may take misc/conf/zabbix_agentd.conf as example.

  • 13. Configure /etc/zabbix/zabbix_suckerd.conf
  • For small installations (up to ten monitored hosts), default parameters are sufficient. However, you should change default parameters to maximize performance from ZABBIX. See section [Performance tuning] for more details.

    You may take misc/conf/zabbix_suckerd.conf as example.

  • 14. Configure /etc/zabbix/zabbix_trapperd.conf
  • For small installations (up to 50 monitored hosts), default parameters are sufficient. However, you should change default parameters to maximize performance from ZABBIX. See section [Performance tuning] for more details.

    You may take misc/conf/zabbix_trapperd.conf as example.

  • 15. Run server processes
  • Run zabbix_suckerd and zabbix_trapperd on server side.

    shell> cd bin
    shell> ./zabbix_suckerd
    shell> ./zabbix_trapperd
    

  • 16. Run agents
  • Run zabbix_agentd where necessary.

    shell> cd bin
    shell> ./zabbix_agentd