-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
83 lines (68 loc) · 1.84 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
## ganglia 2016-05-30
## http://www.aqzt.com
##email: [email protected]
##robert yu
##centos 6和centos 7
OS_CENTOS6(){
wget http://mirrors.aliyun.com/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh epel-release-latest-6.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
##只装ganglia服务器端
yum install ganglia ganglia-devel ganglia-gmetad ganglia-gmond ganglia-web ganglia-gmond-python
#启动命令
#service gmond start
#service httpd start
#service gmetad start
##只装ganglia客户端
yum install -y ganglia ganglia-gmond
#启动客户端命令
service gmond start
}
OS_CENTOS7(){
wget http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh epel-release-latest-7.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
##只装ganglia服务器端
yum install ganglia ganglia-devel ganglia-gmetad ganglia-gmond ganglia-web ganglia-gmond-python
#启动命令
#service gmond start
#service httpd start
#service gmetad start
##只装ganglia客户端
yum install -y ganglia ganglia-gmond
#启动客户端命令
service gmond start
}
OS_SYSTEM(){
if [ -f /etc/redhat-release ];then
## OS=CentOS
if [ ! -z "`cat /etc/redhat-release | grep CentOS |grep "release 7"`" ];then
OS=CentOS7
elif [ ! -z "`cat /etc/redhat-release | grep CentOS |grep "release 6"`" ];then
OS=CentOS6
else
echo $OS
fi
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
OS=Debian
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
OS=Ubuntu
else
echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
fi
echo $OS
}
OS_command()
{
if [ $OS == 'CentOS6' ];then
OS_CENTOS6
elif [ $OS == 'CentOS7' ];then
OS_CENTOS7
else
echo -e "\033[31mDoes not support this OS, Please contact the author! \033[0m"
fi
}
OS_SYSTEM
OS_command
echo ok