Zabbix Installation Instructions ================================ These instructions are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please see doc/manual.txt for non-installation documentation. 1 Installation 1.1 Requirements 1.2 Installation procedure 1.3 Initial Configuration 2 Upgrading 2.1 Zabbix 1.0alpha8 2.2 Zabbix 1.0alpha9 2.3 Zabbix 1.0alpha10 2.4 Zabbix 1.0alpha11 4 Installation 1.1 Requirements Platform Requirements - Linux 2.xx - Support for HP-UX, AIX, FreeBSD and OpenBSD is coming soon Software Requirements - Apache 1.3.12 or later - Database engine - MySQL 3.22 or later or - PostgreSQL 7.0.2 or later - PHP 4.0 or later, compiled as Apache module with - GD module (for PNG images) - MySQL of PostgreSQL module - mhash support - GNU make - WEB browser on client side (support for HTML and PNG images required). MS Explorer and Netscape work perfectly. - UCD-SNMP library and header files. Required for support of SNMP agents. Optional. Zabbix may work on previous versions of Apache, MySQL, PostgreSQL as well. I've tried to run Zabbix on PostgreSQL 6.5x with no luck. PostgreSQL crashes after one to three minutes of zabbix_suckerd running. So, PostgreSQL version 7.0.2 or later is strongly recommended. Regarding the choice between PostgreSQL and MySQL, I recommend MySQL + InnoDB for several reasons: - my recent benchmarks clearly show that PostgreSQL (7.1.x) is at least 10 times slower than MySQL (3.23.29) - no need to constantly run "vacuum" command with MySQL - MySQL MyISAM table is not a good choice because of lack of row locking. So, InnoDB is required If you do use PostgreSQL, performance can be significantly improved by executing the VACUUM command on the Zabbix database. I would suggest execution of VACUUM, at least after the following events: - Zabbix is installed - 10000 records in table "history" - patches applied on Zabbix database For heavily loaded Zabbix servers, hourly execution of "VACUUM ANALYZE" for all tables except "history" is strongly recommended! You can use the command 'echo "vacuum verbose analyze"|psql zabbix'. Debian Potato and Debian Woody are development and testing platforms I currently use. Memory requirements: Zabbix requires both physical (surprise!) and disk memory. 32 Mb of physical memory and 20 Mb of free disk memory could be good starting point. However, the amount of required disk memory obviously depends on the number of hosts and parameters that are being monitored. If you're planning to keep a long history of monitored parameters, you should be thinking of at least a couple of gigabytes to have enough space to store the history in the database. Remember, the more physical memory you have, the faster the database (and therefore Zabbix) works! 1.2 Installation procedure Basic installation of Zabbix usually takes no more than 15 minutes. However, to make the process more enjoyable, I would suggest you make a cup of tea (or coffee) for yourself. Ready? 1.2.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! 1.2.2 Untar Zabbix sources On Linux, use command tar -xvzf . On other systems, try gunzip zabbix.tar.gz tar xvf zabbix.tar 1.2.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: mysql -u -p > create database zabbix; >quit; cd create/mysql cat schema.sql |mysql zabbix -u -p cd create/data cat data.sql |mysql zabbix -u -p For PostgreSQL: psql -U > create database zabbix; > \q cd create/postgresql cat schema.sql|psql -U zabbix cd create/data cat data.sql|psql -U zabbix 1.2.4 Configure include/db.h Change the following parameters: #define DB_NAME "zabbix" #define DB_USER "zabbix" #define DB_PASSWD "password" 1.2.5 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. ./configure --with-mysql # for MySQL or ./configure --with-pgsql # for PostgreSQL make However, if you want to compile client binaries only, run: ./configure make 1.2.6 Copy created binaries from bin/ to /opt/zabbix/bin or any other directory Other common directories are /usr/local/bin or /usr/local/zabbix/bin. 1.2.7 Configure /etc/services On the client (monitored) machines, add the following lines to /etc/services: zabbix_agent 10000/tcp zabbix_trap 10001/tcp 1.2.8 Configure /etc/inetd.conf If you are going to use trapping instead of the recommended client-server approach (see manual for more details), 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 (again, see manual for more details), the following line must be added: zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agent 1.2.9 Restart inetd killall -HUP inetd 1.2.10 Configure WEB interface As user zabbix (or whatever you decided to name your dedicated Zabbix account in step 1.2.1), do the following: Change these values in frontends/php/include/db.inc: $DB_TYPE ="POSTGRESQL"; /* Or "MYSQL" for MySQL */ $DB_SERVER ="localhost"; $DB_DATABASE ="zabbix"; $DB_USER =""; $DB_PWD ="" 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, mkdir /home/zabbix/html cp -R frontends/php/* /home/zabbix/html/ 1.2.11 Configure Apache By default, Apache does not recognize *.html files as PHP scripts. Add the following line to Apache configuration files to make Apache think that every *.html file is actually PHP script that should be interpreted: AddType application/x-httpd-php .html 1.2.12 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. 1.3 Initial Configuration Once your Zabbix installation is complete, you will need to configure Zabbix. Point your web browser to the location you installed the PHP scripts to. (For example, if you copied the PHP files to /home/zabbix/public_html or /home/zabbix/html, point your browser to http://localhost/~zabbix) Once there, click on the CONFIG link. You will be prompted for a username and password. Zabbix comes pre-configured with an administrative account: Enter the username 'Admin' and leave the password field empty. Add the configuration of your SMTP server of choice. Next, click on the "USERS" link. Add yourself to list of Zabbix users. Don't forget to select "Administrators" group. After you create your account, click the "Media" link beside your account listing, and add your email address. Next, delete the default Admin user. Click on the 'HOSTS' link to add new hosts to be monitored. For each host you add, be sure that you've installed the agent software on the host. If you have not yet done this, set the status to "Not monitored". When a host is added, a list of all possible parameters for the host will be automatically added. After you've added your desired hosts, click on the "ITEMS" link to modify the details of the monitored parameters. You may disable or delete monitored parameters or change how often the parameters are checked. Next, click on the 'TRIGGERS' link to change the triggers relating to monitored parameters. You can change threshold values, disable or delete triggers, and set up actions (email notification). When you set up an email notification, you may modify the subject and message body as you wish. You can use macros in both email subject and email body. For example, the subject for a warning message could look like: Processor load on www.sf.net is {www.sf.net:system[procload].last(0)} In this case, you will receive message with subject like "Processor load on www.sf.net is 0.85". Click on the "MAPS" link to set up a network map. A map will help you quickly identify any problems with your monitored machines. Finally, click on the "GRAPHS" link to set up a graph. A graph provides quick historical statistics on one or more monitored statistics. Once you have an initial configuration created, run zabbix_suckerd on the server machine: /opt/zabbix/bin/zabbix_suckerd and run zabbix_agentd on all monitored machines /opt/zabbix/bin/zabbix_agentd You should not run zabbix_agentd if you have chosen to use zabbix_agent! 2. Upgrading The upgrade procedure is quite simple. New binaries and frontend should be installed according to latest installation instructions. In order to update database structure, the following steps should be performed. Note that before applying database patches, all Zabbix processes must be stopped. Also, the process can take from 0 seconds (if no patches required) up to several hours. For production installations database backup is required ! General Procedure Go to the upgrades/dbpatches directory. In this directory are subdirectories named according to a version upgrade (e.g. 1.0alpha3_to_1.0alpha4). Enter the directory corresponding to your upgrade (if you are upgrading through multiple versions, you will need to apply the upgrades one at a time). Depending on which database you use: cd mysql cat patch.sql |mysql zabbix -u -p or cd postgresql cat patch.sql|psql -U zabbix Finally, read version specific notes below for any extra procedures. 2.1 Zabbix 1.0alpha8 - Note that zabbix_sucker has been renamed to zabbix_suckerd. - Replace zabbix_agent with zabbix_agentd. zabbix_agentd runs much faster than the 'old' zabbix_agent. Moreover, if you do not run inetd, zabbix_agentd is the only choice :) - PostgreSQL does not support modifying the structure of table fields. Therefore, please change the definition of the following fields (MySQL code): alter table users modify passwd char(32) default '' not null; alter table actions modify message text default '' not null; alter table alerts modify message text default '' not null; - Try to use IP address in host definition. This unloads DNS and makes zabbix_suckerd faster. 2.2 Zabbix 1.0alpha9 - Don't forget to apply DB patches. 2.3 Zabbix 1.0alpha10 - Don't forget to apply DB patches. - Note that parameters net[listen_*] will be replaced by check_service[*] (for example, net[listen_25] -> check_service[smtp]). 2.4 Zabbix 1.0alpha11 - Do not forget to apply DB patches. - PostgreSQL users: Please delete the column "triggers.lastcheck" manually by reloading whole table. Unfortunately, PostgreSQL does not support "alter table triggers drop lastcheck". - New set of parameters appeared in this release: proc_cnt[*] - IMPORTANT. Parameter tcp_count is not supported anymore.