Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing latest changes from main for odf-must-gather #176

Merged
merged 11 commits into from
Jul 18, 2024
Merged
2 changes: 1 addition & 1 deletion collection-scripts/gather
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pre-install.sh ${BASE_COLLECTION_PATH}
# Process the options
if [ "$odf" == true ]; then
echo "Collect ODF logs..."
gather_ceph_pod_logs &
gather_ceph_pod_logs ${BASE_COLLECTION_PATH} &
pids+=($!)
gather_ceph_logs &
pids+=($!)
Expand Down
13 changes: 13 additions & 0 deletions collection-scripts/gather_ceph_logs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ for ns in $namespaces; do
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}"/log "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
}

# Collecting csi and ceph daemon logs
csi_log_collection() {
dbglog "collecting csi and ceph daemon logs from node ${node}"
# as per the correction we are keeping both /var/lib/rook & /var/log/ceph for ceph pods, as to not break anything
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/log/ceph/ "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".rbd.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".cephfs.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".nfs.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
}

crash_core_collection() {
dbglog "collecting crash core dump from node ${node}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}"-debug | awk '{print $1}')":/host/var/lib/rook/"${ns}"/crash/ "${CRASH_OUTPUT_DIR}"
Expand Down Expand Up @@ -45,15 +55,18 @@ CMDS
dbglog "collecting crash, journal and volume logs from node ${node}"
CRASH_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/crash_${node}
CEPH_DAEMON_LOG_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/ceph_daemon_log_${node}
CSI_LOG_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/csi_log_${node}
JOURNAL_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/journal_${node}
KERNEL_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/kernel_${node}
COREDUMP_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/coredump_${node}
mkdir -p "${CRASH_OUTPUT_DIR}"
mkdir -p "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
mkdir -p "${CSI_LOG_OUTPUT_DIR}"
mkdir -p "${JOURNAL_OUTPUT_DIR}"
mkdir -p "${KERNEL_OUTPUT_DIR}"
mkdir -p "${COREDUMP_OUTPUT_DIR}"
ceph_daemon_log_collection &
csi_log_collection &
pids_log+=($!)
crash_core_collection &
pids_log+=($!)
Expand Down
1 change: 1 addition & 0 deletions collection-scripts/gather_clusterscoped_resources
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ commands_desc+=("pv")
commands_desc+=("ob")
commands_desc+=("sc")
commands_desc+=("nodes")
commands_desc+=("csidriver")
commands_desc+=("clusterversion")
commands_desc+=("infrastructures.config")
commands_desc+=("clusterrole")
Expand Down
14 changes: 14 additions & 0 deletions collection-scripts/gather_namespaced_resources
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,17 @@ if [ -n "$(oc get network-attachment-definitions --no-headers -A | awk '{print $
{ oc get network-attachment-definitions -oyaml --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/get_yaml_net_attach_def_all_ns"
{ oc describe network-attachment-definitions --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/desc_net_attach_def_all_ns"
fi

dbglog "collecting dump of oc get encryptionkeyrotationjob all namespaces"
if [ -n "$(oc get encryptionkeyrotationjob --no-headers -A | awk '{print $1}')" ]; then
{ oc get encryptionkeyrotationjob --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/get_encryptionkeyrotationjob_all_ns"
{ oc describe encryptionkeyrotationjob --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/desc_encryptionkeyrotationjob_all_ns"
{ oc get encryptionkeyrotationjob -oyaml --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/get_yaml_encryptionkeyrotationjob_all_ns"
fi

dbglog "collecting dump of oc get encryptionkeyrotationcronjob all namespaces"
if [ -n "$(oc get encryptionkeyrotationcronjob --no-headers -A | awk '{print $1}')" ]; then
{ oc get encryptionkeyrotationcronjob --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/get_encryptionkeyrotationcronjob_all_ns"
{ oc describe encryptionkeyrotationcronjob --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/desc_encryptionkeyrotationcronjob_all_ns"
{ oc get encryptionkeyrotationcronjob -oyaml --all-namespaces; } >>"${BASE_COLLECTION_PATH}/namespaces/all/get_yaml_encryptionkeyrotationcronjob_all_ns"
fi
2 changes: 1 addition & 1 deletion collection-scripts/gather_noobaa_resources
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mkdir -p "${NOOBAA_COLLLECTION_PATH}/raw_output/}"

# Save the information of all Postgres DBs in the NooBaa DB pod
dbglog "Collecting MCG database information..."
oc rsh --namespace openshift-storage noobaa-db-pg-0 psql -d nbcore -c '\pset pager off' -c '\x on' -c '\list+' &>"${NOOBAA_COLLLECTION_PATH}"/raw_output/db_list.txt 2>&1
oc rsh --namespace openshift-storage noobaa-db-pg-0 psql -d nbcore -c '\pset pager off' -c '\list+' -c '\dt+' &>"${NOOBAA_COLLLECTION_PATH}"/raw_output/db_list.txt 2>&1

# Run the Collection of Noobaa cli using must-gather
# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion collection-scripts/gather_odf_client
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ done

# collect csidriver details
{ oc get csidriver; } >"${BASE_COLLECTION_PATH}/csidriver/get_csidriver" 2>&1
{ oc describe csidriver -o yaml; } >"${BASE_COLLECTION_PATH}/csidriver/desc_csidriver" 2>&1
{ oc describe csidriver; } >"${BASE_COLLECTION_PATH}/csidriver/desc_csidriver" 2>&1
{ oc get csidriver -o yaml; } >"${BASE_COLLECTION_PATH}/csidriver/csidriver.yaml" 2>&1
Loading