logwatchインストール
[root@falcon21 ~]# yum -y install logwatch

/usr/share/logwatch/default.conf/logwatch.confをコピー・編集
[root@falcon21 ~]# cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf

[root@falcon21 ~]# vi /etc/logwatch/conf/logwatch.conf

76 Detail = High //High に修正して詳しく表示

***************************
logwatch はデフォルトで毎日1回ログレポートをメール送信する
[root@falcon21 ~]# vi /etc/cron.daily/0logwatch
#!/bin/sh

#Set logwatch location
LOGWATCH_SCRIPT="/usr/sbin/logwatch"
#Add options to this line. Most options should be defined in /etc/logwatch/conf/logwatch.conf,
#but some are only for the nightly cronrun such as --output mail and should be set here.
#Other options to consider might be "--format html" or "--encode base64", man logwatch for more details.
OPTIONS="--output mail"

#Call logwatch
$LOGWATCH_SCRIPT $OPTIONS

exit 0

------------------------------
実行確認
[root@falcon21 ~]# /etc/cron.daily/0logwatch

メールが届く
**********************************************************

投票数:1 平均点:10.00

 
Back to Top