Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
chore: update to give warning if not collecting logs
Browse files Browse the repository at this point in the history
Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
  • Loading branch information
Deepika Upadhyay committed May 11, 2023
1 parent 05fe14f commit d064284
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions gather-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ gatherKubernetesPodLogs() {
for c in $(kubectl -n "${CLUSTER_NAMESPACE}" get pod "${p}" -o jsonpath='{.spec.containers[*].name}'); do
echo "gather-info: BEGIN logs from pod: ${p} ${c}"
kubectl -n "${CLUSTER_NAMESPACE}" logs -c "${c}" "${p}" > "logs/${p}-${c}"
echo "gather-info: END logs from pod: ${p} ${c}"
if [ -s "logs/${p}-${c}" ]; then
echo "gather-info: END logs from pod: ${p} ${c}"
else
echo "WARN: No debug logs collected for ${p} ${c}"
fi
done
done
}
Expand Down Expand Up @@ -42,35 +46,37 @@ gatherKubernetesObjects() {
}

runCommandInToolsPod() {
kubectl -n "${CLUSTER_NAMESPACE}" exec -it deploy/rook-ceph-tools -- "${@}"
command=$(echo "$*" | sed 's/ /_/g')
command=$(echo "$command" | sed 's/-/_/g')
kubectl -n "${CLUSTER_NAMESPACE}" exec -it deploy/rook-ceph-tools -- "${@}" > ceph-commands/"${command}"
}

gatherCephCommands() {
mkdir -p ceph-commands

# Ceph command outputs
runCommandInToolsPod ceph versions > ceph-commands/ceph_versions
runCommandInToolsPod ceph -s > ceph-commands/ceph_status
runCommandInToolsPod ceph df > ceph-commands/ceph_df
runCommandInToolsPod ceph osd df tree > ceph-commands/ceph_osd_df_tree
runCommandInToolsPod ceph health detail > ceph-commands/ceph_health_detail
runCommandInToolsPod ceph df detail > ceph-commands/ceph_df_detail
runCommandInToolsPod ceph osd tree > ceph-commands/ceph_osd_tree
runCommandInToolsPod ceph osd dump > ceph-commands/ceph_osd_dump
runCommandInToolsPod ceph osd perf > ceph-commands/ceph_osd_perf
runCommandInToolsPod ceph osd pool ls detail > ceph-commands/ceph_osd_pool_ls_detail
runCommandInToolsPod ceph osd pool autoscale-status > ceph-commands/ceph_osd_pool_autoscale_status
runCommandInToolsPod ceph osd numa-status > ceph-commands/ceph_osd_numa-status
runCommandInToolsPod ceph osd blocked-by > ceph-commands/ceph_osd_blocked-by
runCommandInToolsPod ceph mon dump > ceph-commands/ceph_mon_dump
runCommandInToolsPod ceph mon stat > ceph-commands/ceph_mon_stat
runCommandInToolsPod ceph pg stat > ceph-commands/ceph_pg_stat
runCommandInToolsPod ceph pg dump > ceph-commands/ceph_pg_dump
runCommandInToolsPod ceph fs ls > ceph-commands/ceph_fs_ls
runCommandInToolsPod ceph fs dump > ceph-commands/ceph_fs_dump
runCommandInToolsPod ceph mds stat > ceph-commands/ceph_mds_stat
runCommandInToolsPod ceph time-sync-status > ceph-commands/ceph_time_sync_status
runCommandInToolsPod ceph config dump > ceph-commands/ceph_config_dump
runCommandInToolsPod ceph versions
runCommandInToolsPod ceph status
runCommandInToolsPod ceph df
runCommandInToolsPod ceph osd df tree
runCommandInToolsPod ceph health detail
runCommandInToolsPod ceph df detail
runCommandInToolsPod ceph osd tree
runCommandInToolsPod ceph osd dump
runCommandInToolsPod ceph osd perf
runCommandInToolsPod ceph osd pool ls detail
runCommandInToolsPod ceph osd pool autoscale-status
runCommandInToolsPod ceph osd numa-status
runCommandInToolsPod ceph osd blocked-by
runCommandInToolsPod ceph mon dump
runCommandInToolsPod ceph mon stat
runCommandInToolsPod ceph pg stat
runCommandInToolsPod ceph pg dump
runCommandInToolsPod ceph fs ls
runCommandInToolsPod ceph fs dump
runCommandInToolsPod ceph mds stat
runCommandInToolsPod ceph time-sync-status
runCommandInToolsPod ceph config dump
}

packInfo() {
Expand Down

0 comments on commit d064284

Please sign in to comment.