[root@falcon21 ~]# yum -y install logwatch
インストール済み:
  logwatch-7.4.3-9.el8.noarch     perl-Sys-CPU-0.61-14.el8.x86_64     perl-Sys-MemInfo-0.99-6.el8.x86_64
 
完了しました!
 
 
----------------
 
/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
 
メールが届く
 
**********************************************************
投票数:3 平均点:10.00

 
Back to Top