summaryrefslogtreecommitdiffstats
path: root/monitor/barometer_automated_client_install.py
diff options
context:
space:
mode:
authorYang Yu <Gabriel.yuyang@huawei.com>2018-05-02 16:52:11 +0800
committerYang Yu <Gabriel.yuyang@huawei.com>2018-05-03 15:59:28 +0800
commitcb67313c1e14b6eca057bdfc7722bc11506b7a2a (patch)
tree226b177ff6e8a227368c2d765174ba9d4f875829 /monitor/barometer_automated_client_install.py
parent742fc9ab94ede1187c9146e5336e28fe84d510c5 (diff)
Restructure monitoring scripts
Restructure the monitoring scripts and modify the scripts to remove the redundance Change-Id: Ib4a5d7bea2dc455ec03ad61780b6caf06831daa8 Signed-off-by: Yang Yu <Gabriel.yuyang@huawei.com>
Diffstat (limited to 'monitor/barometer_automated_client_install.py')
-rw-r--r--monitor/barometer_automated_client_install.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/monitor/barometer_automated_client_install.py b/monitor/barometer_automated_client_install.py
deleted file mode 100644
index 9bb2c6b1..00000000
--- a/monitor/barometer_automated_client_install.py
+++ /dev/null
@@ -1,43 +0,0 @@
-##############################################################################
-# Copyright (c) 2018 Huawei Tech and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import logging
-import yaml
-import utils.infra_setup.passwordless_SSH.ssh as ssh
-
-logger = logging.getLogger(__name__)
-barometer_client_install_sh =\
- "/home/opnfv/bottlenecks/monitor/barometer_install_client.sh"
-barometer_client_install_conf =\
- "/home/opnfv/bottlenecks/monitor/barometer_client.conf"
-
-with open('/tmp/pod.yaml') as f:
- dataMap = yaml.safe_load(f)
- for x in dataMap:
- for y in dataMap[x]:
- if (y['role'] == 'Controller') or (y['role'] == 'Compute'):
- ip = str(y['ip'])
- user = str(y['user'])
- pwd = str(y['password'])
- ssh_d = ssh.SSH(user, host=ip, password=pwd)
- status, stdout, stderr = ssh_d.execute(
- "cd /etc && mkdir barometer_config"
- )
- if status:
- raise Exception("Command failed with non-zero status.")
- logger.info(stdout.splitlines())
- with open(barometer_client_install_conf) as stdin_file:
- ssh_d.run("cat > /etc/barometer_config/\
- barometer_client_collectd.conf",
- stdin=stdin_file)
- with open(barometer_client_install_sh) as stdin_file:
- ssh_d.run("cat > /etc/barometer_config/install.sh",
- stdin=stdin_file)
-
- ssh_d.run("cd /etc/barometer_config/ && bash ./install.sh")