Logwatch って? †
- 前提条件
- logwatchパッケージがインストール*1されていることが条件。
パッケージの確認は、rpm -q logwatchコマンドで確認できるよ。
logwatch を設定する †
- logwatch 7.x系からなのか設定ファイルの位置が異なっているの注意する(はまった)。
- 毎日logを収集するためにcron.dailyに設定する。
# ls -al /usr/share/logwatch/scripts/logwatch.pl
# ln -s /usr/share/logwatch/scripts/logwatch.pl /etc/cron.daily/
# ls -al /etc/cron.daily/logwatch.pl
- logwatch.conf ファイルをコピーし以下の定義値を修正または追加する。
※もちろんバックアップをしてから作業すること。
# cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf
- /etc/logwatch/conf 以下の定義値を修正または追加する。
※もちろんバックアップをしてから作業すること。
# Default person to mail reports to. Can be a local account or a
# complete email address.
MailTo = hoge@sea-bird.org
# The default detail level for the report.
# This can either be Low, Med, High or a number.
# Low = 0
# Med = 5
# High = 10
Detail = High
# From here with out breaking anything. This would allow mail/mailx/nail etc..... -mgt
mailer = "/usr/sbin/sendmail -t"
- 変更点
- MailTo に、logwatch で集計した結果を送るメールアドレスを指定する
Detail には、reportの解析度を指定しますが一番高い(High)でいいでしょう
logwatch の運用方法 †
- とりあえず毎日、こまめにみてください。特にメール関係は、spamが多いので遮断するとか対処もできるし
Webにいたってはアタック攻撃も結構されているので、遮断するとかとにかくウザイ人を排除したほうがいいです。
参考にさせて頂いたサイト様 †
|