build collectd with pqos
[barometer.git] / src / fuel-plugin / deployment_scripts / install.sh
1 #!/bin/bash
2 set -eux
3
4 INSTALL_HOME=/opt/collectd-ceilometer
5
6 HOST=$1
7 OS_AUTH_URL=$2
8 OS_USERNAME=$3
9 OS_PASSWORD=$4
10
11 CEILOMETER_URL_TYPE=${CEILOMETER_URL_TYPE:-internalURL}
12 CEILOMETER_TIMEOUT=${CEILOMETER_TIMEOUT:-1000}
13
14 rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
15 cd $INSTALL_HOME
16 curl http://$HOST:8080/plugins/fuel-plugin-collectd-ceilometer-1.0/repositories/ubuntu/collectd-ceilometer.tgz | tar xzvf -
17
18 cat << EOF > /etc/ld.so.conf.d/pqos.conf
19 $INSTALL_HOME/lib
20 EOF
21 ldconfig
22 modprobe msr
23
24 apt-get install -y --allow-unauthenticated collectd python-dev libpython2.7
25
26 cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf
27 <LoadPlugin python>
28   Globals true
29 </LoadPlugin>
30
31 <Plugin python>
32     ModulePath "$INSTALL_HOME/collectd-ceilometer-plugin"
33     LogTraces true
34     Interactive false
35     Import "collectd_ceilometer.plugin"
36
37     <Module "collectd_ceilometer.plugin">
38
39         # Verbosity 1|0
40         #VERBOSE 0
41
42         # Batch size
43         BATCH_SIZE 3
44
45         # Service endpoint addresses
46         OS_AUTH_URL "$OS_AUTH_URL"
47
48         # Ceilometer address
49         #CEILOMETER_ENDPOINT
50         CEILOMETER_URL_TYPE "$CEILOMETER_URL_TYPE"
51
52         # Ceilometer timeout in ms
53         CEILOMETER_TIMEOUT "$CEILOMETER_TIMEOUT"
54
55         # # Ceilometer user creds
56         OS_USERNAME "$OS_USERNAME"
57         OS_PASSWORD "$OS_PASSWORD"
58         OS_TENANT_NAME "services"
59
60     </Module>
61 </Plugin>
62 EOF
63
64 service collectd restart