Is it possible to get linux to run a script when the kernel panics?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
As rtmistler said, a kernel panic occurs when the kernel cannot continue to run, and the entire system stops cold.
Unlike an "Oops!", which is a recoverable kernel error, a kernel panic is instant system death.
An external monitoring agent, such as Nagios, can be used to detect when a machine has become unresponsive and possibly to take action. Virtual-machine monitors can also detect when a virtual machine has died.
you know you can subscribe to a thread without posting to it?
just saying...
edit: i realize in retrospect that sundialsvcs' mention of nagios is not immediately visible to anyone, so my veiled criticism might've been a little harsh. my apologies.
As rtmistler said, a kernel panic occurs when the kernel cannot continue to run, and the entire system stops cold.
Unlike an "Oops!", which is a recoverable kernel error, a kernel panic is instant system death.
An external monitoring agent, such as Nagios, can be used to detect when a machine has become unresponsive and possibly to take action. Virtual-machine monitors can also detect when a virtual machine has died.
Thanks for suggesting Nagios, i've just installed it and it seems to be working great, but is there anyway to control it from the command line? I was looking into this project https://github.com/tehmaze/nagios-cli but after installing it it doesn't seem to work so i think it might be outdated, it would be much easier for me to put nagios into my script if were operable on the command line. I haven't done much with servers before so hadn't heard of nagios but it seems to be really popular. I thought that with a kernel panic perhaps the kernel is at least slightly operable before it decided to shutdown, but it sounds like when the kernel panics that it's to late to do anything about it other than restart the PC manually, but it seems like that a kernel oops often leads to a kernel panic so i'll try to get my server to message me when that happens instead.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.