How to Get Your Server to Email You After it Fails
If your company ever runs important scheduled tasks like a regular server health check, you likely get an email update every time the check returns healthy. These updates pile up in your inbox and over time it’s easy to ignore them. Then, as soon as you get comfortable, your server breaks, the emails aren’t sent, and the problem goes unnoticed for far too long. In other words, the lack of an “everything is healthy” status email can be hard to detect.
- Sign up for an account at https://deadmanssnitch.com
-
Create a new snitch by giving it a name and alert email, and choose your desired interval. The interval is how often you expect your process to check-in (e.g. once an hour, once a day, etc). If your job runs at an interval different than what we currently have, round up. For example, if you have a job that runs every 10 minutes, choose the 15-minute interval. Click Save.
</li>
-
The next page has the unique snitch URL that DMS creates for you: https://nosnch.in/c2354d53d2.
If you were using your snitch to monitor a cron job it would look something like:
$ run\_backups\_or\_something && https://nosnch.in/c2354d53d2
To get the snitch email address click "Email" in the left column.
</li>
- Add your snitch email address to the list of addresses the server (or whatever it is you're trying to monitor) already sends to.
-
The fastest way to tell the snitch to start checking is to paste the original snitch in URL form, https://nosnch.in/c2354d53d2, in the browser. Otherwise, you can wait until it receives its first email and that will kick off the check-in process.
Once your snitch starts checking, if it doesn't receive an email during the previous period, DMS will send you an alert email like this:
</li> </ol> That's it! Now you can enjoy your new clutter-free inbox and have the peace of mind that if a mission-critical task doesn't run when it should, you'll be alerted. :) Please Note: While email check-ins are fairly reliable, there are some caveats. The first is that email can be easily delayed. Between the time an email is sent and the time it's received, it usually goes through several intermediaries which may spool, delay, retry, or redirect the email before it finally arrives at Dead Man's Snitch. With check-ins being time sensitive, false alerts *could* occur if a snitch checks-in towards the end of its period. For this reason we suggest using HTTPS when possible. You can start monitoring your server health (or any scheduled task or email) with Dead Man's Snitch for free with our [Lone Snitch plan](https://deadmanssnitch.com/users/sign_up?plan=the_lone_snitch). For more snitches or enhanced intervals [paid plans](https://deadmanssnitch.com/plans) start at $5/month. Happy Snitching!
Comments