Skip to content

Commit 7f733f9

Browse files
committed
Update log collector
1 parent 16ab1d9 commit 7f733f9

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

test/e2e/azure_logcollector.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,31 @@ func linuxLogs(execToPathFn func(outputFileName string, command string, args ...
443443
),
444444
execToPathFn(
445445
"cloud-init.log",
446-
"cat", "/var/log/cloud-init.log",
446+
"sudo", "sh", "-c", "if [ -f /var/log/cloud-init.log ]; then cat /var/log/cloud-init.log; else echo 'cloud-init.log not found'; fi",
447447
),
448448
execToPathFn(
449449
"cloud-init-output.log",
450-
"cat", "/var/log/cloud-init-output.log",
450+
"sudo", "sh", "-c", "if [ -f /var/log/cloud-init-output.log ]; then cat /var/log/cloud-init-output.log; else echo 'cloud-init-output.log not found'; fi",
451+
),
452+
execToPathFn(
453+
"cloud-init-journal.log",
454+
"sudo", "journalctl", "--no-pager", "--output=short-precise", "-u", "cloud-init", "-u", "cloud-config", "-u", "cloud-final",
455+
),
456+
execToPathFn(
457+
"cloud-init-status.txt",
458+
"sudo", "cloud-init", "status", "--long",
451459
),
452460
execToPathFn(
453461
"sentinel-file-dir.txt",
454-
"ls", "/run/cluster-api/",
462+
"ls", "-la", "/run/cluster-api/",
463+
),
464+
execToPathFn(
465+
"var-log-dir.txt",
466+
"ls", "-la", "/var/log/",
467+
),
468+
execToPathFn(
469+
"system-info.txt",
470+
"sudo", "sh", "-c", "echo '=== OS Release ===' && cat /etc/os-release && echo && echo '=== Uptime ===' && uptime && echo && echo '=== Free memory ===' && free -h",
455471
),
456472
execToPathFn(
457473
"cni.log",

0 commit comments

Comments
 (0)