How To Install Zabbix Server 3.4 on CentOS/RHEL 7/6

    Posted in Servers Security on Feb 08, 2018

    Zabbix is an open source software for networks and application monitoring. Zabbix provides agents to monitor remote hosts as well as Zabbix includes support for monitoring via SNMP, TCP and ICMP checks. Click here to know more about zabbix

    zabbix-monitoring-in-5-pictures-2-638.jpg

    This article will help you to step by step install Zabbix 3.0 Server on CentOS/RHEL 7/6 systems. Before starting installation read below basic requirements to run Zabbix 3.4.

    • Apache: 1.3.12 or later.
    • PHP: 5.4.0 or later.
    • MySQL: 5.0.3 or later.
    • 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.

    Step 1 – SetUp Apache, MySQL and PHP

    In order to use Zabbix, we required a Web Server, database server, and PHP to work. In this steps we are going to set up these services, You may skip this step if you have already configured it.

    Install All Services

    # yum install httpd httpd-devel
    # yum install mysql mysql-server
    # yum install php php-devel php-bcmath  php-pear php-gd php-mbstring php-mysql php-xml

    Start All Services

    # service httpd start
    # service mysqld start

    MySQL Initial Setup

    Run the following command to setup MySQL initially and secure it

    # mysql_secure_installation

    Step 2 – Configure Yum Repository

    You can file zabbix repositories package on zabbix official website.

    You can also use one of following commands to add zabbix repository in your system.

    CentOS/RHEL 7:

    # rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

    CentOS/RHEL 6:

    # rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm

    Step 3 – Install Zabbix Server with MySQL

    You have added Zabbix yum repository in above step. Now use the following command to install Zabbix server with MySQL database support packages on your system.

    # yum install zabbix-server-mysql zabbix-web-mysql zabbix-proxy-mysql

    Step 4 – Setup Zabbix Apache Configuration

    Zabbix creates its own apache configuration file /etc/httpd/conf.d/zabbix.conf. Edit this file and just update timezone. More timezone’s

    # php_value date.timezone Asia/Kolkata

    After changing value restart Apache service.

    # service httpd restart

    Step 5 – Configure MySQL Database for Zabbix

    This installation is using MySQL as the backend of Zabbix, So we need to create MySQL database and User for Zabbix installation.

    # mysql -u root -p
    
    mysql> CREATE DATABASE zabbixdb CHARACTER SET UTF8;
    mysql> GRANT ALL PRIVILEGES on zabbixdb.* to zabbix@localhost IDENTIFIED BY 'password';
    mysql> FLUSH PRIVILEGES;
    mysql> quit

    After creating database restore the default mysql database provided by zabbix. These files can be found at /usr/share/doc/zabbix-server-mysql-/create/ directory.

    # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uroot -p zabbixdb
    # zcat /usr/share/doc/zabbix-proxy-mysql*/schema.sql.gz | mysql -uroot -p zabbixdb

    Now edit Zabbix server configuration file /etc/zabbix/zabbix_server.conf and update the following database configurations.

    DBHost=localhost
    DBName=zabbixdb
    DBUser=zabbix
    DBPassword=password

    Step 6 – Start Zabbix Server

    After completing setup, let’s start Zabbix server using the following command.

    # service zabbix-server start

    After starting Zabbix service, let’s go to Zabbix web installer and finish the installation.

    Step 7 – Complete Zabbix Web Installer Wizzard

    Zabbix web installer can be accessed on /zabbix subdirectory URL on your servers IP or domain. For example, host.tecadmin.net is pointed to my Zabbix server. Now access the Zabbix using the following URL. You must change FQDN as per your setup.

    http://uptime.serversctrl.com/zabbix/

    and follow the steps as per given

    Thanks !