서버 리소스의 임계치까지 사용했을때나, DB에 문제가 발생했을때 email을 통해 얼롯팅 받을 수 있도록 설정해보았습니다. (에러 발생시점부터 약 1~2분내로 알람을 받을 수 있습니다.)
Gmail 설정
외부 프로그램 연결 수신 Gmail 계정 활성화
로그인 화면에서 Gmail 사용자 이름과 비밀번호를 입력하십시오.
• https://myaccount.google.com/lesssecureapps
덜 안전한 응용 프로그램을 사용하려면 옵션을 선택하십시오.
■ GMAIL POP/IMAP 설정
gmail 톱니바퀴 모양 클릭 -> 모든 설정 보기
■전달 및 POP/IMAP -> IMAP사용
■ SSMTP 설치 (zabbix-server)
[root@localhost]# yum -y install ssmtp
[root@localhost]# vi /etc/ssmtp/ssmtp.conf
##본인 메일 설정에 맞게 수정
#mailhub=smtp.gmail.com:587
#rewriteDomain=your_local_domain
#hostname=your_local_FQDN
#UseTLS=Yes
#UseSTARTTLS=Yes
#AuthUser=Gmail_username
#AuthPass=Gmail_password
#FromLineOverride=YES
root=jeonghyun.kim@***.com
mailhub=smtp.gmail.com:465
FromLineOverride=YES
AuthUser=jeonghyun.kim@***.com
AuthPass=<gmail비밀번호>
UseTLS=YES
■ 메일 테스트
[root@mha-manager ~]# echo "E-Mail using the command-line" | ssmtp jeonghyun.kim@***.com

■ ZABBIX 미디어 타입 설정 (Administration -> Media types)
■ GMAIL 미디어 테스트
■ TEST 메일 확인
■ Administration -> USER 연락방법 설정 (관리 -> 유저)
■ 연락 방법 설정
■ Action 설정 ( Configuration -> Action )
- 기존 비활성화된 Action 을 활성화 시켜줍니다.
■ User setting
Alert Test
■ DB Slave Stop
■ 대시보드 확인
■ Email 확인
이상으로 email 얼롯팅 설정을 마치고, 다음글에선 telegram 연동을 해보겠습니다.
참고
https://www.tecmint.com/configure-zabbix-to-send-email-alerts-to-gmail/
How to Setup Zabbix to Send Email Alerts to Gmail Account
If you are using Zabbix to monitor your infrastructure you might want to receive email alerts from your local domain somewhere on a public internet domain, even if you don’t own a valid registered internet domain name with a mail server which you can con
www.tecmint.com
https://yunhyeonglee.tistory.com/49
Maria Replication 모니터링 ( feat. Zabbix )
고객으로부터 Maria Replication이 깨졌을 때 Alerting이 오도록 구성 요청을 받아서 테스트하게 되었다. ■ Zabbix Server 설치 2021.11.22 - [Open Source 툴] - 오픈소스 모니터링 Zabbix 5.0 설치 오픈소스 모..
yunhyeonglee.tistory.com
'Others > DB Monitoring' 카테고리의 다른 글
[ Zabbix - 카카오톡 알림 설정 ] part 5-1 (13) | 2022.02.11 |
---|---|
[ Zabbix - Telegram 연동 & PDF report생성 ] part 4 (0) | 2022.02.07 |
[ Zabbix - zabbix 수집 구성 ] part 2 (0) | 2022.02.07 |
[ Zabbix - DB monitoring 서버 구축 ] part 1 (0) | 2022.02.06 |
[ Graylog - Email 얼롯팅 설정 ] part 3 (0) | 2022.02.06 |