Is there any way to check the number of kernel panic that happened on a system ? If not, any idea on how to do make this new functionality ?
I would like to hear about an answer for most Unix-like systems :)
Is there any way to check the number of kernel panic that happened on a system ? If not, any idea on how to do make this new functionality ?
I would like to hear about an answer for most Unix-like systems :)
You could take a look at all the /var/log/message files and count the number of reboot specific headers. Since one generally reboots after a kernel panic.
If you configure 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.
you could configure a kdump_post
script in /etc/kdump.conf
to run an arbitrary script to increment a number each time you get a panic..
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.
the advantage of that approach is that then you will hace kdump configured too, which can provide valuable information for root cause analyses for kernel panics, even if you are no kernel hacker...