Installing ZABBIX from sources – CentOS

ZABBIX is the open source Enterprise-class Monitoring Solution. Everything inside your network can be monitored: Performance Servers, Web Applications, Databases, Networking Equipment and more. More info here.

Installing Zabbix daemons

Download the source archive

The sources can be downloaded from here: http://www.zabbix.com/download.php

[root@web ~]# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.6/zabbix-2.0.6.tar.gz

Once downloaded, extract the sources, by running:

[root@web ~]# tar zxvf zabbix-2.0.6.tar.gz

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:

[root@web ~]# groupadd zabbix
[root@web ~]# useradd -g zabbix zabbix

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.

mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
[root@web ~]# cd zabbix-2.0.6
[root@web zabbix-2.0.6]# mysql -u root -p zabbix < database/mysql/schema.sql
[root@web zabbix-2.0.6]# mysql -u root -p zabbix < database/mysql/images.sql
[root@web zabbix-2.0.6]# mysql -u root -p zabbix < database/mysql/data.sql

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

Possible errors

error:

no acceptable C compiler found in $PATH

The solution depends on what has already been installed on the server. Usually `yum install gcc` is all that is required.

Still not working? Try this:

yum update yum && yum remove gcc && yum install gcc

It should work!

error:

Curl library not found

The solution is:

yum install curl libcurl libcurl-devel

error:

Invalid NET-SNMP directory - unable to find net-snmp-config

The solution is:

yum install net-snmp-devel

Make and install everything

[root@web zabbix-2.0.6]# make install

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.

Review and edit configuration files

[root@web zabbix-2.0.6]# vi /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.

[root@web zabbix-2.0.6]# vi /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.

Start up the daemons

Run zabbix_server on the server side.

[root@web ~]# zabbix_server

Run zabbix_agentd on all the monitored machines.

[root@web ~]# zabbix_agentd

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.

[root@web ~]# cd zabbix-2.0.6
[root@web zabbix-2.0.6]# mkdir /var/www/html/zabbix
[root@web zabbix-2.0.6]# cd frontends/php
[root@web php]# cp -a . /var/www/html/zabbix

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.

zabbix_install2

Step 2

Make sure that all software prerequisites are met. If there’s error, edit the file /etc/php.ini and update the information until all errors are fixed (needed to install bcmath, i.e: yum install php-bcmath).

Screen Shot 2013-07-12 at 7.25.35 PM

Step 3

Enter details for connecting to the database. Zabbix database must already be created.

Screen Shot 2013-07-12 at 7.31.46 PM

Step 4

Enter Zabbix server details.

Screen Shot 2013-07-12 at 7.35.09 PM

Step 5

Review a summary of settings.

Screen Shot 2013-07-12 at 7.37.21 PM

Step 6

Download the configuration file and place it under conf/.

Screen Shot 2013-07-12 at 7.43.52 PM

Screen Shot 2013-07-12 at 7.47.12 PM

Step 7

Finish the installation.

Screen Shot 2013-07-12 at 7.51.27 PM

Step 8

Zabbix frontend is ready! The default user name is Admin, password zabbix.

Screen Shot 2013-07-12 at 7.55.02 PM