Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

내블로그

CentOS7 & Zabbix 설치 본문

리눅스

CentOS7 & Zabbix 설치

잡동사니보관 2020. 10. 13. 12:59

selinux 설정변경(해제)

설정파일 : /etc/selinux/config
SELINUX=enforcing => SELINUX=disabled

패키지 설치

yum -y update
yum -y install net-tools rdate
yum -y install httpd
yum -y install php php-pear php-cgi php-common php-mbstring php-snmp php-gd php-xml php-mysql php-gettext php-bcmath
yum -y install mariadb-server mariadb

php.ini 설정

설정파일 : /etc/php.ini
date.timezone = Asia/seoul

서비스 설정

systemctl enable httpd
systemctl start httpd

systemctl enable mariadb
systemctl start mariadb

mariadb 계정설정

mysql_secure_installation

Enter current password for root (enter for none): => 엔터
Set root password? [Y/n] => y 입력후 엔터
New password: => DB 계정 비밀번호 입력
Re-enter new password: => 다시 DB 계정 비밀번호 입력
Remove anonymous users? [Y/n] => y 입력후 엔터
Disallow root login remotely? [Y/n] => y 입력후 엔터
Remove test database and access to it? [Y/n] => y 입력후 엔터
Reload privilege tables now? [Y/n] => y 입력후 엔터

zabbix 설치

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum clean all
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

zabbix db 설정

mysql -uroot -p

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

zabbix db schema 생성

zcat /usr/share/doc/zabbix-server-mysql-4.4.10/create.sql.gz |mysql -uroot -p zabbix

zabbix 설정변경

설정파일 : /etc/zabbix/zabbix_server.conf

DBPassword= => DBPassword=zabbix

httpd 및 zabbix 재시작

systemctl restart httpd

systemctl enable zabbix-server
systemctl restart zabbix-server

zabbix 설정

http://192.168.0.184/zabbix
접속하면 http://192.168.0.184/zabbix/setup.php
-> Next setup 버튼을 클릭하면서 다음단계로 넘어간다.
-> DB 접속정보에서 패스워드만 zabbix 로 입력후 Next setup 버튼
-> 나머지는 모두 Next setup
-> 모두 완료하면 로그인창이 나온다.
기본 인증정보(Admin/zabbix)로 로그인한다.

클라이언트 설치(CentOS 6)

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/6/x86_64/zabbix-release-4.4-1.el6.noarch.rpm
yum -y install zabbix-agent

설정파일 변경

설정파일 /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 => Server=192.168.0.184

chkconfig zabbix-agent --level 3 on
/etc/init.d/zabbix-agent restart