DrayTek UK Users' Community Forum
Help, Advice and Solutions from DrayTek Users
Automated Reboots...
- ajsmith9870
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
10 Feb 2006 19:12 #30820
by ajsmith9870
Anthony Smith
Replied by ajsmith9870 on topic Far too easy
Thanks Kippy, but that would be far too easy :lol:
Anthony Smith
Please Log in or Create an account to join the conversation.
- telis
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
- wfc
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
08 Mar 2007 22:58 #41345
by wfc
Replied by wfc on topic Automated Reboots...
Great script, I have a problem of my router loosing connection (2800) so I have added at the ping tests to the top giving:
:: Test servers on the Internet
:: Testwww.zen.co.uk
PING -w 7500 212.23.2.21 |find "TTL=" && GOTO:eof
:: Test Zen's primary DNS server
PING -w 7500 212.23.3.100 |find "TTL=" && GOTO:eof
:: Test Zen's secondary DNS server
PING -w 7500 212.23.6.100 |find "TTL=" && GOTO:eof
:: Create SendKeys script
ECHO.set sh=Wscript.CreateObject("Wscript.Shell")>_TEMP.VBS
:: Send Host Name
ECHO.sh.SendKeys "o 192.168.XXX.XXX" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "xxxPASSWORDxxx" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "sys reboot" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "quit" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
:: Open a telnet window - it will be the window with focus
start /I telnet.EXE
:: Run the script to send keys to telnet window
cscript//nologo _TEMP.VBS
:: Clear away workfile
DEL _TEMP.VBS
EXIT
And then run the script every 5 mins from my server. The reason for the three pings is to make sure the internet is down not just one server.
Regards
Leo
:: Test servers on the Internet
:: Test
PING -w 7500 212.23.2.21 |find "TTL=" && GOTO:eof
:: Test Zen's primary DNS server
PING -w 7500 212.23.3.100 |find "TTL=" && GOTO:eof
:: Test Zen's secondary DNS server
PING -w 7500 212.23.6.100 |find "TTL=" && GOTO:eof
:: Create SendKeys script
ECHO.set sh=Wscript.CreateObject("Wscript.Shell")>_TEMP.VBS
:: Send Host Name
ECHO.sh.SendKeys "o 192.168.XXX.XXX" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "xxxPASSWORDxxx" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "sys reboot" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
ECHO.sh.SendKeys "quit" >>_TEMP.VBS
ECHO.Wscript.Sleep 1000 >>_TEMP.VBS
ECHO.sh.SendKeys "{ENTER}" >>_TEMP.vbs
ECHO.Wscript.Sleep 1000 >>_TEMP.vbs
:: Open a telnet window - it will be the window with focus
start /I telnet.EXE
:: Run the script to send keys to telnet window
cscript//nologo _TEMP.VBS
:: Clear away workfile
DEL _TEMP.VBS
EXIT
And then run the script every 5 mins from my server. The reason for the three pings is to make sure the internet is down not just one server.
Regards
Leo
Please Log in or Create an account to join the conversation.
- stuc
- Offline
- Junior Member
Less
More
- Posts: 41
- Thank you received: 0
09 Mar 2007 11:00 #41354
by stuc
Replied by stuc on topic Automated Reboots...
At the risk of complicating things for my own selfish ends.
Would it be possible to use the same method to force an email alert from the router if one or more pings failed but the router still has net access?
I use a static route on the Vigor to route VPN traffic through another VPN, if the Vigor router chirped to a blackberry before users I'd have a head start knowing the Vigor was not the problem but the VPN was down.
Would it be possible to use the same method to force an email alert from the router if one or more pings failed but the router still has net access?
I use a static route on the Vigor to route VPN traffic through another VPN, if the Vigor router chirped to a blackberry before users I'd have a head start knowing the Vigor was not the problem but the VPN was down.
Please Log in or Create an account to join the conversation.
- wfc
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
09 Mar 2007 12:23 #41376
by wfc
Replied by wfc on topic Automated Reboots...
Use Blat to add in the e-mail commands you want http://www.blat.net/
Please Log in or Create an account to join the conversation.
- stuc
- Offline
- Junior Member
Less
More
- Posts: 41
- Thank you received: 0
09 Mar 2007 13:42 #41379
by stuc
Replied by stuc on topic Automated Reboots...
Many thanks,
was not aware of blat, didn't realise I was looking for that sort of thing until now, very interesting.
was not aware of blat, didn't realise I was looking for that sort of thing until now, very interesting.
Please Log in or Create an account to join the conversation.
Moderators: Chris, Sami
Copyright © 2024 DrayTek