mytopインストール
MySQL版topコマンドみたいな感じ。
インストール
ダウンロードして解凍
# tar zxvf mytop-1.6.tar.gz
Make
# cd mytop-1.6
# perl Makefile.PL
# make
# make test
# make install
perl Makefile.PLでMakeMakerが無いと言われたらインストールする。
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at Makefile.PL line 1.本来はCPANからインストールする様だけどyumでも出来た。
BEGIN failed--compilation aborted at Makefile.PL line 1.
# yum -y install perl-ExtUtils-MakeMaker
ReadKeyが無いとWarningが出たらインストールする。
Checking if your kit is complete...
Looks good
Warning: prerequisite Term::ReadKey 2.1 not found.
Writing Makefile for mytop
# yum -y install perl-TermReadKey
スクリプト微修正
そのままだとなんか動かない
Error in option spec: "long|!"ので修正する。
# chmod u+w /usr/local/bin/mytop
# vi /usr/local/bin/mytop
...
"long|!" => \$config{long_nums}, ←これの"long|!"を"long|long_nums|l!"に。!の前の小文字Lを忘れずに。
...
実行
# /usr/local/bin/mytop -s1 -hホスト名 -uユーザ名 -pパスワード