1828258 Members
2781 Online
109975 Solutions
New Discussion

Reboot Mail

 
bruceedgar
Occasional Advisor

Reboot Mail

Hi ,

I would like to have the scripts , which monitor every 2 hours is the server is rebooted , if rebooted it has to send the list of members mails id in a file.

Thanks & Regards

Bruce
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Reboot Mail

Hi Bruce:

On way to implement notification is to create an 'rc' script in '/sbin/init.d' that executes whenever you transition from run-level 2-to-3. That is, create a startup script in /sbin/rc3.d' that emails your member list whenever your server reboots.

The manpages for 'rc(1M)' describe the rc-startup script requirements.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Reboot Mail

This seems to be a fundamentally flawed approach. How in the Wide World of Sports does a UNIX box get rebooted without your knowledge and without explicitly being told to reboot? If you have a box that is rebooting itself or being rebooted by others then notification is closing the barn door after the cows have left. I would fix the fundamental problem and then I would simply have to ask myself when was the last time I booted this box (or do a who -b or an uptime).
If it ain't broke, I can fix that.
bruceedgar
Occasional Advisor

Re: Reboot Mail

hi James/Stephenson tahnks for ur suggestions.

James a novice i have put a script which will have the who -b out in a file and keepon comapre that file with who -b if any changes [i mean if server rebooted ] it will update that file and also send mail to the list of peoples mail ids given in another file.

Stephenson If we are rebbotin we will know it i accept it if in case of any system crash or system is down for any reason the script has to send mail to the peoples in the mailfile.

Thanks
A. Clay Stephenson
Acclaimed Contributor

Re: Reboot Mail

My point is that your system should not be crashing. UNIX boxes should run for months on end and the only time that they should be rebooted is when periodic patch bundles are installed. Your systems should be robust enough so that routine things like disk or power supply failures are tolerated and dealt with without a reboot. If you fix the crashing then you don't need anything else.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Reboot Mail

Shalom,

I agree with the fundamentally flawed approach.

Any system that is going down every few hours has a serious problem.

1) Check hardware with cstm/mstm or xstm
2) See that the system is fully patched to at least a recent bi-annual patch set.
3) See that the system saves crash dumps /etc/rc.config.d/savecrash set the first variable to 1.

This is not a windows box. I know people that have run hpux boxes for years without reboot.

Also, rebooting a system does not "reset mail" the mail queues of inbound and outbound mail will continue to exist.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com