Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Monitor your website or any URL from SQL SERVER Expand / Collapse
Author
Message
Posted Tuesday, May 18, 2010 8:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 8, 2011 7:03 AM
Points: 1, Visits: 7
Or you could use a cheap external website monitoring service such as www.watchour.com!

Personally, I would leave SQL out of the loop as an application platform and let it do what it does best: manage data.
Post #923634
Posted Tuesday, May 18, 2010 4:54 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 8:16 AM
Points: 1,618, Visits: 1,554
I agree with peleg about it not being an appropriate job for SQL Server. Beyond that, it is an interesting use of the OLE Automation procedures.

One recommendation, I would suggest checking the current state of the OLE automation config setting and only enabling/disabling it if it wasn't already enabled. If it is enabled for a reason, such as required by an application, then you could break functionality of whatever uses it.




My blog: SQL Soldier
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #923979
Posted Tuesday, June 7, 2011 8:09 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 1, 2013 2:00 AM
Points: 3, Visits: 180
Hi Guys,

Im looking at adding a simple job to monitor an internal website and its external site. Ive set up the job and its running fine, Only thing is its always raising the alert.

Ive changed the url to "google" and get the same results, Have I missed something or has anyone had this issue?

Help would be much apreciated
Post #1121485
Posted Sunday, May 20, 2012 11:43 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, March 22, 2013 12:13 AM
Points: 19, Visits: 128
Hi SQL Guru's,

Can i use this code where i can login into website with credentials and check the latency.

if latency is beyond the thresshold then it need to fire the email and pager too.

is that possible..

if possible then help me to get the code.

Thank you.
Post #1303181
Posted Monday, August 19, 2013 3:34 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, November 26, 2014 9:53 AM
Points: 3,475, Visits: 584

...how exactly can one create a "job" in SQL Server 2005 Express?
Is it possible?
-- Mark Kamoski
[/quote]

Hi Mark,

One can schedule SQL Server job in Windows Task Schedule using OSQL or SQLCMD. This is an example of the content of the .bat batch file for one of my jobs that sends emails
osql -Sservername -UuserName -PPassword -dDatabaseName -Q"exec DbName.dbo.SPnamel" >"C:\LogName.txt" -n -m-1

One thing that I question is the line for specifying the profile name. While the rest of the scrip works well, sending an email returns an error aabout invalid profile nameas I expected, because the mail server name is not profile name unless the system administrator set up a few profiles with the names same as mail server names.

Yelena




Regards,
Yelena Varshal

Post #1486030
Posted Wednesday, December 25, 2013 5:23 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: 2 days ago @ 5:57 PM
Points: 22, Visits: 91
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
Post #1525919
Posted Friday, September 19, 2014 12:34 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, November 21, 2014 6:54 AM
Points: 26, Visits: 175
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
Post #1615434
Posted Friday, September 19, 2014 4:48 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, December 24, 2014 11:44 AM
Points: 2,509, Visits: 1,592
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!
Post #1615473
Posted Friday, October 10, 2014 4:53 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: 2 days ago @ 5:57 PM
Points: 22, Visits: 91
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'
Post #1624596
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse