Linux

如何獲得核心恐慌計數

  • June 7, 2013

有沒有辦法檢查系統上發生的核心恐慌的數量?如果沒有,關於如何製作這個新功能的任何想法?

我想听聽大多數類 Unix 系統的答案:)

如果配置kdump

 Kdump is a kexec based crash dumping mechansim for Linux. 
 Kdump functionality is broken mainly in two components, user space and kernel space.    
 Kernel space patches are already part of main line kernel tree. 
 User space component is nothing but a patch on top of existing kexec tools. 

您可以配置一個kdump_post腳本/etc/kdump.conf來執行任意腳本以在每次出現恐慌時增加一個數字..

kdump_post <binary | script>

This directive allows you to run a specified executable just after the memory dump     
process terminates. The exit status from the dump process is fed to the kdump_post     
executable, which can be used to trigger different actions for success or failure. 

這種方法的優點是,你也可以配置 kdump,它可以為核心恐慌的根本原因分析提供有價值的資訊,即使你不是核心黑客……

引用自:https://serverfault.com/questions/514123