From 05923421564e868db69695f1c9d6f5969cc7bee8 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Tue, 10 May 2022 14:06:38 +0000 Subject: [PATCH] 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 Change-Id: I48ffd39a945a82252c43786aa7d2c6e3ddc7d7ae --- .../collect_containerization.sh | 4 +-- tools/collector/debian-scripts/collect_dc.sh | 3 +- .../collector/debian-scripts/collect_dpkg.sh | 24 +++++++++++++ tools/collector/debian-scripts/collect_host | 4 +-- .../debian-scripts/collect_ostree.sh | 34 +++++++++++++++++++ .../debian-scripts/collect_patching.sh | 7 ++-- .../debian-scripts/collect_sysinv.sh | 12 ++----- tools/collector/debian/deb_folder/rules | 2 ++ 8 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 tools/collector/debian-scripts/collect_dpkg.sh create mode 100644 tools/collector/debian-scripts/collect_ostree.sh diff --git a/tools/collector/debian-scripts/collect_containerization.sh b/tools/collector/debian-scripts/collect_containerization.sh index 845b2432..68fccdaf 100755 --- a/tools/collector/debian-scripts/collect_containerization.sh +++ b/tools/collector/debian-scripts/collect_containerization.sh @@ -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 diff --git a/tools/collector/debian-scripts/collect_dc.sh b/tools/collector/debian-scripts/collect_dc.sh index da44a935..8da44e9a 100755 --- a/tools/collector/debian-scripts/collect_dc.sh +++ b/tools/collector/debian-scripts/collect_dc.sh @@ -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"` diff --git a/tools/collector/debian-scripts/collect_dpkg.sh b/tools/collector/debian-scripts/collect_dpkg.sh new file mode 100644 index 00000000..0f11cca1 --- /dev/null +++ b/tools/collector/debian-scripts/collect_dpkg.sh @@ -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 diff --git a/tools/collector/debian-scripts/collect_host b/tools/collector/debian-scripts/collect_host index f552fa18..1de68ea6 100755 --- a/tools/collector/debian-scripts/collect_host +++ b/tools/collector/debian-scripts/collect_host @@ -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 diff --git a/tools/collector/debian-scripts/collect_ostree.sh b/tools/collector/debian-scripts/collect_ostree.sh new file mode 100644 index 00000000..7a9481ba --- /dev/null +++ b/tools/collector/debian-scripts/collect_ostree.sh @@ -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 diff --git a/tools/collector/debian-scripts/collect_patching.sh b/tools/collector/debian-scripts/collect_patching.sh index 32ac8ba6..aeccef7c 100755 --- a/tools/collector/debian-scripts/collect_patching.sh +++ b/tools/collector/debian-scripts/collect_patching.sh @@ -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 diff --git a/tools/collector/debian-scripts/collect_sysinv.sh b/tools/collector/debian-scripts/collect_sysinv.sh index 3c00ed0a..52e5e6f9 100755 --- a/tools/collector/debian-scripts/collect_sysinv.sh +++ b/tools/collector/debian-scripts/collect_sysinv.sh @@ -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 diff --git a/tools/collector/debian/deb_folder/rules b/tools/collector/debian/deb_folder/rules index 72cd0e51..6f7a99a7 100755 --- a/tools/collector/debian/deb_folder/rules +++ b/tools/collector/debian/deb_folder/rules @@ -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