Server Reboot Alert


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Server Reboot Alert
# 1  
Old 04-08-2005
Server Reboot Alert

I want to get an email alert from a cronjob when a server got rebooted unexpectedly. Please help. Thanks! Smilie
# 2  
Old 04-08-2005
Using cron would be difficult since it runs jobs on a schedule - reboots don't normally happen that way.

Put a startup script which emails you when the server reboots. Since you didn't post what OS or version you are running, I can't give you specifics of where the script should go (For Solaris in /etc/rc2.d or /etc/rc3.d would be a good place).
You would want it to start after the network is up and running so putting it as S99some-name should work (again, it matters on what your OS is).

Create S99serverup in /etc/rc2.d would send a email to your address at your domain with the hostname and reboot as subject. No internal message but you can change that with information placed into another file if needed.

#!/bin/sh
/bin/mailx -s"`hostname` reboot" youremail@yourdomain.xxx < /dev/null
exit
# 3  
Old 04-09-2005
My OS version is as below:

Linux jupiter 2.4.21-27.0.1.ELsmp #1 SMP Mon Dec 20 18:47:45 EST 2004 i686 i686 i386 GNU/Linux
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Server reboot

Hi, The server got rebooted and below messages can be seen in /var/log/messages Sep 7 10:49:12 minersville kernel: Call Trace: <IRQ> <ffffffff80167420>{__alloc_pages+796} Sep 7 10:49:12 minersville kernel: <ffffffff80182814>{kmem_getpages+106} <ffffffff80183c16>{fallback_alloc+304}... (3 Replies)
Discussion started by: admin_db
3 Replies

2. Solaris

Validate mountpoints on solaris server after server reboot

Hi, anyone please let us know how to write shell script to find the missing mountpoints after server reboot. i want to take the mountpount information before server reboot, and validate the mountpoints after server reboot if any missing.please let us know the shell script from begining to end as... (24 Replies)
Discussion started by: VenkatReddy786
24 Replies

3. Linux

Linux server reboot

We reboot our linux servers daily. Is it needed ? (10 Replies)
Discussion started by: linuxadmin
10 Replies

4. Solaris

Change gateway without reboot server

Hi Gurus Recently i had change the gateway for a server i had change the IP in the /etc/defaultrouter and run the below command # route add default 10.86.33.222 # route delete default 10.86.33.1 # netstat -rn Routing Table: IPv4 Destination Gateway Flags Ref ... (2 Replies)
Discussion started by: SmartAntz
2 Replies

5. Solaris

server reboot itself but no core dump

I wonder if anyone here came accross the same situation like me. One of server in my company reboot itself serveral days ago. I have checked /var/adm/messages... there is nothing there but a few messages mention explorer file has been generated by sysadmin. There is no core dump file either.... (4 Replies)
Discussion started by: uuontario
4 Replies

6. Solaris

Reboot the server through console

Hi All, I want to know the procedure like if server is down, i want to reboot the server through console ($rsc or $sc prompt).Could you please help me out. I would really appreciate your cooperation. thanks for understanding regards krishna (5 Replies)
Discussion started by: murthy76
5 Replies

7. AIX

IP setting changes after server reboot

I've recently changed my gateway setting using SMIT. Everything went fine except that the gateway setting kept reverting back to the old one everytime I reboot the server. I'm on AIX 5.2 running p-Series. Thanks for any info. (3 Replies)
Discussion started by: dereklow
3 Replies

8. UNIX for Advanced & Expert Users

server reboot

hi all, :) for a reboot of sun box for patch installation i would like to know where do the reboot logs apart from /var/adm/messages and patch run messages would be available, i would like to know the sequence of messages logged in the file like requesting the users to log out sending a... (1 Reply)
Discussion started by: matrixmadhan
1 Replies

9. SCO

Reboot the sco server

Dear sir, I am using sco open server 5.06.How we can reboot the system without using root password? Whar are the permision need to change to do this. Thanks, Mostafizur Rahman (3 Replies)
Discussion started by: rahmanm
3 Replies
Login or Register to Ask a Question