System Administration
Showing results for 
Search instead for 
Did you mean: 

I am new to linux ..Pls help me

kiran kumar mundiyath
Occasional Visitor

I am new to linux ..Pls help me


I wanted to write a shell script in linux so that if any crash dump occurs and if any hardware failures are detected it should mail me.I want to execute this script every 4 hours daily .Request you to help me pls

Thanks and appreciate it !!

Steven Schweda
Honored Contributor

Re: I am new to linux ..Pls help me

> [...] linux [...]

It might make more sense to ask a Linux
question in a Linux forum:

> [...] I want to execute this script every 4
> hours daily

man cron
Michael Steele_2
Honored Contributor

Re: I am new to linux ..Pls help me


I don't know which of your managers gave you this assignment but this is not how admins are notified after a server panics and reboots itself.

Data centers, all data centers, rely on a monitoring that pings every box in the network, and when one of those boxes fails to respond, then the monitoring server sends out the email and alarm.

Your solution will not work for several reasons. The box is hung and not responding. This means nothing is being executed included your alarm script or email transmissions.

The box is rebooting. Some HP boxes take 20 minutes, some Linux x86 boxes 10 minutes. All depends. But when you add in making a crash dump, then add in another 20 minutes making it now 40 and 30.

The only tests that will work under you plan, would be to execute a 'who -b' every four hours, and then perform a date comparison. Or to check the date on some of the system log files like OLDmessages or messages.

Verify that you data center does not have a monitoring server already set up and get back to me.
Support Fatherhood - Stop Family Law
Occasional Advisor

Re: I am new to linux ..Pls help me


I agree that real monitoring should be done with a monitoring tool and a monitoring center. Anyway, for hardware monitoring there's the hardware-monitoring-tools of hp called hp-health and hpasm which you should have a look on. Combined with a script such as check_hpasm this is a good way to monitor the hardware. (For check_hpasm I found only a link to a german page, probably Google may translate:

Best regards,
Honored Contributor

Re: I am new to linux ..Pls help me

Not really recommended, but if you really want to do this, here's how you could do it:

1) enable kdump
2) write a script looking for any differences/changes in /var/crash. If diff's exist, pipe diff results to mail
3) fire said script off with a cron job.