469,317 Members | 1,894 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

Website Monitoring Script

Is there a script that monitor (ping) my website every hour and run iisreset
if it receives an error or no response.

Thanks
Aaron
Jul 21 '05 #1
14 4372
Have you seen this?

http://www.gfi.com/nsm/nsmfreeware.htm

Regards

Oli
"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.

Thanks
Aaron

Jul 21 '05 #2
Actually if you don't mind spending just a little bit of money you can do really
well getting hostmon from ks-soft... It will do all sorts of other nice things
like track access time on the pages, etc.

http://www.ks-soft.com/hostmon.eng/index.htm

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net

Aaron wrote:
Is there a script that monitor (ping) my website every hour and run iisreset
if it receives an error or no response.

Thanks
Aaron

Jul 21 '05 #3
I tried to install it, but it doesn;'t work on my win xp pro machine.
I want to test it before I run it on the production server
(windows 2003)

"Oli Restorick [MVP]" <ol*@mvps.org> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
Have you seen this?

http://www.gfi.com/nsm/nsmfreeware.htm

Regards

Oli
"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.

Thanks
Aaron


Jul 21 '05 #4
I tried this but I can't find the feature that resets IIS.
Can it do that?

thx

"Joe Richards [MVP]" <hu**********@hotmail.com> wrote in message
news:ek*************@TK2MSFTNGP11.phx.gbl...
Actually if you don't mind spending just a little bit of money you can do really well getting hostmon from ks-soft... It will do all sorts of other nice things like track access time on the pages, etc.

http://www.ks-soft.com/hostmon.eng/index.htm

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net

Aaron wrote:
Is there a script that monitor (ping) my website every hour and run iisreset if it receives an error or no response.

Thanks
Aaron

Jul 21 '05 #5
You can script whatever responses you want it to do for you. Check out the docs.

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net

Aaron wrote:
I tried this but I can't find the feature that resets IIS.
Can it do that?

thx

"Joe Richards [MVP]" <hu**********@hotmail.com> wrote in message
news:ek*************@TK2MSFTNGP11.phx.gbl...
Actually if you don't mind spending just a little bit of money you can do


really
well getting hostmon from ks-soft... It will do all sorts of other nice


things
like track access time on the pages, etc.

http://www.ks-soft.com/hostmon.eng/index.htm

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net

Aaron wrote:
Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.

Thanks
Aaron


Jul 21 '05 #6
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.

Thanks.
A
"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run iisreset if it receives an error or no response.

Thanks
Aaron

Jul 21 '05 #7

"Aaron" <ku*****@yahoo.com> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
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.


I guess you could get a copy of wget and test with that but try WSH.
Goto http://www.paulsadowski.com/WSH/xmlhttp.htm and look at the
HTMLHead.vbs script and go from there.
Jul 21 '05 #8

"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.


Change URL and CMD strings to whatever you need.

'CheckServer.vbs
URL = http://localhost
CMD = "cscript c:\inetpub\adminscripts\iisreset.vbs"

Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")

on error resume next
http.open "HEAD", URL, FALSE
http.send ""
if http.Status <> "200" then
WshShell.Run CMD
end if

set http = nothing
set WshShell = nothing
Jul 21 '05 #9
If you can script in perl you can use the LWP module to pull the info and then
if the script runs on the local web server you can do an iisreset, otherwise you
can rcmd or telnet to the remote server and do the reset. However, you have to
have someone logged on all of the time or find some other way to run the monitor
script as a service.

--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net

Aaron wrote:
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.

Thanks.
A
"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run


iisreset
if it receives an error or no response.

Thanks
Aaron


Jul 21 '05 #10
Why don't you get hold of an evaluation copy of Windows Server 2003 from
Microsoft's web site to do your testing?

Oli
"Aaron" <ku*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I tried to install it, but it doesn;'t work on my win xp pro machine.
I want to test it before I run it on the production server
(windows 2003)

"Oli Restorick [MVP]" <ol*@mvps.org> wrote in message
news:u1**************@tk2msftngp13.phx.gbl...
Have you seen this?

http://www.gfi.com/nsm/nsmfreeware.htm

Regards

Oli
"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
> Is there a script that monitor (ping) my website every hour and run
> iisreset
> if it receives an error or no response.
>
> Thanks
> Aaron
>
>



