1

我希望能够监控内核恐慌——知道它们是否以及何时发生。
有没有办法知道,在机器启动后,它由于内核恐慌(而不是,例如,命令重启或电源故障)而停机?

机器可能配置了 KDUMP 和/或 KDB,但我不想假设安装或未安装。

修补内核是一种选择,尽管我更愿意避免它。但即使我这样做了,我也不确定补丁能做什么。

我正在使用内核 2.6.18(我知道很古老)。较新内核的解决方案也可能很有趣。

谢谢。

4

1 回答 1

1

内核模块“netconsole”可以帮助您通过 UDP 记录内核 printk 消息。

您可以在远程系统日志服务器中查看日志消息,如果机器重新启动,则事件。

Introduction:
=============

This module logs kernel printk messages over UDP allowing debugging of
problem where disk logging fails and serial consoles are impractical.

It can be used either built-in or as a module. As a built-in,
netconsole initializes immediately after NIC cards and will bring up
the specified interface as soon as possible. While this doesn't allow
capture of early kernel panics, it does capture most of the boot
process.

查看内核文档以获取更多信息:https ://www.kernel.org/doc/Documentation/networking/netconsole.txt

于 2014-01-02T09:21:29.273 回答