1 | #!/bin/bash |
---|
2 | |
---|
3 | function install_drbl() |
---|
4 | { |
---|
5 | echo "Installing Diskless Remote Boot in Linux ...." |
---|
6 | echo "deb http://free.nchc.org.tw/drbl-core drbl stable" > drbl.list |
---|
7 | sudo mv drbl.list /etc/apt/sources.list.d/ |
---|
8 | wget http://drbl.nchc.org.tw/GPG-KEY-DRBL |
---|
9 | sudo apt-key add GPG-KEY-DRBL |
---|
10 | rm GPG-KEY-DRBL |
---|
11 | sudo apt-get update |
---|
12 | sudo apt-get install drbl |
---|
13 | sudo /opt/drbl/sbin/drblsrv -i |
---|
14 | sudo /opt/drbl/sbin/drblpush -i |
---|
15 | } |
---|
16 | |
---|
17 | function install_ganglia() |
---|
18 | { |
---|
19 | echo "Installing Ganglia ...." |
---|
20 | sudo apt-get install gmetad ganglia-monitor |
---|
21 | sudo apt-get install rrdtool librrds-perl librrd-dev apache2 libapache2-mod-php5 php5-gd apache2-mpm-prefork apache2-utils apache2.2-common libapr1 libaprutil1 libmysqlclient15off libpq5 mysql-common openssl-blacklist ssl-cert |
---|
22 | echo "deb http://free.nchc.org.tw/debian testing main" > testing.list |
---|
23 | sudo mv testing.list /etc/apt/sources.list.d/ |
---|
24 | sudo apt-get update |
---|
25 | sudo apt-get install ganglia-webfrontend |
---|
26 | sudo rm /etc/apt/sources.list.d/testing.list |
---|
27 | sudo apt-get update |
---|
28 | } |
---|
29 | |
---|
30 | function configure_gmetad() |
---|
31 | { |
---|
32 | echo "Configuring gmetad ..." |
---|
33 | } |
---|
34 | |
---|
35 | function configure_gmom() |
---|
36 | { |
---|
37 | echo "Configuring gmom ..." |
---|
38 | } |
---|
39 | |
---|
40 | if [ ! -d /opt/drbl ]; then |
---|
41 | install_drbl |
---|
42 | fi |
---|
43 | |
---|
44 | if [ ! -f /usr/sbin/gmond ] || [ ! -f /usr/sbin/gmetad ]; then |
---|
45 | install_ganglia |
---|
46 | fi |
---|