
This commit adds more IPSec info to the collect tool to help debugging/troubleshooting IPsec related issues. Now, the certificates loaded in the ipsec daemon and the content of the certificates are collected by the tool. At the moment, the following ipsec data are collected: - swanctl --list-certs - swanctl --list-conns - swanctl --list-sas - ip -s xfrm policy - ip -s xfrm state - The content of the certificates (var/extra/certs/etc/swanctl) Test Plan: PASS: Run 'collect --all', IPSec information collected correctly under var/extra. Story: 2010940 Task: 51472 Change-Id: Icd99e495153a52d78683544f5e7ac36f1544f85a Signed-off-by: Leonardo Mendes <Leonardo.MendesSantana@windriver.com>
34 lines
758 B
Bash
34 lines
758 B
Bash
#! /bin/bash
|
|
#
|
|
# Copyright (c) 2024 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="ipsec"
|
|
LOGFILE="${extradir}/${SERVICE}.info"
|
|
echo "${hostname}: IPSec Info ........: ${LOGFILE}"
|
|
|
|
###############################################################################
|
|
# All nodes
|
|
###############################################################################
|
|
declare -a CMDS=("swanctl --list-certs"
|
|
"swanctl --list-conns"
|
|
"swanctl --list-sas"
|
|
"ip -s xfrm policy"
|
|
"ip -s xfrm state"
|
|
)
|
|
|
|
for CMD in "${CMDS[@]}" ; do
|
|
delimiter ${LOGFILE} "${CMD}"
|
|
${CMD} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
|
|
done
|
|
|
|
exit 0
|