http://www.ff-bb.cn/logs/167741012.html css
MUNIN是一個基於WEB界面的系統監視工具html
MUNIN的安裝有2種方式,一個是去munin上下載源代碼進行編譯,不過要解決很多依賴問題。
二是進行yum安裝,這樣能夠避免依賴問題。
centos默認狀況下不能進行munin的yum安裝。先要安裝yum-priorities
1;
用於 CentOS 5 安裝源的 yum-priorities 軟件包:
yum install yum-priorities
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
2.
個人centos是64位的,下載以下:
wget http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
3;
rpm -Uvh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
[root@192 ~]# cd /etc/yum.repos.d/
[root@192 yum.repos.d]# ls
CentOS-Base.repo CentOS-Base.repo.bak mirrors-rpmforge
CentOS-Base.repo.5 CentOS-Media.repo rpmforge.repo
有了這個RPMforge Repository的源就能夠開始yum 安裝munin
4 服務端安裝
#yum install munin munin-node
安裝完畢以後
#cd /etc/munin
# ls
munin.conf munin-node.conf plugins
munin-node.confdafault plugins.conf
plugin-conf.d templates
須要在你web服務器的靜態目錄中建立一個目錄 munin
#mkdir -p /usr/local/nginx/html/htdocs/munin/
#chown -R munin:munin /usr/local/nginx/html/htdocs/munin/
簡單設置 munin的配置文件/etc/munin/munin.conf
vi /etc/munin/munin.conf
dbdir /var/lib/munin
htmldir /usr/local/nginx/html/htdocs/munin/
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
[localhost]
address 127.0.0.1
use_node_name yes
#添加一個客戶端
[db]
address 172.32.1.1
use_node_name yes
設置 munin啓動腳步並啓動 munin
#chkconfig --levels 235 munin-node on
#/etc/init.d/munin-node start
Starting Munin Node: [ OK ]
# ps fax|grep munin
11627 pts/2 S+ 0:00 \_ grep munin
11548 ? Ss 0:00 /usr/sbin/munin-node
#cd /var/log/munin
# ls
munin-graph.log munin-limits.log munin-update.log
munin-html.log munin-node.log
# tail -f /var/log/munin/munin-html.log
Sep 17 12:00:11 - processing service: netstat
Sep 17 12:00:11 - processing service: open_files
Sep 17 12:00:11 - processing service: open_inodes
Sep 17 12:00:11 - processing service: processes
Sep 17 12:00:11 - processing service: sendmail_mailqueue
Sep 17 12:00:11 - processing service: sendmail_mailstats
Sep 17 12:00:11 - processing service: sendmail_mailtraffic
Sep 17 12:00:11 - processing service: swap
Sep 17 12:00:11 - processing service: vmstat
# ll /usr/local/nginx/html/htdocs/munin/
-rw-r--r-- 1 munin munin 2555 Sep 17 12:00 definitions.html
-rw-r--r-- 1 munin munin 1470 Sep 17 12:00 index.html
-rw-r--r-- 1 munin munin 473 Sep 17 12:00 logo.png
-rw-r--r-- 1 munin munin 3538 Sep 17 12:00 style.css
drwxr-xr-x 2 munin munin 4096 Sep 17 12:00 localhost
5;客戶端安裝,個人客戶端也是centos5.6
在客戶端主機上,只須要安裝munin-node就能夠了
yum install -y munin-node
cd /etc/munin
vi munin-node.conf
添加服務端的ip
allow ^172\.32\.1\.19$ #這個就是munin主服務器上的IP,容許這個IP對個人訪問.
#/etc/init.d/munin-node restart
cat /var/log/munin/munin-node.log
在apache/nginx中配置一個虛擬主機
<VirtualHost *:80>
ServerName www.ff-bb.cn
DocumentRoot "/var/www/html/munin"
</VirtualHost>
過幾分鐘,訪問這個域名便可看到數據。