반응형
## zabbix repository 추가
[root@ZABBIX]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
## zabbix server, agent 설치
[root@ZABBIX]# yum clean all
[root@ZABBIX]# yum install zabbix-server-mysql zabbix-agent2
[root@ZABBIX]# yum install centos-release-scl
## zabbix web front 설치
[root@ZABBIX]# cat /etc/yum.repos.d/zabbix.repo
...
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1 # 0 -> 1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
...
[root@ZABBIX]# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl
## Mariadb 설치
[root@ZABBIX]# yum install mariadb-server
[root@ZABBIX]# systemctl restart mariadb
[root@ZABBIX]# mysql_secure_installation
## DB, 사용자 생성
[root@ZABBIX]# mysql -u root -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY 'zbx_monitor';
mysql> grant all privileges on zabbix.* to zbx_monitor@'%';
mysql> quit
[root@ZABBIX]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzbx_monitor -p zabbix
## zabbix config 설정
[root@ZABBIX]# cat /etc/zabbix/zabbix_server.conf | grep -v ^# | egrep -v ^[[:space:]]*$
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBUser=zbx_monitor
DBPassword=zbx_monitor
StartPollers=40
StartPollersUnreachable=5
StartPingers=5
StartDiscoverers=10
StartHTTPPollers=5
JavaGateway=192.168.47.242
JavaGatewayPort=10052
StartJavaPollers=10
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
CacheSize=128M
HistoryCacheSize=128M
TrendCacheSize=64M
ValueCacheSize=64M
Timeout=30
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
## php 설정
[root@ZABBIX]# cat /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf | grep -v ^# | egrep -v ^[[:space:]]*$
[zabbix]
user = apache
group = apache
listen = /var/opt/rh/rh-php72/run/php-fpm/zabbix.sock
listen.acl_users = apache,nginx
listen.allowed_clients = 127.0.0.1
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35
php_value[session.save_handler] = files
php_value[session.save_path] = /var/opt/rh/rh-php72/lib/php/session/
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[max_input_vars] = 10000
php_value[date.timezone] = Asia/Seoul
## zabbix 시작
[root@ZABBIX]# systemctl restart zabbix-server zabbix-agent2 rh-nginx116-nginx rh-php72-php-fpm
[root@ZABBIX]# systemctl enable zabbix-server zabbix-agent2 rh-nginx116-nginx rh-php72-php-fpm
## java gateway 설치
[root@ZABBIX]# yum install zabbix-java-gateway
[root@ZABBIX]# systemctl enable zabbix-java-gateway
[root@ZABBIX]# systemctl restart zabbix-java-gateway
## 웹 접속
## 웹 접속 후 시작되는 설정은 /etc/zabbix/web/zabbix.conf.php 에 저장됨
반응형
'Monitoring Tools > Zabbix' 카테고리의 다른 글
7. [zabbix agent] varnish (0) | 2021.03.17 |
---|---|
6. [zabbix agent] redis (0) | 2021.03.17 |
4. [오류수정] zabbix DB Replication error (0) | 2021.03.17 |
3. [이중화] zabbix DB replication (0) | 2021.03.17 |
2. zabbix Agent 환경 (0) | 2021.03.17 |