A
Aaron
Is there a script that monitor (ping) my website every hour and run iisreset
if it receives an error or no response.
Thanks
Aaron
if it receives an error or no response.
Thanks
Aaron
Aaron said:All these programs are too expensive for me.
Can I do this with DOS, I don't need anything complicated.
1.Download a file from a website
2. If the download fails run iisreset
*I'll just add this batch file to schedule tasks in windows.
Aaron said:Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.
Aaron said:Thanks Paul this works great.
I want to add one more thing
if http.Status <> "200" and does not finish downloading in 10 sec.
Paul R. Sadowski said:Oops, I pasted my test copy. The proper order is to create the Xml.Http
object before the error handling. Minor thing but we want to see if there's
a problem creating either object so they should come before the error
handling.
URL = "http://localhost"
CMD = "cscript c:\inetpub\adminscripts\iisrestart.vbs"
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
on error resume next
http.open "HEAD", URL, FALSE
StartTime = Now
http.send ""
EndTime = Now
if http.Status <> "200" or DateDiff("s", StartTime, EndTime) > 10 then
WshShell.Run CMD
end if
set http = nothing
set WshShell = nothing