#!/bin/bash

########
# 安裝 Ganglia 叢集監控系統
########
if [ ! -f /usr/sbin/gmond ] || [ ! -f /usr/sbin/gmetad ]; then
  echo "Installing Ganglia ...."
  sudo apt-get install gmetad ganglia-monitor
  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
  echo "deb http://free.nchc.org.tw/debian testing main" > testing.list
  sudo mv testing.list /etc/apt/sources.list.d/
  sudo apt-get update
  sudo apt-get install ganglia-webfrontend
  sudo rm /etc/apt/sources.list.d/testing.list
  sudo apt-get update
fi
