最終更新:2019-02-15 (金) 12:28:13 (1894d)  

Munin
Top / Munin

サーバに関するあらゆる情報をグラフ化し、HTMLを作ってくれる。

http://munin.projects.linpro.no/

パッケージ

Ubuntu

インストール

yum install munin munin-node
  • munin - HTMLを生成
  • munin-node - データを収集
  • munin-run - プラグインを試しに実行できる

設定ファイル

/etc/munin/munin.conf
/etc/munin/munin-node.conf
/etc/munin/munin-htpasswd

起動

/etc/init.d/munin-node start
chkconfig munin-node on

出力

/var/www/html/munin

cronで5分おきに生成される。

夜間帯に色を付ける

プラグインの追加

MySQL

  • ln -s /usr/share/munin/plugins/mysql_bytes /etc/munin/plugins/mysql_bytes
    ln -s /usr/share/munin/plugins/mysql_isam_space_ /etc/munin/plugins/mysql_isam_space_
    ln -s /usr/share/munin/plugins/mysql_queries /etc/munin/plugins/mysql_queries
    ln -s /usr/share/munin/plugins/mysql_slowqueries /etc/munin/plugins/mysql_slowqueries
    ln -s /usr/share/munin/plugins/mysql_threads /etc/munin/plugins/mysql_threads

Apache

  • ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/apache_accesses
    ln -s /usr/share/munin/plugins/apache_processes /etc/munin/plugins/apache_processes
    ln -s /usr/share/munin/plugins/apache_volume /etc/munin/plugins/apache_volume

Apacheの設定

httpd.confmod_statusを有効にして、ExtendedStatusをonにする

ExtendedStatus On

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>

ポートを変えたときは

/etc/munin/plugin-conf.d

に apacheとか言うファイル名で

[apache*]
env.ports 8080

とかにする。

Windowsの監視

Muninではじめる実践★リソース監視 -俺のサーバがこんなに重いはずがない、を乗り切るために- from Masahito Zembutsu
俺の Munin がこんなに軽いわけがない #監視ツール勉強会 from Masahito Zembutsu

関連

参考