因为logwatch默认要使用sendmail服务,所以请参考linux之发送邮件--sendmail服务配置首先设置正确sendmail服务。
harvey@harvey-Virtual-Machine:~$ tree /etc/logwatch/ /etc/logwatch/ ├── conf │ ├── logfiles │ └── services └── scripts └── services 5 directories, 0 files
harvey@harvey-Virtual-Machine:~$ tree /usr/share/logwatch/default.conf/ /usr/share/logwatch/default.conf/ ├── html │ ├── footer.html │ └── header.html ├── ignore.conf ├── logfiles │ ├── autorpm.conf │ ├── bfd.conf ... │ ├── vsftpd.conf │ ├── windows.conf │ ├── xferlog.conf │ └── yum.conf ├── logwatch.conf #这个就是我们马上要配置的文件 └── services ├── afpd.conf ... └── zz-zfs.conf 3 directories, 149 files
sudo vim /usr/share/logwatch/default.conf/logwatch.conf #1,配置mailto 为自己的邮箱
logwatch --mailto youmail@youmail.com
linux日志服务之logwatch,布布扣,bubuko.com
原文:http://www.cnblogs.com/zhanghaiyublog/p/3617710.html