logwatchインストール

[root@falcon21 ~]# yum -y install logwatch
インストール:
  logwatch.noarch 0:7.4.0-35.20130522svn140.el7_5

依存性関連をインストールしました:
  perl-Date-Manip.noarch 0:6.41-2.el7 perl-Sys-CPU.x86_64 0:0.54-4.el7 perl-Sys-MemInfo.x86_64 0:0.91-7.el7

完了しました!


/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