Skip to content

Commit

Permalink
csi: add logrotate file to a csi log dir
Browse files Browse the repository at this point in the history
added the csi log to a csi log directory csi_log_${node}

Also updated correct dir path to cllect the ceph daemon logs

closes: red-hat-storage#178

Signed-off-by: parth-gr <[email protected]>
  • Loading branch information
parth-gr committed Jul 11, 2024
1 parent f6d6004 commit e396041
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion collection-scripts/gather_ceph_logs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ 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
ceph_daemon_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,11 +56,12 @@ 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}"
Expand Down

0 comments on commit e396041

Please sign in to comment.