logwatch インストール
[root@falcon21 ~]# dnf -y install logwatch
インストール済み:
logwatch-7.11-2.el10.noarch perl-Date-Manip-6.94-5.el10.noarch
完了しました!
—————-
Logwatchの設定ファイルの場所:
デフォルト設定: /usr/share/logwatch/default.conf/logwatch.conf
ローカル設定: /etc/logwatch/conf/logwatch.conf
root@falcon21:~# vi /etc/logwatch/conf/logwatch.conf
内容がない。default.confを参照して、ここに書き込む
又は、default.confをコピーして設定
root@falcon21:~# cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf
[root@falcon21 ~]# vi /etc/logwatch/conf/logwatch.conf 58 CharEncoding = “UTF-8” 63 Output = stdout 75 MailTo = root 85 Subject = “Logwatch from falcon21.space” 92 Mailto_host1 = xxxxxx@falcon21.space 97 MailFrom = Logwatch 158 mailer = “/usr/sbin/sendmail -t” 176 LogDir = /var/log |
デフォルトでcron.dailyに登録される。・・・毎日メールが届く [root@falcon21 ~]# ll /etc/cron.daily/ 合計 8 -rwxr-xr-x 1 root root 486 11月 27 2024 0logwatch -rwxr-xr-x 1 root root 213 11月 13 09:39 awstats logwach 手動コマンド [root@falcon21 ~]# /etc/cron.daily/0logwatch cronが実行されない場合は、cronデーモンを起動する # systemctl start crond.service # systemctl enable crond.service |