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.

What if my server could email me as soon as it goes down?</strong> </center> ## Dead Man's Snitch After hearing so many people ask if [Dead Man's Snitch](https://deadmanssnitch.com) can monitor emails the same way it monitors cron jobs (*if my job/task doesn't run when it should, alert me*) we decided to add [email check-in functionality](http://blog.deadmanssnitch.com/post/118364791235/snitch-check-in-via-email) to DMS. With email check-in, DMS will alert you as soon as your server stops pinging DMS with regular emails. Given DMS' already negative-type alerting, this new feature didn't take much to build. DMS creates a unique snitch token that you can configure your server to send its status updates to. Then, depending on how often you expect your job to run, if your snitch hasn't been emailed within a given time, DMS will alert you. When we built this feature it was important that it be simple and quick to set up. Here's how it works.
  1. Sign up for an account at https://deadmanssnitch.com
  2. 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.

    Creating a new snitch </li>

  3. 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.

    Snitch setup instructions </li>

  4. Add your snitch email address to the list of addresses the server (or whatever it is you're trying to monitor) already sends to.
  5. 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.

    Checking-in via browser

    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:

    Example alert email </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!

Photo of Spencer Toth

Spencer has a passion for helping businesses grow. With experience ranging from user onboarding and retention to marketing funnels and email campaigns, Spencer brings a unique perspective and vision to our internal and client projects. After graduating from Grand Valley State University with a Marketing Degree, completing the National Science Foundation’s, Michigan I-CORPS Product Commercialization bootcamp, and learning Lean Start-up Principles and the Business Model Canvas while working at Start Garden, he joined our team to help us with marketing and strategy.

Spencer lives in Grand Rapids with his wife, Kierstin, and son, Carter. When his nose isn’t buried in books about business or startups, he can be found woodworking or sailing the Great Lakes.

Comments