您好,登錄后才能下訂單哦!
rhel6-ganglia安裝配置
軟件下載地址:http://yunpan.cn/QbFvIIsQhvdws
1.ganglia是分布式的監(jiān)控系統(tǒng),有兩個Daemon,分別是:客戶端GangliaMonitoring Daemon
(gmond)和服務(wù)端GangliaMeta Daemon (gmetad),還有GangliaPHP Web Frontend(基于
web的動態(tài)訪問方式)組成是一個Linux下圖形化監(jiān)控系統(tǒng)運行性能的軟件,界面美觀、豐富,功能強大
而ganglia又依賴于一個web服務(wù)器用來顯示集群狀態(tài),用rrdtool來存儲數(shù)據(jù)和生成曲線圖,需要xml解析因此需要expat,配置文件解析需要libconfuse。安裝apche的httpd還需要支持php4以上,同時還有一些依賴軟件。
http://ganglia.sourceforge.net/軟件下載
2. 安裝
依賴包:
[root@desk32~]# yum -y install apr-devel apr-util check-devel cairo-develpango-devel libxml2-devel rpm-build glib2-devel dbus-develfreetype-devel fontconfig-devel gcc gcc-c++ expat-devel python-devellibXrender-devel
在解開ganglia-3.6.0.tar.gz后可以看見有一個ganglia.spec的文件證明是可以直接通過rpmbuild的方式編譯出rpm包的;
build需要的依賴包:
yum -yinstall libart_lgpl-devel pcre-devel libtool
[root@desk32~]# rpm -ivh libconfuse-devel-2.6-3.el6.x86_64.rpmlibconfuse-2.6-3.el6.x86_64.rpm
[root@desk32~]# yum localinstall rrdtool-devel-1.3.8-6.el6.x86_64.rpm
[root@desk32~]# rpmbuild -tb ganglia-3.6.0.tar.gz #-tb表示從tar包中build二進制文件
[root@desk32~]# cd /root/rpmbuild/RPMS/x86_64/
[root@desk32x86_64]# ls
ganglia-devel-3.6.0-1.x86_64.rpm
ganglia-gmetad-3.6.0-1.x86_64.rpm
ganglia-gmond-3.6.0-1.x86_64.rpm
ganglia-gmond-modules-python-3.6.0-1.x86_64.rpm
libganglia-3.6.0-1.x86_64.rpm
[root@desk32x86_64]# rpm -ivh *
/etc/ganglia/主配置目錄
/var/lib/ganglia/rrdsrrds圖信息存儲目錄
[root@desk32ganglia]# vim gmond.conf
…................................
cluster{
name= "mycluster"
owner= "unspecified"
latlong = "unspecified"
url ="unspecified"
}
…................................
以下的內(nèi)容并不需要修改:
udp_send_channel {#udp包的發(fā)送通道
mcast_join = 239.2.11.71 #多播,工作在239.2.11.71通道下。如果使用單播模式,則要寫host= host1(接受數(shù)據(jù)的目標(biāo)主機),單播模式下也可以配置多個udp_send_channel
port = 8649#監(jiān)聽端口
ttl = 1
}
udp_recv_channel { #接收udp包配置
mcast_join = 239.2.11.71 #同樣工作在239.2.11.71通道下,如果使用單播模式,則要寫host= localip,就是必須是本機的ip
port = 8649#監(jiān)聽端口
bind = 239.2.11.71 #綁定
}
tcp_accept_channel {
port = 8649#通過tcp協(xié)議監(jiān)聽的端口,遠(yuǎn)端可以通過鏈接8649端口得到監(jiān)控數(shù)據(jù),gmetad就是通過該端口得到xml數(shù)據(jù)
}
[root@desk32ganglia]# /etc/init.d/gmetad start
StartingGANGLIA gmetad: [ OK ]
[root@desk32ganglia]# /etc/init.d/gmond start
StartingGANGLIA gmond: [ OK ]
tcp 0 0 0.0.0.0:8649 0.0.0.0:* LISTEN 23393/gmond
tcp 0 0 0.0.0.0:8651 0.0.0.0:* LISTEN 23376/gmetad
tcp 0 0 0.0.0.0:8652 0.0.0.0:* LISTEN 23376/gmetad
[root@desk32~]# tar zxf ganglia-web-3.5.2.tar.gz -C /var/www/html/
[root@desk32~]# cd /var/www/html/
[root@desk32html]# mv ganglia-web-3.5.2/ ganglia
[root@desk32ganglia]# yum -y install rsync
[root@desk32ganglia]# make install
/etc/init.d/gmetadrestart
/etc/init.d/gmondrestart
web訪問:
http://desk32/ganglia
當(dāng)然ganglia所取到的數(shù)據(jù)只是desk32.example.com
現(xiàn)在在其他的主機上安裝gmond客戶端服務(wù),那么在服務(wù)端將可監(jiān)控同網(wǎng)中的所有客戶機。
客戶端軟件包:ganglia-gmond-3.6.0-1.x86_64.rpm
ganglia-gmond-modules-python-3.6.0-1.x86_64.rpm
libganglia-3.6.0-1.x86_64.rpm
libconfuse-2.6-3.el6.x86_64.rpm
libconfuse-devel-2.6-3.el6.x86_64.rpm
[root@desk32x86_64]# scp ganglia-gmond-* desk3:
[root@desk32x86_64]# scp ganglia-gmond-* server60
[root@desk32x86_64]# scp libganglia-3.6.0-1.x86_64.rpm desk3:
[root@desk32x86_64]# scp libganglia-3.6.0-1.x86_64.rpm server60:
[root@desk32~]# scp libconfuse-2.6-3.el6.x86_64.rpm libconfuse-devel-2.6-3.el6.x86_64.rpm desk3:
[root@desk32~]# scp libconfuse-2.6-3.el6.x86_64.rpm libconfuse-devel-2.6-3.el6.x86_64.rpm server60:
以下操作分別在客戶機desk3(192.168.122.3)與server60(192.168.122.160)上操作:
[root@desk3~]# rpm -ivh libconfuse-2.6-3.el6.x86_64.rpmlibconfuse-devel-2.6-3.el6.x86_64.rpm
[root@desk3~]# rpm -ivh libganglia-3.6.0-1.x86_64.rpm
[root@desk3~]# rpm -ivh ganglia-gmond-*
3.ganglia與nagios的整合;
關(guān)于nagios的配置參見博文rhel6-nagios安裝配置:
http://wangziyin.blog.51cto.com/6948950/1305465
[root@desk32contrib]# cp/root/rpmbuild/BUILD/ganglia-3.6.0/contrib/check_ganglia.py/usr/local/nagios/libexec/
[root@desk32contrib]# cd /usr/local/nagios/libexec/
[root@desk32libexec]# chmod a+x check_ganglia.py
[root@desk32libexec]# vim check_ganglia.py
配置nagios:
[root@desk32objects]# vim commands.cfg
###############check_ganglia#############################
definecommand{
command_name check_ganglia
command_line $USER1$/check_ganglia.py -h $HOSTNAME$ -m $ARG1$ -w$ARG
2$ -c$ARG3$
}
[root@desk32objects]# vim templates.cfg
defineservice{
use generic-service
name ganglia-service
hostgroup_name ganglia-servers
service_groups ganglia-metrics
}
[root@desk32objects]# vim service.cfg
defineservicegroup{
servicegroup_name ganglia-metrics
alias ganglia-metrics
membersserver60.example.com,根分區(qū),server60.example.com,系統(tǒng)負(fù)載,server60.example.com,內(nèi)存空閑
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 根分區(qū)
check_command check_ganglia!disk_free_percent_rootfs!20!10
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 系統(tǒng)負(fù)載
check_command check_ganglia!load_one!4!5
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 內(nèi)存空閑
check_command check_ganglia!mem_free!50000!30000
}
[root@desk32objects]# vim hosts.cfg
definehost{
use linux-server
host_name server60.example.com
alias ganglia client
address 192.168.122.160
}
definehostgroup{
hostgroup_name ganglia-servers
alias ganglia-servers
members desk32.example.com
}
[root@desk32objects]# /usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg
[root@desk32objects]# /etc/init.d/nagios restart
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。