2014年4月17日

muninの設定とかテスト方法とか覚書

muninの設定にあたりよく使う設定やテスト方法等まとめておきます

Apache nginxのステータス取得の設定

・Apacheのステータスを取る設定(許可IPは 127.0.0.1)

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

・nginxのステータスを取る設定(許可IPは 127.0.0.1)

server {
    listen 80;
    server_name localhost;
    location /nginx_status {
        stub_status on;
        access_logoff;
        allow 127.0.0.1;
        deny all;
    }
}

設定のパラメーターは /etc/munin/plugin-conf.d/munin-node

/etc/munin/plugin-conf.d/munin-node に記述
上記のapacheとnginxにあわせています

[apache_*]
env.url http://127.0.0.1:%d/server-status?auto
env.ports 8080

[nginx*]
env.url http://localhost/nginx_status

[mysql*]
env.mysqladmin /usr/bin/mysqladmin
env.mysqlopts -uroot -ppassword

[hddtemp_smartctl]
user root
env.smartctl /usr/sbin/smartctl
env.drives twa0
env.args_twa0 --all -d 3ware,0

[hddtemp_smartctl]
user root
env.smartctl /usr/sbin/smartctl
env.drives sda
env.args_sda --all -d ata


munin オススメ設定

/usr/sbin/munin-node-configure --suggest --shell --families auto,manual,contrib

ln -s '/usr/share/munin/plugins/apache_volume' '/etc/munin/plugins/apache_volume'
ln -s '/usr/share/munin/plugins/apc_nis' '/etc/munin/plugins/apc_nis'
ln -s '/usr/share/munin/plugins/buddyinfo' '/etc/munin/plugins/buddyinfo'
ずらーっとでてくるので必要なものをシンボリックリンク張る

シンボリックリンク張った後は /etc/init.d/munin-node restart する


プラグインのテスト

例:apache_volumeのテスト

/usr/sbin/munin-run --servicedir /usr/share/munin/plugins --debug apache_volume
# Processing plugin configuration from /etc/munin/plugin-conf.d/df
# Processing plugin configuration from /etc/munin/plugin-conf.d/fw_
# Processing plugin configuration from /etc/munin/plugin-conf.d/hddtemp_smartctl
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Processing plugin configuration from /etc/munin/plugin-conf.d/postfix
# Processing plugin configuration from /etc/munin/plugin-conf.d/sendmail
# Setting /rgid/ruid/ to /99/99/
# Setting /egid/euid/ to /99 99/99/
# Setting up environment
# Environment ports = 8080
# Environment url = http://127.0.0.1:%d/server-status?auto
# About to run '/usr/share/munin/plugins/apache_volume'
volume8080.value 5297152


どれも忘れやすいので、まとめて記述しておきました
munin使っていたら試してみてください


  • follow us in feedly

スポンサーリンク