summaryrefslogtreecommitdiffstats
path: root/src/fuel-plugin/deployment_scripts/install.sh
blob: 5491f340c0a0c3304460d0579c38f99f6911f2f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
set -eux

INSTALL_HOME=/opt/collectd-ceilometer

HOST=$1
OS_AUTH_URL=$2
OS_USERNAME=$3
OS_PASSWORD=$4

CEILOMETER_URL_TYPE=${CEILOMETER_URL_TYPE:-internalURL}
CEILOMETER_TIMEOUT=${CEILOMETER_TIMEOUT:-1000}

MCELOG_SOCKET="socket-path = /var/run/mcelog-client"
MCELOG_CONF="/etc/mcelog/mcelog.conf"

rm -rf $INSTALL_HOME; mkdir -p $INSTALL_HOME
cd $INSTALL_HOME
curl http://$HOST:8080/plugins/fuel-plugin-collectd-ceilometer-1.0/repositories/ubuntu/collectd-ceilometer.tgz | tar xzvf -

cat << EOF > /etc/ld.so.conf.d/pqos.conf
$INSTALL_HOME/lib
EOF
ldconfig
modprobe msr

apt-get install -y --allow-unauthenticated collectd python-dev libpython2.7 mcelog

echo $MCELOG_SOCKET | sudo tee -a $MCELOG_CONF;

cat << EOF > /etc/collectd/collectd.conf.d/collectd-ceilometer-plugin.conf
<LoadPlugin python>
  Globals true
</LoadPlugin>

<Plugin python>
    ModulePath "$INSTALL_HOME/collectd-ceilometer-plugin"
    LogTraces true
    Interactive false
    Import "collectd_ceilometer.plugin"

    <Module "collectd_ceilometer.plugin">

        # Verbosity 1|0
        #VERBOSE 0

        # Batch size
        BATCH_SIZE 3

        # Service endpoint addresses
        OS_AUTH_URL "$OS_AUTH_URL"

        # Ceilometer address
        #CEILOMETER_ENDPOINT
        CEILOMETER_URL_TYPE "$CEILOMETER_URL_TYPE"

        # Ceilometer timeout in ms
        CEILOMETER_TIMEOUT "$CEILOMETER_TIMEOUT"

        # # Ceilometer user creds
        OS_USERNAME "$OS_USERNAME"
        OS_PASSWORD "$OS_PASSWORD"
        OS_TENANT_NAME "services"

    </Module>
</Plugin>
EOF

cat << EOF > /etc/collectd/collectd.conf.d/intel-rdt.conf
<LoadPlugin intel_rdt>
  Interval 1
</LoadPlugin>

<Plugin "intel_rdt">
  Cores ""
</Plugin>
EOF

cat << EOF > /etc/collectd/collectd.conf.d/hugepages.conf
LoadPlugin hugepages

<Plugin hugepages>
    ReportPerNodeHP  true
    ReportRootHP     true
    ValuesPages      true
    ValuesBytes      false
    ValuesPercentage false
</Plugin>
EOF

cat << EOF > /etc/collectd/collectd.conf.d/mcelog.conf
<LoadPlugin mcelog>
  Interval 1
</LoadPlugin>
<Plugin "mcelog">
   McelogClientSocket "/var/run/mcelog-client"
</Plugin>
EOF

service collectd restart