Skip to content

Commit

Permalink
eks-log-collector.sh: add reboot history
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesdigital committed Aug 12, 2024
1 parent d1d2163 commit ad2b4ba
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions log-collector-script/linux/eks-log-collector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ collect() {
get_sandboxImage_info
get_cpu_throttled_processes
get_io_throttled_processes
get_reboot_history
get_nvidia_bug_report
}

Expand Down Expand Up @@ -712,7 +713,7 @@ get_system_services() {
}

get_containerd_info() {
try "Collect Containerd daemon information"
try "collect Containerd daemon information"

if [[ "$(pgrep -o containerd)" -ne 0 ]]; then
# force containerd to dump goroutines
Expand All @@ -726,7 +727,7 @@ get_containerd_info() {

ok

try "Collect Containerd running information"
try "collect Containerd running information"
if ! command -v ctr > /dev/null 2>&1; then
warning "ctr not installed"
else
Expand All @@ -742,13 +743,13 @@ get_containerd_info() {
}

get_sandboxImage_info() {
try "Collect sandbox-image daemon information"
try "collect sandbox-image daemon information"
timeout 75 journalctl -u sandbox-image > "${COLLECT_DIR}"/sandbox-image/sandbox-image-log.txt 2>&1 || echo -e "\tTimed out, ignoring \"sandbox-image info output \" "
ok
}

get_docker_info() {
try "Collect Docker daemon information"
try "collect Docker daemon information"

if [[ "$(pgrep -o dockerd)" -ne 0 ]]; then
timeout 75 docker info > "${COLLECT_DIR}"/docker/docker-info.txt 2>&1 || echo -e "\tTimed out, ignoring \"docker info output \" "
Expand All @@ -764,7 +765,7 @@ get_docker_info() {
}

get_cpu_throttled_processes() {
try "Collect CPU Throttled Process Information"
try "collect CPU Throttled Process Information"
readonly THROTTLE_LOG="${COLLECT_DIR}"/system/cpu_throttling.txt
command find /sys/fs/cgroup -iname "cpu.stat" -print0 | while IFS= read -r -d '' cs; do
# look for a non-zero nr_throttled value
Expand All @@ -791,7 +792,7 @@ get_cpu_throttled_processes() {
}

get_io_throttled_processes() {
try "Collect IO Throttled Process Information"
try "collect IO Throttled Process Information"
readonly IO_THROTTLE_LOG="${COLLECT_DIR}"/system/io_throttling.txt
command echo -e "PID Name Block IO Delay (centisconds)" > ${IO_THROTTLE_LOG}
# column 42 is Aggregated block I/O delays, measured in centiseconds so we capture the non-zero block
Expand All @@ -800,8 +801,14 @@ get_io_throttled_processes() {
ok
}

get_reboot_history() {
try "collect reboot history"
timeout 75 last reboot > "${COLLECT_DIR}"/system/last_reboot.txt 2>&1 || echo -e "\tTimed out, ignoring \"reboot history output \" "
ok
}

get_nvidia_bug_report() {
try "Collect Nvidia Bug report"
try "collect Nvidia Bug report"
if ! command -v nvidia-bug-report.sh &> /dev/null; then
echo "No Nvidia drivers found, nothing to do."
else
Expand Down

0 comments on commit ad2b4ba

Please sign in to comment.