aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/nfvi/collectd.sh
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2016-12-30 09:22:25 -0800
committerDeepak S <deepak.s@linux.intel.com>2017-01-19 08:28:10 +0530
commitddb76faa5841997bd3eec4ed2f3d33f56e66d0c3 (patch)
tree2970946f924aedcc318158d19e24a3252cdf0cd5 /yardstick/network_services/nfvi/collectd.sh
parent4c02cf5d19e2c36c9747a1c05d86331a1918baec (diff)
Add infrastructure to add the NFVi KPI collections
This patches added common function to collect NFVi KPIs for given usecases - Core KPIs like memory/LLC/IPC etc - OVS stats - memory stats etc. JIRA: YARDSTICK-488 Change-Id: Iab41146392efc47b7313b1846a67728a44d0f1d6 Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Diffstat (limited to 'yardstick/network_services/nfvi/collectd.sh')
-rwxr-xr-xyardstick/network_services/nfvi/collectd.sh89
1 files changed, 89 insertions, 0 deletions
diff --git a/yardstick/network_services/nfvi/collectd.sh b/yardstick/network_services/nfvi/collectd.sh
new file mode 100755
index 000000000..7acb40431
--- /dev/null
+++ b/yardstick/network_services/nfvi/collectd.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+#
+# Copyright (c) 2016-2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+INSTALL_NSB_BIN="/opt/nsb_bin"
+cd $INSTALL_NSB_BIN
+
+if [ "$(whoami)" != "root" ]; then
+ echo "Must be root to run $0"
+ exit 1;
+fi
+
+echo "Install required libraries to run collectd..."
+pkg=(git flex bison build-essential pkg-config automake autotools-dev libltdl-dev librabbitmq-dev rabbitmq-server)
+for i in "${pkg[@]}"; do
+dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed"
+ if [ "$?" -eq "1" ]; then
+ apt-get -y install "${i}";
+ fi
+done
+echo "Done"
+
+ldconfig -p | grep libpqos >/dev/null
+if [ $? -eq 0 ]
+then
+ echo "Intel RDT library already installed. Done"
+else
+ pushd .
+
+ echo "Get intel_rdt repo and install..."
+ rm -rf intel-cmt-cat >/dev/null
+ git clone https://github.com/01org/intel-cmt-cat.git
+ pushd intel-cmt-cat
+ git checkout tags/v1.5 -b v1.5
+ make install PREFIX=/usr
+ popd
+
+ popd
+ echo "Done."
+fi
+
+which /opt/nsb_bin/collectd/collectd >/dev/null
+if [ $? -eq 0 ]
+then
+ echo "Collectd already installed. Done"
+else
+ pushd .
+ echo "Get collectd from repository and install..."
+ rm -rf collectd >/dev/null
+ git clone https://github.com/collectd/collectd.git
+ pushd collectd
+ git stash
+ git checkout -b collectd 43a4db3b3209f497a0ba408aebf8aee385c6262d
+ ./build.sh
+ ./configure --with-libpqos=/usr/
+ make install > /dev/null
+ popd
+ echo "Done."
+ popd
+fi
+
+modprobe msr
+cp $INSTALL_NSB_BIN/collectd.conf /opt/collectd/etc/
+
+echo "Check if admin user already created"
+rabbitmqctl list_users | grep '^admin$' > /dev/null
+if [ $? -eq 0 ];
+then
+ echo "'admin' user already created..."
+else
+ echo "Creating 'admin' user for collectd data export..."
+ rabbitmqctl delete_user guest
+ rabbitmqctl add_user admin admin
+ rabbitmqctl authenticate_user admin admin
+ rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"
+ echo "Done"
+fi