LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-18-2017, 04:31 AM   #1
Sol33t303
Member
 
Registered: Jul 2017
Posts: 94

Rep: Reputation: Disabled
Is it possible to get linux to run a script when the kernel panics?


I want to setup a script that texts me when my server has crashed, so is it possible to do that? If so how could i?
 
Old 10-18-2017, 08:24 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,438
Blog Entries: 13

Rep: Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748
No.

A kernel panic is a crash of the kernel.

The OS is no longer running.

A shell script cannot run without a shell.

The shell is not running when the OS is not running.
 
Old 10-18-2017, 08:48 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179Reputation: 3179
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.
 
2 members found this post helpful.
Old 10-18-2017, 08:54 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,438
Blog Entries: 13

Rep: Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748Reputation: 3748
And the very, very sad part I'm realizing just now is that there specifically a Sticky thread discussing kernel panics

Created by sundialsvcs, which I helped to post over in the Linux - Newbie forum.
 
Old 10-18-2017, 09:05 AM   #5
YesItsMe
Member
 
Registered: Oct 2014
Distribution: Gentoo (broken)
Posts: 611

Rep: Reputation: 222Reputation: 222Reputation: 222
Quote:
Originally Posted by Sol33t303 View Post
I want to setup a script that texts me when my server has crashed
You might be interested in Nagios.
 
Old 10-18-2017, 12:22 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,413
Blog Entries: 9

Rep: Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659
Quote:
Originally Posted by YesItsMe View Post
You might be interested in Nagios.
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.

Last edited by ondoho; 10-19-2017 at 02:00 AM.
 
1 members found this post helpful.
Old 10-18-2017, 12:28 PM   #7
YesItsMe
Member
 
Registered: Oct 2014
Distribution: Gentoo (broken)
Posts: 611

Rep: Reputation: 222Reputation: 222Reputation: 222
You know that a Direct Message is the preferred way to annoy other LQ members without causing any disruption?
 
1 members found this post helpful.
Old 10-21-2017, 04:08 AM   #8
Sol33t303
Member
 
Registered: Jul 2017
Posts: 94

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Kernel Panics theunixwizard Linux - Kernel 1 02-16-2008 01:21 PM
Kernel panics when installing linux - windows mostly works Captain Tram Linux - Hardware 12 03-27-2007 06:11 PM
Kernel 2.4.23 compile causes kernel panics on ATA RAID-1 (mirror) array Raptor Ramjet Slackware 3 12-18-2003 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration