fuel: fix collectd ceilometer installation script
[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 apt-get install -y collectd
15
16 rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
17 cd $INSTALL_HOME
18 curl http://$HOST:8080/plugins/fuel-plugin-collectd-ceilometer-0.9/repositories/ubuntu/collectd-ceilometer.tgz | tar xzvf -
19
20 cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf
21 <LoadPlugin python>
22   Globals true
23 </LoadPlugin>
24
25 <Plugin python>
26     ModulePath "$INSTALL_HOME"
27     LogTraces true
28     Interactive false
29     Import "collectd_ceilometer.plugin"
30
31     <Module "collectd_ceilometer.plugin">
32
33         # Verbosity 1|0
34         #VERBOSE 0
35
36         # Batch size
37         BATCH_SIZE 3
38
39         # Service endpoint addresses
40         OS_AUTH_URL "$OS_AUTH_URL"
41
42         # Ceilometer address
43         #CEILOMETER_ENDPOINT
44         CEILOMETER_URL_TYPE "$CEILOMETER_URL_TYPE"
45
46         # Ceilometer timeout in ms
47         CEILOMETER_TIMEOUT "$CEILOMETER_TIMEOUT"
48
49         # # Ceilometer user creds
50         OS_USERNAME "$OS_USERNAME"
51         OS_PASSWORD "$OS_PASSWORD"
52         OS_TENANT_NAME "services"
53
54     </Module>
55 </Plugin>
56 EOF
57
58 service collectd restart