Operating System - Linux
1752738 Members
5572 Online
108789 Solutions
New Discussion юеВ

I am new to linux ..Pls help me

 

I am new to linux ..Pls help me

Hi

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 !!

sai
4 REPLIES 4
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:

http://forums.itrc.hp.com/service/forums/familyhome.do?familyId=118

> [...] 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

Hi

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
mbscholz
Occasional Advisor

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

Hi,

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: http://labs.consol.de/lang/de/nagios/check_hpasm/).

Best regards,
Michael
Alan_152
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.