Netservers
1832274 Members
2087 Online
110041 Solutions
New Discussion

automate server reboot

 
SOLVED
Go to solution
paul_280
Advisor

automate server reboot

I have a server that keeps losing it's network connectivity. As a temporary fix it usually gets rebooted.

This means coming out at night if it goes wrong.

Is there a way of checking network connectivity every 30 secs, maybe a batch file that pings the default gateway for example, and then reboots itself if it gets no reply.

Thanks in advance
9 REPLIES 9
Karthik S S
Honored Contributor

Re: automate server reboot

Must be something to do with the hardware. Script to reboot the system will be of no use for a permanant fix.


You can try the following one by one to zero down on the root cause..

1. Check the network settings on the system

2. Check for the duplicate IP addresses on the network.

3. Try with a different UTP cable

4. Try connecting the server to a different switch or switch port.

5. Replace the NIC card on the system

6. Try installing latest patches for the OS

Pl. post more details about the system

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
paul_280
Advisor

Re: automate server reboot

Karthik

Thanks for the input, yes it's a temporary fix I agree, the problem is caused by 3rd party software that we've paid lots of money to the manufacturers to put right.

Until they do though, I'm trying to find a fix so we don't keep having to come out at night, and rebooting the system does seem to do the trick for a few hours

Details of server

Name ourserver
Model HP NetServer LP 2000r
Location

Processor 1 Pentium III, 1266 MHz
Processor 2 Pentium III, 1266 MHz
BIOS Version 4.06.06 RP
Video BIOS Version 4.328
Memory Total 1280 MB
Up Time 2 days, 17:48:38.56
OS Windows NT
OS Version 4.0 Build 1381 Service Pack 6

Martin Breidenbach
Honored Contributor
Solution

Re: automate server reboot

Should be possible to do with some freeware tools.

There are PING variants that set errorlevel and command line tools to shut down the system. Mix them together in a batch file and schedule the batch file via scheduler service (or add a freeware timer tool).

A google search for PING and ERRORLEVEL revealed this:

http://wettberg.home.texas.net/alive.htm

Use this to ping a 'known good' ip address (like another server). If errorlevel isn't zero reboot.

(No, I haven't tried that before)
Karthik S S
Honored Contributor

Re: automate server reboot

Hi Paul,

You can make use shutdown.exe command which is a part of WindowsNT resource kit. This command can be put in a small script which checks for network connectivity and if the test case fails shutdown (reboot) can be invoked.

For getting Unix like commands and to write shell scripts for the above task you can additionally install "Windows Services for Unix" ( 4months trail from MS site).

www.microsoft.com/windows/sfu/default.asp

Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
paul_280
Advisor

Re: automate server reboot

Martin / Karthik

OK with your help I'm on my way to solving this.

I've downloaded the Alive program and installed the reskit. I've written a batch file that pings another server on the same switch (this will probably be changed) every 30 seconds, if I pull the network cable out of the other server the problem server is rebooting as planned.

All I need to do now is get it to log back in automatically. There is a program that needs to be running for the server to do it's job, so I could put that program in the start up folder

So any ideas about getting it to automatically logon?
Martin Breidenbach
Honored Contributor

Re: automate server reboot

I believe automatic logon can be done by doing some registry settings - should be documented somewhere in MS knowledgebase. I think the MS tweakui powertoy can do that too.

AFAIK automatic logon is a security risk because the admin password is written unencrypted in the registry.
Karthik S S
Honored Contributor

Re: automate server reboot

Paul,

To enable autologon read,

http://www.itworld.com/nl/win_admin_tips/07202001/

To lock the workstation once it has logged in ... probably you can enable screen saver password.

Regards,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
paul_280
Advisor

Re: automate server reboot

Karthik / Martin

Yes, all done, thanks for the help

Incase anyone has done a search and found this and needs to do something similar here's what I did with your help:

Downloaded the alive program from
http://wettberg.home.texas.net/alive.htm

Copied the shutdown.exe from the reskit and copied both files to system32

then put a batch file like this in scheduled tasks to run every 30 secs

alive servername
if errorlevel 1 shutdown \\ipaddress /Y /R /C

Then changed the registry in regedt32 to enable autologon, see this article for instructions

http://support.microsoft.com/default.aspx?scid=kb;en-us;310584

Then made another batch file like this

RUNDLL32 USER32.DLL,LockWorkStation

Then put this .bat file and a shortcut to the program that needs to running on the server in the startup folder



Karthik S S
Honored Contributor

Re: automate server reboot

Great ...

Thanks for sharing the procedure that you have followed.

Now have a look at,
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1fd2e6ab52b11743b07c0dd4ca137e4c,00.html

Enjoy

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn