본문 바로가기

OS,Network,Container

CentOS7 Zabbix 4.0 모니터링 툴 설치,구성하기 #2

반응형

CentOS7 Zabbix 4.0 모니터링툴 설치 및 구성하기 #1

 

리눅스 Zabbix 4.0 모니터링 툴 설치, 구성하기 #1

CentOS7 Zabbix 4.0 설치 및 구성하기 #1 Zabbix : 서버 및 네트워크 모니터링 프로그램. 기본적으로 Apache와 PHP 5.4이상, MySQL 5.4 이상이 설치되어있어야 하므로 APM 구축을 먼저 한 이후에 Zabbix 설치 및..

nyyang.tistory.com

못보신 분들은 #1 보고 오시면 됩니다.

 

 

 

 

 

 

 

 

[ Zabbix 4.0설치 및 설정 ]

 

 

 

 

 

 

 

 

 

우선 Zabbix Package들을 설치하자.

 

 

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

CentOS7 시스템에 Zabbix Repo를 추가한다.

 

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

Zabbix와 DB, WEB 연동을 위한 설치와 agent, get 설치

 

 

[root@localhost ~]# rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

[root@localhost ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent

 

 

 

 

 

 

[ Zabbix 테이블 값 데이터베이스에 적용 ]

 

 

- cd /usr/share/doc/zabbix-server-mysql-3.4.6/
- gunzip create.sql.gz

- mysql -u root -p zabbix < create.sql

[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
AUTHORS        ChangeLog      COPYING        create.sql.gz  NEWS           README

[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/

[root@localhost zabbix-server-mysql-3.4.15]# gunzip create.sql.gz

[root@localhost zabbix-server-mysql-3.4.15]# mysql -u root -p zabbix < create.sql
Enter password:

 

 

 

 

 

[ Zabbix 서버 설정 ]

 

 

 

 

- vim /etc/zabbix/zabbix_server.conf

[root@localhost zabbix-server-mysql-3.4.15]# vim /etc/zabbix/zabbix_server.conf

 

빨간색 내용을 맨 아래에 추가할 것

 

DBHost=localhost

DBName=zabbix

DBUser=zabbix               

DBPassword=testpw123

 

DBName과 DBUser은 이미 존재하므로 / 기능을 이용하여 찾은 이후에 바꿔주고

DBHost와 DBPassword는 추가한다.

 

 

 

 

 

 

 

zabbix-server의 서비스를 시작하고 매 부팅마다 실행될 수 있도록 설정한다.

 

- systemctl restart zabbix-server

- systemctl enable zabbix-server

- systemctl status zabbix-server

 

 

 

[root@localhost zabbix-server-mysql-3.4.15]# systemctl restart zabbix-server
[root@localhost zabbix-server-mysql-3.4.15]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[root@localhost zabbix-server-mysql-3.4.15]# systemctl status zabbix-server
● zabbix-server.service - Zabbix Server
   Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-04-02 04:52:52 PDT; 24s ago
 Main PID: 28705 (zabbix_server)
   CGroup: /system.slice/zabbix-server.service
           ├─28705 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
           ├─28710 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for pro...
           ├─28711 /usr/sbin/zabbix_server: alerter #1 started
           ├─28712 /usr/sbin/zabbix_server: alerter #2 started
           ├─28713 /usr/sbin/zabbix_server: alerter #3 started
           ├─28714 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
           ├─28715 /usr/sbin/zabbix_server: timer #1 [processed 0 triggers, 0 events in ...
           ├─28716 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000410 sec...
           ├─28717 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.000380...
           ├─28718 /usr/sbin/zabbix_server: history syncer #1 [synced 0 items in 0.00005...
           ├─28719 /usr/sbin/zabbix_server: history syncer #2 [synced 0 items in 0.00002...
           ├─28720 /usr/sbin/zabbix_server: history syncer #3 [synced 0 items in 0.00002...
           ├─28721 /usr/sbin/zabbix_server: history syncer #4 [synced 0 items in 0.00002...
           ├─28722 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.0...
           ├─28723 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxi...
           ├─28724 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000036 ...
           ├─28725 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.00092...
           ├─28726 /usr/sbin/zabbix_server: poller #1 [got 0 values in 0.000010 sec, idl...
           ├─28727 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000051 sec, idl...
           ├─28728 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000010 sec, idl...
           ├─28729 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000010 sec, idl...
           ├─28730 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000011 sec, idl...
           ├─28731 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000...
           ├─28732 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000000 sec, ...
           ├─28733 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000000 sec, ...
           ├─28745 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000000 sec, ...
           ├─28746 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000000 sec, ...
           ├─28747 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000000 sec, ...
           ├─28751 /usr/sbin/zabbix_server: icmp pinger #1 [got 0 values in 0.000025 sec...
           ├─28752 /usr/sbin/zabbix_server: alert manager #1 [sent 0, failed 0 alerts, i...
           ├─28753 /usr/sbin/zabbix_server: preprocessing manager #1 [queued 0, processe...
           ├─28762 /usr/sbin/zabbix_server: preprocessing worker #1 started
           ├─28763 /usr/sbin/zabbix_server: preprocessing worker #2 started
           └─28764 /usr/sbin/zabbix_server: preprocessing worker #3 started

Apr 02 04:52:52 localhost.localdomain systemd[1]: Starting Zabbix Server...
Apr 02 04:52:52 localhost.localdomain systemd[1]: Can't open PID file /run/zabbix/zabb...ry
Apr 02 04:52:52 localhost.localdomain systemd[1]: Started Zabbix Server.
Hint: Some lines were ellipsized, use -l to show in full.

 

 

 

 

 

[ Firewall 설정 & Zabbix 마무리 셋업 ]

 

 

 

 

- firewall-cmd --add-service={http,https} --permanent
- firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent

- firewall-cmd --reload
- firewall-cmd --list-all

 

- systemctl restart zabbix-server
- systemctl restart zabbix-agent
- systemctl restart httpd

 

 

[root@localhost ~]# firewall-cmd --permanent --add-service={http,https}
success
[root@localhost ~]# firewall-cmd --permanent --add-port={10051/tcp,10050/tcp}
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources:
  services: dhcpv6-client http https ssh
  ports: 22/tcp 53/tcp 10051/tcp 10050/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

[root@localhost ~]# systemctl restart zabbix-server
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl restart mariadb

 

 

 

 

 

 [ Web client로 Zabbix 접속 ] 

 

이제 Web Client에서 Zabbix로 접속해보자.

 

주소창에 192.168.5.3/zabbix

 

Next step을 누른다.

 

 

OK떴는지 확인 후 Next step을 누른다.

 

 

 

 

DBName, DBUser, Password 등을 기입한다.

Next step을 누른다.

 

 

 

 

 Name은 Zabbix_Monitoring 으로 설정해주었다.

 

 

 

 

최종확인하기

설치 완료

 

 

 

 

 

ID : Admin

PW: zabbix

 

초기 설정값임

 

 

 

 

사람 모양 클릭 -> Language : Korean 으로 변경 ( 우린 한쿡인 )

 

 

 

 

다시 들어와서 Change Password 클릭 후 Password 변경하기

 

 

 

 

 

안바꾼다면 default password인 zabbix로 설정되므로 변경해주어야 타인이 침입하기 힘듬

반응형