PR

興味深いコマンド「httping」にハマる。 (グラフが表示されない~)

XWSS018344_s4

サーバーを監視するというのはなかなか難しいし、様々な手法がある。

面白いスライドとしては「Muninではじめる実践★リソース監視 -俺のサーバがこんなに重いはずがない、を乗り切るために-」があった。

面白い記事としては「Webサーバの停止を素早く発見する:Wgetとメールを使ったお手軽サーバ死活監視 (1/2) – @IT」があった。

で、それらを同時にやってくれそうな面白いツール(実際に監視ツールとも連携できるようだし)に出会ったので使ってみたけれど、少しハマった。

スポンサードリンク

apt-get によるインストール

$ sudo apt-get install httping

apt-get からインストールした。

動作・バージョン確認

確かに動作したけれど、何かがおかしい。

$ httping -V
HTTPing v1.4.4, (C) 2003-2010 [email protected]
SSL support included

Ver.2.3.3 が最新版だから、だいぶ古いようだ。CentOS ならともかくUbuntu でこのような状態になるのは珍しい(少なくとも遭遇したことがなかった)。

削除

$ sudo apt-get remove httping

一旦削除する。

ソースからインストール

ダウンロードしてmake

$ wget http://www.vanheusden.com/httping/httping-2.3.3.tgz
 $ tar xfz httping-2.3.3.tgz
 $ cd httping-2.3.3
 $ make
 :
 :
 # Oh, blatant plug: http://www.vanheusden.com/wishlist.php
 msgfmt -o nl.mo nl.po
 make: msgfmt: コマンドが見つかりませんでした
 make: *** [nl.mo] エラー 127

gettextをインストール

$ sudo apt-get install gettext

必要らしいパッケージをインストール。

make install

$ sudo make install
install -m 0755 -d //usr/bin
install -m 0755 httping //usr/bin
install -m 0755 -d //usr/share/man/man1
install -m 0644 httping.1 //usr/share/man/man1
install -m 0755 -d //usr/share/man/nl/man1
install -m 0644 httping-nl.1 //usr/share/man/nl/man1
install -m 0755 -d //usr/share/doc/httping
install -m 0644 license.txt license.OpenSSL readme.txt //usr/share/doc/httping
cp nl.mo //usr/share/locale/nl/LC_MESSAGES/httping.mo

インストールできたようだ。

動作・バージョン確認

$ httping -V
HTTPing v2.3.3, (C) 2003-2013 [email protected]

バージョンも最新になった。

ハマりはじめ

古いバージョンでも新しいバージョンでも、基本的な動作はした。が、やってみたいGUI ちっくな画面が出てこない。

どうしたものか調べると、いくつか必要な物があるらしい。(更に調べると、インストール自体は、それらを必須としないから、特にエラーにはならない。使える環境なら動くよということらしい)

ncurses-devを入れてみる

$ sudo apt-get install ncurses-dev

インストールしてみたもののダメらしい。

インストール構成の変更

もしかしたらインストールしなおす必要があるのかもしれない。

もしかしたらインストール設定を変更する必要があるのかもしれない。

$ ./configure
*** HTTPing v2.3.3 (267) configure script ***

- this system does NOT support TCP fast open - this is an optional feature
- this system does NOT have the ncurses development libraries - they are optional
- this system does NOT have the OpenSSL development libraries - they are optional
- this system does NOT have the FFTW3 development libraries - they are optional and only usefull when also including ncurses

NOT support や NOT have the ~ となっているが、ほとんどはシステムで動作している。

$ ./configure --help
*** HTTPing v2.3.3 (267) configure script ***

--with-tfo      force enable tcp fast open
--with-ncurses  force enable ncurses
--with-openssl  force enable openssl
--with-fftw3    force enable fftw3

うーむ。Apache などは必要な項目のディレクトリを指定できたりするのだが、これも同じなのだろうかと思ってhelp を参照するが、特にそういう項目は見当たらない。

fftw3をインストール

$ sudo apt-get install fftw3

fftw3をインストールしてみる。

$ ./configure --with-tfo --with-ncurses --with-openssl --with-fftw3
*** HTTPing v2.3.3 (267) configure script ***

+ system supports TCP fast open
+ system has ncurses development libraries
+ system has OpenSSL development libraries
+ system has FFTW3 development libraries

ついでにオプション全部有効にしてしまえ。TFO 有効にするのは面倒みたいだし。

$ make
cc -Wall -W  -DVERSION=\"2.3.3\" -DLOCALEDIR=\"/usr/share/locale\" -DTCP_TFO -DNC -DFW -D_DEBUG -ggdb   -c -o mssl.o mssl.c
cc -Wall -W  -DVERSION=\"2.3.3\" -DLOCALEDIR=\"/usr/share/locale\" -DTCP_TFO -DNC -DFW -D_DEBUG -ggdb   -c -o nc.o nc.c
nc.c: 関数 ‘draw_graph’ 内:
nc.c:612:24: 警告: 仮引数 ‘val’ が未使用です [-Wunused-parameter]
cc -Wall -W  -DVERSION=\"2.3.3\" -DLOCALEDIR=\"/usr/share/locale\" -DTCP_TFO -DNC -DFW -D_DEBUG -ggdb   -c -o fft.o fft.c
fft.c:6:19: 致命的エラー: fftw3.h: そのようなファイルやディレクトリはありません
コンパイルを停止しました。
make: *** [fft.o] エラー 1

ですよね・・。

$ ./configure  --with-ncurses --with-openssl --with-fftw3
*** HTTPing v2.3.3 (267) configure script ***

- this system does NOT support TCP fast open - this is an optional feature
+ system has ncurses development libraries
+ system has OpenSSL development libraries
+ system has FFTW3 development libraries

これでどうよ?あ、ダメですね・・。

(ログではこうなっているんだけど、指摘されたものとは違う対処してる・・)

/usr/bin/ld: cannot find -lncursesw

$ sudo apt-get install libxi-dev

/usr/bin/ld: cannot find -lncursesw を解決してみる。

・・・ダメか。

$ sudo apt-get install libncursesw5-dev

これでどうだ。

# Oh, blatant plug: http://www.vanheusden.com/wishlist.php
msgfmt -o nl.mo nl.po

Oh.. Oh!?!?

もしかして・・。

$ httping  -V
HTTPing v2.3.3, (C) 2003-2013 [email protected]
 * SSL support included (-l)
 * ncurses interface included (-K)
 * TFO (TCP fast open) support included (-F)

あ、できたーーー!!

あー・・。長かった。

後でどれが正しいのか検証しなければな・・。

参考文献

コメント