Setup SSMTP để Naigos sử dụng email ID gmail gửi mail alert


Setup SSMTP để Naigos sử dụng email ID gmail gửi mail alert

- Stop dịch vụ smtp mặc định

service sendmail stop   
chkconfig sendmail off
hoặc
service postfix stop   
chkconfig postfix off

- Download và cập nhật database các phần mềm mới

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm

- Cài đặt SSMTP

yum install ssmtp mailx

- Cấu hình ssmtp
+ Edit /etc/ssmtp/ssmtp.conf

FromLineOverride=YES
root=nagios
mailhub=smtp.gmail.com:587
UseTLS=YES
UseSTARTTLS=YES
AuthUser=abc@email.com
AuthPass=<pass plaintext>

- Thay đổi MTA mặc định

alternatives --config mta

*+ 1           /usr/sbin/sendmail.postfix
  2           /usr/sbin/sendmail.ssmtp

Enter to keep the current selection[+], or type selection number:

chọn 2

- Gửi mail test

echo "Testing outgoing email" | mailx -s "Testing" abc@domain.com

Post a Comment