Debian: Update collect tool to gather ostree info

- Removed unused variables from collect_dc.sh
 - Removed references to dpkg from collect_sysinv.sh
   as well as the rpm.info file.
 - Added collect_dpkg.sh to gather debian package info for
   all node types to dpkg.info.
 - Added collect_ostree.sh to gather ostree log info for
   sysroot and any feed directories to ostree.info.

Cleaned up the width of some collect -v formatting.

Test Plan:
  Build / Install / Bootstrap / Unlock Debian AIO-SX
  Run collect on AIO-SX and verify the two new files
ostree.info and dpkg.info are present, and rpm.info is not.

Story: 2009969
Task: 45325
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I48ffd39a945a82252c43786aa7d2c6e3ddc7d7ae
This commit is contained in:
Al Bailey 2022-05-10 14:06:38 +00:00
parent f2073ab18f
commit 0592342156
8 changed files with 70 additions and 20 deletions

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2019-2021 Wind River Systems, Inc.
# Copyright (c) 2019-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -25,7 +25,7 @@ HELM_DIR="${extradir}/helm"
ETCD_DB_FILE="${extradir}/etcd_database.dump"
KUBE_CONFIG_FILE="/etc/kubernetes/admin.conf"
KUBE_CONFIG="--kubeconfig ${KUBE_CONFIG_FILE}"
echo "${hostname}: Containerization Info ...: ${LOGFILE}"
echo "${hostname}: Containers Info ...: ${LOGFILE}"
###############################################################################
# All nodes

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2020-2021 Wind River Systems, Inc.
# Copyright (c) 2020-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -12,7 +12,6 @@ source /usr/local/sbin/collect_utils
SERVICE="distributed_cloud"
LOGFILE="${extradir}/${SERVICE}.info"
RPMLOG="${extradir}/rpm.info"
function is_active_controller {
active_controller=`sm-query service management-ip | grep "enabled-active"`

View File

@ -0,0 +1,24 @@
#! /bin/bash
#
# Copyright (c) 2022 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="dpkg"
LOGFILE="${extradir}/${SERVICE}.info"
###############################################################################
# DPKG Info (.deb debian packages)
###############################################################################
echo "${hostname}: DPKG Info .........: ${LOGFILE}"
delimiter ${LOGFILE} "dpkg -l"
dpkg -l >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
exit 0

View File

@ -1,7 +1,7 @@
#! /bin/bash
########################################################################
#
# Copyright (c) 2016-2021 Wind River Systems, Inc.
# Copyright (c) 2016-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -318,7 +318,7 @@ function collect_extra()
# iSCSI Information
LOGFILE="${EXTRA_DIR}/iscsi.info"
echo "${hostname}: iSCSI Information ......: ${LOGFILE}"
echo "${hostname}: iSCSI Info ........: ${LOGFILE}"
if [ "$nodetype" = "controller" ] ; then
# Controller- LIO exported initiators summary

View File

@ -0,0 +1,34 @@
#! /bin/bash
#
# Copyright (c) 2022 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="ostree"
LOGFILE="${extradir}/${SERVICE}.info"
SYSROOT_REPO="/sysroot/ostree/repo"
FEED_OSTREE_BASE_DIR="/var/www/pages/feed"
OSTREE_REF="starlingx"
echo "${hostname}: OSTREE Info .......: ${LOGFILE}"
###############################################################################
# OSTREE Info (logs for the sysroot and patch feeds)
###############################################################################
delimiter ${LOGFILE} "ostree log ${OSTREE_REF} --repo=${SYSROOT_REPO}"
ostree log ${OSTREE_REF} --repo=${SYSROOT_REPO} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
for feed_dir in ${FEED_OSTREE_BASE_DIR}/*/ostree_repo
do
delimiter ${LOGFILE} "ostree log ${OSTREE_REF} --repo=${feed_dir}"
ostree log ${OSTREE_REF} --repo=${feed_dir} >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
done
exit 0

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2013-2014 Wind River Systems, Inc.
# Copyright (c) 2013-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -17,9 +17,6 @@ echo "${hostname}: Patching Info .....: ${LOGFILE}"
###############################################################################
# All nodes
###############################################################################
# FIXME: Debian doesnt support smart channel
#delimiter ${LOGFILE} "smart channel --show"
#smart channel --show 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
###############################################################################
# Only Controller
@ -38,9 +35,9 @@ if [ "$nodetype" = "controller" ] ; then
delimiter ${LOGFILE} "find /opt/patching"
find /opt/patching 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
# todo(abailey): Verify that we can remove the next 2 lines
delimiter ${LOGFILE} "find /var/www/pages/updates"
find /var/www/pages/updates 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
fi
exit 0

View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2013-2021 Wind River Systems, Inc.
# Copyright (c) 2013-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -12,7 +12,6 @@ source /usr/local/sbin/collect_utils
SERVICE="inventory"
LOGFILE="${extradir}/${SERVICE}.info"
RPMLOG="${extradir}/rpm.info"
INVENTORY=${4}
function is_service_active {
@ -50,8 +49,8 @@ function collect_inventory {
delimiter ${LOGFILE} "system service-list"
system service-list 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
# delimiter ${LOGFILE} "vm-topology"
# timeout 60 vm-topology --show all 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
# delimiter ${LOGFILE} "vm-topology"
# timeout 60 vm-topology --show all 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
delimiter ${LOGFILE} "system network-list"
system network-list 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
@ -100,11 +99,6 @@ function collect_inventory {
###############################################################################
if [ "$nodetype" = "controller" ] ; then
echo "${hostname}: Software Config ...: ${RPMLOG}"
# These go into the SERVICE.info file
delimiter ${RPMLOG} "dpkg -l"
dpkg -l >> ${RPMLOG}
if [ "${INVENTORY}" = true ] ; then
collect_inventory
fi

View File

@ -32,9 +32,11 @@ override_dh_auto_install:
install -m 755 -p collect_openstack.sh $(SYSCONFDIR)/collect.d/collect_openstack
install -m 755 -p collect_networking.sh $(SYSCONFDIR)/collect.d/collect_networking
install -m 755 -p collect_ceph.sh $(SYSCONFDIR)/collect.d/collect_ceph
install -m 755 -p collect_dpkg.sh $(SYSCONFDIR)/collect.d/collect_dpkg
install -m 755 -p collect_sm.sh $(SYSCONFDIR)/collect.d/collect_sm
install -m 755 -p collect_tc.sh $(SYSCONFDIR)/collect.d/collect_tc
install -m 755 -p collect_nfv_vim.sh $(SYSCONFDIR)/collect.d/collect_nfv_vim
install -m 755 -p collect_ostree.sh $(SYSCONFDIR)/collect.d/collect_ostree
install -m 755 -p collect_ovs.sh $(SYSCONFDIR)/collect.d/collect_ovs
install -m 755 -p collect_patching.sh $(SYSCONFDIR)/collect.d/collect_patching
install -m 755 -p collect_coredump.sh $(SYSCONFDIR)/collect.d/collect_coredump