Slee
Slee

Reputation: 28248

schedule webpage

I need to schedule several different pages on several different sites to be run at certain times, usually once a night. Is there any software out there to do this? it would be nice if it called the page and then recorded the response and whether the called page was successful run or not. I was using Helm on a different box and it had a nice Web Scheduler module but Helm is not an option for this machine. This is a Window Server 2008 box.

Upvotes: 1

Views: 1462

Answers (8)

Matthijs
Matthijs

Reputation: 11

The code given in the upper example has some issues with the task being active during the loading of the website. The website is loading 2 minutes but the task is already done in 1 second, which brings a problem when you execute it every 5 minutes. If the website loads 10 minutes and the task is already done in 1 second it wil execute again that while I want it to wait the loading time of the website.

So what I've done is the following (this script will keep the task busy as long the website is loading):

dim URL, oArgs, objXML
Set oArgs = WScript.Arguments
URL = oArgs(0)

on error resume next

Set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = "false"
objXML.load(URL)
Set objXML = Nothing

Upvotes: 1

Regina
Regina

Reputation: 41

I use http://scheduler.codeeffects.com. Very effective and reliable, no complains.

Upvotes: 0

Terry
Terry

Reputation:

fyi - wget is GNU standard license, so I'm not sure it's usable for most commercial/proprietary systems.

Upvotes: 0

oglester
oglester

Reputation: 6655

Similar (though possibly more powerful) is netcat and its windows port

Upvotes: 0

Slee
Slee

Reputation: 28248

I ended up using this script and Task Scheduler, simple and works great:

Call LogEntry()
Sub LogEntry()

'Force the script to finish on an error.
On Error Resume Next

'Declare variables
Dim objRequest
Dim URLs
URLs = Wscript.Arguments(0)
Set objRequest = CreateObject("Microsoft.XMLHTTP")

'Open the HTTP request and pass the URL to the objRequest object
objRequest.open "POST", URLs, false

'Send the HTML Request
objRequest.Send

Set objRequest = Nothing
WScript.Quit

End Sub

Then I just call it with the URL I want run as an argument:

Upvotes: 0

JoshBaltzell
JoshBaltzell

Reputation: 1494

We use standard scheduled tasks that call a bat file that calls a VBS file. I know it is not the most elegant solution ever, but it consistently works.

BAT:

webrun.vbs http://website.com/page.aspx

VBS:

dim URL, oArgs  

Set oArgs = WScript.Arguments  

    if oArgs.Count = 0 then  
    msgbox("Error: Must supply URL")  
    wscript.quit 1  
    end if  

URL = oArgs(0)  

 on error resume next  
Set objXML = CreateObject("MSXML2.ServerXMLHTTP")  

    if err then  
    msgbox("Error: " & err.description)  
    wscript.quit 1  
    end if  

' Call the remote machine the request  
    objXML.open "GET", URL, False  

    objXML.send()  

' return the response  
    'msgbox objXML.responSetext  

' clean up  
    Set objXML = Nothing  

The code in the VBS file is almost assuredly both overkill and underwritten, but functional none-the-less.

Upvotes: 6

Reputation:

If it's not a requirement to schedule them from the same box, have a look to Zoho's site24x7.

It is initially designed to monitor web sites but it has an option to record expected answers and compare them so you can use it for your purpose with the added security of an external site. It's not free however except for few urls.

They are other similar providers but they looked pretty good last time I searched the web on this topic.

Upvotes: 0

Mark Allen
Mark Allen

Reputation: 1205

How about wget.exe and the task scheduler?

Upvotes: 3

Related Questions