20가지가 넘는 알림들을 실시간으로 메일이나, 텔레그램, SMS, Email 등으로 보내주기 때문이다.
Netdata의 알림 기능을 사용해서 특정 프로그램의 CPU나 GPU의 점유율이 어느 정도 만큼 줄었을 때 설정한 알림을 통해 전달해주기 때문에 작업 종료를 빠르게 파악할 수 있다.
Email 알림을 이용한 글이 몇 개 없어 작업하는데 어려움을 겪어 이렇게 남겨놓는다..
Email 알림 구성
Netdata는 기본적으로 sendmail을 사용하여 이메일 알림을 보내지만 이메일 서버를 관리하는 것은 쉬운 일이 아니다.
Netdata는 SMTP를 지원하지 않지만 msmtp 클라이언트라는 패키지를 설치할 수 있어 SMTP 서버로 메일을 보낼 수 있다.
1. msmtp 설치
$ yum install msmtp
2. msmtp 구성 파일 생성
$ sudo vi /etc/msmtprc
3. 위에서 생성한 파일에 아래 내용 입력
# Set default values for all following accounts.
defaults
# Use the mail submission port 587 instead of the SMTP port 25.
port 587
# Always use TLS.
tls on
# The SMTP server of your ISP
account gmail
host smtp.gmail.com
auth on
user <yoursesusername>
password <yoursespassword>
# Set default account to isp
account default: gmail
4. 생성한 파일의 권한 수정
$ chmod 644 /etc/msmtprc
5. Email 알림 설정을 위해 Netdata의 구성 파일 편집
$ cd /usr/lib/netdata/conf.d/
$ vi health_alarm_notify.conf
6. 아래 내용을 찾아 msmtp 경로 입력
# The full path to the sendmail command.
# If empty, the system $PATH will be searched for it.
# If not found, email notifications will be disabled (silently).
sendmail="/usr/bin/msmtp"
7. 아래 내용을 찾아 이메일 발송인과 수신인의 세부 정보 입력
# email global notification options
# multiple recipients can be given like this:
# "admin1@example.com admin2@example.com ..."
# the email address sending email notifications
# the default is the system user netdata runs as (usually: netdata)
# The following formats are supported:
# EMAIL_SENDER="user@domain"
# EMAIL_SENDER="User Name <user@domain>"
# EMAIL_SENDER="'User Name' <user@domain>"
# EMAIL_SENDER="\"User Name\" <user@domain>"
EMAIL_SENDER="이메일 발송인"
# enable/disable sending emails
SEND_EMAIL="YES"
# if a role recipient is not configured, an email will be send to:
DEFAULT_RECIPIENT_EMAIL="이메일 수신인"
# to receive only critical alarms, set it to "root|critical"