반응형
1. Mysql Template : Agent User 및 권한 설정
CREATE USER 'zabbix'@'%' IDENTIFIED BY 'zabbix';
GRANT SELECT,USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zabbix'@'%';
2. OS 별 Agent 다운로드
## CentOS6 : http://repo.zabbix.com/zabbix/5.0/rhel/6/x86_64/zabbix-agent-5.0.9-1.el6.x86_64.rpm
## CentOS7 : http://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-agent-5.0.9-1.el7.x86_64.rpm
## Ubuntu14 release : http://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1%2Btrusty_all.deb
## tar (ubunru, centos 모두 설치 가능) : https://cdn.zabbix.com/zabbix/binaries/stable/5.0/5.0.9/zabbix_agent-5.0.9-linux-3.0-amd64-static.tar.gz
3. CentOS 7 zabbix-agent root 실행
## zabbix_agentd.conf 에 AllowRoot 옵션이 있으나 옵션 설정을 하고 데몬 시작을 하여도 zabbix user로 실행 되는 경우가 있음.
[root@ZABBIX-AGENT zabbix]# cat zabbix_agentd.conf | grep AllowRoot=
AllowRoot=1
## zabbix user로 zabbix-agent가 실행됨
[root@ZABBIX-AGENT zabbix]# ps aux | grep zabbix
zabbix 123959 0.0 0.0 79924 1272 ? S 16:04 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix 123960 0.0 0.0 79924 1912 ? S 16:04 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 123961 0.0 0.0 79924 1816 ? S 16:04 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix 123962 0.0 0.0 79924 2288 ? S 16:04 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 123963 0.0 0.0 79924 2268 ? S 16:04 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix 123964 0.0 0.0 79924 2248 ? S 16:04 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 124050 0.0 0.0 112816 964 pts/0 S+ 16:04 0:00 grep --color=auto zabbix
## 이경우 systemd service 설정에서 user와 group을 지정해 준다.
[root@ZABBIX-AGENT zabbix]# cat /usr/lib/systemd/system/zabbix-agent.service
...
[Service]
...
User=root
Group=root
...
## daemon reload
[root@ZABBIX-AGENT zabbix]# systemctl daemon-reload
## zabbix-agent 재시작후 확인
[root@ZABBIX-AGENT zabbix]# systemctl restart zabbix-agent
[root@ZABBIX-AGENT zabbix]# ps aux | grep zabbix
root 125582 0.0 0.0 79924 1268 ? S 16:06 0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
root 125583 0.0 0.0 79924 1908 ? S 16:06 0:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
root 125584 0.0 0.0 79924 2260 ? S 16:06 0:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
root 125585 0.2 0.0 80044 2308 ? S 16:06 0:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
root 125586 0.0 0.0 79924 2288 ? S 16:06 0:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
root 125587 0.0 0.0 79924 2244 ? S 16:06 0:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 125666 0.0 0.0 112816 964 pts/0 S+ 16:06 0:00 grep --color=auto zabbix
반응형
'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 |
1. zabbix server 설치 (0) | 2021.03.17 |