diff --git a/tools/engtools/hostdata-collectors/README b/tools/engtools/hostdata-collectors/README index b33a91d6..6daf1d40 100644 --- a/tools/engtools/hostdata-collectors/README +++ b/tools/engtools/hostdata-collectors/README @@ -2,7 +2,7 @@ The Engineering tools is meant to be installed as a patch. Therefore, the RPM is of the build but is not included in the image. Assuming your development environment is fully set up, simply run patch-engtools.sh to generate the patch: -In this directory ($MY_REPO/stx/middleware/util/recipes-common/engtools/hostdata-collectors), +In this directory ($MY_REPO/stx/utilities/tools/engtools/hostdata-collectors), enter the command: >./patch-engtools.sh diff --git a/tools/engtools/hostdata-collectors/centos/collect-engtools.spec b/tools/engtools/hostdata-collectors/centos/collect-engtools.spec index 288577bc..1d83efb3 100644 --- a/tools/engtools/hostdata-collectors/centos/collect-engtools.spec +++ b/tools/engtools/hostdata-collectors/centos/collect-engtools.spec @@ -12,6 +12,8 @@ Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: systemd Requires: iperf3 +Requires: python36-six +Requires: python36-psutil %description This package contains data collection tools to monitor host performance. diff --git a/tools/engtools/hostdata-collectors/patch-engtools.sh b/tools/engtools/hostdata-collectors/patch-engtools.sh index dbb80682..88c2cd32 100755 --- a/tools/engtools/hostdata-collectors/patch-engtools.sh +++ b/tools/engtools/hostdata-collectors/patch-engtools.sh @@ -14,7 +14,7 @@ if [ $? -ne 0 ]; then exit 1 fi -source ${MY_REPO}/stx/middleware/recipes-common/build-info/release-info.inc +source ${MY_REPO}/stx/utilities/utilities/build-info/release-info.inc #TiS_REL="16.10" #PATCH_ID="ENGTOOLS-${TiS_REL}" PATCH_ID="ENGTOOLS-${PLATFORM_RELEASE}" @@ -23,7 +23,7 @@ PWD=$(pwd) # Create CGCS Patch cd ${MY_WORKSPACE} -PATCH_BUILD=${MY_REPO}/stx/stx-update/extras/scripts/patch_build.sh +PATCH_BUILD=${MY_REPO}/stx/update/extras/scripts/patch_build.sh ${PATCH_BUILD} --id ${PATCH_ID} --reboot-required=N \ --summary "System engineering data collection and analysis tools." \ --desc "System engineering data collection and analysis tools." \ diff --git a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py index d23b404b..3cf3427d 100644 --- a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py +++ b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 textwidth=79 autoindent """ @@ -8,7 +8,7 @@ Last author: lmwangi at gmail com Displays the available memory fragments by querying /proc/buddyinfo Example: -# python buddyinfo.py +# python3 buddyinfo.py """ import optparse import os diff --git a/tools/engtools/hostdata-collectors/scripts/cfg/engtools.conf b/tools/engtools/hostdata-collectors/scripts/cfg/engtools.conf index 6ef46ed8..cbbf7be5 100644 --- a/tools/engtools/hostdata-collectors/scripts/cfg/engtools.conf +++ b/tools/engtools/hostdata-collectors/scripts/cfg/engtools.conf @@ -87,7 +87,7 @@ OPEN_STACK_SERVICE_LIST=nova cinder aodh barbican ceilometer heat glance ceph ho SKIP_LIST=ps top sh curl awk wc sleep lsof cut grep ip tail su [ExcludeList] -EXCLUDE_LIST=python python2 bash perl sudo init +EXCLUDE_LIST=python python2 python3 bash perl sudo init [ApiStatsConstantPorts] DB_PORT_NUMBER=5432 diff --git a/tools/engtools/hostdata-collectors/scripts/live_stream.py b/tools/engtools/hostdata-collectors/scripts/live_stream.py index 3fc10a50..c32dd745 100644 --- a/tools/engtools/hostdata-collectors/scripts/live_stream.py +++ b/tools/engtools/hostdata-collectors/scripts/live_stream.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 """ Copyright (c) 2017 Wind River Systems, Inc. @@ -1478,14 +1478,14 @@ if __name__ == "__main__": # use first interface if not specified in engtools.conf if external_if == "" or external_if is None: p = Popen("ifconfig", shell=True, stdout=PIPE) - external_if = p.stdout.readline().split(":")[0] + external_if = p.stdout.readline().decode().split(":")[0] p.kill() appendToFile("/tmp/livestream.log", "-External interface for {}: {}".format(node, external_if)) # enable IP forwarding p = Popen("sysctl -w net.ipv4.ip_forward=1 > /dev/null", shell=True) p.communicate() p = Popen("iptables -t nat -L --line-numbers", shell=True, stdout=PIPE) - tmp = [line.strip("\n") for line in p.stdout.readlines()] + tmp = [line.decode().strip("\n") for line in p.stdout.readlines()] # entries need to be removed in reverse order for line in reversed(tmp): formatted_line = " ".join(line.strip("\n").split()[1:])