3. Installation
1 Getting Zabbix
Overview
There are three ways of getting Zabbix:
-
Install it from the distribution packages
-
Download the latest source archive and compile it yourself
-
Download the virtual appliance
To download the latest sources or the virtual appliance, go to the Zabbix download page, where direct links to latest versions are provided. To download older versions, see the link below stable version downloads.
2 Requirements
Hardware
Memory
Zabbix requires both physical and disk memory. 128 MB of physical memory and 256 MB of free disk space could be a 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.
Each Zabbix daemon process requires several connections to a database server. Amount of memory allocated for the connection depends on configuration of the database engine.
CPU
Zabbix and especially Zabbix database may require significant CPU resources depending on number of monitored parameters and chosen database engine.
Other hardware
A serial communication port and a serial GSM modem are required for using SMS notification support in Zabbix. USB-to-serial converter will also work.
Examples of hardware configuration
The table provides several examples of hardware configurations:
Name | Platform | CPU/Memory | Database | Monitored hosts |
---|---|---|---|---|
Small | Ubuntu Linux | PII 350MHz 256MB | SQLite | 20 |
Medium | Ubuntu Linux 64 bit | AMD Athlon 3200+ 2GB | MySQL InnoDB | 500 |
Large | Ubuntu Linux 64 bit | Intel Dual Core 6400 4GB | RAID10 MySQL InnoDB or PostgreSQL | >1000 |
Very large | RedHat Enterprise | Intel Xeon 2xCPU 8GB | Fast RAID10 MySQL InnoDB or PostgreSQL | >10000 |
Supported platforms
Due to security requirements and mission-critical nature of monitoring server, UNIX is the only operating system that can consistently deliver the necessary performance, fault tolerance and resilience. Zabbix operates on market leading versions.
Zabbix is tested on the following platforms:
-
Linux
-
IBM AIX
-
FreeBSD
-
NetBSD
-
OpenBSD
-
HP-UX
-
Mac OS X
-
Solaris
-
Windows: 2000, Server 2003, XP, Vista, Server 2008, 7, 8, Server 2012 (Zabbix agent only)
Software
Zabbix is built around a modern Apache web server, leading database engines, and PHP scripting language.
Database management system
Software | Version | Comments |
---|---|---|
MySQL | 5.0.3 or later | Required if MySQL is used as Zabbix back end database. InnoDB engine is required. |
Oracle | 10g or later | Required if Oracle is used as Zabbix back-end database. |
PostgreSQL | 8.1 or later | Required if PostgreSQL is used as Zabbix back-end database. It is suggested to use at least PostgreSQL 8.3, which introduced much better VACUUM performance. |
SQLite | 3.3.5 or later | Required if SQLite is used as Zabbix back-end database. |
IBM DB2 | 9.7 or later | Required if IBM DB2 is used as Zabbix back end database. |
Frontend
The following software is required to run Zabbix frontend:
Software | Version | Comments |
---|---|---|
Apache | 1.3.12 or later | |
PHP | 5.3.0 or later | |
PHP extensions: | ||
gd | 2.0 or later | PHP GD extension must support PNG images (–with-png-dir), JPEG (–with-jpeg-dir) images and FreeType 2 (–with-freetype-dir). |
bcmath | php-bcmath (–enable-bcmath) | |
ctype | php-ctype (–enable-ctype) | |
libXML | 2.6.15 or later | php-xml or php5-dom, if provided as a separate package by the distributor. |
xmlreader | php-xmlreader, if provided as a separate package by the distributor. | |
xmlwriter | php-xmlwriter, if provided as a separate package by the distributor. | |
session | php-session, if provided as a separate package by the distributor. | |
sockets | php-net-socket (–enable-sockets). Required for user script support. | |
mbstring | php-mbstring (–enable-mbstring) | |
gettext | php-gettext (–with-gettext). Required for translations to work. | |
ibm_db2 | Required if IBM DB2 is used as Zabbix back end database. | |
mysqli | Required if MySQL is used as Zabbix back end database. | |
oci8 | Required if Oracle is used as Zabbix back-end database. | |
pgsql | Required if PostgreSQL is used as Zabbix back-end database. | |
sqlite3 | Required if SQLite is used as Zabbix back-end database. |
WEB browser on client side
Cookies and Java Script must be enabled.
Latest versions of Google Chrome, Mozilla Firefox, Microsoft Internet Explorer and Opera are supported. Other browsers (Apple Safari, Konqueror) may work with Zabbix as well.
Server
Requirement | Description |
---|---|
OpenIPMI | Required for IPMI support. |
libssh2 | Required for SSH support. Version 1.0 or higher. |
fping | Required for ICMP ping items. |
libcurl | Required for web monitoring. |
libiksemel | Required for Jabber support. |
net-snmp | Required for SNMP support. |
Java gateway
If you obtained Zabbix from the source repository or an archive, then the necessary dependencies are already included into the source tree.
If you obtained Zabbix from your distribution's package, then the necessary dependencies are already provided by the packaging system.
In both cases above, the software is ready to be used and no additional downloads are necessary.
If, however, you wish to provide your versions of these dependencies (for instance, if you are preparing a package for some Linux distribution), below is the list of library versions that Java gateway is known to work with. Zabbix may work with other versions of these libraries, too.
The following table lists JAR files that are currently bundled with Java gateway in the original code:
Library | Website | Comments |
---|---|---|
logback-core-0.9.27.jar | http://logback.qos.ch/ | Tested with 0.9.27, 1.0.13, and 1.1.1. |
logback-classic-0.9.27.jar | http://logback.qos.ch/ | Tested with 0.9.27, 1.0.13, and 1.1.1. |
slf4j-api-1.6.1.jar | http://logback.qos.ch/ | Tested with 1.6.1, 1.6.6, and 1.7.6. |
android-json-4.3_r3.1.jar | https://android.googlesource.com/platform/libcore/+/master/json | Tested with 2.3.3_r1.1 and 4.3_r3.1. See src/zabbix_java/lib/README for instructions on creating a JAR file. |
Java gateway compiles and runs with Java 1.6 and above. It should also compile and run with Java 1.5, but it has not been tested.
Database size
Zabbix configuration data require a fixed amount of disk space and do not grow much.
Zabbix database size mainly depends on these variables, which define the amount of stored historical data:
-
Number of processed values per second
This is the average number of new values Zabbix server receives every second. For example, if we have 3000 items for monitoring with refresh rate of 60 seconds, the number of values per second is calculated as 3000/60 = 50.
It means that 50 new values are added to Zabbix database every second.
-
Housekeeper settings for history
Zabbix keeps values for a fixed period of time, normally several weeks or months. Each new value requires a certain amount of disk space for data and index.
So, if we would like to keep 30 days of history and we receive 50 values per second, total number of values will be around (30*24*3600)* 50 = 129.600.000, or about 130M of values.
Depending on the database engine used, type of received values (floats, integers, strings, log files, etc), the disk space for keeping a single value may vary from 40 bytes to hundreds of bytes. Normally it is around 50 bytes per value.
In our case, it means that 130M of values will require 130M * 50 bytes = 6.5GB of disk space.
-
Housekeeper setting for trends
Zabbix keeps a 1-hour max/min/avg/count set of values for each item in the table trends. The data is used for trending and long period graphs. The one hour period can not be customised.
Zabbix database, depending on database type, requires about 128 bytes per each total.
Suppose we would like to keep trend data for 5 years. Values for 3000 items will require 3000*24*365* 128 = 3.4GB per year, or 16.8GB for 5 years.
-
Housekeeper settings for events
Each Zabbix event requires approximately 130 bytes of disk space. It is hard to estimate the number of events generated by Zabbix daily. In the worst case scenario, we may assume that Zabbix generates one event per second.
It means that if we want to keep 3 years of events, this would require 3*365*24*3600* 130 = 12.3GB
The table contains formulas that can be used to calculate the disk space required for Zabbix system:
Parameter | Formula for required disk space (in bytes) |
---|---|
Zabbix configuration | Fixed size. Normally 10MB or less. |
History | days*(items/refresh rate)*24*3600*bytes items : number of items days : number of days to keep history refresh rate : average refresh rate of items bytes : number of bytes required to keep single value, depends on database engine, normally 50 bytes. |
Trends | days*(items/3600)*24*3600*bytes items : number of items days : number of days to keep history bytes : number of bytes required to keep single trend, depends on database engine, normally 128 bytes. |
Events | days*events*24*3600*bytes events : number of event per second. One (1) event per second in worst case scenario. days : number of days to keep history bytes : number of bytes required to keep single trend, depends on database engine, normally 130 bytes. |
So, the total required disk space can be calculated as:
Configuration + History + Trends + Events
The disk space will NOT be used immediately after Zabbix installation. Database size will grow then it will stop growing at some point, which depends on hosekeeper settings.
Time synchronisation
It is very important to have precise system date on server with Zabbix running. ntpd is the most popular daemon that synchronizes the host's time with the time of other machines.
3 Installation from packages
From distribution packages
Several popular OS distributions have Zabbix packages provided. You can use these packages to install Zabbix.
From Zabbix official repository
Zabbix SIA provides official RPM and DEB packages for Red Hat Enterprise Linux, Debian and Ubuntu LTS.
Package files are available at repo.zabbix.com. yum and apt repositories are also available on the server. A step-by-step tutorial for installing Zabbix from packages is provided here.
Red Hat Enterprise Linux / CentOS
Supported for versions: RHEL 5, RHEL 6, Oracle Linux 5, Oracle Linux 6, CentOS 5, CentOS 6
Installing repository configuration package
Install the repository configuration package. This package contains yum configuration files.
Zabbix 2.2 for RHEL5, Oracle Linux 5, CentOS 5:
# rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/5/x86_64/zabbix-release-2.2-1.el5.noarch.rpm
Zabbix 2.2 for RHEL6, Oracle Linux 6, CentOS 6:
# rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
Installing Zabbix packages
Install Zabbix packages. Example for Zabbix server and web frontend with mysql database.
# yum install zabbix-server-mysql zabbix-web-mysql
Example for installing Zabbix agent only.
# yum install zabbix-agent
Creating initial database
Create zabbix database and user on MySQL.
# mysql -uroot mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; mysql> exit
Import initial schema and data.
# cd /usr/share/doc/zabbix-server-mysql-2.2.0/create # mysql -uroot zabbix < schema.sql # mysql -uroot zabbix < images.sql # mysql -uroot zabbix < data.sql
Starting Zabbix server process
Edit database configuration in zabbix_server.conf
# vi /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
Start Zabbix server process.
# service zabbix-server start
Editing PHP configuration for Zabbix frontend
Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf. Some PHP settings are already configured.
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 # php_value date.timezone Europe/Riga
It's necessary to uncomment the “date.timezone” setting and set the right timezone for you. After changing the configuration file restart the apache web server.
# service httpd restart
Zabbix frontend is available at http://zabbix-frontend-hostname/zabbix in the browser. Default username/password is Admin/zabbix.
Debian / Ubuntu
Supported for version: Debian 7 (Wheezy), Ubuntu 12.04 LTS (Precise Pangolin)
Installing repository configuration package
Install the repository configuration package. This package contains apt configuration files.
Zabbix 2.2 for Debian 7:
# wget http://repo.zabbix.com/zabbix/2.2/debian/pool/main/z/zabbix-release/zabbix-release_2.2-1+wheezy_all.deb # dpkg -i zabbix-release_2.2-1+wheezy_all.deb # apt-get update
Zabbix 2.2 for Ubuntu 12.04 LTS:
# wget http://repo.zabbix.com/zabbix/2.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_2.2-1+precise_all.deb # dpkg -i zabbix-release_2.2-1+precise_all.deb # apt-get update
Installing Zabbix packages
Install Zabbix packages. dbconfig-common will create the database and populate the initial schema and data automatically. If backend db is located on a different server, please set dbc_remote_questions_default='true' in /etc/dbconfig-common/config.
Example for Zabbix server and web frontend with mysql database.
# apt-get install zabbix-server-mysql zabbix-frontend-php
Example for installing Zabbix agent only.
# apt-get install zabbix-agent
Editing PHP configuration for Zabbix frontend
Apache configuration file for Zabbix frontend is located in /etc/apache2/conf.d/zabbix. Some PHP settings are already configured.
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 # php_value date.timezone Europe/Riga
It's necessary to uncomment the “date.timezone” setting and set the correct timezone for you. After changing the configuration file restart the apache web server.
# service apache2 restart
Zabbix frontend is available at http://zabbix-frontend-hostname/zabbix in the browser. Default username/password is Admin/zabbix.
Troubleshooting
See the section on installation-specific issue troubleshooting.
4 Installation from sources
You can get the very latest version of Zabbix by compiling it from the sources.
A step-by-step tutorial for installing Zabbix from the sources is provided here.
1 Installing Zabbix daemons
1 Download the source archive
Go to the Zabbix download page and download the source archive. Once downloaded, extract the sources, by running:
$ tar -zxvf zabbix-2.2.0.tar.gz
2 Create user account
For all of the Zabbix daemon processes, an unprivileged user is required. If a Zabbix daemon is started from an unprivileged user account, it will run as that user.
However, if a daemon is started from a 'root' account, it will switch to a 'zabbix' user account, which must be present. To create such a user account (in its own group, “zabbix”) on Linux systems, run:
groupadd zabbix useradd -g zabbix zabbix
A separate user account is not required for Zabbix frontend installation.
If Zabbix server and agent are run on the same machine it is recommended to use a different user for running the server than for running the agent. Otherwise, if both are run as the same user, the agent can access the server configuration file and any Admin level user in Zabbix can quite easily retrieve, for example, the database password.
root
, bin
, or any other account with special rights is a security risk.
3 Create Zabbix database
For Zabbix server and proxy daemons, as well as Zabbix frontend, a database is required. It is not needed to run Zabbix agent.
SQL scripts are provided for creating database schema and inserting the dataset. Zabbix proxy database needs only the schema while Zabbix server database requires also the dataset on top of the schema.
Having created a Zabbix database, proceed to the following steps of compiling Zabbix.
4 Configure the sources
When configuring the sources for a Zabbix server or proxy, you must specify the database type to be used. Only one database type can be compiled with a server or proxy process at a time.
To see all of the supported configuration options, inside the extracted Zabbix source directory run:
./configure --help
To configure the sources for a Zabbix server and agent, you may run something like:
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
To configure the sources for a Zabbix server (with PostgreSQL etc.), you may run:
./configure --enable-server --with-postgresql --with-net-snmp
To configure the sources for a Zabbix proxy (with SQLite etc.), you may run:
./configure --prefix=/usr --enable-proxy --with-net-snmp --with-sqlite3 --with-ssh2
To configure the sources for a Zabbix agent, you may run:
./configure --enable-agent
Use can add –enable-static flag 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. Note that –enable-static does not work under Solaris.
In order to build the server statically you must have a static version of every external library needed. There is no strict check for that in configure script.
Use –with-oracle flag to specify location of the OCI API.
5 Make and install everything
$ make dbschema
make install
This step should be run as a user with sufficient permissions (commonly 'root', or by using sudo
).
Running make install
will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in /usr/local/bin.
6 Review and edit configuration files
-
edit the Zabbix agent configuration file /usr/local/etc/zabbix_agentd.conf
You need to configure this file for every host with zabbix_agentd installed.
You must specify the Zabbix server IP address in the file. Connections from other hosts will be denied.
-
edit the Zabbix server configuration file /usr/local/etc/zabbix_server.conf
You must specify the database name, user and password (if using any).
The rest of the parameters will suit you with their defaults if you have a small installation (up to ten monitored hosts). You should change the default parameters if you want to maximize the performance of Zabbix server (or proxy) though. See the performance tuning section for more details.
-
if you have installed a Zabbix proxy, edit the proxy configuration file /usr/local/etc/zabbix_proxy.conf
You must specify the server IP address and proxy hostname (must be known to the server), as well as the database name, user and password (if using any).
7 Start up the daemons
Run zabbix_server on the server side.
shell> zabbix_server
See the "See also" section at the bottom of this page to find out how to configure shared memory.
Run zabbix_agentd on all the monitored machines.
shell> zabbix_agentd
If you have installed Zabbix proxy, run zabbix_proxy.
shell> zabbix_proxy
2 Installing Zabbix web interface
Copying PHP files
Zabbix frontend is written in PHP, so to run it a PHP supported webserver is needed. Installation is done by simply copying the PHP files from frontends/php to the webserver HTML documents directory.
Common locations of HTML documents directories for Apache web servers include:
-
/usr/local/apache2/htdocs (default directory when installing Apache from source)
-
/srv/www/htdocs (OpenSUSE, SLES)
-
/var/www/html (Fedora, RHEL, CentOS)
-
/var/www (Debian, Ubuntu)
It is suggested to use a subdirectory instead of the HTML root. To create a subdirectory and copy Zabbix frontend files into it, execute the following commands, replacing the actual directory:
mkdir <htdocs>/zabbix cd frontends/php cp -a . <htdocs>/zabbix
If installing from SVN and planning to use any other language than English, you must generate translation files. To do so, run:
locale/make_mo.sh
msgfmt
utility from gettext package is required.
Installing frontend
Step 1
In your browser, open Zabbix URL: http://<server_ip_or_name>/zabbix
You should see the first screen of the frontend installation wizard.
Step 2
Make sure that all software prerequisites are met.
Pre-requisite | Minimum value | Description |
---|---|---|
PHP version | 5.3.0 | |
PHP memory_limit option | 128MB | In php.ini: memory_limit = 128M |
PHP post_max_size option | 16MB | In php.ini: post_max_size = 16M |
PHP upload_max_filesize option | 2MB | In php.ini: upload_max_filesize = 2M |
PHP max_execution_time option | 300 seconds | In php.ini: max_execution_time = 300 |
PHP max_input_time option | 300 seconds | In php.ini: max_input_time = 300 |
PHP session.auto_start option | must be disabled | In php.ini: session.auto_start = 0. |
Database support | One of: IBM DB2, MySQL, Oracle, PostgreSQL, SQLite | One of the following modules must be installed: ibm_db2, mysql, oci8, pgsql, sqlite3 |
bcmath | php-bcmath | |
mbstring | php-mbstring | |
sockets | php-net-socket. Required for user script support. | |
gd | 2.0 or higher | php-gd. PHP GD extension must support PNG images (–with-png-dir), JPEG (–with-jpeg-dir) images and FreeType 2 (–with-freetype-dir). |
libxml | 2.6.15 | php-xml or php5-dom |
xmlwriter | php-xmlwriter | |
xmlreader | php-xmlreader | |
ctype | php-ctype | |
session | php-session | |
gettext | php-gettext Starting with Zabbix 2.2.1, the PHP gettext extension is no longer a mandatory requirement for installing Zabbix. If gettext is not installed, the frontend will work as usual, however, the translations will not be available. |
Starting with Zabbix 2.2.1, optional pre-requisites may also be present in the list. A failed optional prerequisite is displayed in orange and has a Warning status. With a failed optional pre-requisite, the setup may continue.
Step 3
Step 4
Step 5
Step 6
Download the configuration file and place it under conf/.
Step 7
Step 8
Zabbix frontend is ready! The default user name is Admin, password zabbix.
Proceed to getting started with Zabbix.
Troubleshooting
See the section on installation-specific issue troubleshooting.
See also
5 Upgrade procedure
Overview
This section provides the steps required for a successful upgrade from Zabbix 2.2.x to 2.4.
Database upgrade to version 2.4 may take a long time.
1 Stop Zabbix server
Stop Zabbix server to make sure that no new data is inserted into database.
2 Back up the existing Zabbix database
This is a very important step. Make sure that you have a backup of your database. It will help if the upgrade procedure fails (lack of disk space, power off, any unexpected problem).
3 Back up configuration files, PHP files and Zabbix binaries
Make a backup copy of Zabbix binaries, configuration files and PHP files.
4 Install new server binaries
You may use pre-compiled binaries or compile your own.
5 Review server configuration parameters
Some parameters of zabbix_server.conf might have changed from 2.2, new parameters added. You may want to review them.
6 Start new Zabbix binaries
Start new binaries. Check log files to see if the binaries have started successfully.
Zabbix server will automatically upgrade the database.
Before you start the server:
-
Make sure the database user has enough permissions (create table, drop table, create index, drop index)
-
Make sure you have enough free disk space.
Zabbix server will automatically upgrade the database only from Zabbix 2.0.x to 2.4. For upgrading from earlier versions consult Zabbix documentation for 2.0 and earlier.
7 Install new Zabbix web interface
Follow installation instructions.
Data source: Zabbix