Munin 是一款優秀的性能監控工具,採用client-server模式,支持同時監控多個節點,並且以web的方式展現出來。
Munin 功能介紹
Munin的組織架構
Munin的安裝
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -ivh epel-release-latest-6.noarch.rpm
Clean yum 並安裝munin-nodeyum clean all
yum install munin-node
安裝完以後配置/etc/munin/munin-node.conf ,把服務器地址配置成allow,並去掉幾個文件夾的註釋#
allow ^127\.0\.0\.1$
allow ^::1$
allow ^10\.128\.1\.232$
重啓munin-mode,並確保從服務器可以telnet到客戶端的4949端口。服務器地址變化後需要重啓munin-node/etc/init.d/munin-node restart
服務器端安裝(以Centos 7 爲例):
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
clean yum 並安裝munin,以及用於作爲web 服務器的nginx
yum install munin
yum install nginx
配置/etc/munin/munin.conf 加客戶端地址:
[147]
address 10.128.1.147
use_node_name yes
user munin;
替換原nginx.conf 中的地址server配置端,替換爲如下配置,並打開Iptables的8080端口,讓外面機器可以訪問。server {
listen 8080;
server_name _;
location /munin {
#alias /var/cache/munin/www/;
alias /var/www/html/munin/;
}
location ^~ /cgi-bin/munin-cgi-graph/ {
access_log off;
fastcgi_split_path_info ^(/cgi-bin/munin-cgi-graph)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fcgi-graph.sock;
include fastcgi_params;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
啓動nginx,幾分鐘後就可以看到監控畫面了。
systemctl start nginx