summaryrefslogtreecommitdiffstats
path: root/monitor/dispatch/automate_collectd_client.py
diff options
context:
space:
mode:
authorYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>2018-05-26 11:26:31 +0800
committerYang (Gabriel) Yu <Gabriel.yuyang@huawei.com>2018-05-26 16:57:59 +0800
commit5b78e737e9656ecc7d1b1856ce9aec2bd48459bd (patch)
tree8b2dfd9e2513d4631ae2c0d9f079d8a686bb47c5 /monitor/dispatch/automate_collectd_client.py
parentb1b458428b644e0df7957e3137bc75d658d68ab1 (diff)
Adapt monitoring install to apex
To let the installation be adapted to Apex and Centos Change-Id: If779bab1badbd2f0ad9e0a5054e082e49b7d6238 Signed-off-by: Yang (Gabriel) Yu <Gabriel.yuyang@huawei.com>
Diffstat (limited to 'monitor/dispatch/automate_collectd_client.py')
-rw-r--r--monitor/dispatch/automate_collectd_client.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/monitor/dispatch/automate_collectd_client.py b/monitor/dispatch/automate_collectd_client.py
deleted file mode 100644
index c4346e51..00000000
--- a/monitor/dispatch/automate_collectd_client.py
+++ /dev/null
@@ -1,50 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 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__)
-collectd_client_install_sh =\
- "/home/opnfv/bottlenecks/monitor/dispatch/install_collectd_client.sh"
-collectd_client_install_conf =\
- "/home/opnfv/bottlenecks/monitor/config/collectd_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 collectd_config"
- )
- if status:
- print Exception(
- "Command: \"mkdir collectd_config\" failed.")
- logger.info(stdout.splitlines())
- with open(collectd_client_install_sh) as stdin_file:
- ssh_d.run("cat > /etc/collectd_config/install.sh",
- stdin=stdin_file)
- with open(collectd_client_install_conf) as stdin_file:
- ssh_d.run(
- "cat > /etc/collectd_config/collectd_client.conf",
- stdin=stdin_file
- )
- status, stdout, stderr = ssh_d.execute(
- "sudo apt-get install -y docker.io"
- )
- if status:
- raise Exception("Command for installing docker failed.")
- logger.info(stdout.splitlines())
- ssh_d.run("cd /etc/collectd_config/ && bash ./install.sh")