
Debian and Centos use the same tools but they are installed in different places. In order for collect to work on Debian, make sure that we are trying not use to RPMs on Debian. This is done in the collect-patching script so that the "smart" program is not run. Also kdump uses the /var/lib/kdump path on Debian rather than /var/crash on Centos. Also checked for 'rpm -qa' usage and changed them to 'dpkg -l'. Test Plan PASS Build package PASS Build and install ISO PASS Run the collect -v -all Story: 2009101 Task: 43732 Depends-On: https://review.opendev.org/c/starlingx/tools/+/838327 Signed-off-by: Charles Short <charles.short@windriver.com> Change-Id: I66cf0615f8cab7fe877b6cb09d605557c9258c43
59 lines
1.5 KiB
Bash
Executable File
59 lines
1.5 KiB
Bash
Executable File
#! /bin/bash
|
|
#
|
|
# Copyright (c) 2013-2014 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="networking"
|
|
LOGFILE="${extradir}/${SERVICE}.info"
|
|
echo "${hostname}: Networking Info ...: ${LOGFILE}"
|
|
|
|
###############################################################################
|
|
# All nodes
|
|
###############################################################################
|
|
declare -a CMDS=("ip -s link"
|
|
"ip -4 -s addr"
|
|
"ip -6 -s addr"
|
|
"ip -4 -s neigh"
|
|
"ip -6 -s neigh"
|
|
"ip -4 rule"
|
|
"ip -6 rule"
|
|
"ip -4 route"
|
|
"ip -6 route"
|
|
)
|
|
|
|
for CMD in "${CMDS[@]}" ; do
|
|
delimiter ${LOGFILE} "${CMD}"
|
|
${CMD} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
done
|
|
|
|
CMD="iptables-save"
|
|
delimiter ${LOGFILE} "${CMD}"
|
|
${CMD} > ${extradir}/iptables.dump 2>>${COLLECT_ERROR_LOG}
|
|
|
|
CMD="ip6tables-save"
|
|
delimiter ${LOGFILE} "${CMD}"
|
|
${CMD} > ${extradir}/ip6tables.dump 2>>${COLLECT_ERROR_LOG}
|
|
|
|
###############################################################################
|
|
# Only Worker
|
|
###############################################################################
|
|
if [[ "$nodetype" = "worker" || "$subfunction" == *"worker"* ]] ; then
|
|
NAMESPACES=($(ip netns))
|
|
for NS in ${NAMESPACES[@]}; do
|
|
delimiter ${LOGFILE} "${NS}"
|
|
for CMD in "${CMDS[@]}" ; do
|
|
ip netns exec ${NS} ${CMD}
|
|
done
|
|
done >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
fi
|
|
|
|
exit 0
|