構築にあたっては、次のurlを参考にしました。(とても分かりやすいです)
http://www.server-kanshi.net/install/
(前準備) xymonユーザ追加
$ su - # adduser xymon
xymonのサービスは xymonユーザで起動する必要があります。rootでも起動できるように思えますが、rootで起動しようとすると、次のようにエラーとなります。
# /home/xymon/server/xymon.sh start Xymon must be started as the xymon user
(前準備) fping
$ wget http://fping.org/dist/fping-3.10.tar.gz $ tar -zxvf fping-3.10.tar.gz $ cd fping-3.10 $ ./configure $ make $ su # make install # chmod 4755 /usr/local/sbin/fping
「chmod 4755 〜」に関しては次のurlをご覧下さい。
fpingで「(null): can't create socket (must run as root?) : Protocol not supported」エラー - end0tknrのkipple - web写経開発
(前準備) RRDtool
$ wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.9.tar.gz $ tar -zxvf rrdtool-1.4.9.tar.gz $ cd rrdtool-1.4.9 $ ./configure checking build system type... i686-pc-linux-gnu <略> checking for glib_check_version in -lglib-2.0... no checking for pkg-config... pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no glib-2.0.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of glib-2.0. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libglib-2.0 and its header files. If you have not installed glib-2.0, you can get it either from its original home on ftp://ftp.gtk.org/pub/glib/2.28/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of glib-2.0 is 2.28.7. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for cairo_font_options_create in -lcairo... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no cairo-png.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of cairo-png. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libcairo and its header files. If you have not installed cairo-png, you can get it either from its original home on http://cairographics.org/releases/ You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of cairo-png is 1.10.2. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- <略> checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... no checking for pkg-config... (cached) pkg-config configure: WARNING: ---------------------------------------------------------------------------- * I found a copy of pkgconfig, but there is no pangocairo.pc file around. You may want to set the PKG_CONFIG_PATH variable to point to its location. ---------------------------------------------------------------------------- configure: WARNING: ---------------------------------------------------------------------------- * I could not find a working copy of pangocairo. Check config.log for hints on why this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately so that compiler and the linker can find libpangocairo-1.0 and its header files. If you have not installed pangocairo, you can get it either from its original home on http://ftp.gnome.org/pub/GNOME/sources/pango/1.28 You can find also find an archive copy on http://oss.oetiker.ch/rrdtool/pub/libs The last tested version of pangocairo is 1.28.4. LIBS=-lm LDFLAGS= CPPFLAGS= ---------------------------------------------------------------------------- checking for xmlParseFile in -lxml2... yes checking libxml/parser.h usability... yes checking libxml/parser.h presence... yes checking for libxml/parser.h... yes configure: error: Please fix the library issues listed above and try again. $
何やら、RRDtoolには依存パッケージ()があるようですので、追加でインストールします。
glib2
http://ftp.gnome.org/pub/gnome/sources/glib/2.43/glib-2.43.2.tar.xz からも取得できますが、glib2も依存パッケージが多い予感がしたので、yumでinstall。
$ su - # yum install glib2 # yum install glib2-devel
cairo
http://cairographics.org/releases/ からsrc取得できますが、やはりyumで。
$ su - # yum install cairo # yum install cairo-devel
pango ( pangocairo )
http://ftp.gnome.org/pub/GNOME/sources/pango からsrc取得できますが、やはりyumで。
$ su - # yum install pango # yum install pango-devel
ここまでで、RRDtoolの依存ライブラリがそろったので、改めて、configure , make , make installで完了。
$ ./configure $ make $ su # make install
xymon本体のinstall
$ wget http://downloads.sourceforge.net/project/xymon/Xymon/4.3.17/xymon-4.3.17.tar.gz $ tar -zxvf xymon-4.3.17.tar.gz $ su - # cd /home/endo/tmp/xymon-4.3.17 # ./configure What group-ID does your webserver use [nobody] ? ※ -> daemon What is the IP-address of this host [127.0.0.1] ? ※ -> 192.168.137.5 # make # make install
※xymonのconfigureは対話式ですが、この中で私は「※」の2箇所のみ変更しました。
apacheの設定
httpd.confへの追記
/home/xymon/server/etc/xymon-apache.conf に apacheの設定内容が記載されていますので、これをapacheの設定ファイル(私の場合、/usr/local/apache22/conf/httpd.conf )へ追記します。
※参考にさせて頂いた http://www.server-kanshi.net/install/preparation.html では、
xymon-apache.conf をコピーするだけのように記載されていますが、コピーだけでは私の環境では動作しませんでした。
chmod 755 /home/xymon
xymonのwebページでは、/home/xymon/server/www を閲覧可能にする為、chmod します。
$ su - # chmod 755 /home/xymon
apache , xymon の起動と動作確認
先程まででインストールと設定は完了しているので、apache , xymon の起動と動作確認を行います。
$ su - # /usr/local/apache22/bin/apachectl restart # su - xymon $ /home/xymon/server/xymon.sh start ※ Xymon started
xymon.shはxymonユーザで起動する必要があり、このスクリプトが監視結果を定期的(5分毎?)に /home/xymon/server/www/critical.html , index.html , nongreen.html red.html ,xymon.html に作成します。
xymon.sh が *.htmlを作成する数分後に http://$ホスト名/xymon/ へアクセスし、次のような画面が表示されれば、動作確認も完了です。