Centos7 installing Logwatch with MSMTP mail client sending server monitoring analysis log

Source: Internet
Author: User

###########################

#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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.