Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to restart a windows 2008 server only if the gatwaay is not responding. Is there a way to conditionally ping the gateway and if the gateway is not reachable a restart is triggered?

Thank you

share|improve this question
    
Restart the gateway, or the server? Or is the server the gateway? –  Nixphoe May 13 '11 at 15:30
3  
I was trying to figure out why you'd need to restart a server if the gateway was down. O_o –  GregD May 13 '11 at 15:35
    
@Nixphoe - I need to restart the actual sever. Its happening that when the link is down , the firewall service crashes and the only way to recover is by restarting the whole server.I am really struggling with this one. thank you. –  redknight May 13 '11 at 16:15
add comment

1 Answer

up vote 1 down vote accepted

It might be a better option to contact the firewall vendor to see what you can't do to get those services started with out a reboot (seriously though). But to do what you're asking, you could try running this batch script, have it start up with Task Scheduler on reboot. You could either loop it with the "goto start" option listed. Or remove that and just have Task Scheduler run it every 5 minutes.

:start
ping [gatewayIP]
if %errorlevel%==1 shutdown /r 
goto start
share|improve this answer
    
thank you for the batch script. I understand that this is only a dirty workaround, but it avoids me having to check in at unholy hours ! As regards vendors I am checking since on the firewall I have a third party content filtering product and I am monitoring to see if this could be the culprit. –  redknight May 13 '11 at 16:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.