Skip to content

Instantly share code, notes, and snippets.

@ashikawa
Last active October 11, 2015 23:28
Show Gist options
  • Save ashikawa/3936605 to your computer and use it in GitHub Desktop.
Save ashikawa/3936605 to your computer and use it in GitHub Desktop.
Muninインストールログ

munin インストールログ (Cent6)

インストールと自動起動設定

wget http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-7.noarch.rpm
vi /etc/yum.repos.d/epel-testing.repo
yum --enablerepo=epel install munin
vi /etc/munin/munin.conf
  • munin.conf
# a simple host tree
#[buildvm-01.phx2.fedoraproject.org]
#    address 127.0.0.1
#    use_node_name yes

[localhost]
        address 127.0.0.1
        use_node_name yes
/etc/init.d/munin-node start
chkconfig munin-node on
chkconfig --list | fgrep munin

/var/www/html/munin にインストールされている
必要に応じて httpd.conf を設定

Basic認証

htpasswd -c /etc/munin/munin-htpasswd admin
	< admin

ズーミング機能

cp /var/www/html/munin/cgi/munin-cgi-graph /var/www/cgi-bin/
vi /etc/munin/munin.conf
  • munin.conf
cgiurl_graph /munin-cgi/munin-cgi-graph

プラグインの設定

インストール方法

# プラグイン一覧
ls -l /usr/share/munin/plugins/

# プラグインの情報
munin-node-configure -suggest

# 一括インストールコマンドの出力
munin-node-configure --shell

# インストール(シンボリックリンクの作成 通常は configure で良い)
ln -s /usr/share/munin/plugins/**** /etc/munin/plugins/****

# 動作確認
munin-run ****

# 困ったら
munin-run --debug ****

# 再起動
/etc/init.d/munin-node restart

ApacheAcecss

ln -s /usr/share/munin/plugins/apache_accesses /etc/munin/plugins/[apache_accesses]
vi /etc/httpd/conf/httpd.conf
  • httpd.conf
ExtendedStatus On

<Location /server-status>
    SetHandler server-status
#    Order deny,allow
#    Deny from all
#    Allow from .example.com
</Location>
/etc/init.d/httpd reload
munin-run apache_accesses
/etc/init.d/munin-node restart

CPU

ln -s /usr/share/munin/plugins/cpu /etc/munin/plugins/cpu
munin-run cpu

IOSTAT

ln -s /usr/share/munin/plugins/iostat /etc/munin/plugins/iostat
munin-run iostat

PROC

ln -s /usr/share/munin/plugins/proc /etc/munin/plugins/proc
munin-run proc

MySQL

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
vi /etc/munin/plugin-conf.d/munin-node
  • munin-node
[mysql*]
    env.mysqlopt -u root -ppassword
    env.mysqladmin /usr/bin/mysqladmin
munin-run mysql_queries
munin-run mysql_slowqueries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment