LoginSignup
2
2

More than 5 years have passed since last update.

xymonクライアントインストール

Last updated at Posted at 2016-08-09

サーバ監視ツールのxymonを監視対象のサーバにインストールしましたが、再起動後になぜかステータスが更新されない。。
そもそもサービスが起動していないじゃないか!?ということがありました。。
頻繁に再起動なんてしないですので忘れがちですよね。

毎回 手作業で実施するのも面倒なので、色々参考にしながらサーバ再起動時にxymonクライアントも一緒に起動させるようにしてみました。
備忘録ですが、ご指摘あればよろしくお願い致しますm(_ _)m

参考:クライアントのインストールについては下記サイト参照
http://www.server-kanshi.net/install/xymoninst.html

※以下作業は、CentOS6.8にて実施しています。
(CentOS7.xだと、多少記述が変わると思います)

実際の作業はここから

$ cd /etc/rc.d/init.d

・以下ファイル名で作成(ファイル名はご自由にどうぞ)
$ vi xymonclient

#!/bin/sh
#
# chkconfig: 2345 87 87
# description: xymon client

# /usr/local以下にクライアントをインストールした場合
HOBBITHOME=/usr/local/xymon

case $1 in
  start | stop | restart )
    [ -x $HOBBITHOME/runclient.sh ] && \
    $HOBBITHOME/runclient.sh $1
  ;;
  *)
    $HOBBITHOME/runclient.sh start
  ;;
esac
exit 0

$ wq!

・パーミッション変更
$ chmod +x xymonclient

・サービスに追加
$ chkconfig --add xymonclient

・サービスON
$ chkconfig xymonclient on

・リストにいるか確認
$ chkconfig --list

・念のためステータス確認
$ /usr/local/xymon/runclient.sh status

・ONになっているようであればstopする
$ /usr/local/xymon/runclient.sh stop

・再起動
$ reboot

・再度ステータスを確認し、起動していれば成功
$ /usr/local/xymon/runclient.sh status

2
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
2
2