Files
membank/auto-check/docker/stress-test/scripts/dmesg.sh

17 lines
550 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
echo '===MONITOR:dmesg==='
# -T 输出人类可读时间戳(如 [Mon Aug 24 10:23:45 2026]
# 依赖挂载宿主机 /etc/localtime 保证时区正确;老内核不支持 -T 时回退
DMESG_ERR=$(dmesg -T --level=err,crit,alert,emerg 2>/dev/null | tail -30)
if [ -z "$DMESG_ERR" ]; then
DMESG_ERR=$(dmesg --level=err,crit,alert,emerg 2>/dev/null | tail -30 || true)
fi
if [ -n "$DMESG_ERR" ]; then
echo 'status:fail'
echo "output:${DMESG_ERR}"
else
echo 'status:pass'
echo 'output:无硬件相关内核报错'
fi
echo ''
echo '===END==='