~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to perf_static/setup-perf-monitoring.sh

  • Committer: Aaron Bentley
  • Date: 2015-12-15 16:03:14 UTC
  • mto: This revision was merged to the branch mainline in revision 1197.
  • Revision ID: aaron.bentley@canonical.com-20151215160314-zsy2kn45fefnqlht
Switch FakeJujuClient to raise on accessing juju_home.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
# Commands to be run on a juju controller apiserver to enable system
3
 
# monitoring.
4
 
 
5
 
set +ex
6
 
 
7
 
collectd_config_file=$1
8
 
runner_script_output_path=$2
9
 
 
10
 
cat <<EOF > ${runner_script_output_path}
11
 
password=`sudo grep oldpassword /var/lib/juju/agents/machine-*/agent.conf | cut -d" " -f2`
12
 
mongostat --host=127.0.0.1:37017 \
13
 
    --authenticationDatabase admin \
14
 
    --ssl \
15
 
    --sslAllowInvalidCertificates \
16
 
    --username \"admin\" \
17
 
    --password \"\$password\" \
18
 
    --noheaders 5 > /tmp/mongodb-stats.log 2> /tmp/mongodb-error.log
19
 
EOF
20
 
 
21
 
sudo apt-get install -y collectd-core
22
 
sudo mkdir /etc/collectd/collectd.conf.d
23
 
sudo cp ${collectd_config_file} /etc/collectd/collectd.conf
24
 
sudo /etc/init.d/collectd restart
25
 
 
26
 
sudo echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing multiverse" | sudo tee /etc/apt/sources.list.d/mongo-org.list
27
 
sudo apt-get update
28
 
sudo apt-get install --yes --allow-unauthenticated mongodb-org-tools=3.2.10~rc2 daemon
29
 
sudo chmod +x ${runner_script_output_path}