您好,登錄后才能下訂單哦!
rhel6-ganglia安裝配置
軟件下載地址:http://yunpan.cn/QbFvIIsQhvdws
1.ganglia是分布式的監控系統,有兩個Daemon,分別是:客戶端GangliaMonitoring Daemon
(gmond)和服務端GangliaMeta Daemon (gmetad),還有GangliaPHP Web Frontend(基于
web的動態訪問方式)組成是一個Linux下圖形化監控系統運行性能的軟件,界面美觀、豐富,功能強大
而ganglia又依賴于一個web服務器用來顯示集群狀態,用rrdtool來存儲數據和生成曲線圖,需要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"
}
…................................
以下的內容并不需要修改:
udp_send_channel {#udp包的發送通道
mcast_join = 239.2.11.71 #多播,工作在239.2.11.71通道下。如果使用單播模式,則要寫host= host1(接受數據的目標主機),單播模式下也可以配置多個udp_send_channel
port = 8649#監聽端口
ttl = 1
}
udp_recv_channel { #接收udp包配置
mcast_join = 239.2.11.71 #同樣工作在239.2.11.71通道下,如果使用單播模式,則要寫host= localip,就是必須是本機的ip
port = 8649#監聽端口
bind = 239.2.11.71 #綁定
}
tcp_accept_channel {
port = 8649#通過tcp協議監聽的端口,遠端可以通過鏈接8649端口得到監控數據,gmetad就是通過該端口得到xml數據
}
[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
當然ganglia所取到的數據只是desk32.example.com
現在在其他的主機上安裝gmond客戶端服務,那么在服務端將可監控同網中的所有客戶機。
客戶端軟件包: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的整合;
關于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,根分區,server60.example.com,系統負載,server60.example.com,內存空閑
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 根分區
check_command check_ganglia!disk_free_percent_rootfs!20!10
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 系統負載
check_command check_ganglia!load_one!4!5
}
defineservice{
use ganglia-service
host_name server60.example.com
service_description 內存空閑
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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。