locked
i need a conditional script to reboot my server RRS feed

  • Question

  • Team,

    I have a server that a couple of times a week it drops the network connection/ i think it is a driver issue but i am also having WHS run on something that "they" said couldnt be done. So a simple restart cures it it and it runs grerat. So what i would like to do is write something that pings the gateway once a ?????  and if it doesnt get a responce to auto reboot. Am i completely insane for doing this. any thoughts?

     

    Sincerely,

    Fosster Gandrup

    Tuesday, April 20, 2010 12:58 AM

Answers

  • Hi,
    You could try running a a sheduled task that starts a batchfile that conditionally reboots the server.
    If your router supports ping requests you could try this:

    ---8<---- (testonline.cmd) -------
    ping 192.168.1.1
    if NOT errorlevel==1 goto OKSERVER

    rem no response from router. Assume network connection down...
    echo SERVER not online!
    echo Rebooting...
    shutdown -r -f

    :OKSERVER
    ---8<------------------------------

    Of coarse, a better solution would be solving the network connectivity problem? :-/
    - Theo.

     


    No home server like Home Server
    Tuesday, April 20, 2010 8:07 PM
    Moderator
  • It's unsupported, but you can create a scheduled task that will run the shutdown command. You'll want to run it with the /r parameter (for restart), and set it to run nightly at e.g. 11:50 PM.
    I'm not on the WHS team, I just post a lot. :)
    Tuesday, April 20, 2010 3:57 AM
    Moderator

All replies

  • It's unsupported, but you can create a scheduled task that will run the shutdown command. You'll want to run it with the /r parameter (for restart), and set it to run nightly at e.g. 11:50 PM.
    I'm not on the WHS team, I just post a lot. :)
    Tuesday, April 20, 2010 3:57 AM
    Moderator
  • Hi,
    You could try running a a sheduled task that starts a batchfile that conditionally reboots the server.
    If your router supports ping requests you could try this:

    ---8<---- (testonline.cmd) -------
    ping 192.168.1.1
    if NOT errorlevel==1 goto OKSERVER

    rem no response from router. Assume network connection down...
    echo SERVER not online!
    echo Rebooting...
    shutdown -r -f

    :OKSERVER
    ---8<------------------------------

    Of coarse, a better solution would be solving the network connectivity problem? :-/
    - Theo.

     


    No home server like Home Server
    Tuesday, April 20, 2010 8:07 PM
    Moderator
  • Thanks guys! This is very helpful! Yes i do agree that solving the real issue is the best choice..but until i can get ahold of the driver that HP is using for the LX195 this will work.

     

    Sincerely,

    Fosster

    Tuesday, April 20, 2010 9:32 PM