Wednesday, December 9, 2015

Install Zabbix on Linux

7:43 PM Posted by Dilli Raj Maharjan , 1 comment

Zabbix is a software for monitoring availability and performance of IT infrastructure components. It is opensource and helps gathering statistical data of system health. 


Following are its core features:
  1. A web-based interface
  2. Secure user authentication
  3. A flexible user permission schema
  4. Agents based data gathering and agent-less monitoring
  5. Polling and trapping support.
  6. Zabbix-proxy to centrally collect information and upload to zabbix server.
  7. Remote commands support
  8. True open-source software 
  9. Notification by SMS, Jabber, email, skype, IM, Voice
  10. Visualisation 

Requirement

Memory size: 128 MB 
Disk size: 256 MB 

Backend database: 

  1. MySQL 5.0.3 or later
  2. PostgreSQL 8.1 or later
  3. Oracle 10g or later
  4. SQLite 3.3.5 or later
  5. IBM DB2 9.7 or later

Zabbix frontend requires:

  1. Apache 1.3.12 or later
  2. PHP 5.3.0 or later
  3. PHP extensions: gd, bcmath, ctype , libXML, xmlreader, xmlwriter, session, sockets, mbstring, gettext, ibm_db2, mysqli, oci8, pgsql, sqlite3
  4. OS Packages: net-snmp.x86_64, snmp.x86_64, OpenIPMI-libs.x86_64, mysql-server

Install required package with yum command below.

yum -y install httpd.x86_64 php.x86_64 php-bcmath.x86_64 php-common.x86_64 php-gd.x86_64 php-mysql.x86_64 php-odbc.x86_64 php-xml.x86_64 php-mbstring

Download fping from URL below:

wget  http://pkgs.repoforge.org/fping/fping-3.1-1.el6.rf.x86_64.rpm
rpm ivh fping-3.1-1.el6.rf.x86_64.rpm







Download iksemel package

http://repo.zabbix.com/non-supported/rhel/6/x86_64/iksemel-1.4-2.el6.x86_64.rpm


Download Zabbix rpm.

  1. Go to URL http://www.zabbix.com/download.php
  2. Under Zabbix Packages heading select the version of OS and architecture.
  3. Choose desired version and download 











Package description:

zabbix-agent-*.rpm Client agent that will be installed on the Zabbix client. Need to be installed on every machine that is intended to monitor.
zabbix-web-*.rpm Web interface to configure Zabbix server. It comes with two backend database flavor.
  • zabbix-web-mysql-*.rpm
  • zabbix-web-pgsql-*.rpm
Zabbix-proxy-*.rpm Optional package component that will centrally collect data and upload to zabbix server. It comes with three backend database.
  • zabbix-proxy-mysql-*.rpm
  • zabbix-proxy-pgsql-*.rpm
  • zabbix-proxy-sqlite3-*.rpm
Zabbix-server-*.rpm Core package the installed the zabbix server. It comes with two backend database 
  • zabbix-server-mysql-*.rpm
  • zabbix-server-pgsql-*.rpm
At least zabbix-web-*.rpm and Zabbix-server-*.rpm package is required to install on monitoring server.

Install zabbix-server package.

rpm -ivh zabbix-2.4.7-1.el6.x86_64.rpm zabbix-server-2.4.7-1.el6.x86_64.rpm zabbix-server-mysql-2.4.7-1.el6.x86_64.rpm



Install  zabbix-web packages

rpm -ivh zabbix-web-2.4.7-1.el6.noarch.rpm zabbix-web-mysql-2.4.7-1.el6.noarch.rpm





Configure backend database to store zabbix data. In my case I am using mysql as backend database.Install mysql initial database(Fresh Database)

mysql_install_db 
































Start mysql database

/etc/init.d/mysqld start


















Login as user root and change mysql root password

mysql -u root 
update mysql.user
set password=PASSWORD('*******')

where user='root';

Create mysql database zabbix with character set utf8

Create database zabbix character set utf8;

Create user zabbix

grant all on zabbix.* to zabbix@'localhost' identified by '********';
flush privileges;
















Now create required schema objects.

cd /usr/share/doc/zabbix-server-mysql-2.4.7/create/
mysql -uzabbix -p zabbix < schema.sql
mysql -uzabbix -p zabbix < images.sql
mysql -uzabbix -p zabbix < data.sql














Edit zabbix_server.conf file to set database IP, User and client. Add following lines on the file.

vi /etc/zabbix/zabbix_server.conf 
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=(your zabbix password)

Modify php.ini configuration file
Change following parameter values

max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300
date.timezone Asia/Kathmandu

Start httpd and zabbix-server

/etc/init.d/httpd start
/etc/init.d/zabbix-server start








Make sure these services are startup at boot.

chkconfig httpd on
chkconfig zabbix-server on
chkconfig mysqld on








Monitor logfile with command below


tail -f /var/log/zabbix/zabbix_server.log 




































Verify all services are started properly.

Web configuration

Open following URL on browser.

http://192.168.1.250/Zabbix












Click on Next

Verify all pre-requisites are installed and click on next.


Configure database connections parameters and click on Test connection.

Click on next if Test connection returns OK

Enter hostname, name and port and click on next


Verify the Pre-Installation Summary and Click on Next to continue.


Click on Finish to complete Installation.

Login with Admin/zabbix


1 comment:

  1. Illuminate Zabbix Server MySQL Issue through MySQL Server 5.0 Support
    Assume on the off chance that you introduce Zabbix on Centos6 framework yet in the meantime you found that issue with your MySQL database availability then how you can tackle it? Note that, with Cognegic's MySQL Remote Support or MySQL Remote Service you will get the profound comprehension of your MySQL issues and furthermore you will get the execution subtle elements of SQL arrangement, database qualities et cetera. You can basically get in touch with us by means of dialing our without toll number and get the best help through Cognegic's MySQL Backup Database.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    ReplyDelete