'OSS(Open Source Software)/zabbix'에 해당되는 글 1건

  1. 2017.08.22 :: CentOS7 에 zabbix 3.2 설치하기

설치 환경

  • OS : CentOS7

  • Zabbix Version : 3.2

  • WAS Server : Nginx 1.12.1 + PHP-FPM 5.4.16


1. zabbix server 설치

1-1. 필수 패키지 설치 - DBMS

# yum install mariadb mariadb-server

1-2. zabbix 3.2 Repository 패키지 설치

# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

1-3. zabbix 설치

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

### agent 설치

# yum install zabbix-agent

1-4. 서비스 활성화 및 시작

# systemctl start mariadb

# systemctl enable mariadb

# systemctl enable zabbix-server

1-5. 데이터베이스 초기화

# mysql -uroot -p<password>

mysql> create database zabbix character set utf8 collate utf8_bin;

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';

mysql> flush privileges;

mysql> quit;

1-6. zabbix 초기 데이터 복구 - 패키지 설치인 경우만

# cd /usr/share/doc/zabbix-server-mysql-3.2.x

# zcat create.sql.gz | mysql -uroot zabbix

1-7. zabbix server 설정에 DB 접속 정보 수정 - /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=password

1-8. zabbix server 시작

# systemctl start zabbix-server


2. nginx 설치

2-1. nginx repo 추가

/etc/yum.repos.d/nginx.repo

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/centos/$releasever/$basearch/

gpgcheck=0

enabled=1

2-2. 설치

# yum install nginx

2-3. 설정

vhost 설정을 적절하게 수정해 준다. 

ex) /etc/nginx/conf.d/vhost.conf

server {

    listen                  80;

    server_name        example.com;


    charset               utf-8;

    access_log          /var/log/nginx/zabbix-access.log  main;


    location / {

        root   /usr/share/zabbix;

        index  index.html index.htm index.php;

    }


    error_page  404              /404.html;


    error_page   500 502 503 504  /50x.html;

    location = /50x.html {

        root   /usr/share/nginx/html;

    }


    location ~ \.php$ {

        root           /usr/share/zabbix;

        fastcgi_pass unix:/tmp/php5-fpm.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        include fastcgi_params;

     }

}


3. php-fpm 설치

3-1. php-fpm 설치

# yum install php-fpm

3-2. php-fpm 설정

/etc/php-fpm.d/www.conf 

listen = /tmp/php5-fpm.sock

user = nginx

group = nginx

3-3. 서비스 시작

# systemctl start nginx

# systemctl start php-fpm

4. frontend 설치

4-1. http://server_ip/zabbix 이동

php의 기본 설정을 사용했기 때문에, 위와 같이 권장 옵션 값으로 변경하라는 메시지가 나온다.

4-2. 권장 옵션값에 맞게 php 설정을 수정

/etc/php.ini

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = Asia/Seoul

4-3. DB 연결 설정

4-4.  zabbix server 설정

4-5. 요약

4-6. 완료

초기 암호 : Admin / zabbix



posted by 구닥다리 엔지니어
: