swatchを入れてみる

ログ監視がしたくなってきたので、swatchを入れてみる。入れたのは、3.2.2

 #cd ../swatch-3.2.2/
 #perl Makefile.PL

READMEに書いてあったとおり依存関係でエラーがでる。

 Warning: prerequisite Date::Calc 0 not found at (eval 1) line 219.
 Warning: prerequisite Date::Parse 0 not found at (eval 1) line 219.
 Warning: prerequisite File::Tail 0 not found at (eval 1) line 219.
 Warning: prerequisite Time::HiRes 1.12 not found at (eval 1) line 219.

さら、Date::Calcは、Carp-Clan5.3とBit-Vector6.4に依存関係があるらしいので、これを先に入れる。ちなみにBit-VectorはCarp-Clanが無いと入らないのでこの順番を守ることが必要

ちなみにファイルはhttp://search.cpan.org/よりダウンロードして解凍してあるものとしてる。

 #cd Carp-Clan-5.3
 #perl Makefile.PL
 #make
 #make test
 #make install

 #cd  Bit-Vector-6.4
 #perl Makefile.PL
 #make
 #make test
 #make install

これでswatchが依存しているライブラリを入れる準備ができた。以下一気に入れる。

 #cd Date-Calc-5.5.1
 #perl Makefile.PL
 #make
 #make test
 #make install

 #cd ../Date-Manip-5.48/
 #perl Makefile.PL
 #make
 #make test
 #make install

 #cd ../Time-HiRes-1.9715/
 #perl Makefile.PL   <=エラーが出たのでmake testを必ずするようにと指示があった。
 #make
 #make test <=エラーが0件だったので続行
 #make install

 #cd ../File-Tail-0.99.3/
 #perl Makefile.PL
 #make
 #make test
 #make install

ようやく本体

 #cd ../swatch-3.2.2/
 #perl Makefile.PL
 #make
 #make test
 #make install

これで問題無し。ただし、exampleのしたが空でろくなconfigサンプルが無い。ちょっと書き方を見ないとわからないので、もうちょっと調べることにする。

ちなみに以下のようなコマンド命令で動くことはわかっている。
#swatch --config-file=設定ファイル名 --tail-file=監視対象ファイル &

不明なのは、config-fileの正確な書き方と、複数のファイルを一度に監視対象にできないのか、というあたり。

ちょっと古い情報なのでexampleが無いなど一部食い違いもあるが、以下のサイトが後で役に立つかもしれないので、メモ

http://www.atmarkit.co.jp/flinux/rensai/root04/root04b.html