How to Install and Configure Zabbix in Cent OS 7


How to Install and Configure Zabbix in Cent OS 7
================================================================================================================
Zabbix သည် IT Components တွေဖြစ်ကြတဲ့ networks, servers, virtual machines and cloud services များ၏ metrics, network utilization, CPU load and disk space များကို monitoring လုပ်နိုင်သည့် Open Source software tools တွေထဲက တစ်ခုပဲဖြစ်ပါတယ်။ Zabbix ကို XML based template များဖြင့် အသုံးပြုနိုင်ပါတယ်။
Zabbix monitor operation ကို Linux, Hewlett Packard Unix (HP-UX), Mac OS X, Solaris နဲ့ အခြားသော Operating Systems (OSes) များပေါ်တွင် run နိုင်ပြီးတော့ windows ပေါ်မှာတော့ zabbix agent နဲ့ run နိုင်ပါတယ်။ Zabbix ကို MySQL, MariaDB, PostgreSQL, SQLite, Oracle or IBM DB2 ကဲ့သို့သော Data Base တွေကို အသုံးပြုပြီး လုပ်ဆောင်နိုင်ပါတယ်။
Zabbix ကို backend အနေနဲ့ C Programming နဲ့ ရေးထားပြီးတော့ Frontend ကိုတော့ PHP နဲ့ ရေးထားပါတယ်။ ဒါဆိုရင် Zabbix အနေနဲ့ ဘာတွေလုပ်ဆောင်နိုင်မလဲ Zabbix ကို ဘယ် Database တွေနဲ့ သုံးလို့ရမလဲဆိုတာကို နားလည်မယ်လို့ထင်ပါတယ်။ ကျနော်တို့ Lab setup ပိုင်းကို ဆက်သွားကြတာပေါ့။
Prerequisites
- Apache web server
- PHP with required extensions
- MySQL / MariaDB server
Installing Zabbix on Cent OS 7
Firstly login to terminal as root and start your vm network connect with internet.
Disable SELinux
SELinux ကို disable လုပ်ရခြင်းကတော့ တစ်ချို့ software package တွေက SELinux မှာ ငြိတတ်တာမျိုးတွေ ရှိတဲ့အတွက် ပိတ်ပေးခဲ့ခြင်းဖြစ်ပါတယ်။
[root@zabbix ~]# vim /etc/sysconfig/selinux
Change “SELINUX=enforcing” to “SELINUX=disabled”
Save and exit the file and then reboot the system.
[root@zabbix ~]# reboot
Install and Configure Apache
[root@zabbix ~]# yum –y install httpd
[root@zabbix ~]# systemctl status httpd.service
[root@zabbix ~]# systemctl start httpd.service
[root@zabbix ~]# systemctl enable httpd.service
Configure Needed Repositories
Built in ဖြစ်တဲ့ PHP54 အစား PHP72 repo ကို ထည့်သွင်းအသုံးပြုပါမယ်။
[root@zabbix ~]# yum –y install epel-release

[root@zabbix ~]# yum –y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Disable PHP 5 repo and enable PHP 7.2 repo
[root@zabbix ~]# yum-config-manager – -disable remi-php54
[root@zabbix ~]# yum-config-manager – -enable remi-php72
Install PHP
[root@zabbix ~]# yum –y install php php-pear php-cgi php-common php-mbstring php-snmp 
Php-gd php-pecl-mysql php-xml php-mysql php-gettext php-bcmath
Modify the PHP time Zone in php.ini file.
[root@zabbix ~]# vim /etc/php.ini
Changing number the following in php.ini file.
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = Asia/Yangon
save and exit php.ini file.
Install MariaDB
[root@zabbix ~]# yum –y – -enablerepo=remi install mariadb-server
[root@zabbix ~]# systemctl start mariadb.service
[root@zabbix ~]# systemctl enable mariadb.service
Run the following command to secure MariaDB
[root@zabbix ~]# mysql_secure_installation
Add a new root password for mariadb and continue. Then it will ask a few questions.
Type “Y” to agree for 4 time.
Login to DB server and verify
[root@zabbix ~]# mysql –u root -p
Create Database and user account
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> create user zabbixusr@localhost identified by ‘password’;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbixusr@localhost;

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
Install Zabbix and needed dependencies
[root@zabbix ~]# rpm –ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
Install Zabiix
[root@zabbix ~]# yum –y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
Configure Zabbix
[root@zabbix ~]# vim /etc/httpd/conf.d/zabbix.conf
Remove “;” and type timezone
php_value date.timezone Asia/Yangon
save and exit zabbix.conf file.
Edit Zabbix Server Configuration file.
[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf
Change the following and remove # sign front of sentence.
DBHost=localhost
DBName=zabbix
DBUser=zabbixusr
DBPassword=password
Save and exit the file.
Generally, Zabbix installation package gives SQL file which includes an initial schema and data for the Zabbix server with MySQL.
Change directory and go the zabbix directory.
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql –u zabbixusr –p zabbix
When prompted enter the zabbixusr’s password.
Allow the ports in the firewall
[root@zabbix ~]# firewall-cmd - -permanent - -add-port=10050/tcp
[root@zabbix ~]# firewall-cmd - -permanent - -add-port=80/tcp
[root@zabbix ~]# firewall-cmd - -reload
 Start zabbix and web server service.
[root@zabbix ~]# systemctl start zabbix-server
[root@zabbix ~]# systemctl enable zabbix-server
[root@zabbix ~]# systemctl start httpd
[root@zabbix ~]# systemctl enable httpd
Installing and Configuring Zabbix Fronted
Open your browser on physical OS and type the following.

Now, You can manage your zabbix monitoring server.

ကိုးကား
https://www.fosslinux.com/7705/how-to-install-and-configure-zabbix-on-centos-7.htm
https://www.linuxtechi.com/install-zabbix-3-0-on-centos-7-rhel-7/
https://linuxize.com/post/how-to-install-and-configure-zabbix-on-ubuntu-18-04/?fbclid=IwAR1FDYUKIOsc9YhlPQ6OeO9nnIPnjp5wJNZsKezmxCiffUmNH7b8-s8mcwA

#OpenLearning
#SheinMyintAung




Comments