Home » none » Free Website Monitor

Free Website Monitor


I have over 100 websites now and the danger exists that one of them might get hacked.

This wouldn’t be a big problem if I knew about it.  I have backups in place.

But how do you keep track of 100 web sites so that you know if one or more have been hacked so you can do something about it?

Obviously, you need some kind of site monitoring software.  I don’t need anything elaborate.  Just go look at the website and make sure it still has my content.

I found one that does just that, and it was free, but when I went to add my second site, I couldn’t get it to work.  It couldn’t see the text on the page that was clearly there.

That’s when I thought to myself, “I bet this is something I could get PowerShell to do for me easily enough.”  And sure enough, a search on the web turned up this script:

Quick And Dirty Website Monitoring With Powershell

Then I decided I should make sure that my router was up, so I went looking for a ping script that I could adapt.  I used this one:

PowerShell To Ping Range of IP Addresses

The result is my own script that looks like this:

    $ping = New-Object System.Net.NetworkInformation.Ping
    $ip = "";

    $res = $ping.send($ip)
    if($res.Status -eq "Success")

        # Create the variables
        $global:GArgs = $Args

        $urlsToTest = @{}
        $urlsToTest["domain1"] = "http://somedomain.com"
        $urlsToTest["domain2"] = "http://someotherdomain.com"

        $successCriteria = @{}
        $successCriteria["domain1"] = "*text to search in somedomain.com*"
        $successCriteria["domain2"] = "*text to search in someotherdomain.com*"

        $userAgent = "PowerShell User"
        $webClient = new-object System.Net.WebClient
        $webClient.Headers.Add("user-agent", $userAgent)

        foreach ($key in $urlsToTest.Keys) {
           $output = ""

           $startTime = get-date
           $output = $webClient.DownloadString($urlsToTest[$key])
           $endTime = get-date

           if ($output -like $successCriteria[$key]) {
              $key + "`t`tSuccess`t`t" + $startTime.DateTime + "`t`t" + `                   ($endTime - $startTime).TotalSeconds + " seconds"

              if ($GArgs -eq "-log") {
                 $key + "`t`tSuccess`t`t" + $startTime.DateTime + "`t`t" + `                   ($endTime - $startTime).TotalSeconds + " seconds" >> WebSiteTest.log
           } else {
              $key + "`t`tFail`t`t" + $startTime.DateTime + "`t`t" + `                   ($endTime - $startTime).TotalSeconds + " seconds"

              if ($GArgs -eq "-log") {
                 $key + "`t`tFail`t`t" + $startTime.DateTime + "`t`t" + `                   ($endTime - $startTime).TotalSeconds + " seconds" >> WebSiteTest.log

                 $emailFrom = "fromemail@fromemail.com"
                 $emailTo = "toemail@toemail.com"
                 $subject = "URL Test Failure - " + $startTime
                 $body = "URL Test Failure: " + $key + " (" + `                    $urlsToTest[$key] + ") at " + $startTime
                 $smtpServer = "smtp.domain.com"
                 $smtp = new-object Net.Mail.SmtpClient($smtpServer)


Then I just schedule the script in the Windows scheduler and it monitors my web sites for me.

Like this Article? Subscribe to get every article sent to your email.

Related Post

  • Synergy – The Virtual KVM (sort of)Synergy – The Virtual KVM (sort of) This afternoon (last Thursday by the time this actually goes live) one of my clients introduced me to Synergy.  This is one of the coolest tools I've seen since VNC. Now, to be […]
  • SQL Express Mixed Mode AuthenticationSQL Express Mixed Mode Authentication So, I'm getting ready to do some data binding demos and I realized that when I installed Visual Studio, I forgot to install SQL Server Express first so that I could control the […]
  • Paging on a DatalistPaging on a Datalist This morning, my email had the following question: “I am having a problem with datalist. Is it possible to do paging on datalist? If yes, what is the solution? I am using VB.NET on […]
  • WordPress w/ Forms Authentication on IIS6WordPress w/ Forms Authentication on IIS6 I know I said yesterday that I'd start a series about creating DotNetNuke modules, but I solved a problem yesterday after I wrote that post that I think a lot of you will be interested […]
  • Validating A WebForms Checkbox . . .Validating A WebForms Checkbox . . . . . . and other ASP.NET controls that the Validation controls can not be wired to.The presentation today may be something you already know how to do.  But, this question comes up […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer. His commitment to quality through test driven development, vast knowledge of C#, HTML, CSS and JavaScript as well as his ability to mentor younger programmers and his passion for Agile/Scrum as defined by the Agile Manifesto and the Scrum Alliance will certainly be an asset to your organization.