Enhance collect tool with k8s networking data
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>
This commit is contained in:
parent
4733477aa2
commit
e3535e008b
@ -18,30 +18,29 @@ echo "${hostname}: Networking Info ...: ${LOGFILE}"
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# All nodes
|
# All nodes
|
||||||
###############################################################################
|
###############################################################################
|
||||||
delimiter ${LOGFILE} "ip -s link"
|
declare -a CMDS=("ip -s link"
|
||||||
ip -s link >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
"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"
|
||||||
|
)
|
||||||
|
|
||||||
delimiter ${LOGFILE} "ip -s addr"
|
for CMD in "${CMDS[@]}" ; do
|
||||||
ip -s addr >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
delimiter ${LOGFILE} "${CMD}"
|
||||||
|
${CMD} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
||||||
|
done
|
||||||
|
|
||||||
delimiter ${LOGFILE} "ip -s neigh"
|
CMD="iptables-save"
|
||||||
ip -s neigh >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
delimiter ${LOGFILE} "${CMD}"
|
||||||
|
${CMD} > ${extradir}/iptables.dump 2>>${COLLECT_ERROR_LOG}
|
||||||
delimiter ${LOGFILE} "ip rule"
|
|
||||||
ip rule >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
||||||
|
|
||||||
delimiter ${LOGFILE} "ip route"
|
|
||||||
ip route >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
||||||
|
|
||||||
delimiter ${LOGFILE} "iptables -L -v -x -n"
|
|
||||||
iptables -L -v -x -n >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
||||||
|
|
||||||
delimiter ${LOGFILE} "iptables -L -v -x -n -t nat"
|
|
||||||
iptables -L -v -x -n -t nat >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
||||||
|
|
||||||
delimiter ${LOGFILE} "iptables -L -v -x -n -t mangle"
|
|
||||||
iptables -L -v -x -n -t mangle >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
||||||
|
|
||||||
|
CMD="ip6tables-save"
|
||||||
|
delimiter ${LOGFILE} "${CMD}"
|
||||||
|
${CMD} > ${extradir}/ip6tables.dump 2>>${COLLECT_ERROR_LOG}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Only Worker
|
# Only Worker
|
||||||
@ -50,11 +49,9 @@ if [[ "$nodetype" = "worker" || "$subfunction" == *"worker"* ]] ; then
|
|||||||
NAMESPACES=($(ip netns))
|
NAMESPACES=($(ip netns))
|
||||||
for NS in ${NAMESPACES[@]}; do
|
for NS in ${NAMESPACES[@]}; do
|
||||||
delimiter ${LOGFILE} "${NS}"
|
delimiter ${LOGFILE} "${NS}"
|
||||||
ip netns exec ${NS} ip -s link
|
for CMD in "${CMDS[@]}" ; do
|
||||||
ip netns exec ${NS} ip -s addr
|
ip netns exec ${NS} ${CMD}
|
||||||
ip netns exec ${NS} ip -s neigh
|
done
|
||||||
ip netns exec ${NS} ip route
|
|
||||||
ip netns exec ${NS} ip rule
|
|
||||||
done >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
done >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user