diff options
author | 2016-10-23 01:41:03 +0000 | |
---|---|---|
committer | 2016-10-23 01:41:03 +0000 | |
commit | a7c3ac83eac821842499776eb8ac8fa67dc8897f (patch) | |
tree | 43ddf66bf2a0591ef655d9f24fe3b02e96342fbb /tests/blueprints | |
parent | 0e1a0960d3dca58423f9999b9bb31a138f8f9031 (diff) |
Apex support mods
JIRA: VES-1
Change-Id: I9265191fb9c5a985fe84355159114941cccc16f4
Signed-off-by: blsaws <bryan.sullivan@att.com>
Diffstat (limited to 'tests/blueprints')
-rwxr-xr-x | tests/blueprints/tosca-vnfd-hello-ves/start.sh | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/tests/blueprints/tosca-vnfd-hello-ves/start.sh b/tests/blueprints/tosca-vnfd-hello-ves/start.sh index 4c6184c..858ddb9 100755 --- a/tests/blueprints/tosca-vnfd-hello-ves/start.sh +++ b/tests/blueprints/tosca-vnfd-hello-ves/start.sh @@ -35,20 +35,35 @@ setup_collectd () { guest=$1 echo "$0: Install prerequisites" - sudo apt-get update - echo "$0: Install collectd plugin" - cd ~ - git clone https://github.com/maryamtahhan/OpenStackBarcelonaDemo.git + dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'` + if [ "$dist" == "Ubuntu" ]; then + conf="/etc/collectd/collectd.conf" + else + conf="/etc/collectd.conf" + fi + + if [[ ! -d ~/OpenStackBarcelonaDemo ]]; then + if [ "$dist" == "Ubuntu" ]; then + sudo apt-get update + sudo apt-get install -y collectd + else + sudo yum update -y + sudo yum install -y epel-release + sudo yum install -y collectd + fi + cd ~ + + echo "$0: Install VES collectd plugin" + git clone https://github.com/maryamtahhan/OpenStackBarcelonaDemo.git - sudo apt-get install -y collectd - sudo sed -i -- "s/FQDNLookup true/FQDNLookup false/" /etc/collectd/collectd.conf - sudo sed -i -- "s/#LoadPlugin cpu/LoadPlugin cpu/" /etc/collectd/collectd.conf - sudo sed -i -- "s/#LoadPlugin disk/LoadPlugin disk/" /etc/collectd/collectd.conf - sudo sed -i -- "s/#LoadPlugin interface/LoadPlugin interface/" /etc/collectd/collectd.conf - sudo sed -i -- "s/#LoadPlugin memory/LoadPlugin memory/" /etc/collectd/collectd.conf + sudo sed -i -- "s/FQDNLookup true/FQDNLookup false/" /etc/collectd/collectd.conf + sudo sed -i -- "s/#LoadPlugin cpu/LoadPlugin cpu/" /etc/collectd/collectd.conf + sudo sed -i -- "s/#LoadPlugin disk/LoadPlugin disk/" /etc/collectd/collectd.conf + sudo sed -i -- "s/#LoadPlugin interface/LoadPlugin interface/" /etc/collectd/collectd.conf + sudo sed -i -- "s/#LoadPlugin memory/LoadPlugin memory/" /etc/collectd/collectd.conf - if [[ "$guest" == true ]]; then - cat <<EOF | sudo tee -a /etc/collectd/collectd.conf + if [[ "$guest" == true ]]; then + cat <<EOF | sudo tee -a $conf <LoadPlugin python> Globals true </LoadPlugin> @@ -86,8 +101,8 @@ LoadPlugin aggregation </Plugin> LoadPlugin uuid EOF - else - cat <<EOF | sudo tee -a /etc/collectd/collectd.conf + else + cat <<EOF | sudo tee -a $conf <LoadPlugin python> Globals true </LoadPlugin> @@ -128,7 +143,12 @@ LoadPlugin aggregation SetPlugin "cpu-aggregation" CalculateAverage true </Aggregation> -</Plugin>EOF +</Plugin> +EOF + fi + else + echo "$0: Update collectd conf with current Collector IP" + sudo sed -i -- "s/ Domain \".*\"/ Domain \"$collector_ip\"/" $conf fi sudo service collectd restart } |