<p>There's no plugin for that... it wouldn't quite make sense. If the site went down, the plugin would be down too.</p>

<p>Your best bet is to find a 3rd party service to monitor the site's uptime. There are several services which will alert (via text or email) if your site becomes unavailable. Here are a few examples...</p>

<ul>
<li><a href="https://uptimerobot.com/" rel="nofollow">Uptime Robot</a></li>
<li><a href="https://newrelic.com/" rel="nofollow">New Relic</a></li>
<li><a href="https://www.pingdom.com/" rel="nofollow">Pingdom</a></li>
</ul>

CC BY-SA 3.0
2016-08-13T02:44:39.847Z
Ahh, that makes sense :) Uptime robot monitoring is already installed for that site and I haven't reveived an alert. Maybe server is not serving 500 code? I haven't tested it, because of putting off fire.
Tibor Szasz
CC BY-SA 3.0
2016-08-13T03:09:21.670Z
FWIW [Constellix Sonar](http://constellix.com/sonar/sonarchecks/) can also be useful because it'll capture traceroutes from its nodes that report issues. Also free for some undefined amount of time.
Matt Stein
CC BY-SA 3.0
2016-08-13T03:24:43.757Z
Thanks, I already use some similar solution on another project.

Is there an onError hook for craft? If it can display a nice maintenance page, I'm sure it can send and error report before :)
Tibor Szasz
CC BY-SA 3.0
2016-08-13T19:07:48.987Z
@TiborSzasz No `onError` hook. Craft has some internal logic to serve `{errorCode}.html` templates for internal exceptions, but if your database burns down and someone hacks into your server and uninstalls Apache obviously that stuff goes out the window. Like Lindsey says, use a third party service to monitor uptime, and possibly a third party service like [Rollbar](https://github.com/boboldehampsink/rollbar) to monitor exceptions.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-08-13T19:48:37.593Z
Sure, but it would be handy. Uptime Robot didn't catch the 503 error that goes with faulty DB connection. I should check out other services.
Tibor Szasz
CC BY-SA 3.0
2016-08-13T19:49:27.173Z
@MatsMikkelRummelhoff if you post the no hook as answer I accept it.
Tibor Szasz
CC BY-SA 3.0
2016-08-14T02:00:08.927Z
@MatsMikkelRummelhoff Craft doesn't explicitly define an onError event because Yii already provides one (http://www.yiiframework.com/doc/api/1.1/CApplication#onError-detail) as well as onException (http://www.yiiframework.com/doc/api/1.1/CApplication#onException-detail)
Brad Bell
CC BY-SA 3.0
2016-08-14T05:53:32.420Z
Thats good to know, @BradBell - wasnt aware of that.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-08-13T02:18:30.503Z
2016-08-13T02:18:30.503Z
Lindsey D
<p>I have a Craft installation on DigitalOcean, with the smallest package:</p>

<pre><code>512MB Memory
1 Core Processor
20GB SSD Disk
1TB Transfer
</code></pre>

<p>I installed the default LAMP droplet.</p>

<p>PROBLEM:
MySQL crashes from time to time. There were no significant server load either.</p>

<p>What might be a root cause? </p>

<p><strong>Bonus question:</strong></p>

<p>Is there a plugin that automatically reports when the site is down?</p>

<p><a href="https://i.sstatic.net/RzXjx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RzXjx.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-08-13T10:39:17.210Z
Question is still open, when Craft crashes gracefully, I would assume it to fire a hook event. Note that crash can mean a faulty MySQL connection too, but for the visitors it doesn't matter.
Tibor Szasz
<server>
Plugin to report when site becomes unavailable
# Plugin to report when site becomes unavailable

(Asked by: username_0 on 2016-08-13)

I have a Craft installation on DigitalOcean, with the smallest package:
512MB Memory
1 Core Processor
20GB SSD Disk
1TB Transfer

I installed the default LAMP droplet.
PROBLEM:
MySQL crashes from time to time. There were no significant server load either.
What might be a root cause? 
Bonus question:
Is there a plugin that automatically reports when the site is down?

**Tags:** server

> **Comments:**
> **username_0**: Question is still open, when Craft crashes gracefully, I would assume it to fire a hook event. Note that crash can mean a faulty MySQL connection too, but for the visitors it doesn't matter.  

---

## 1 answers

### Answer by username_1 on 2016-08-13. Score: 3

There's no plugin for that... it wouldn't quite make sense. If the site went down, the plugin would be down too.

Your best bet is to find a 3rd party service to monitor the site's uptime. There are several services which will alert (via text or email) if your site becomes unavailable. Here are a few examples...

* [Uptime Robot](https://uptimerobot.com/)
* [New Relic](https://newrelic.com/)
* [Pingdom](https://www.pingdom.com/)

> **Comments:**
> **username_0**: Ahh, that makes sense :) Uptime robot monitoring is already installed for that site and I haven't reveived an alert. Maybe server is not serving 500 code? I haven't tested it, because of putting off fire.  
> **username_2**: FWIW [Constellix Sonar](http://constellix.com/sonar/sonarchecks/) can also be useful because it'll capture traceroutes from its nodes that report issues. Also free for some undefined amount of time.  
> **username_0**: Thanks, I already use some similar solution on another project.  Is there an onError hook for craft? If it can display a nice maintenance page, I'm sure it can send and error report before :)  
> **username_3**: @TiborSzasz No `onError` hook. Craft has some internal logic to serve `{errorCode}.html` templates for internal exceptions, but if your database burns down and someone hacks into your server and uninstalls Apache obviously that stuff goes out the window. Like Lindsey says, use a third party service to monitor uptime, and possibly a third party service like [Rollbar](https://github.com/boboldehampsink/rollbar) to monitor exceptions.  
> **username_0**: Sure, but it would be handy. Uptime Robot didn't catch the 503 error that goes with faulty DB connection. I should check out other services.  
> **username_0**: @MatsMikkelRummelhoff if you post the no hook as answer I accept it.  
> **username_4**: @MatsMikkelRummelhoff Craft doesn't explicitly define an onError event because Yii already provides one (http://www.yiiframework.com/doc/api/1.1/CApplication#onError-detail) as well as onException (http://www.yiiframework.com/doc/api/1.1/CApplication#onException-detail)  
> **username_3**: Thats good to know, @BradBell - wasnt aware of that.  

---