Jul 21 '05 #11
Thanks Paul this works great.
I want to add one more thing
if http.Status <> "200" and does not finish downloading in 10 sec.
URL = "http://localhost"
CMD = "c:\windows\system32\iisreset.exe"

Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")

on error resume next
http.open "GET", URL, FALSE
http.send ""
if http.Status <> "200" then <<<<<<<<<<<<<<<<<<
WshShell.Run CMD
else
WScript.Echo "OK"
end if

set http = nothing
set WshShell = nothing


"Paul R. Sadowski" <xp***@mailshell13.mailshell.com> wrote in message
news:uE**************@TK2MSFTNGP10.phx.gbl...

"Aaron" <ku*****@yahoo.com> wrote in message
news:uE****************@TK2MSFTNGP12.phx.gbl...
Is there a script that monitor (ping) my website every hour and run
iisreset
if it receives an error or no response.


Change URL and CMD strings to whatever you need.

'CheckServer.vbs
URL = http://localhost
CMD = "cscript c:\inetpub\adminscripts\iisreset.vbs"

Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")

on error resume next
http.open "HEAD", URL, FALSE
http.send ""
if http.Status <> "200" then
WshShell.Run CMD
end if

set http = nothing
set WshShell = nothing

Jul 21 '05 #12

"Aaron" <ku*****@yahoo.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
Thanks Paul this works great.
I want to add one more thing
if http.Status <> "200" and does not finish downloading in 10 sec.


Do you really mean that or do you mean if the status does not = 200 **OR**
the time for the head request to return is greater than 10 seconds? The
script below assumes my interpretation.

If you really mean your way then change this line
if http.Status <> "200" or DateDiff("s", StartTime, EndTime) > 10 then
to
if http.Status <> "200" and DateDiff("s", StartTime, EndTime) > 10 then

'CheckServer.vbs
URL = http://localhost
CMD = "cscript c:\inetpub\adminscripts\iisrestart.vbs"

Set WshShell = WScript.CreateObject("WScript.Shell")

on error resume next
Set http = CreateObject("Microsoft.XmlHttp")
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
Jul 21 '05 #13
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
"Paul R. Sadowski" <xp***@mailshell13.mailshell.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...

"Aaron" <ku*****@yahoo.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
Thanks Paul this works great.
I want to add one more thing
if http.Status <> "200" and does not finish downloading in 10 sec.


Do you really mean that or do you mean if the status does not = 200 **OR**
the time for the head request to return is greater than 10 seconds? The
script below assumes my interpretation.

If you really mean your way then change this line
if http.Status <> "200" or DateDiff("s", StartTime, EndTime) > 10 then
to
if http.Status <> "200" and DateDiff("s", StartTime, EndTime) > 10 then

'CheckServer.vbs
URL = http://localhost
CMD = "cscript c:\inetpub\adminscripts\iisrestart.vbs"

Set WshShell = WScript.CreateObject("WScript.Shell")

on error resume next
Set http = CreateObject("Microsoft.XmlHttp")
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

Jul 21 '05 #14
This is awesome! thanks for your help

"Paul R. Sadowski" <xp***@mailshell13.mailshell.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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
"Paul R. Sadowski" <xp***@mailshell13.mailshell.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...

"Aaron" <ku*****@yahoo.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
Thanks Paul this works great.
I want to add one more thing
if http.Status <> "200" and does not finish downloading in 10 sec.


Do you really mean that or do you mean if the status does not = 200 **OR** the time for the head request to return is greater than 10 seconds? The
script below assumes my interpretation.

If you really mean your way then change this line
if http.Status <> "200" or DateDiff("s", StartTime, EndTime) > 10 then
to
if http.Status <> "200" and DateDiff("s", StartTime, EndTime) > 10 then

'CheckServer.vbs
URL = http://localhost
CMD = "cscript c:\inetpub\adminscripts\iisrestart.vbs"

Set WshShell = WScript.CreateObject("WScript.Shell")

on error resume next
Set http = CreateObject("Microsoft.XmlHttp")
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


Jul 21 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sven Dzepina | last post: by
reply views Thread by Mike Curry | last post: by
1 post views Thread by Lintie | last post: by
13 posts views Thread by Aaron | last post: by
19 posts views Thread by Erik Sandblom | last post: by
2 posts views Thread by Arthur Dent | last post: by
16 posts views Thread by nmdc69 | last post: by
9 posts views Thread by jcor | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.