?
Solved

detect network outage

Posted on 2013-06-18
5
Medium Priority
?
283 Views
Last Modified: 2013-06-19
How can I get my asp.net application to give me a message indicating the network is down?  Can I test whatever code you give me by pulling the network cable out of the back of my PC or do I need to wait for a genuine outage?

I just realised that if the app is on the web server and the application on the user's machine can't connect to that web server then no ASP code will be executed.  What about something on the user's machine or do you have any other suggestions?

Related to this, is there a way of detecting a failure to connect to the database and sending a proper excepction message?
0
Comment
Question by:AlHal2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Rob
ID: 39258501
As you say your network is down (from your point of view) if you pull the cable out of the back of your pc BUT from the webserver's view (and your .NET app) there is nothing wrong.

I'm assuming you mean if your webserver is disconnected from the "rest of the world"?  Usually this would be done by another server or machine on the network that is monitoring your webserver or application or service.  

There are many off the shelf products for this such as Nagios.  Quick google search to find others

Unless I'm missing something, there is really no need for your app to detect whether it is online or not as that wasn't what it was designed for yeah?  sure it can detect whether it's been able to connect to a database or not or open a file properly or whatever but as for actual monitoring I would go with an IT Monitoring tool.

When you're app does fail to connect to the database it would be a good idea to log it in a file and send an email to yourself etc.  If the network is down then you'll have other issues anyway.
0
 

Author Comment

by:AlHal2
ID: 39258979
The problem we were having is that the GUIs seemed to be down (ie when people clicked the link it failed) for a few minutes then fine again.
I assumed it was a network issue, but it could have been a server issue.  It was not a database issue as the error message appeared before any db connection had been made.
Would Nagios and co detect this?
0
 
LVL 43

Accepted Solution

by:
Rob earned 1000 total points
ID: 39259055
Nagios has a steep learning curve but it does have its benefits because it can be configured to look and monitor virtually anything.  

Hard to say what to configure when you're not sure what the issue is... what was the failure message.  Anything in the logs on the server etc?
0
 

Author Closing Comment

by:AlHal2
ID: 39259081
All I know is that Internet explorer sometimes says the site is not available.  
I also need to find out about server logs.
I guess you've answered the question, so here are the points.
0
 
LVL 43

Expert Comment

by:Rob
ID: 39259127
thanks for the points... i'll keep a lookout if you post any more questions
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question