LoginSignup
3
2

Xymon インストール

Last updated at Posted at 2020-06-11

はじめに

監視ツールXymonをインストールする方法です。
パッケージは利用しません。
非公式のパッケージが存在してはいますが、公式として推奨されていないため、ソースからビルドします。

CentOS 7.8、 Amazon Linux release 2、RHEL 8.4 で動作確認しました。

事前準備

# yum install httpd pcre-devel rrdtool-devel openssl-devel c-ares-devel openldap-devel gcc libtirpc-devel mailx
# useradd xymon
# passwd xymon

インストール

任意のユーザとディレクトリで。

$ wget https://sourceforge.net/projects/xymon/files/latest/download/xymon.tar.gz

サーバでダウンロードしたファイルを展開

$ tar xvfz xymon.tar.gz

展開されたディレクトリに入る。

$ cd xymon-?.?.??

configure

$ ./configure

色々と聞いてきますが、下記の2つの質問は答えます。それ以外はエンターキーでデフォルトで良いです。

What group-ID does your webserver use [nobody] ?
apache
What is the IP-address of this host [127.0.0.1] ?
実際にアクセスしたいIPアドレス

make

$ make

以降はrootで

$ su -

makeしたディレクトリに移動して

# cd 先程までのディレクトリ

インストール

# make install

起動までの設定

Apache設定

# vi /etc/httpd/conf.d/xymon.conf

以下をコピペ

/etc/httpd/conf.d/xymon.conf
# This file is for Apache 1.3.x and Apache 2.x
#
# Add this to your Apache configuration, it makes
# the Xymon webpages and cgi-scripts available in the
# "/xymon" and "/xymon-cgi" URLs.


# NB: The "Alias" line below must NOT be used if you have
#     the Xymon webfiles as the root URL. In that case,
#     you should instead set this:
#
#          DocumentRoot /usr/local/xymon/server/www/

Alias /xymon/  "/home/xymon/server/www/"
<Directory "/home/xymon/server/www/">
    Options Indexes FollowSymLinks Includes MultiViews
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        #Require all granted
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>
    AuthUserFile /home/xymon/server/etc/xymonpasswd
    AuthType Basic
    AuthName "Xymon Administration"
    Require valid-user
</Directory>

ScriptAlias /xymon-cgi/ "/home/xymon/cgi-bin/"
<Directory "/home/xymon/cgi-bin">
    AllowOverride None
    Options ExecCGI Includes
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        #Require all granted
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>
    AuthUserFile /home/xymon/server/etc/xymonpasswd
    AuthType Basic
    AuthName "Xymon Administration"
    Require valid-user
</Directory>

ScriptAlias /xymon-seccgi/ "/home/xymon/cgi-secure/"
<Directory "/home/xymon/cgi-secure">
    AllowOverride None
    Options ExecCGI Includes
    <IfModule mod_authz_core.c>
        # Apache 2.4+
        #Require all granted
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Allow from all
    </IfModule>

    # Password file where users with access to these scripts are kept.
    # Create it with "htpasswd -c /home/xymon/server/etc/xymonpasswd USERNAME"
    # Add more users / change passwords with "htpasswd /home/xymon/server/etc/xymonpasswd USERNAME"

    AuthUserFile /home/xymon/server/etc/xymonpasswd
    AuthType Basic
    AuthName "Xymon Administration"
    Require valid-user
</Directory>

上記はBasic認証をかける前提にしていますので、認証の設定をしておきます。
ユーザ名とパスワードは、ログインするときに使うものを決めてください。

# htpasswd -c -b /home/xymon/server/etc/xymonpasswd ユーザ名 パスワード

起動用の設定

# vi /etc/systemd/system/xymon.service

以下をコピペ

/etc/systemd/system/xymon.service
[Unit]
Description=Xymon
After=network-online.target

[Service]
Type=forking
ExecStart=/home/xymon/server/xymon.sh start
ExecStop=/home/xymon/server/xymon.sh stop
User=xymon
Group=xymon

[Install]
WantedBy=network-online.target

/home/xymon を Apache で直接見せるために権限を変えます。

# chmod 755 /home/xymon/

Apache リスタート(もしくは起動)

# systemctl restart httpd

OS 起動時に Xymon も自動起動

# systemctl enable xymon

起動

# systemctl start xymon

動作確認

ブラウザで 「 http://IPアドレス/xymon/
ユーザ名とパスワードを聞かれたら入力。
このときブラウザにユーザ名とパスワードは登録させてください。そうでないと画像やCSSが読めなくなります。
ブラウザで左側が赤で全体に黒っぽい画面に左上にXymonと出ていれば成功です。

xymon1.jpg

関連情報

Amazon Linux / RHEL 系向け Xymon クライアント インストール

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2