SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Monitor your website or any URL from SQL SERVER


Monitor your website or any URL from SQL SERVER

Author
Message
jed-850078
jed-850078
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 7
Or you could use a cheap external website monitoring service such as www.watchour.com! :-D

Personally, I would leave SQL out of the loop as an application platform and let it do what it does best: manage data.
Robert Davis
Robert Davis
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2838 Visits: 1623
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 MVP
Database Engineer at BlueMountain Capital Management
be.raduk
be.raduk
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 182
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
sanath.kumar.kura
sanath.kumar.kura
SSC Rookie
SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)SSC Rookie (31 reputation)

Group: General Forum Members
Points: 31 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.
Yelena Varshal
Yelena Varshal
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4700 Visits: 596
...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

terry.home
terry.home
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 188
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
mauriciorpp
mauriciorpp
SSC-Enthusiastic
SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)SSC-Enthusiastic (174 reputation)

Group: General Forum Members
Points: 174 Visits: 257
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
Miles Neale
Miles Neale
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3080 Visits: 1694
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!
terry.home
terry.home
Valued Member
Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)Valued Member (70 reputation)

Group: General Forum Members
Points: 70 Visits: 188
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'
Iwas Bornready
Iwas Bornready
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14072 Visits: 885
On the surface looks good, will dig in now.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search