###########################
#DATE 2016-07-29 #
#Authur by Denilas Yeung #
###########################
First, install the MSMTP
Download MSMTP:HTTP://JAIST.DL.SOURCEFORGE.NET/PROJECT/MSMTP/MSMTP/1.6.5/MSMTP-1.6.5.TAR.XZ
Because the file format is XZ, the decompression method is:
#xz-D Msmtp-1.6.5.tar.xz
#tar XVF Msmtp-1.6.5.tar
#cd msmtp-1.6.5
#./configure--PREFIX=/USER/LOCAL/MSMTP
#make
#make Install
#/usr/local/msmtp/bin/msmtp-p #确认配置文件存放路径, Centos7 configuration file created MSMTPRC file under/usr/local/etc/, centos6.x in/usr/local/msmtp/ Create a MSMTPRC file under etc/
#vi/USR/LOCAL/ETC/MSMTPRC
Account AccountName
Logfile/usr/local/msmtp/msmtp.log
Host Smtp.xxx.com
Port 25
From [email protected]
Auth Login
TLS off
User [email protected]
Password Password
Account Default:accountname
#保存退出
#/usr/local/msmtp/bin/msmtp [email protected] #测试是否能发送邮件
At this point, the MSMTP configuration is complete
#########################################################################################
Second, installation configuration Logwatch
#yum-y Install Logwatch
#whereis Logwatch #查看logwatch安装后在系统那些文件夹下, the default configuration file is/usr/share/logwatch/default.conf/logwatch.conf
#vi/usr/share/logwatch/default.conf/logwatch.conf #修改以下几个参数
MailTo = Recipient e-mail address to receive
Mailfrom = who issued
Detail = low ro Med or High #系统日志分析报告的详细度: Simple, Medium, detailed
Mailer = "/usr/local/msmtp/bin/msmtp-t" #默认为sendmail, modify the path to MSMTP
#保存退出
#/usr/share/logwatch/scripts/logwatch.pl--mailto [email protected] #测试目前系统日志分析报告发送至 [email protected] mail, check whether you receive. The default system sends a report of the previous day, which can be modified in the configuration file.
###########################################################################################
These are the handy notes for today's configuration!
This article is from "Yang Aerospace" blog, please be sure to keep this source http://denilas.blog.51cto.com/244465/1832012
Centos7 installing Logwatch with MSMTP mail client sending server monitoring analysis log