安裝Munin監控替代Cacti | Alex's blog
這次添加第二臺服務器的時候是在受不了Cacti了,全都換成了Munin監控。
在CentOS5上安裝的話,Munin并沒有在官方的yum源中,需要自己手工添加yum源:
#rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#rpm -Uvh epel-release-5-4.noarch.rpmcentos6的話可能需要安裝epel6.5的版本:
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm然后在創建一個文件:/etc/yum.repos.d/dag.repo
#vim /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1弄完以后就可以通過yum來安裝Munin了。
1. 監控端(生成Munin圖表的server)安裝:
#yum -y install munin
2. 被監控端(提供運行數據的server)安裝:
#yum -y install munin-node
3. 監控端配置:
Munin不用設置用戶,只需要制定一個發布圖表的目錄即可,當然這個目錄最好是web服務器中的目錄,這樣就能夠直接通過web服務器查看監控信息了:# vim /etc/munin/munin.conf
Configfile for Munin master
dbdir /var/lib/munin/
htmldir /var/www/munin/
#如果/var/www是web服務器的主目錄的話,就在里面創建一個用戶名為munin的目錄否則munin無法寫入;名稱隨便可以起,例子中的名稱也是munin
logdir /var/log/munin
rundir /var/run/munin/# This is an example of the correct way to activate Nagios warnings
contact.nagios.command /usr/local/nagios/bin/send_nsca nagioshost.example.com -c /usr/local/nagios/etc/send_nsca.cfg -to 60# From and including the first host, no more global directives can be defined.
# Everything after one host definition belongs to that host, until another host definition is found.[foo.example.com] # 創建一個名為foo.example.com的監控
#
address 12.23.34.56 #被監控的IP地址為12.23.34.564. 被監控端配置
# vim /etc/munin/munin-node.conf
log_level 4
log_file /var/log/munin/munin-node.log
port 4949
pid_file /var/run/munin/munin-node.pid
background 1
host *
user root
group root
setsid yes
ignore_file ~$
ignore_file \.bak$
ignore_file %$
ignore_file \.dpkg-(tmp|new|old|dist)$
ignore_file \.rpm(save|new)$
# host_name localhost.localdomain
allow ^127\.0\.0\.1$
#指定自己允許被那個IP地址監控,寫成正則表達式的格式,例如允許被12.21.34.43監控就寫成allow ^12\.21\.34\.43$然后分別啟動監控端的munin服務和被監控端的munin-node服務即可。第一次畫圖會比較慢,等幾個小時后圖形就正常了。
監控服務端啟動:#service munin start
#chkconfig munin on //為了保證服務開機啟動被監控段啟動:
#service munin-node start
#chkconfig munin-node on //為了保證服務開機啟動
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
