よくわからないエンジニア

よく分からないエンジニアの日々の記録

よくわからないエンジニア

監視ツールXymonをインストールする

折角apacheを導入したのだが、
このまま遊ばせておくのもあれなので監視ツールを導入する。
世の中に無料で高機能な監視ツールは数あるが、
拡張性が高く、設定も簡単なので個人的にお気に入りなのは、
「Xymon」である。

Xymonのインストール

この記事を書いている時の最新版Xymonが4.3.27だったので、
それをダウンロードして解凍する。

#cd /usr/local/src/
#wget https://sourceforge.net/projects/xymon/files/Xymon/4.3.27/xymon-4.3.27.tar.gz/download
#mv download xymon.tar.gz
#tar xvfz xymon.tar.gz
#cd xymon-4.3.27/

まずは何も考えずにconfigureを走らせる。

# ./configure --server
Checking for PCRE ...
Compiling with PCRE library works OK
Linking with PCRE library works OK


Checking for C-ARES library ...
test-cares.c:5:18: error: ares.h: No such file or directory
test-cares.c:6:22: error: ares_dns.h: No such file or directory
test-cares.c:7:26: error: ares_version.h: No such file or directory
test-cares.c: In function 'main':
test-cares.c:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before                                                                         'mychannel'
test-cares.c:12: error: 'mychannel' undeclared (first use in this function)
test-cares.c:12: error: (Each undeclared identifier is reported only once
test-cares.c:12: error: for each function it appears in.)
test-cares.c:13: error: storage size of 'options' isn't known
test-cares.c:24: warning: implicit declaration of function 'ares_version'
test-cares.c:24: warning: assignment makes pointer from integer without a cast
test-cares.c:59: warning: implicit declaration of function 'ares_init_options'
test-cares.c:59: error: 'ARES_OPT_TIMEOUTMS' undeclared (first use in this funct                                                                        ion)
test-cares.c:59: error: 'ARES_OPT_TRIES' undeclared (first use in this function)
test-cares.c:60: error: 'ARES_SUCCESS' undeclared (first use in this function)
test-cares.c:65: warning: implicit declaration of function 'ares_destroy'
make: *** [test-compile] Error 1
ERROR: Cannot compile using c-ares library.
The system C-ARES library is missing or not usable. I will use the version shipp                                                                        ed with Xymon


