IMG-LOGO
공지사항 :

Centos zabbix 설치

lmkfox - 2021-02-21 08:28:52 2879 Views 0 Comment

Centos 에 자빅스 설치 하기 

 

rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

 

설치를 위해 레파지토리 등록

 

그후 설치

 

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

# yum -y install zabbix-agent zabbix-get

 

패키지 설치 완료후 페차지토리 비활성화

 

# vi /etc/yum.repos.d/zabbix.repo

 

[zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/zabbix/2.2/rhel/6/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://repo.zabbix.com/non-supported/rhel/6/$basearch/ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=1

 

enabled=0 으로 변경 

 

DB 설치 

 

MySQL 설치

 

yum install mysql-server

 

# /etc/init.d/mysqld start

 

# /usr/bin/mysql_secure_installation

 

# mysql -u root -p

 

-------DB 적용--------

create database zabbix character set utf8;

 

ok

 

grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix-password';

 

ok

 

FLUSH PRIVILEGES;

 

ok

 

exit

 

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

 

zabbix용 DB 스키마와 데이터를 임포트

 

# mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.16/create/schema.sql

 

# mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.16/create/images.sql

 

# mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.16/create/data.sql

 

(버전에 따라 경로가 다를 수 있음)

 

zabbix 서버 의 설정

 

# vi /etc/zabbix/zabbix_server.conf

 

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

 

LogFile=/var/log/zabbix/zabbix_server.log

 

LogFileSize=0

 

 

PidFile=/var/run/zabbix/zabbix_server.pid

 
DBName=zabbix
 
DBUser=zabbix
 
DBPassword=zabbix-password
 
DBSocket=/var/lib/mysql/mysql.sock
 
SNMPTrapperFile=/var/log/snmptt/snmptt.log
 
AlertScriptsPath=/usr/lib/zabbix/alertscripts
 
ExternalScripts=/usr/lib/zabbix/externalscripts
 
 
WEB 설정
 
부팅 시 자동으로 zabbix 서버 시작 설정
 
# chkconfig zabbix-server on
 
PHP 설정에서 Timezone 설정
 
# vi /etc/php.ini
 
-------------------------------
date.timezone = Asia/Seoul
-------------------------------
 
아파치 재 실행!
 
# service httpd restart
 
자빅스 설정 
 
# cat /etc/httpd/conf.d/zabbix.conf
 
-----------------------------------------
#
Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
# php_value date.timezone Europe/Riga
</Directory>
<Directory "/usr/share/zabbix/conf">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/api">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/include">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
<Directory "/usr/share/zabbix/include/classes">
Order deny,allow
Deny from all
<files *.php>
Order deny,allow
Deny from all
</files>
</Directory>
---------------------------------------------------
 
초기 설정 
http://서버 IP/zabbix/
 
Next 넘기다가 3번째 configure DB connection 에서 
 
User : zabbix
Password : zabbix-password
 
그리고 계속 Next 누르면 끝
 
초기 비번은 admin // zabbix
 

댓글