最近部落格的主机有点搞笑,主机商好像搞混了我的意思,唉唉…废话不说了,开始鞭… 🤖🤓🤖
# 这边只需要按几次ENTER用默认值安装即可 🤓
1 2 3 4 5 6 |
cd /opt wget http://downloads.sourceforge.net/project/logwatch/logwatch-7.5.4/logwatch-7.5.4.tar.gz tar xfz logwatch-7.5.4.tar.gz cd logwatch-7.5.4 chmod +x install_logwatch.sh ./install_logwatch.sh |
cd /opt
mv /etc/logwatch/conf/logwatch.conf /etc/logwatch/conf/logwatch.conf.bak
cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf
rm -rf logwatch-7.5.4
接下来改一下设定
vi /etc/logwatch/conf/logwatch.conf
第35行 – 寄给谁这当然要弄一下滴
MailTo = qoo@gmail.com
第48行 – 输出方式
Print = No
第72行 – 分析的细节度
Detail = High
第79行 – 要分析的服务项目,这后面可以接着补上不侦测的服务
Service = All
例如不想侦测http、iptables就这样补在后面
Service = "-http"
Service = "-iptables"
详细可分析的项目可以到程式目录查看
/usr/share/logwatch/scripts/services/
最后再执行一次看看能不能正确收的信吧~ Logwatch在安装的时候已经自动建立一个cron,所以能收到信就是OK了。
logwatch --detail Low
