Tuesday 21 November 2017

Zabbix installation in RHEL 6 & 7


Step 1
We need to install all the required packages and dependencies. Below I have mentioned the detailed packages that required to install zabbix.

  • Apache above 1.3.12
  • PHP above 5.4.0 and 7 is not support for zabbix
  • Mysql above 5.0.3
  • OpenIPMI
  • libssh2 above 1.0 version - for ssh support.
  • fping - for ICMP ping items.
  • libcurl - for web monitoring
  • libiksemel - for jabber support.
  • net-snmp - for snmp support.

Step 2
Setup Apache, Mysql and PHP.
Use below command to install required package and dependencies.

yum install httpd httpd-devel -y

yum install mysql mysql-server -y

yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml -y
after installation need to start the services with below command.
service httpd start
service mysqld start
Step 3
Setup mysql like below
mysql_secure_installation
it will provide the details like below and give the details that you rquired.
Now try to login mysql with given password

mysqld -u root -p

Step 4

Configure Repository for zabbix.

For CentOS/RHEL 7

rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

For CentOS/RHEL 6

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

Now start installing zabbix with mysql

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway -y

Step 5

Setup apache for zabbix with below details.
after installing zabbix it will create by default it configuration in /etc/httpd/conf.d/zabbix.conf. edit this file and modify the timezone on your required.
php_value date.timezone Asia/Kolkata
now restart the apache service with below command
service httpd restart
Step 6
Creating database for zabbix in mysql PHP
login mysql with root
mysql -u root -p
now create database
CREATE DATABASE zabbix CHARACTER SET UTF8;
now create a user with permission
GRANT ALL PRIVILEGES on zabbix.* to user@localhost IDENTIFIED BY 'password';
now flush it
FLUSH PRIVILEGES;
quite;
after creating DB and user we need to restore the default DB of zabbix to mysql.
We can found that on /usr/share/doc/zabbix-server-mysql-3.0.0 in this location or
/usr/share/doc/zabbix-server-mysql-3.0.0/create.
on that we can found a zip file just unzip it and use it with below commands.

gunzip create.sql.gz
mysql -u user -p zabbix < create.sql
it will restore all the required details to zabbix db.  

now check the DB details in zabbix configuration in /etc/zabbix/zabbix_server.conf

add details of db

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

save & exit

Configure PHP
Need to change some parameters in php for zabbix. Find the details below and modifies as per your requirement in /etc/php.ini.
vi /etc/php.ini
max_execution_time = 600
max_input_time = 600
memory_limit = 2048
post_max_size = m2M
upload_max_filesize = 16M
date.timezone = Asia/Kolkata
if you use firewall or iptables don't forget to allow following ports.
10050, 10051 and 80
Step 7
Now restart and start the required services.
service httpd restart
service zabbix-server start
and don't forget to enable it to auto start on boot
chkconfig zabbix-server on
chkconfig httpd on
chkconfig mysqld on
now open the  url in your browser

http://ipaddress/zabbix

it will lead you to installation page like below screenshot


click next

it will lead you to the prerequisites you can check if anything missing in this.

Click next
now you will lead to DB config check the details or add the details of DB that you have created for zabbix.

after fill all click next

Then give the name that show in browser tab like below screenshot.


Click next

You will redirect to installation summery screen like below.

you will got the congratulation screen that you have completed successfully on that screen.

Now click finish and it redirect you to login page. By default username is admin and passowrd is  zabbix
That's all Now you can add the client machine with  zabbix agent.

No comments:

Post a Comment

Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...