One of our websites has a glitch which occasionally takes it down - the back end needs to be restarted. The replacement is not yet ready for production, so I've created a VBS script which polls the server and restarts the server if:
a) The HTTP status code <> 200, or b) The page loads but a substring is not found on the page.
The HTTP status check times out if the tomcat service fails to respond; I would like to call a function if that occurs. Is it possible to capture and handle a timeout? This is a snippet of my relevant code pieces.
xmlhttp.setOption 2, 13056
xmlhttp.open "get", "https://www.mywebsite.com/thisurl", false
xmlhttp.send
if xmlhttp.status <> 200 then
call restartTomcat()
call emailAlert()
end if
Thank you in advance.