Unix監視 の概要

Unix監視の概要
ENCYCLOPEDIA
ENCYCLOPEDIA
Unix監視
の概要
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited1 1991 - 2012
Unix監視の概要
ENCYCLOPEDIA
目次
Argent Extended Technologyを使用したUNIXの監視 3
アーキテクチャ4
アーキテクチャ – エージェントレス5
アーキテクチャ – エージェントベース5
Argent Guardian6
Argent Guardian – ルール7
Argent Guardian –「警告」ルール8
Argent Guardian –「警告」ルール、個々のオブジェクトに対するイベントの発生 12
Argent Guardian –「予測」ルール18
Argent Guardian –「警告」ルールと
「予測」ルールの連結23
Argent Data Consolidator30
付録A: UNIXSSH.INI 32
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
2
Unix監視の概要
Argent Extended Technologyを
使用したUNIXの監視
Argent XTは、UNIX環境を管理するために使用できる包
括的な監視および警告のソリューションです。
Argent XTは1つの製品パッケージとして提供され、多様
なネットワーク環境およびセキュリティ要件に適合する
柔軟なアーキテクチャ・オプションを提供します。
Argent Guardianには、全体をカスタマイズできるシェ
ル・スクリプトとして記述されたルールを使用して、UNIX
サーバ上ですべてのメトリックを監視する機能がありま
す。
Argent Predictorを使用して、Argent Guardianルールの
実行によって保存されたパフォーマンス・データに関する
グラフやレポートを作成します。
ENCYCLOPEDIA
Argent XTには、UNIXシステムの監視に関する以下の7つ
のオプションがあります。
•
•
•
•
•
•
•
Telnet
SSH
SSHリレー・エージェント
UNIXセキュア・エージェント
UNIXシェル・スクリプト・エージェント
UNIXデーモン
UNIXルール・エンジン
これらのオプションは、セキュリティ要件やネットワーク・
アーキテクチャなどに応じて、ぞれぞれ異なる機能とメリ
ットを提供します。
Argent XTのアーキテクチャは、大きく分けて2つのカテゴ
リ、エージェントレス監視とエージェントベース監視に分
類されます。
Argent Data Consolidatorは、ログ・ファイル、ASCIIファイ
ル、システムログ・メッセージなどを管理する包括的なソ
リューションです。
Argent SNMP Monitorを使用して、UNIXサーバ上の
SNMPが有効な環境で、ルールに基づいたSNMPを作成
できます。
Argent Monitor for VMwareでは、VMware ESXサーバの
監視をカスタマイズするために、同じタイプのUNIXシェ
ル・スクリプト・ルールを使用できます。
このマニュアルでは、Argent XTを使用するUNIXの監視
の概要が示されます。以下に関する知識を前提としてい
ます。
•
•
•
•
UNIXシステムの操作知識
ボーン・シェル・スクリプトの基礎知識
XMLの基礎知識
Argent XTの概念について精通していること
Argentのドキュメントはすべて次のURLからオンラインで
入手できます。http://help.Argent.com
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
3
Unix監視の概要
ENCYCLOPEDIA
アーキテクチャ
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
4
Unix監視の概要
ENCYCLOPEDIA
アーキテクチャ –
エージェントレス
アーキテクチャ –
エージェントベース
エージェントレス監視は、監視対象となるUNIXサーバに
何もインストールする必要がないため、最も簡単に設定
できます。すべてのルール(シェル・スクリプト)は、
メイン
のArgent XT Windowsサーバに格納され、Telnetまたは
SSHセッションを介してリモートで実行されます。
SSHリレー・エージェント
SSHリレー・エージェントは、SSH接続ワークロードを
Windows監視エンジンからUNIXマシンにシフトします。
これにより、通常、SSH接続の効率が向上します。
Telnet
UNIXマシンにシフトするには、他のUNIXサーバを監視す
る専用のUNIXサーバにSSHリレー・エージェントをインス
トールする必要があります。
Windows監視エンジンは、Telnetセッションを介してルー
ルを実行し、警告およびレポートを中央管理するために
情報がリードバックされます。
Telnet通信は、完全なプレーンテキストで、セキュリティで
保護されていません。
SSH
一方、SSHは完全にすべてが暗号化され、セキュリティで
保護されています。
これは、PuTTyツール、PSCP、およびPLINKを利用し
て、Argent XT Windowsサーバから実現します。
これらの詳細については、
「付録A: UNIXSSH.INI」を参照し
てください。
Windows監視エンジンは、SSHを介して監視対象サーバ
への接続を確立するSSHリレー・エージェントにルールを
送信し、ルールを実行して、情報を送り返します。
TelnetやSSHを使用する代わりに、ローカルUNIX監視エ
ージェントを監視するUNIXシステムにインストールするこ
ともできます。
UNIXセキュア・エージェント
UNIXセキュア・エージェントは、監視対象となるサーバ上
にインストールするバイナリ実行可能ファイルです。
このエージェントは、inetd/xinetdスーパー・デーモンを
介して起動され、専用のセキュリティで保護されたチャ
ネルでリッスンします。
Windows監視エンジンからルールが送信され、ローカル
で実行して、情報を送り返します。
UNIXシェル・スクリプト・エージェント
UNIXシェル・スクリプト・エージェントは、監視対象となる
サーバ上にインストールするシェル・スクリプトです。
UNIXセキュア・エージェントと同様に、
このエージェント
はinetd/xinetdを介して起動され、セキュリティで保護さ
れたチャネルでリッスンします。
シェル・スクリプトであるため、カスタマイズが可能
で、UNIXセキュア・エージェントのバイナリが存在しない
システム上でも使用できます。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
5
Unix監視の概要
ENCYCLOPEDIA
UNIXデーモン
Argent Guardian
専用のデーモンとしてインストールされ、Windows監視
エンジンから送信されるルールをセキュリティで保護さ
れたチャネルでリッスンします。
Argent Guardianは、Windows、UNIX、iSeriesなどのすべ
てのアプリケーションに対応した業界で最もスケーラブ
ルなソリューションの1つで、独特のアーキテクチャを駆
使してすべてのビジネス・アプリケーションの正常性やパ
フォーマンスを監視します。Argentでは、エージェントレ
スまたはエージェントベースの監視を同じレベルで、
しか
も同じ費用で提供します。
UNIXデーモンは、UNIXセキュア・エージェントに似ていま
すが、inetd/xinetdを必要としません。
UNIXルール・エンジン
UNIXルール・エンジンは、Argent Mother/Daughterアー
キテクチャの概念に類似しています。
メインArgentサーバから順次命令を取得し、監視される
サーバへのSSH接続を確立して、
メインArgentサーバに
結果を送り返します。
これにより、
フォールト・トレランスが強化され、Windows
監視サーバからの接続負荷が除去されます。それぞれの
UNIXルール・エンジンがメインArgentサーバへの接続を
開始し、開く必要のあるポートが1つになるため、
ファイア
ウォールの設定が簡単になります。
7つのオプションの詳細については、http://help.Argent.
com/#unix_sevenも参照してください。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
柔軟性がありUNIX管理者やLinux管理者によって広く
使用されているスクリプトベースのシステムを使用し
て、UNIXサーバで実行するアプリケーションを監視しま
す。
Unixルールは、以下のような一般的なプラットフォームす
べてに使用できます。
•
•
•
•
•
Solaris
HP-UX
AIX
SCO
Linux
6
Unix監視の概要
ENCYCLOPEDIA
Argent Guardian – ルール
Argent Guardianには、UNIXのさまざまなベースライン・メトリック(CPU使
用率、
メモリなど)を監視する多くのルールがプレインストールされていま
す。
Argent GuardianでのUNIX監視の既存のルールは、
[監視]>[UNIXルール]>[UNIXフレーバ]からアクセスできます。
すべてのルールは、UNIXフレーバごとにまとめられており、さらに「警告」
ルールと
「予測」ルールに分類されます。
デフォルトで、
「警告」ルールは、特定の条件に一致すると(例えば、
レポー
ト用のデータが何も保存されない)、アラートをトリガするように記述され
ています。
これは、
「予測」ルールを使用して実行され、接頭辞“_PDT_”に
よって区別されます。
例:
SCP_AIX_DISK_SPACE_10は、空きディスク領域が10%未満になるとアラ
ートをトリガするという
「警告」ルールです。
SCP_AIX_PDT_DISK_FREEは、
レポート、
グラフ化、傾向分析のために、%
Free Disk SpaceメトリックをArgent Predictorに保存するルールです。
http://help.Argent.com/#rul_ag_linux_monも参照してください。
Noどちらのアーキテクチャ・オプションを選択したとしても、UNIX監視の
すべてのルールは同じ方法(ボーン・シェル・スクリプト)で記述されます。
この方法により、既存のルールのカスタマイズ、新規ルールの記述、また
は既存スクリプトの適用を実行できます。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
7
Unix監視の概要
ENCYCLOPEDIA
Argent Guardian –「警告」ルール
以下の空きディスク領域を監視する
「警告」ルールの例は、デフォルトの
SCP_LINUX_DISK_SPACE_10に似ていますが、読みやすさを考慮して簡
略化されています。
ルールの出力がXML形式に従っている限り、ルールの実際のロジック全
体をカスタマイズでき、必要に合わせてスクリプトを変更できます。
#!/bin/sh
# Header information, etc....
STATUS=NOVAL
SUMMARY=NOVAL
COMMENT=NOVAL
# xmlOut() - prints an entire XML output for a command script.
# Used for The Argent Guardian rules that return a PASS/FAIL
# status and summary and comment descriptions.
xmlOut()
{
xmlBegin
xmlStatus
xmlEnd
}
# xmlBegin() - Prints out the definition of the XML format used to
# send status data to The Argent Guardian.
xmlBegin()
{
cat <<!
<?xml version=”1.0”?>
<!DOCTYPE TAGResult
[
<!ELEMENT TAGResult (QEResult+)>
<!ELEMENT QEResult (status, summary, comment)>
<!ELEMENT status (#PCDATA)> <!-- (PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
]>
<TAGResult>
!
} # End of xmlBegin()
# xmlStatus() - Send a status block to The Argent Guardian. The
# status should be ‘PASS’ or ‘FAIL’. The summary explains the result
# and the comment is a generic description of the Unix rule.
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
8
Unix監視の概要
ENCYCLOPEDIA
xmlStatus()
{
cat <<!
<QEResult>
<status>$STATUS</status>
<summary>$SUMMARY</summary>
<comment>$COMMENT</comment>
</QEResult>
!
} # End of xmlStatus()
# xmlEnd() - Completes the XML data block.
xmlEnd()
{
cat <<!
</TAGResult>
!
} # End of xmlEnd()
############################# Main portion of script##########################
# Set the IFS variable, which is used by the read command to parse input.
# We wish to read the input one line at a time.
IFS=’
# Use the df command to get information about the filesystems.
DFCMD=”df -P”
#
# The FREE_PCT variable defines the minimum percentage of free disk space
# for each filesystem.
FREE_PCT=90
# Assume the status of the rule is OK
STATUS=PASS
EXIT_CODE=0
SUMMARY=”All filesystems have at least ${FREE_PCT}% of their space free”
COMMENT=”Used ${DFCMD} to get File System capacities.”
# Iterate through all the filesystems
for fs in `eval $DFCMD`; do
# FS is the actual filesystem, MNT is the mounted directory. Include
# an ‘x’ before the line in case the filesystem is blank.
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
9
Unix監視の概要
ENCYCLOPEDIA
FS=`echo $fs | awk ‘ { print $1 } ‘`
MNT=`echo x$fs | awk ‘ { print $6 } ‘`
# Skip the first line of DFCMD, which is the column headers
if [ “$FS” = “Filesystem” ]; then
continue
fi
# Derive the free space from the capacity used and compare it to
# the threshold.
CAPACITY=`echo $fs | awk ‘ { print $5 } ‘`
CAPACITY=`echo $CAPACITY | sed ‘s/%//’`
FREE_SPACE=`expr 100 - $CAPACITY`
if [ “$FREE_SPACE” -lt “$FREE_PCT” ]; then
# Update the summary string.
if [ $STATUS = “PASS” ]; then
SUMMARY=”These filesystems have less than ${FREE_PCT}% Free Space.”
EXIT_CODE=1
fi
STATUS=FAIL
SUMMARY=”${SUMMARY}
$MNT: ${FREE_SPACE}% Free “
fi
done
# Report the findings back to The Argent Guardian
xmlOut
exit $EXIT_CODE
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
10
Unix監視の概要
ENCYCLOPEDIA
このルールを実行すると、以下が出力され、Argent Guardianによって読み取られます。
<?xml version=”1.0”?>
<!DOCTYPE TAGResult
[
<!ELEMENT TAGResult (QEResult+)>
<!ELEMENT QEResult (status, summary, comment)>
<!ELEMENT status (#PCDATA)> <!-- (PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
]>
<TAGResult>
<QEResult>
<status>FAIL</status>
<summary>These filesystems have less than 90% Free Space.
/: 64% Free
/boot: 87% Free </summary>
<comment>Used df -P to get File System capacities.</comment>
</QEResult>
</TAGResult>
このXMLブロックは、Argent Guardianにリードバックされ、以下のアラートがArgent Alert Consoleを
介して送信されます。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
11
Unix監視の概要
ENCYCLOPEDIA
Argent Guardian –「警告」ルール、個々のオ
ブジェクトに対するイベントの発生
通常、Argent UNIXルールは、条件に対して1つのイベントを実行するよう
に構成されます。ルールのスクリプト全体はブール値PASSまたはFAILとし
て扱われます。
例えば、組み込まれているSCP_LINUX_DISK_SPACE_60を考慮してみまし
ょう。
このルールのスクリプトが実行されたファイル・システムに60%未満
の空き領域しかなかった場合、
このルールが適用されます。
しかし、空き領域が60%未満のファイル・システムすべてに対して1つのイ
ベントのみが実行されます。結果として、すべてのファイル・システムの空
き領域が60%以上にならないと、条件が解除されません。
イベントを同じ
「XTイベント」
として識別する内部のメカニズムは、以下の
フィールドを比較します。
•
•
•
•
ノード名
リレータ名
ルール名
比較文字列
個々のオブジェクトを識別するために、新しいタグ‘COMPARE’が追加され
ます。以前のファイル・システムのサンプル・ルールでは、
ファイル・システ
ム名をCOMPARE値に指定する必要がありました。
ルールのロジックでも、複数の‘QERESULT’タグ(適用されるファイル・シス
テムごとに1つ)を出力するように変更されました。
また、[パフォーマンス・インスタンスごとに個別のイベントを発生させる]
オプションをチェックする必要があります。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
12
Unix監視の概要
http://help.Argent.com/#Q716も参照してください。
ENCYCLOPEDIA
#!/bin/sh
# Header information, etc....
STATUS=NOVAL
SUMMARY=NOVAL
COMMENT=NOVAL
COMPARE=NOVAL
# xmlBegin() - Prints out the definition of the XML format used to
# send status data to The Argent Guardian.
xmlBegin()
{
cat <<!
<?xml version=”1.0”?>
<!DOCTYPE TAGResult
[
<!ELEMENT TAGResult (QEResult+)>
<!ELEMENT QEResult (status, summary, comment, compare)>
<!ELEMENT status (#PCDATA)> <!-- (PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
<!ELEMENT compare (#PCDATA) >
]>
<TAGResult>
!
} # End of xmlBegin(
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
13
Unix監視の概要
ENCYCLOPEDIA
# xmlStatus() - Send a status block to The Argent Guardian. The
# status should be ‘PASS’ or ‘FAIL’. The summary explains the result
# and the comment is a generic description of the Unix rule.
xmlStatus()
{
cat <<!
<QEResult>
<status>$STATUS</status>
<summary>$SUMMARY</summary>
<comment>$COMMENT</comment>
<compare>$COMPARE</compare> </QEResult>
!
} # End of xmlStatus()
# xmlEnd() - Completes the XML data block.
xmlEnd()
{
cat <<!
</TAGResult>
!
} # End of xmlEnd()
############################# Main portion of script ##########################
# Set the IFS variable, which is used by the read command to parse input.
# We wish to read the input one line at a time.
IFS=’
‘
# Use the df command to get information about the filesystems.
DFCMD=”df -P”
#
# The FREE_PCT variable defines the minimum percentage of free disk space
# for each filesystem.
FREE_PCT=90
# Assume the status of the rule is OK
STATUS=PASS
EXIT_CODE=0
SUMMARY=”All filesystems have at least ${FREE_PCT}% of their space free”
COMMENT=”Used ${DFCMD} to get File System capacities.”
xmlBegin
# Iterate through all the filesystems
for fs in `eval $DFCMD`; do
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
14
Unix監視の概要
ENCYCLOPEDIA
# FS is the actual filesystem, MNT is the mounted directory. Include
# an ‘x’ before the line in case the filesystem is blank.
FS=`echo $fs | awk ‘ { print $1 } ‘`
MNT=`echo x$fs | awk ‘ { print $6 } ‘`
# Skip the first line of DFCMD, which is the column headers
if [ “$FS” = “Filesystem” ]; then
continue
fi
# Derive the free space from the capacity used and compare it to
# the threshold.
CAPACITY=`echo $fs | awk ‘ { print $5 } ‘`
CAPACITY=`echo $CAPACITY | sed ‘s/%//’`
FREE_SPACE=`expr 100 - $CAPACITY`
COMPARE=$MNT
if [ “$FREE_SPACE” -lt “$FREE_PCT” ]; then # Update the summary string. SUMMARY=”File System $MNT (${FREE_SPACE}%) has less than ${FREE_PCT}% Free Space.”
STATUS=FAIL
EXIT_CODE=1
fi
xmlStatus
done
if [ $STATUS = “PASS” ]; then
xmlStatus
fi
# Report the findings back to The Argent Guardian
xmlEnd
exit $EXIT_CODE
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
15
Unix監視の概要
ENCYCLOPEDIA
出力形式の変更に注目してください。複数の‘QERESULT’タグ(適用されるファイル・システムごとに1
つ)があります。
<?xml version=”1.0”?>
<!DOCTYPE TAGResult
[
<!ELEMENT TAGResult (QEResult+)>
<!ELEMENT QEResult (status, summary, comment, compare)> <!ELEMENT status (#PCDATA)> <!-- (PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
<!ELEMENT compare (#PCDATA) >
]>
<TAGResult>
<QEResult>
<status>FAIL</status>
<summary>File System / (64%) has less than 90% Free Space.</summary>
<comment>Used df -P to get File System capacities.</comment>
<compare>/</compare>
</QEResult>
<QEResult>
<status>FAIL</status>
<summary>File System /boot (87%) has less than 90% Free Space.</summary>
<comment>Used df -P to get File System capacities.</comment>
<compare>/boot</compare>
</QEResult>
</TAGResult>
これは、各ファイル・システムのArgent Alert Consoleで発生する個々のアラートに対応します。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
16
Unix監視の概要
ENCYCLOPEDIA
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
17
Unix監視の概要
ENCYCLOPEDIA
Argent Guardian –「予測」ルール
以下の空きディスク領域を監視する
「予測」ルールの例は、デフォルトの
SCP_LINUX_PDT_DISK_FREEに似ていますが、読みやすさを考慮して簡略
化されています。
このルールは、オリジナルの空きディスク領域ルールに似たロジックを使
用しますが、パフォーマンス・データの収集のみに使用されます。
#!/bin/sh
# Header information, etc....
OBJECT=NOVAL
COUNTER=NOVAL
INSTANCE=NOVAL
METRIC=NOVAL
# xmlBegin() - Prints out the definition of the XML format used to
# send status data to The Argent Guardian.
xmlBegin()
{
cat <<!
<?xml version=”1.0”?>
<!DOCTYPE PDTResult
[
<!ELEMENT PDTResult (QEResult+)>
<!ELEMENT QEResult (status, performance+)>
<!ELEMENT status (#PCDATA)> <!-- (PERFORMANCE) -->
<!ELEMENT performance (object, counter, instance, metric)>
<!ELEMENT object (#PCDATA) >
<!ELEMENT counter (#PCDATA) >
<!ELEMENT instance (#PCDATA) >
<!ELEMENT metric (#PCDATA) >
]>
<PDTResult>
!
} # End of xmlBegin()
# xmlPerformance() - Send a performance block to The Argent Predictor. The
# actual value of the metric is stored in <metric>. The other fields
# are used to describe the metric. Multiple xmlPerformance() calls may be
# made between the xmlBegin() and xmlEnd() functions.
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
18
Unix監視の概要
ENCYCLOPEDIA
xmlPerformance()
{
cat <<!
<QEResult>
<status>performance</status>
<performance>
<object>$OBJECT</object>
<counter>$COUNTER</counter>
<instance>$INSTANCE</instance>
<metric>$METRIC</metric>
</performance>
</QEResult>
!
} # End of xmlPerformance()
# xmlEnd() - Completes the XML data
xmlEnd()
{
cat <<!
</PDTResult>
!
} # End of xmlEnd()
############################# Main portion of script ##########################
# Set the IFS variable, which is used by the read command to parse input.
# We wish to read the input one line at a time.
IFS=’
‘
OSNAME=`uname`
EXIT_CODE=0
# Define any directories you wish to ignore here. Directory variables
# should start at ‘1’ and increment continuously. The following are
# three example variables (that would need to be uncommented).
# Begin output to The Argent Predictor by sending the XML header.
OBJECT=”$OSNAME Filesystem”
COUNTER=”Pct Free Disk Space”
xmlBegin
# Use the df commmand to get the free space for each filesystem.
DF_CMD=”df -P”
for fs in `eval $DF_CMD`; do
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
19
Unix監視の概要
ENCYCLOPEDIA
# FS is the actual filesystem, MNT is the mounted directory. Include
# an ‘x’ before the line in case the filesystem is blank.
FS=`echo $fs | awk ‘ { print $1 } ‘`
MNT=`echo x$fs | awk ‘ { print $6 } ‘`
# Skip the first line of the df command output, which is the column headers
if [ “$FS” = “Filesystem” ]; then
continue
fi
# Get the capacity (disk space used) and the free space
CAPACITY=`echo $fs | awk ‘ { print $5 } ‘`
CAPACITY=`echo $CAPACITY | sed ‘s/%//’`
FREE_SPACE=`expr 100 - $CAPACITY`
# Send performance data to The Argent Predictor
INSTANCE=$MNT
METRIC=$FREE_SPACE
xmlPerformance
done
# Send the XML footer to The Argent Predictor
xmlEnd
exit $EXIT_CODE
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
20
Unix監視の概要
ENCYCLOPEDIA
出力における変更点に注目してください。‘PDTRESULT’タグは、パフォーマンス・デ
ータを識別するために使用され、それぞれの‘QERESULT’タグは個々のパフォーマ
ンス・インスタンスに対応します。
<?xml version=”1.0”?>
<!DOCTYPE PDTResult
[
<!ELEMENT PDTResult (QEResult+)>
<!ELEMENT QEResult (status, performance+)>
<!ELEMENT status (#PCDATA)> <!-- (PERFORMANCE) -->
<!ELEMENT performance (object, counter, instance, metric)>
<!ELEMENT object (#PCDATA) >
<!ELEMENT counter (#PCDATA) >
<!ELEMENT instance (#PCDATA) >
<!ELEMENT metric (#PCDATA) >
]>
<PDTResult>
<QEResult>
<status>performance</status>
<performance>
<object>Linux Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/</instance>
<metric>64</metric>
</performance>
</QEResult>
<QEResult>
<status>performance</status>
<performance>
<object>Linux Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/boot</instance>
<metric>87</metric>
</performance>
</QEResult>
<QEResult>
<status>performance</status>
<performance>
<object>Linux Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/dev/shm</instance>
<metric>100</metric>
</performance>
</QEResult>
</PDTResult>
このパフォーマンス・データはArgent Predictorに格納され、
グラフやレポートの
作成、傾向分析の履歴データの提供などに使用できます。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
21
Unix監視の概要
ENCYCLOPEDIA
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
22
Unix監視の概要
ENCYCLOPEDIA
Argent Guardian –「警告」ルールと
「予測」
ルールの連結
デフォルトで、Argent Guardian UNIXルールは、
「警告」ルールと
「予測」ル
ールに分けられていますが、1つのルールに連結できます。
技術的な操作により、2つのタイプのルールを連結して、
アラートを送信
し、予測データを保存できます。
以下に、
アラートの送信、個々のアイテムに対するアラートの送信、予測
データの保存を実行するオプションを連結したルールの例を示します。
#!/bin/sh
# Header information, etc....
# The FREE_PCT variable defines the minimum percentage of free disk space
# for each filesystem.
FREE_PCT=10
# Send Alerts (Y/N)?
ALERT=”Y”
# Send individual alerts per instance (Y/N)?
MULTI=”Y”
# Save Predictor data (Y/N)?
PREDICTOR=”Y”
# Required Argent variables
STATUS=NOVAL
SUMMARY=NOVAL
COMMENT=NOVAL
OBJECT=NOVAL
COUNTER=NOVAL
INSTANCE=NOVAL
METRIC=NOVAL
COMPARE=NOVAL
XML_PERFORMANCE=NOVAL
XML_STATUS=NOVAL
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
23
Unix監視の概要
ENCYCLOPEDIA
# xmlOut() - Prints out the definition of the XML format used to
# send status data to The Argent Guardian.
xmlOut()
{
cat <<!
<?xml version=”1.0”?>
<!DOCTYPE CombinedResult
[
<!ELEMENT CombinedResult (PDTResult?, TAGResult?)>
<!ELEMENT PDTResult (QEResult+)>
<!ELEMENT QEResult (status, summary?, comment?, compare?, performance?)>
<!ELEMENT status (#PCDATA) > <!-- (PERFORMANCE | PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
<!ELEMENT compare (#PCDATA) >
<!ELEMENT performance (object, counter, instance, metric)>
<!ELEMENT object (#PCDATA) >
<!ELEMENT counter (#PCDATA) >
<!ELEMENT instance (#PCDATA) >
<!ELEMENT metric (#PCDATA) >
<!ELEMENT TAGResult (QEResult+)>
]>
<CombinedResult>
!
if [ “$PREDICTOR” = “Y” ]; then
cat <<!
<PDTResult>$XML_PERFORMANCE
</PDTResult>
!
fi
if [ “$ALERT” = “Y” ]; then
cat <<!
<TAGResult>$XML_STATUS
</TAGResult>
!
fi
cat <<!
</CombinedResult>
!
} # End of xmlOut()
# xmlPerformance() - Send a performance block to The Argent Predictor. The
# actual value of the metric is stored in <metric>. The other fields
# are used to describe the metric. Multiple xmlPerformance() calls may be
# made between the xmlBegin() and xmlEnd() functions.
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
24
Unix監視の概要
ENCYCLOPEDIA
xmlPerformance()
{
XML_PERFORMANCE=”${XML_PERFORMANCE}
<QEResult>
<status>performance</status>
<performance>
<object>$OBJECT</object>
<counter>$COUNTER</counter>
<instance>$INSTANCE</instance>
<metric>$METRIC</metric>
</performance>
</QEResult>”
} # End of xmlPerformance()
# xmlStatus() - Send a status block to The Argent Guardian. The
# status should be ‘PASS’ or ‘FAIL’. The summary explains the result
# and the comment is a generic description of the Unix rule.
xmlStatus()
{
XML_STATUS=”${XML_STATUS}
<QEResult>
<status>$STATUS</status>
<summary>$SUMMARY</summary>
<comment>$COMMENT</comment>
<compare>$COMPARE</compare>
</QEResult>”
} # End of xmlStatus()
############################# Main portion of script ##########################
# Set the IFS variable, which is used by the read command to parse input.
# We wish to read the input one line at a time.
IFS=’
‘
# Use the df command to get information about the filesystems.
DFCMD=”df -P”
# Assume the status of the rule is OK
OBJECT=”UNIX Filesystem”
COUNTER=”Pct Free Disk Space”
STATUS=PASS
EXIT_CODE=0
SUMMARY=”All filesystems have at least ${FREE_PCT}% of their space free”
COMMENT=”Used ${DFCMD} to get File System capacities.”
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
25
Unix監視の概要
ENCYCLOPEDIA
COMPARE=””
XML_PERFORMANCE=””
XML_STATUS=””
# Iterate through all the filesystems
for fs in `eval $DFCMD`; do
# FS is the actual filesystem, MNT is the mounted directory. Include
# an ‘x’ before the line in case the filesystem is blank.
FS=`echo $fs | awk ‘ { print $1 } ‘`
MNT=`echo x$fs | awk ‘ { print $6 } ‘`
# Skip the first line of DFCMD, which is the column headers
if [ “$FS” = “Filesystem” ]; then
continue
fi
# Derive the free space from the capacity used and compare it to
# the threshold.
CAPACITY=`echo $fs | awk ‘ { print $5 } ‘`
CAPACITY=`echo $CAPACITY | sed ‘s/%//’`
FREE_SPACE=`expr 100 - $CAPACITY`
if [ “$PREDICTOR” ]; then
INSTANCE=$MNT
METRIC=$FREE_SPACE
xmlPerformance
fi
if [ “$ALERT” = “Y” ]; then
if [ “$FREE_SPACE” -lt “$FREE_PCT” ]; then
if [ “$MULTI” = “Y” ]; then
# Update the summary string.
SUMMARY=”File System $MNT (${FREE_SPACE}%) has less than ${FREE_PCT}% Free Space.”
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
26
Unix監視の概要
ENCYCLOPEDIA
COMPARE=$MNT
STATUS=FAIL
EXIT_CODE=1
xmlStatus
fi
if [ “$MULTI” = “N” ]; then
if [ $STATUS = “PASS” ]; then
SUMMARY=”These filesystems have less than ${FREE_PCT}% Free Space.”
EXIT_CODE=1
fi
STATUS=FAIL
SUMMARY=”${SUMMARY}
$MNT: ${FREE_SPACE}% Free “
fi
fi
fi
done
if [ $STATUS = “PASS” -o $MULTI = “N” ]; then
xmlStatus
fi
# Report the findings back to The Argent Guardian
xmlOut
exit $EXIT_CODE
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
27
Unix監視の概要
ENCYCLOPEDIA
連結したルールの出力に注目してください。XML DTDが更新されて、‘PDTRESULT’タグ
と‘TAGRESULT’タグの両方で、予測データの保存およびアラートの送信を実行できます。
<?xml version=”1.0”?>
<!DOCTYPE CombinedResult
[
<!ELEMENT CombinedResult (PDTResult?, TAGResult?)>
<!ELEMENT PDTResult (QEResult+)>
<!ELEMENT QEResult (status, summary?, comment?, compare?, performance?)>
<!ELEMENT status (#PCDATA)> <!-- (PERFORMANCE | PASS | FAIL) -->
<!ELEMENT summary (#PCDATA) >
<!ELEMENT comment (#PCDATA) >
<!ELEMENT compare (#PCDATA) >
<!ELEMENT performance (object, counter, instance, metric)>
<!ELEMENT object (#PCDATA) >
<!ELEMENT counter (#PCDATA) >
<!ELEMENT instance (#PCDATA) >
<!ELEMENT metric (#PCDATA) >
<!ELEMENT TAGResult (QEResult+)>
]>
<CombinedResult>
<PDTResult>
<QEResult>
<status>performance</status>
<performance>
<object>UNIX Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/</instance>
<metric>64</metric>
</performance>
</QEResult>
<QEResult>
<status>performance</status>
<performance>
<object>UNIX Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/boot</instance>
<metric>87</metric>
</performance>
</QEResult>
<QEResult>
<status>performance</status>
<performance>
<object>UNIX Filesystem</object>
<counter>Pct Free Disk Space</counter>
<instance>/dev/shm</instance>
<metric>100</metric>
</performance>
</QEResult>
</PDTResult>
<TAGResult>
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
28
Unix監視の概要
ENCYCLOPEDIA
<QEResult>
<status>FAIL</status>
<summary>File System / (64%) has less than 90% Free Space.</summary>
<comment>Used df -P to get File System capacities.</comment>
<compare>/</compare>
</QEResult>
<QEResult>
<status>FAIL</status>
<summary>File System /boot (87%) has less than 90% Free Space.</summary>
<comment>Used df -P to get File System capacities.</comment>
<compare>/boot</compare>
</QEResult>
</TAGResult>
</CombinedResult>
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
29
Unix監視の概要
Argent Data Consolidator
Argent Data Consolidatorは、Windows、UNIX、Linux、IBM
メインフレーム、Ciscoデバイス、その他のネットワーク・
デバイスなどプラットフォームを問わず、1つの製品で必
要なアーカイブ機能およびコンプライアンス機能を提供
します。
ENCYCLOPEDIA
ASCIIログ
Argent Data Consolidatorには、Cronログ、
ブート・ログな
ど一般的なUNIXログ・ファイルを解析する多くのルール
がプレインストールされています。
ASCIIファイル・ルールによって、Solaris、HP-UX、AIX、
W200x、Ciscoなど任意のコンピューティング・プラットフ
ォームのすべてのASCIIログ・ファイルを解析およびテス
Argentは空調設備やUPS電源供給装置からのログまたは トできます。
ファイルでさえも統合できます。ハードウェアにログまた
Argent Data ConsolidatorでのUNIX監視の既存
はファイルがあれば、Argentはそれらを統合します。
のルールは、[データ・セキュリティ]>[ASCIIファイ
ル]>[UNIX]>[UNIXフレーバ]からアクセスできます。
Argentは、
レポートまたは分析を行えるように、1つ以上
の中央管理ODBCデータベースにログおよびファイルを
ASCIIログ・ファイルがすべて異なり、
またレコードのさま
統合します。統合の間、各レコードを分析するオプション
ざまな位置で異なるトークンまたはキーワードが使用さ
を選択でき、異常が検出された場合に警告することもで
れるときでも、異なるルールを作成してデータを解析で
きます。
きます。
ArgentはすべてのODBCバックエンドをサポートしてい
るため、Argentを使用して以下のようなことも行えます。 サンプルASCIIファイル・ルールをご覧ください。
• 200台のWindows サーバからのWindowsイベント・
ログをシュトゥットガルトにあるSQL Serverバックエン
ドに。
• 20,000人のユーザすべてのPST電子メール・ファイル
をロンドンにあるOracleバックエンドに。
• 350台のSolarisマシンからのUnix SYSLOGをパロアル
トにあるMySQLバックエンドに。
• UPSおよびAirConハードウェアの例外ログとファイル
すべてをシカゴにあるSQL Serverバックエンドに。
• すべてのCiscoのログをシドニーにあるMySQLバック
エンドに。
ご覧のとおり、Argentには限りない可能性があります。セ
ットアップに数週間も掛かりません。数時間でセットアッ
プできます。
フィルタ
フィルタを使用して、統合する対象レコードを選択的に
制限できます。データ・ソースからのすべてのレコードを
統合することもできれば、選択的に統合することもできま
す。
このArgentの画面では、指定されているすべての条件が
示されています。
• タイム・スタンプの形式
• フィールドの順序
• フィールドのオフセット
ログ解析仕様の詳細については、http://help.Argent.
com/#adc_log_specも参照してください。
アラート
統合とフィルタに加えて、Argent Data Consolidatorルー
ルを設定し、
スキャンされたログに指定した条件が検出
されたときにアラートを送信することもできます。
詳細については、http://help.Argent.com/#rul_adcも参
照してください。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
30
Unix監視の概要
ENCYCLOPEDIA
システムログ
SYSLOGメッセージ・ルールを使用して、SYSLOGイベントを統合します。
SYSLOGは、ネットワーク上で実行するイベント・ロギング・プロトコルです
(IETF標準については、http://www.ietf.org/html.charters/syslog-charter.
html)を参照してください)。
以下は、IETF RFC3164からの引用です。
システムログは、
トランスポート層の基本メカニズムとして、ユーザ・デー
タグラム・プロトコル(UDP)を使用します。システムログに割り当てられる
UDPポートは514です。
Argentは、受信SYSLOGメッセージをUDP 514でリッスンするこよによって
SYSLOGサーバとして機能します。
また、それらのメッセージを定義した中
央管理データベースに統合します。
以下のSYSLOGルールでは、[メッセージ・プロパティ]セクションと[メッセ
ージ機能]セクションの選択事項に従って、すべてのイベントを統合しま
す。
[基本]タブを定義した後、オプションでルール・フィルタとルール・アラー
トを追加できます。
SYSLOGルールの設定の詳細については、http://help.Argent.
com/#Q061も参照してください。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
31
Unix監視の概要
付録A: UNIXSSH.INI
Argent Guardianには、セキュリティで保護されたシェル・
プロトコルを使用して、セキュリティで保護されたエージ
ェントレスのUNIX監視を実行する機能があります。
ENCYCLOPEDIA
これにより、
プライベート・キーの使用の承認、
コマンドの
単一操作への最適化など、カスタム操作のコマンドを変
更できました。
旧式に関するその他のメリットとして、他の言語(例え
ば、Perl)でルールを作成する機能がありました。
これは、PuTTyツール、PSCP、およびPLINKを使用する
Windowsのメカニズムによって実現します。以下のように しかし、Argent XT 8.0A-0901-B以降では、UNIXマシンに
接続する方法が変更されたため、
このUNIXSSH.INIファイ
実行します。
ルが読み取られなくなりました。
Argent XT 8.0A-0810以下の場合
それでも、
レジストリ・エントリ (HKLM\SOFTWARE\
Argent\ArgentGuardian\MonitoringEngine\SSH_ NO_
COPY_SCRIPT) を変更して、旧式に戻すことを選択できま
す(ただし、実行速度は遅くなります)。
1. スクリプトをUNIXマシンの/tmpディレクトリにコピー
します。
2. スクリプト許可を変更して実行可能ファイルにします。
3. スクリプトを実行し、STDOUTからの出力を確認しま
値を0(ゼロ)に設定すると、UNIXSSH.INIを使用するように
す。
なります。
4. ファイルをUNIXマシンの/tmpディレクトリから削除し
ます。
これは、旧式を使用する監視エンジンごとに設定する必
要があります。
Argent XT 8.0A-0901-B以上の場合
1. SSHをUNIXマシンにインストールします。
2. コマンド・ラインからスクリプト全体を入力し、Ctrlキ
ーを押しながらDを押します。
3. STDOUTからスクリプトの出力を確認します。
Argent XT 8.0A-0901-B以前では、
スクリプトのコピー、実
行、削除に関する実際のコマンドは、各Argent製品ディ
レクトリ (例えば、C:\ ARGENT\ArgentManagementConsole\ArgentGuardian\ UNIXSSH.INI) にあるUNIXSSH.INIフ
ァイルを使用して手動で指定できました。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
32
Unix監視の概要
UNIXSSH.INIのカスタマイズ
デフォルトで、SSH監視には4つの段階に分かれた操作が
あり、
これらの操作はほとんどの実装に適しています。た
だし、数百にのぼるUNIXサーバやLinuxサーバを監視す
る場合、
または単にArgentサーバから必要なSSH接続数
を削減したい場合に、‘UNIXSSH.INI’ファイルを更新する必
要があります。
デフォルト‘UNIXSSH.INI’の内容:
0
{SSH_BIN}PSCP -P {PORT} -pw {PASSWORD}
{SOURCE_ SCRIPT} {USER}@{HOST}:{TARGET_SCRIPT}
0 {SSH_BIN}PLINK -P {PORT} -pw {PASSWORD}
{USER}@{HOST} “chmod +x {TARGET_SCRIPT}”
1 {SSH_BIN}PLINK -P {PORT} -pw {PASSWORD}
{USER}@{HOST} {TARGET_SCRIPT_WITH_PARAM}
0 {SSH_BIN}PLINK -P {PORT} -pw {PASSWORD}
{USER}@{HOST} “rm -f {TARGET_SCRIPT}”
ENCYCLOPEDIA
最適化された‘UNIXSSH.INI’の内容:
0
{SSH_BIN}PSCP -P {PORT} -pw {PASSWORD}
{SOURCE_ SCRIPT} {USER}@{HOST}:{TARGET_SCRIPT}
1 {SSH_BIN}PLINK -P {PORT} -pw {PASSWORD}
{USER}@{HOST} “chmod +x
{TARGET_SCRIPT};{TARGET_SCRIPT_WITH_PARAM};rm -f
{TARGET_SCRIPT}”;
UNIXSSH.INIをさらにカスタマイズすることもできます。例
えば、ユーザ名とパスワードの代わりにプライベート・キ
ーを認証に使用できます。
0
{SSH_BIN}PSCP -P {PORT} –i C:\keys\private.ppk
SOURCE_ SCRIPT} {USER}@{HOST}:{TARGET_SCRIPT}
1 {SSH_BIN}PLINK -P {PORT} –i C:\keys\private.ppk
{USER}@{HOST} “chmod +x
{TARGET_SCRIPT};{TARGET_SCRIPT_WITH_PARAM};rm -f
{TARGET_SCRIPT}”;
既存のファイルを以下の最適化されたファイルに置き換
えます。最適化されたファイルでは、2、3、4行目を1つの
PLINKの実行に結合することによって、必要な接続数が削
減さています。
注:ArgSoft Pacific Intellectual Property Holdings (HK), Limited が作成したこのホワイト ペーパーは情報提供のみを目的としています。明示または黙示
に関わらず、これらの情報について ArgSoft Pacific Intellectual Property Holdings (HK), Limited はいかなる責任も負わないものとします。この情報は予
告なく変更されることがあります。ArgSoft Pacific Intellectual Property Holdings (HK), Limited は本書内に含まれる技術または編集上の誤り、または脱落
に対して責任を負いません。また、このドキュメントに含まれるマテリアルの提供、実行、使用が原因で発生する付随的損害、間接的損害、結果的損害に
対しても責任を追わないものとします。ここに記載されている意見は ArgSoft Pacific Intellectual Property Holdings (HK), Limited の見解です。記載されて
いる社名および商品名は、登録各社の商標および登録商標です。
© ArgSoft Pacific Intellectual Property Holdings (HK), Limited 1991 - 2012
33