Browse Source

Add resource CPU and memory info in collect

This adds commands to collect more data to debug
resource allocations and usage for the system
and containerization.

The following command outputs were added:
system host-cpu-list <hostname>
ctr -n k8s.io images list
kubectl describe nodes | grep -e Capacity: -B1
  -A40 | grep -e 'System Info:' -B13 | grep
  -v 'System info:'
lscpu
lscpu -e
cat /sys/devices/system/cpu/isolated

Partial-Bug: 1886868

Signed-off-by: Enzo Candotti <enzo.candotti@windriver.com>
Change-Id: Ib26b4bb22d787451cc96820b3a413b410f79d49d
changes/55/773455/2
Enzo Candotti 2 months ago
parent
commit
27fce5a523
3 changed files with 18 additions and 1 deletions
  1. +6
    -1
      tools/collector/scripts/collect_containerization.sh
  2. +9
    -0
      tools/collector/scripts/collect_host
  3. +3
    -0
      tools/collector/scripts/collect_sysinv.sh

+ 6
- 1
tools/collector/scripts/collect_containerization.sh View File

@ -1,6 +1,6 @@
#! /bin/bash
#
# Copyright (c) 2019 Wind River Systems, Inc.
# Copyright (c) 2019-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -41,6 +41,10 @@ CMD="crictl images"
delimiter ${LOGFILE_IMG} "${CMD}"
${CMD} 2>>${COLLECT_ERROR_LOG} >>${LOGFILE_IMG}
CMD="ctr -n k8s.io images list"
delimiter ${LOGFILE_IMG} "${CMD}"
${CMD} 2>>${COLLECT_ERROR_LOG} >>${LOGFILE_IMG}
CMD="docker container ps -a"
delimiter ${LOGFILE_IMG} "${CMD}"
${CMD} 2>>${COLLECT_ERROR_LOG} >>${LOGFILE_IMG}
@ -67,6 +71,7 @@ if [ "$nodetype" = "controller" -a "${ACTIVE}" = true ] ; then
CMDS+=("kubectl get nodes --show-labels")
CMDS+=("kubectl get nodes -o json")
CMDS+=("kubectl describe nodes")
CMDS+=("kubectl describe nodes | grep -e Capacity: -B1 -A40 | grep -e 'System Info:' -B13 | grep -v 'System Info:'")
CMDS+=("kubectl services")
CMDS+=("kubectl get configmaps --all-namespaces")
CMDS+=("kubectl get daemonsets --all-namespaces")


+ 9
- 0
tools/collector/scripts/collect_host View File

@ -212,9 +212,18 @@ function collect_extra()
delimiter ${LOGFILE} "cat /proc/version"
cat /proc/version >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "lscpu"
lscpu >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "lscpu -e"
lscpu -e >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "cat /proc/cpuinfo"
cat /proc/cpuinfo >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "cat /sys/devices/system/cpu/isolated"
cat /sys/devices/system/cpu/isolated >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}
delimiter ${LOGFILE} "ip addr show"
ip addr show >> ${LOGFILE} 2>>${COLLECT_ERROR_LOG}


+ 3
- 0
tools/collector/scripts/collect_sysinv.sh View File

@ -72,6 +72,9 @@ function collect_inventory {
delimiter ${LOGFILE} "system host-ethernet-port-list ${host}"
system host-ethernet-port-list ${host} 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
delimiter ${LOGFILE} "system host-cpu-list ${host}"
system host-cpu-list ${host} 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}
delimiter ${LOGFILE} "system host-memory-list ${host}"
system host-memory-list ${host} 2>>${COLLECT_ERROR_LOG} >> ${LOGFILE}


Loading…
Cancel
Save