e3535e008b
Add networking logs for ipv6 Save iptables using iptables-save ip6tables-save Story: 2006536 Task: 36596 Change-Id: I6b26d816706a95669ebf78d03311c42ac00df9f7 Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
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
|