ページへ戻る
印刷
Syslog監視
をテンプレートにして作成 ::
Nest Of Hawk
xpwiki
:Syslog監視 をテンプレートにして作成
開始行:
[[Gentoo Linuxな生活/システム管理関連]]
*運用監視
サーバといっても、インストールして、動き出しさえすればOK...
*Syslog
SyslogはUNIXにおける動作ログを収集するスタンダードです。...
*Syslog監視ツール
そんなわけで、Syslog監視ツールなるものがあります。
:Swatch|リアルタイムで何か事があったら通知してくれるツール
:logwatch|ログファイルをスキャンして、ログの要約を通知し...
と、あります。で、私が選んだのはlogwatchです。だってさぁ...
**logwatchインストール
emerge -b logwatch
はい、インストール終了
**設定しましょう
/etc/log.dにlogwatch.confがあります。こいつを設定してやり...
#ログのある場所
LogDir = /var/log
#テンポラリエリア
TmpDir = /tmp
#メールを送る送付先
MailTo = XXXXX
#プリントアウトするかどうか
Print = No
#MkTempを使用するか
UseMkTemp = Yes
#いつのログを調査するか
Range = Yesterday
#ログ解析の詳細度
Detail = Low
どのサービスをチェックするか
Service = All
#メイルになんのツールを使用するか
mailer = /bin/mail
ほとんどデフォルトで問題ありません。さて、ここで問題なの...
**出力の調整
まず、構成から説明しますね
,/etc/log.d,logwatchの設定ルート
,/etc/log.d/conf,設定ファイルが入っている
,/etc/log.d/conf/logfiles,調べるlogファイル名の設定。
,/etc/log.d/conf/services,調べる動作サービスの設定
,/etc/log.d/scripts/,実際に調べるときに使うスクリプトファ...
となってます。
-/etc/log.d/conf/logfilesにどのファイルを調べるかを書いて...
-/etc/log.d/conf/servicesに、何のサービスについて、どのフ...
この2つでおっけーなはず。うちでは、amavis,apache,kernel,p...
ちと例を出すと、/etc/log.d/conf/services/postfix.conf
#####################################################
# $Id: postfix.conf,v 1.3 2004/02/03 03:52:18 kirk Exp $
#####################################################
# You can put comments anywhere you want to. They are e...
# rest of the line.
# this is in the format of <name> = <value>. Whitespace...
# and end of the lines is removed. Whitespace before an...
# is removed. Everything is case *insensitive*.
# Yes = True = On = 1
# No = False = Off = 0
Title = postfix ←/etc/log.d/scripts/servic...
# Which logfile group...
LogFile = messages ←messagesを調べる。messagesの定...
/etc/log.d/conf/lo...
# Only give lines pertaining to the postfix service...
*OnlyService = "postfix/[a-zA-Z0-9]*"
# *OnlyService = "postfix/smtpd"
*RemoveHeaders =
#####################################################
# This was written and is maintained by:
# Kenneth Porter <shiva@well.com>
#
# Please send all comments, suggestions, bug reports,
# etc, to shiva@well.com.
#
#####################################################
これはほとんど変更しておりません。で、次に/etc/log.d/conf...
#####################################################
# $Id: messages.conf,v 1.17 2002/10/13 15:24:27 kirk Exp $
#####################################################
#####################################################
# This was written and is maintained by:
# Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
# etc, to kirk@kaybee.org.
#####################################################
# What actual file? Defaults to LogPath if not absolute...
LogFile = messages ←ファイル名はmessages
# If the archives are searched, here is one or more line
# (optionally containing wildcards) that tell where they...
# Note: if these are gzipped, you need to end with a .gz...
# you use wildcards...
Archive = messages.* ←固めた過去ファイルはmessages.*
Archive = messages.*.gz
# Expand the repeats (actually just removes them now)
*ExpandRepeats ←アーカイブファイルもチェックする
# Now, lets remove the services we don't care about at a...
*RemoveService = talkd
*RemoveService = telnetd
*RemoveService = inetd
*RemoveService = nfsd
*RemoveService = /sbin/mingetty
# Keep only the lines in the proper date range...
*OnlyHost
*ApplyStdDate
こんな感じ。これもデフォルトそのままです。結構簡単にいけ...
--------------------- postfix Begin --------------------...
5856267 bytes transferred
89 messages sent
Messages sent by:
XXXXXX (uid=XX): : X Time(s)
XXXXXX (uid=X): : X Time(s)
Relaying denied:
From unknown[211.49.139.241] to username@put_a_valid_d...
さて、コレを見て解ること。誰かが不正中継を要求してきてま...
*最後に
logwatchを入れたから安心、というわけでは在りません。実際...
終了行:
[[Gentoo Linuxな生活/システム管理関連]]
*運用監視
サーバといっても、インストールして、動き出しさえすればOK...
*Syslog
SyslogはUNIXにおける動作ログを収集するスタンダードです。...
*Syslog監視ツール
そんなわけで、Syslog監視ツールなるものがあります。
:Swatch|リアルタイムで何か事があったら通知してくれるツール
:logwatch|ログファイルをスキャンして、ログの要約を通知し...
と、あります。で、私が選んだのはlogwatchです。だってさぁ...
**logwatchインストール
emerge -b logwatch
はい、インストール終了
**設定しましょう
/etc/log.dにlogwatch.confがあります。こいつを設定してやり...
#ログのある場所
LogDir = /var/log
#テンポラリエリア
TmpDir = /tmp
#メールを送る送付先
MailTo = XXXXX
#プリントアウトするかどうか
Print = No
#MkTempを使用するか
UseMkTemp = Yes
#いつのログを調査するか
Range = Yesterday
#ログ解析の詳細度
Detail = Low
どのサービスをチェックするか
Service = All
#メイルになんのツールを使用するか
mailer = /bin/mail
ほとんどデフォルトで問題ありません。さて、ここで問題なの...
**出力の調整
まず、構成から説明しますね
,/etc/log.d,logwatchの設定ルート
,/etc/log.d/conf,設定ファイルが入っている
,/etc/log.d/conf/logfiles,調べるlogファイル名の設定。
,/etc/log.d/conf/services,調べる動作サービスの設定
,/etc/log.d/scripts/,実際に調べるときに使うスクリプトファ...
となってます。
-/etc/log.d/conf/logfilesにどのファイルを調べるかを書いて...
-/etc/log.d/conf/servicesに、何のサービスについて、どのフ...
この2つでおっけーなはず。うちでは、amavis,apache,kernel,p...
ちと例を出すと、/etc/log.d/conf/services/postfix.conf
#####################################################
# $Id: postfix.conf,v 1.3 2004/02/03 03:52:18 kirk Exp $
#####################################################
# You can put comments anywhere you want to. They are e...
# rest of the line.
# this is in the format of <name> = <value>. Whitespace...
# and end of the lines is removed. Whitespace before an...
# is removed. Everything is case *insensitive*.
# Yes = True = On = 1
# No = False = Off = 0
Title = postfix ←/etc/log.d/scripts/servic...
# Which logfile group...
LogFile = messages ←messagesを調べる。messagesの定...
/etc/log.d/conf/lo...
# Only give lines pertaining to the postfix service...
*OnlyService = "postfix/[a-zA-Z0-9]*"
# *OnlyService = "postfix/smtpd"
*RemoveHeaders =
#####################################################
# This was written and is maintained by:
# Kenneth Porter <shiva@well.com>
#
# Please send all comments, suggestions, bug reports,
# etc, to shiva@well.com.
#
#####################################################
これはほとんど変更しておりません。で、次に/etc/log.d/conf...
#####################################################
# $Id: messages.conf,v 1.17 2002/10/13 15:24:27 kirk Exp $
#####################################################
#####################################################
# This was written and is maintained by:
# Kirk Bauer <kirk@kaybee.org>
#
# Please send all comments, suggestions, bug reports,
# etc, to kirk@kaybee.org.
#####################################################
# What actual file? Defaults to LogPath if not absolute...
LogFile = messages ←ファイル名はmessages
# If the archives are searched, here is one or more line
# (optionally containing wildcards) that tell where they...
# Note: if these are gzipped, you need to end with a .gz...
# you use wildcards...
Archive = messages.* ←固めた過去ファイルはmessages.*
Archive = messages.*.gz
# Expand the repeats (actually just removes them now)
*ExpandRepeats ←アーカイブファイルもチェックする
# Now, lets remove the services we don't care about at a...
*RemoveService = talkd
*RemoveService = telnetd
*RemoveService = inetd
*RemoveService = nfsd
*RemoveService = /sbin/mingetty
# Keep only the lines in the proper date range...
*OnlyHost
*ApplyStdDate
こんな感じ。これもデフォルトそのままです。結構簡単にいけ...
--------------------- postfix Begin --------------------...
5856267 bytes transferred
89 messages sent
Messages sent by:
XXXXXX (uid=XX): : X Time(s)
XXXXXX (uid=X): : X Time(s)
Relaying denied:
From unknown[211.49.139.241] to username@put_a_valid_d...
さて、コレを見て解ること。誰かが不正中継を要求してきてま...
*最後に
logwatchを入れたから安心、というわけでは在りません。実際...
ページ名: