integ/tools/engtools/hostdata-collectors/scripts/remote/rstop-engtools.sh
Scott Little 4366c6cfd8 Relocate hostdata-collectors to
stx-integ/tools/engtools/hostdata-collectors

Move content from stx-utils into stx-integ or stx-update

Packages will be relocated to

stx-update:
    enable-dev-patch
    extras

stx-integ:
    config-files/
        io-scheduler

    filesystem/
        filesystem-scripts

    grub/
        grubby

    logging/
        logmgmt

    tools/
        collector
        monitor-tools

    tools/engtools/
        hostdata-collectors
        parsers

    utilities/
        build-info
        branding   (formerly wrs-branding)
        platform-util

Change-Id: I9796704d8ffc6590a971af9d41b626189e35ecc4
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 12:42:01 -04:00

38 lines
871 B
Bash

#!/bin/bash
# Purpose:
# Remote stop engtools on all blades.
# Define common utility functions
TOOLBIN=$(dirname $0)
. ${TOOLBIN}/engtools_util.sh
if [ $UID -eq 0 ]; then
ERRLOG "Do not start $0 using sudo/root access."
exit 1
fi
# environment for system commands
source /etc/nova/openrc
declare -a BLADES
BLADES=( $(system host-list | awk '(/compute|controller|storage/) {print $4;}') )
LOG "Remote stop engtools on all blades:"
for blade in ${BLADES[@]}; do
if [ "${blade}" == "${HOSTNAME}" ]; then
LOG "stop on $blade:"
sudo service collect-engtools.sh stop
else
ping -c1 ${blade} 1>/dev/null 2>/dev/null
if [ $? -eq 0 ]; then
LOG "stop on $blade:"
ssh -q -t -o StrictHostKeyChecking=no \
${blade} sudo service collect-engtools.sh stop
else
WARNLOG "cannot ping: ${blade}"
fi
fi
done
LOG "done"
exit 0