Open Source

CentOS Zabbix Server 4.0 Install (자빅스 설치)

Pydole 2019. 4. 1. 13:07

 

- OS : CentOS 7

- Zabbix : 4.0

 

 

 

1. httpd Install (Web Server)

 

 

 # yum -y install httpd

 # vi /etc/httpd/conf/httpd.conf

   ServerName 192.168.x.x
   DocumentRoot "/usr/share/zabbix"  → 실제 zabbix 설치가 않되면 경로에러가 날 수 있으니 자빅스 설치후 기동

 

 # systemctl start httpd

 # systemctl enable httpd

 

 

 

 

2. PHP Install

 

 # yum -y install php

 # vi /etc/php.ini

    date.timezone = Asia/Seoul

 

 

 

 

 

3. MaiaDB Install

 

 

# yum -y install mariadb-server mariadb

# systemctl start mariadb

# systemctl enable mariadb

 

# mysql_secure_installation

 

[ Enter ]

 

Set root password? [Y/n] y 
New password: 
Re-enter new password: 
Password updated successfully! 
Reloading privilege tables.. 
 ... Success! 


By default, a MariaDB installation has an anonymous user, allowing anyone 
to log into MariaDB without having to have a user account created for 
them.  This is intended only for testing, and to make the installation 
go a bit smoother.  You should remove them before moving into a 
production environment. 

Remove anonymous users? [Y/n] y 
 ... Success! 

Normally, root should only be allowed to connect from 'localhost'.  This 
ensures that someone cannot guess at the root password from the network. 

Disallow root login remotely? [Y/n] y
 ... Success! 

By default, MariaDB comes with a database named 'test' that anyone can 
access.  This is also intended only for testing, and should be removed 
before moving into a production environment. 

Remove test database and access to it? [Y/n] y
 - Dropping test database... 
 ... Success! 
 - Removing privileges on test database... 
 ... Success! 

Reloading the privilege tables will ensure that all changes made so far 
will take effect immediately. 

Reload privilege tables now? [Y/n] y
 ... Success! 

Cleaning up... 

All done!  If you've completed all of the above steps, your MariaDB 
installation should now be secure. 

Thanks for using MariaDB!

 

 

 

 

 

 

4 ~ 6. STEP

https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=7&db=mysql

 

 

 

 

4. Zabbix Repo

 

 

 # rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

 # yum clean all

 # yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

 

 

 

 

5. Create initial database

 

 

 # mysql -u root -p

 

  mysql> create database zabbix character set utf8 collate utf8_bin;
  mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';   password → zabbixdbpasswd
  mysql> quit

 

 

 

 

6. Import initial schema and data.

 

 

 # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

   password :

 

 # vi /etc/zabbix/zabbix_server.conf

   DBPassword=password

 

 # systemctl restart zabbix-server zabbix-agent httpd
 # systemctl enable zabbix-server zabbix-agent httpd

 

 

 

 

6. Web Test

 

 

 

 

----------------------------------------------------------------------------------------------------------------------------------

 

zabbix 데몬 기동시 아래와 같이 에러발생시 "selinux 를 disabled" 한다.

 

[root@localhost ~]# systemctl restart zabbix-server zabbix-agent httpd
Job for zabbix-server.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-server.service" and "journalctl -xe" for details.

 

 

아마도, semanage 명령어를 이용해 10051 포트를 등록해주면 해결될 듯 하다.

 

https://pydole.tistory.com/entry/CentOS-7-SElinux-%EB%B3%B4%EC%95%88%EC%97%90%EC%84%9C-http%EC%99%80-tomcat-%EC%97%B0%EB%8F%99%EC%8B%9C-%ED%8F%AC%ED%8A%B8-%EC%B6%94%EA%B0%80