Automate IE to try to reconnect if web server is down

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Guest

Automate IE to try to reconnect if web server is down

Post by Guest » Sun Jun 06, 2004 1:36 pm

I am a newbie, just started trying this nice product that i think would do the job for me. I conect to a web application using IE6.0 to pull information from Intranet web server and refresh every 5 seconds. My requierment is that if the server is down or the network is down I need this product to detect it and dispaly a default page , and retry every Interval of time , till server is restored or the link is up, then reconnect to the original page. If some body can help i realy appreciate it

Lumumba

Post by Lumumba » Sun Jun 06, 2004 3:39 pm

You should create a loop which is pinging a server/network. As long there's no response you could display its status on a page via FTP on another server.

Guest

Post by Guest » Sun Jun 06, 2004 7:03 pm

Thanks for your hints , i searched "pinging servers" and found a hit, I will try my best coding it, but if some body did the same thing and want to share his code will be great.

Guest

Post by Guest » Sun Jun 06, 2004 7:33 pm

I just cut this out of a script that I had done a while ago. This is scheduled to run every 5 minutes and just pops up a status message. Intended to send multi emails when server was down.

Need to insert IP address to ping.

Output of PING goes to a file.
Find parses out the line with the ping results
ReadLine gets the number of failures. If 0=OK, if 4=NG, if 1-3=Retry.
================================
/Need to test email server and verify it is active.

Let>RP_WAIT=1
Let>CF_OVERWRITE=1
Let>RP_WINDOWMODE=0
Let>IP=127.000.000.001

Label>Start
Message>Running PING to Email Server now....
Run Program>command.com /c ping %IP% > c:\temp\tstmail1.txt

Message>Checking Results of Email Server status now....
Run Program>command.com /c find /c "timed out" c:\temp\tstmail1.txt >c:\temp\tstmail2.txt
ReadLn>c:\temp\tstmail2.txt,2,countline
Position>:,%countline%,30,start
Add>Start,30
MidStr>%countline%,%start%,2,count

Label>Test1
//Note, need different email account to send these messages if this email server is down!.
If>%count%=4,NoMail,Test2

Label>Test2
If>%count%=0,Good,Start

Label>Good
Message>Email server is OK
//If good send OK mail, once every six hours
Goto>End

Label>NoMail
Message>Email server is DOWN
//If no good, send warning emails to tech support and group

Label>End
Comments for Run Program> commands:
WIN9X = use command.com
WINNT/XP/2K = use com

If doing Cut/Paste from forum be sure to remove any Trailing Space Characters.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Jun 06, 2004 7:51 pm

Previous posting with script for testing email was from me. Sorry, thought I was logged in. I am repeating it here to make it easier for me to locate in the future.
================================
I just cut this out of a script that I had done a while ago. This is scheduled to run every 5 minutes and just pops up a status message. Intended to send multi emails when server was down.

Need to insert IP address to ping.

Output of PING goes to a file.
Find parses out the line with the ping results.
ReadLine gets the number of failures. If 0=OK, if 4=NG, if 1-3=Retry.
=============================
/Need to test email server and verify it is active.

Let>RP_WAIT=1
Let>CF_OVERWRITE=1
Let>RP_WINDOWMODE=0
Let>IP=127.000.000.001

Label>Start
Message>Running PING to Email Server now....
Run Program>command.com /c ping %IP% > c:\temp\tstmail1.txt

Message>Checking Results of Email Server status now....
Run Program>command.com /c find /c "timed out" c:\temp\tstmail1.txt >c:\temp\tstmail2.txt
ReadLn>c:\temp\tstmail2.txt,2,countline
Position>:,%countline%,30,start
Add>Start,30
MidStr>%countline%,%start%,2,count

Label>Test1
//Note, need different email account to send these messages if this email server is down.
If>%count%=4,NoMail,Test2

Label>Test2
If>%count%=0,Good,Start

Label>Good
Message>Email server is OK
//If good send OK mail, once every six hours
Goto>End

Label>NoMail
Message>Email server is DOWN
//If no good, send warning emails to tech support and group

Label>End
Comments for Run Program>commands:
WIN9X = use command.com
WINNT/XP/2K = use com

If doing Cut/Paste from forum be sure to remove any Trailing Space Characters.
Last edited by Bob Hansen on Tue Jun 08, 2004 7:13 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Tue Jun 08, 2004 3:04 pm

Thanks Bob , i will use your code , this is what i wanted , and then add some code for closing the browser window, and opening a local page if connection is down.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts