Monitor your website or any URL from SQL SERVER

  • Like the idea.

    I would suggest altering the script in the following ways

    1. Read the website url's from a table

    2. On success/fail write datetime and url and pass/fail to table for log purpose

    3. On failure also send the email as you already do.

    Might also be handy if different specific text on a website could be identified as either pass or fail (some websites do return pages when they are down)

    Yes there are other tools that can do this, but would be handy if we can do it in SQL instead.

    Thanks for sharing

    Regards

    Terry

  • This is good for intranet websites, where external monitoring tools aren't allowed. Its nice to know SQL Server can do it!

    I would suggest adding some logic/tables to read the URLs from, and to log the result of the checks. Overall good article.

    cya

  • peleg (5/18/2010)


    i dont think that the sql server should do this kind of work.

    although it's good to know, but there are better way's & tools to do it.

    +1 Still true after all these years.

    Not all gray hairs are Dinosaurs!

  • I think it is quite handy that this can be done in SQL.

    I agree there are other tools that can and have been written already that probably do a much better job of this. However I would ultimately like to log this uptime/downtime somewhere safe and ultimately I think SQL table is a good place for this. This means I can also setup a sql report that can be instantly accessed to show uptime when needed.

    So why use another application to write a program that stores this in SQL when I can just use SQL to do it?

    I note that this script attempts to send an email when the and is failing for me on that point (I think because the profile name you are using is not one that exists on my server). I might suggest alter this to simply display text to show whether it worked or failed

    i.e. if @text is null SELECT 'It failed'

  • On the surface looks good, will dig in now.

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply