アイビスヘッダー

IBS
ラベル munin の投稿を表示しています。 すべての投稿を表示
ラベル munin の投稿を表示しています。 すべての投稿を表示

2012年9月22日土曜日

RHEL6(x86_64)でepelを利用してのmuninインストールが失敗する

RHEL6.3(x86_64)を利用していて、epelレポジトリを利用して、muninのインストールを行うと以下のエラーで失敗する。

Error: Package: munin-1.4.7-5.el6.noarch (epel)
           Requires: perl(RRDs)
Error: Package: perl-Log-Log4perl-1.30-1.el6.noarch (epel)
           Requires: perl(RRDs)

yum search で探してみても、それらしいパッケージは見つからない。


試しに、CentOS6用の以下パッケージをダウンロードしてインストールしてみると、あっさり成功!
rpm -ivh rrdtool-perl-1.3.8-6.el6.x86_64.rpm

これでいいのか?
とりあえず設定を進めてみる。

2012年2月2日木曜日

munin で KVM の情報を取得する

CentOS6.2(x86_64)で動作している KVM 上の、各VMの状態を知りたいと思っていたら、munin に libvirt というプラグインを開発されている方がいることを知りました。
Debian向けにはパッケージが存在するのでインストールするのは簡単だと思いますが、CentOS用にはパッケージが存在しないので手動でインストールする必要があります。

CentOS6.2(x86_64)には、munin-node(epel)をインストールしておきます。

pluginモジュールを以下のサイトからダウンロードします。
http://honk.sigxcpu.org/projects/libvirt/monitor/releases/munin-libvirt-plugins-0.0.6.tar.gz

展開してインストールを行います。
# tar xvfz munin-libvirt-plugins-0.0.6.tar.gz
# cd munin-libvirt-plugins-0.0.6
# make
# make install
# ln -s /usr/share/munin/plugins/libvirt-* /etc/munin/plugins/

munin-node設定
# vi /etc/munin/plugin-conf.d/libvirt
 
[libvirt-*]
env.uri qemu:///system

※SELinuxを無効にしておいてください。
これで僕は大はまりしました。

munin-nodeを再起動して完了です。


KVM以外の監視もできるようです、本家サイトを見てください。
http://libvirt.org/

2012年2月1日水曜日

munin で tomcat7 監視設定

CentOS6.2(x86_64) +  tomcat7.0.25 + munin-node1.4.6(epel) の環境です。

tomcat設定
$TOMCAT_HOME/conf/tomcat-users.xml に2行追加

<role rolename="manager-status"/>
<user username="munin" password="munin" roles="manager-status"/>


munin-node設定
/etc/munin/plugin-conf.d/tomcat ファイルを作成

[tomcat_*]
env.host 127.0.0.1
env.port 8080
env.request /manager/status?XML=true
env.user munin
env.password munin
env.timeout 30
env.connector jk-8009


リンクをはる
# ln -s /usr/share/munin/plugins/tomcat_* /etc/munin/plugins/


確認
# /usr/share/munin/plugins/tomcat_access autoconf
# curl http://munin:munin@127.0.0.1:8080/manager/status?XML=true


必須パッケージに、perl-XML-Simpleが必要なところではまりましたが
/usr/share/munin/plugins/tomcat_access autoconf が教えてくれました。

pluginファイルがそのままでは、tomcat7では利用できませんので編集します。
/etc/munin/plugins/tomcat_access

if($xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'requestInfo'}->[0]->{'requestCount'}) {
    print "accesses.value " . $xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'requestInfo'}->[0]->{'requestCount'} . "\n";
} else {
    print "accesses.value U\n";
}

/etc/munin/plugins/tomcat_threads

if($xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'threadInfo'}->[0]->{'currentThreadsBusy'} &&
    $xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'threadInfo'}->[0]->{'currentThreadCount'}) {
    print "busy.value " . $xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'threadInfo'}->[0]->{'currentThreadsBusy'} . "\n";
    print "idle.value " .
          ($xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'threadInfo'}->[0]->{'currentThreadCount'} -
          $xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'threadInfo'}->[0]->{'currentThreadsBusy'}) . "\n";
} else {
    print "busy.value U\n";
    print "idle.value U\n";
}

/etc/munin/plugins/tomcat-volume

if($xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'requestInfo'}->[0]->{'bytesSent'}) {
    print "volume.value " . $xml->{'connector'}->{'"http-bio-'.$PORT.'"'}->{'requestInfo'}->[0]->{'bytesSent'} . "\n";
} else {
    print "volume.value U\n";
}

変更内容としては、tomcat6までは connector name が
'http-8080'
で返ってきてたんですが、tomcat7からは
'"http-bio-8080"'
で返ってくるので、それに対応することです。

後は、tomcatの再起動と、munin-nodeの再起動で完成です。