Last post Jan 21, 2015 09:48 AM by dst101
Jan 21, 2015 02:54 AM|dst101|LINK
I have been trying to figure out how to email out to myself when a website goes down. I remember looking a web page a while back and I was sure there was a setting in the web.config that you can set so if the application pool stops it the application will
Can anyone shed any light?
Sorry if this is the wrong section.
Jan 21, 2015 04:15 AM|IbrahimIslam|LINK
What you can do is hook up Application_End event and inside it send an email:
protected void Application_End(object sender, EventArgs e)
//Send an email
Jan 21, 2015 04:34 AM|dst101|LINK
Yeah, I guess I could set that up in my global.asax
I was looking specifically for if the application pool freezes or hangs it will send out a specific email. I think it's called Health Monitoring in the web.config file.
Jan 21, 2015 05:27 AM|dst101|LINK
Going down the Application_End route as this seems to be far more straight forward for my needs.
How would you capture the actual message from this or would it be a case of just informing one self that the application is frozen?
Jan 21, 2015 05:51 AM|AidyF|LINK
If your site is down....how is it going to send you an email? For your code to run your site needs to be up.
Most people implement a polling solution for this where you periodically request a page on your site and if you get an error response then send an email. There are third-party services you can subscribe to that will do this for you if you give them a url
to monitor, and I'm sure there are lots of free apps\scripts already out there to do this too.
Jan 21, 2015 07:10 AM|dst101|LINK
Don't suppose you have any urls handy?
Jan 21, 2015 08:45 AM|AidyF|LINK
I googled "site up status" and found this
most third party ones are going to cost you. If you google for an app or a script, or just write something yourself as a console app (google "asp.net httpwebrequest") and set it up in windows scheduler. These things are all outside the scope of this forum
Jan 21, 2015 09:48 AM|dst101|LINK
Currently trying this one, I'll see how it goes: