1
2
|
#安装ganglia相关包
yum -y
install
apr-devel apr-util check-devel cairo-devel pango-devel libxml2-devel rpmbuild glib2-devel dbus-devel freetype-devel fontconfig-devel gcc-c++ expat-devel python-devel libXrender-devel pcre pcre-devel
|
1
2
3
4
5
6
7
|
tar
xzf rrdtool-1.4.9.
tar
.gz
cd
rrdtool-1.4.9
.
/configure
--prefix=
/opt/rrdtool-1
.4.9 --disable-perl
make
make
install
ln
-s
/opt/rrdtool-1
.4.9
/include/rrd
.h
/usr/include/rrd
.h
ln
-s
/opt/rrdtool-1
.4.9
/lib/librrd
.a
/usr/lib/librrd
.a
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/sh
#安装confuse
tar
zxf confuse-2.7.
tar
.gz
cd
confuse-2.7
.
/configure
CFLAGS=-fPIC --disable-nls ;
make
;
make
install
cd
..
#安装ganglia
tar
zxf ganglia-3.6.1.
tar
.gz
cd
ganglia-3.6.1
#server
.
/configure
--prefix=
/opt/modules/ganglia
--with-static-modules --
enable
-gexec --
enable
-status --with-gmetad --with-python=
/usr
--with-librrd=
/opt/rrdtool-1
.4.9 --with-libexpat=
/usr
--with-libconfuse=
/usr/local
--with-libpcre=
/usr/local
#client
#./configure --prefix=/opt/modules/ganglia --enable-gexec --enable-status --with-python=/usr --with-libconfuse=/usr/local --with-libexpat=/usr --with-libpcre=/usr
make
;
make
install
cd
gmetad
cp
gmetad.conf
/opt/modules/ganglia/etc/
cp
gmetad.init
/etc/init
.d
/gmetad
sed
-i
"s/^GMETAD=\/usr\/sbin\/gmetad/GMETAD=\/opt\/modules\/ganglia\/sbin\/gmetad/g"
/etc/init
.d
/gmetad
chkconfig --add gmetad
#我的服务器有两块网卡,eth1使用公网地址,eth2使用局域网地址,监控服务器和被监控服务器之间的通信通过局域网地址实现以减少公网网卡的负载,使用以下命令:(此IP可以在/etc/ganglia/gmond.conf中修改)
ip route add 239.2.11.71 dev eth2
service gmetad start
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
tar
zxf confuse-2.7.
tar
.gz
cd
confuse-2.7
.
/configure
CFLAGS=-fPIC --disable-nls ;
make
;
make
install
cd
..
tar
zxf ganglia-3.6.1.
tar
.gz
cd
ganglia-3.6.1
#server
#./configure --prefix=/opt/modules/ganglia --with-static-modules --enable-gexec --enable-status --with-gmetad --with-python=/usr --with-librrd=/opt/rrdtool-1.4.5 --with-libexpat=/usr --with-libconfuse=/usr/local --with-libpcre=/usr/local
#client不需要rrdtool
.
/configure
--prefix=
/opt/modules/ganglia
--
enable
-gexec --
enable
-status --with-python=
/usr
--with-libconfuse=
/usr/local
--with-libexpat=
/usr
--with-libpcre=
/usr
make
;
make
install
cd
gmond
.
/gmond
-t >
/opt/modules/ganglia/etc/gmond
.conf
cp
gmond.init
/etc/init
.d
/gmond
sed
-i
"s/^GMOND=\/usr\/sbin\/gmond/GMOND=\/opt\/modules\/ganglia\/sbin\/gmond/g"
/etc/init
.d
/gmond
chkconfig --add gmond
ip route add 239.2.11.71 dev eth2
service gmond start
|
1
2
|
tar
xzf ganglia-web-3.6.2
cd
ganglia-web-3.6.2
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
##########################################################
# User configurables:
##########################################################
# Location where gweb should be installed to (excluding conf, dwoo dirs).
GDESTDIR =
/var/www/html/ganglia
# Location where default apache configuration should be installed to.
GCONFDIR =
/etc/ganglia-web
# Gweb statedir (where conf dir and Dwoo templates dir are stored)
GWEB_STATEDIR =
/var/lib/ganglia-web
# Gmetad rootdir (parent location of rrd folder)
GMETAD_ROOTDIR =
/var/lib/ganglia
APACHE_USER = apache
##########################################################
|
1
2
3
4
|
#
$conf[
'gmetad_root'
]
=
"/var/lib/ganglia"
;
$conf[
'rrds'
]
=
"${conf['gmetad_root']}/rrds"
;
$conf[
'rrdtool'
]
=
"/opt/rrdtool-1.4.9/bin/rrdtool"
;
|
1
2
3
4
|
service iptables stop
chkconfig iptables off
service httpd start
chkconfig httpd on
|