Checking for RRDtool ...
Not RRDtool 1.0.x, checking for 1.2.x
test-rrd.c:3:17: error: rrd.h: No such file or directory
test-rrd.c: In function 'main':
test-rrd.c:26: warning: implicit declaration of function 'rrd_clear_error'
test-rrd.c:28: warning: implicit declaration of function 'rrd_graph'
make: *** [test-compile] Error 1
ERROR: Cannot compile with RRDtool.
ERROR: Linking with RRDtool fails
RRDtool include- or library-files not found.
These are REQUIRED for trend-graph support in Xymon, but Xymon can
be built without them (e.g. for a network-probe only installation.

RRDtool can be found at http://oss.oetiker.ch/rrdtool/
If you have RRDtool installed, use the "--rrdinclude DIR" and "--rrdlib DIR"
options to configure to specify where they are.

Continuing with all trend-graph support DISABLED


Checking for OpenSSL ...
Compiling with SSL library works OK
Linking with SSL library works OK
Checking if your SSL library has SSLv2 enabled
Will support SSLv2 when testing SSL-enabled network services
Checking if your SSL library has SSLv3 enabled
Will support SSLv3 when testing SSL-enabled network services

Xymon can use the OpenSSL library to test SSL-enabled services
like https-encrypted websites, POP3S, IMAPS, NNTPS and TELNETS.
If you have the OpenSSL library installed, I recommend that you enable this.

Do you want to be able to test SSL-enabled services (y) ?
y



Checking for LDAP ...
WARNING: Cannot compile with LDAP
WARNING: Cannot link with LDAP
(Open)LDAP include- or library-files not found.
If you want to perform detailed LDAP tests (queries), you need
to install an LDAP client library that Xymon can use.
OpenLDAP can be found at http://www.openldap.org/

If you have OpenLDAP installed, use the "--ldapinclude DIR" and "--ldaplib DIR"
options to configure to specify where they are.

Continuing with LDAP support disabled.

エラーや警告出てたので、一旦Ctrl+Cで停止。

ライブラリの準備

足りないものはちゃんと入れてあげましょう。
エラーから足りないものは、C-ARES,RRDtool,LDAPと認識、
まずは全部のdevelをyumで突っ込む。

#yum install c-ares-devel
#yum install rrdtool-devel
#yum install openldap-devel

依存関係でその他ライブラリがボコボコ入るけど気にしません。
再度、configureを走らせると。

Configuration script for Xymon

This script asks a few questions and builds a Makefile to compile Xymon

Checking your make-utility
Checking pre-requisites for building Xymon

Checking for fping ...
Xymon has a built-in ping utility (xymonping)
However, it is not yet fully stable and therefore it
may be best to use the external fping utility instead.
I could not find fping on your system
Do you want to use xymonping [Y/n] ?
Y
OK, I will use xymonping.


Checking for PCRE ...
Compiling with PCRE library works OK
Linking with PCRE library works OK


Checking for C-ARES library ...
Compiling with c-ares library works OK
C-ARES version: Found 1.10.0 - OK, require 1.10.0
Linking with c-ares library works OK


Checking for RRDtool ...
Not RRDtool 1.0.x, checking for 1.2.x
Compiling with RRDtool works OK
Linking with RRDtool works OK


Checking for OpenSSL ...
Compiling with SSL library works OK
Linking with SSL library works OK
Checking if your SSL library has SSLv2 enabled
Will support SSLv2 when testing SSL-enabled network services
Checking if your SSL library has SSLv3 enabled
Will support SSLv3 when testing SSL-enabled network services

Xymon can use the OpenSSL library to test SSL-enabled services
like https-encrypted websites, POP3S, IMAPS, NNTPS and TELNETS.
If you have the OpenSSL library installed, I recommend that you enable this.

エラー消えました。素晴らしすぎます。
ちなみに、ライブラリをソースから突っ込んで試した場合、
丸一日費やした挙句に環境投げ捨てました。

ではインストールの続きを。。

#useradd xymon
#./configure --server

Configuration script for Xymon

This script asks a few questions and builds a Makefile to compile Xymon

Checking your make-utility
Checking pre-requisites for building Xymon

Checking for fping ...
Xymon has a built-in ping utility (xymonping)
However, it is not yet fully stable and therefore it
may be best to use the external fping utility instead.
I could not find fping on your system
Do you want to use xymonping [Y/n] ?
Y
OK, I will use xymonping.


Checking for PCRE ...
Compiling with PCRE library works OK
Linking with PCRE library works OK


Checking for C-ARES library ...
Compiling with c-ares library works OK
C-ARES version: Found 1.10.0 - OK, require 1.10.0
Linking with c-ares library works OK


Checking for RRDtool ...
Not RRDtool 1.0.x, checking for 1.2.x
Compiling with RRDtool works OK
Linking with RRDtool works OK


Checking for OpenSSL ...
Compiling with SSL library works OK
Linking with SSL library works OK
Checking if your SSL library has SSLv2 enabled
Will support SSLv2 when testing SSL-enabled network services
Checking if your SSL library has SSLv3 enabled
Will support SSLv3 when testing SSL-enabled network services

Xymon can use the OpenSSL library to test SSL-enabled services
like https-encrypted websites, POP3S, IMAPS, NNTPS and TELNETS.
If you have the OpenSSL library installed, I recommend that you enable this.

Do you want to be able to test SSL-enabled services (y) ?
y



Checking for LDAP ...
Compiling with LDAP works OK
LBER library not needed
Linking with LDAP works OK

Xymon can use your OpenLDAP LDAP client library to test LDAP servers.

Do you want to be able to test LDAP servers (y) ?
y



Checking for clock_gettime() requiring librt ...
clock_gettime() requires librt


Checking for Large File Support ...
Large File Support OK


Setting up for a Xymon server


What userid will be running Xymon [xymon] ?

Found passwd entry for user xymon:x:12781:12781::/home/xymon:/bin/bash


Where do you want the Xymon installation [/home/xymon] ?

OK, will configure to use /home/xymon as the Xymon toplevel directory


What URL will you use for the Xymon webpages [/xymon] ?



Where to put the Xymon CGI scripts [/home/xymon/cgi-bin] ?
(Note: This is the filesystem directory - we will get to the URL shortly)



What is the URL for the Xymon CGI directory [/xymon-cgi] ?
(Note: This is the URL - NOT the filesystem directory)



********************** SECURITY NOTICE ****************************
If your Xymon server is accessible by outsiders, then you should
restrict access to the CGI scripts that handle enable/disable of
hosts, and acknowledging of alerts. The easiest way to do this is
to put these in a separate CGI directory and require a password to
access them.
Even if your Xymon server is on a secured, internal network, you
may want to have some operations (like disabling a host) be password-
protected - that lets you see who disabled or acknowledged an alert.

Where to put the Xymon Administration CGI scripts [/home/xymon/cgi-secure] ?
(Note: This is the filesystem directory - we will get to the URL shortly)



What is the URL for the Xymon Administration CGI directory [/xymon-seccgi] ?
(Note: This is the URL - NOT the filesystem directory)



** Note that you may need to modify your webserver configuration.
** After installing, see /home/xymon/server/etc/xymon-apache.conf for an example configuration.


To generate Xymon availability reports, your webserver
must have write-access to a directory below the Xymon
top-level directory. I can set this up if you tell me
what group-ID your webserver runs with. This is typically
'nobody' or 'apache' or 'www-data'

What group-ID does your webserver use [nobody] ?
httpd


Where to put the Xymon logfiles [/var/log/xymon] ?



What is the name of this host [unknownengineer.example.jp] ?



What is the IP-address of this host [127.0.0.1] ?
172.**.**.**


Where should I install the Xymon man-pages (/usr/local/man) ?





Using Linux Makefile settings



Created Makefile with the necessary information to build Xymon
Some defaults are used, so do look at the Makefile before continuing.

Configuration complete - now run make (GNU make) to build the tools

#make
#make install

yumってやっぱ正義だわ。。
次回は起動まで頑張ります。