473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to monitor website availability from an ASP.NET app?

Bob
I'm trying to centralize some of the resources (images, css, footer etc)
into one website that all my apps can use. Simple things like images and
css would be a direct link (e.g. img
src=http://myresourcecenter.com/images/logo.gif) and some others would be a
web service call with the results to be cached by individual apps. The
problem is, if this resource website is down, all my web apps would cease to
work, so I need to put in a mirror site of it. I'm thinking of setting up
some sort of mechanism in these individual apps that can ping a page on the
resource website, say, every 60 seconds, if it doesn't get a response (e.g.
throws a WebException), it assumes the resource website is down and changes
the value of the global variable that holds the resource website URL to that
of the mirror site. Essentially a simple failover solution. The problem is
I'm not sure what's the best way to do this. I guess this "monitor" has to
be in the same thread as the web app so it can change the value for the
entire app, but the only way to fire the check regularly I can think of is
using Thread.Sleep(). This halts the entire web app though. So I need
something that doesn't interfere with the web app thread, and at the same
time can change a global value in the app. Could anyone comment on what
I'm thinking? whether this is doable, and possibly how?

Thanks a lot in advance.
Bob
Nov 18 '05 #1
1 1727
Hi Bob:

What you are looking for is certainly doable. Check out the Timer
class in the System.Threading namespace. You could start the timer
during the Application_Start event, and at the interval you specify it
will fire a method on a thread from the thread pool. Inside the
callback method check the availability of the web service and adjust
your settings accordingly.

HTH,

--
Scott
http://www.OdeToCode.com

On Wed, 21 Jul 2004 20:17:41 -0500, " Bob" <bo*******@yahoo.com>
wrote:
I'm trying to centralize some of the resources (images, css, footer etc)
into one website that all my apps can use. Simple things like images and
css would be a direct link (e.g. img
src=http://myresourcecenter.com/images/logo.gif) and some others would be a
web service call with the results to be cached by individual apps. The
problem is, if this resource website is down, all my web apps would cease to
work, so I need to put in a mirror site of it. I'm thinking of setting up
some sort of mechanism in these individual apps that can ping a page on the
resource website, say, every 60 seconds, if it doesn't get a response (e.g.
throws a WebException), it assumes the resource website is down and changes
the value of the global variable that holds the resource website URL to that
of the mirror site. Essentially a simple failover solution. The problem is
I'm not sure what's the best way to do this. I guess this "monitor" has to
be in the same thread as the web app so it can change the value for the
entire app, but the only way to fire the check regularly I can think of is
using Thread.Sleep(). This halts the entire web app though. So I need
something that doesn't interfere with the web app thread, and at the same
time can change a global value in the app. Could anyone comment on what
I'm thinking? whether this is doable, and possibly how?

Thanks a lot in advance.
Bob


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: support | last post by:
Do you need to monitor websites for changes? iSpySiteWatch (http://www.ispysitewatch.com) is an Automated WebSite Monitoring system that can track changes on most websites. We've tested it to...
7
by: Jonathan Wood | last post by:
Greetings, I have extensive programming experience (nearly 20 years) but have yet to write a full-blown Web application. In fact, I have done hardly any server/client/database programming at...
4
by: Jeremy | last post by:
How can I prove uptime (or quantify downtime) on an ASP.NET 1.1 Web application (running on an IIS6 Windows Server Standard server)? What's going on here is that I'm considering the feasability...
4
by: Brian Kitt | last post by:
Hey all. I'm not sure where to go with this post. I have a website that needs to be monitored externally, not internally. We want to get a feel for the response time (and more specifically up...
2
by: Lan W via DBMonster.com | last post by:
Hi, We have DB2 8.2 installed on Linux Redhat server. What's the easy way to monitor the linux server to check the database availability? since our first goal is just want to be notified that...
1
by: aalves | last post by:
Hi, I am new to this website, so I hope I am posting this in the right spot. I have been developing this interface fpr a program, but I developed it while using a big monitor and now when I went to...
1
by: Justin Voelker | last post by:
I have built a php website with a messaging system where users of a website can send messages to each other and they will appear in the other users inbox for viewing next time they log in. In a bar...
3
by: xtoughyx | last post by:
I work for a company which assigns me tasks via their own online portal/webpage which requires a log-in. These tasks are posted very irregularly, and there are frequently long periods in which no...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.