This is the script that I made, and I will freely admit that I'm not a pro by
any means at making them. The domain names have been changed obviously. My
only problem is that every time the monitor runs I get an email even though I
know the site is still up. Is there something wrong there that is telling it
to send the message no matter what? Any help is greatly appreciated. Thanks.
url="http://www.contoso.com"
on error resume next
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
Call objHTTP.Open("GET", url, FALSE)
stat=objHTTP.status
if not stat="200" then
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "www.contoso.com is DOWN"
objMessage.Sender = "mrussell@contoso.com"
objMessage.To = "mrussell@contoso.com"
objMessage.TextBody = "WEBSITE IS DOWN"
'==This section provides the configuration information for the remote SMTP
server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.lifeclinic.com"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMessage.Configuration.Fields.Update
objMessage.Send
end if