utilities/tools/collector/scripts/collect_ovs.sh

36 lines
1.0 KiB
Bash

#! /bin/bash
########################################################################
#
# Copyright (c) 2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
########################################################################
# Loads Up Utilities and Commands Variables
source /usr/local/sbin/collect_parms
source /usr/local/sbin/collect_utils
SERVICE="ovs"
LOGFILE="${extradir}/${SERVICE}.info"
###############################################################################
# Only Worker Nodes
###############################################################################
if [[ "$nodetype" == "worker" || "$subfunction" == *"worker"* ]] ; then
if [[ "$vswitch_type" == *ovs* ]]; then
echo "${hostname}: OVS Info ..........: ${LOGFILE}"
delimiter ${LOGFILE} "ovsdb-client dump"
ovsdb-client dump >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "ovs-vsctl show"
ovs-vsctl --timeout 10 show >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
fi
fi
exit 0