How to set up detailed website monitoring

The basic premise is this: You have a website you want to monitor. It’s important to you that it works, and you need to know right away when there is a problem with it.

This article will show you how you can set up highly detailed monitoring of your website using the Pingdom uptime monitoring service. A basic Pingdom account comes with five checks, i.e. you can monitor five different things. We will use these five checks to set up monitoring of your website and its surrounding functionality.

The approach here can be applied to other monitoring services as well though there may be some differences in how things work and are set up.

Pingdom check types for monitoring
Above: The different check types available with Pingdom (and even more will come down the line). We only use three of them in this article: the HTTP, DNS and SMTP check types.

We will not go into details on how every single part of the monitoring is actually set up, but the check settings are quite self explanatory, and if you have any problems at all you can always contact our support and ask for advice.

So, let’s get started!

First step – Testing the website

An HTTP check will test that a web page loads correctly. It will only load the HTML of the page, but that is enough to know that the web server is working and is serving pages.

URL

To make sure that real page content is served by the web server, you can make the HTTP check also test for a text string that has to be present on the page. A good example would be for example a copyright notice or something at the bottom of your page that won’t change.

text test

Detects: An HTTP check is useful because it will fail if your network goes down, or if your web server goes down or stops working correctly. When you are also looking for a text string it will also fail when the page content served is incorrect (if your web server for example starts serving blank pages).

Now we have used up one check. This is a good start, but there are additional steps that can be made.

Second step – Testing your database

If your website uses one or several databases (which it probably does), it can be a good idea to make a small script (for example a PHP script) that will perform a quick test accessing the database. The script can output for example “database ok” if successful, and “database fail” if not successful.

Then set up another Pingdom HTTP check that accesses this script and looks for the “ok” text in the output.

Detects: Database access problems on your web server. This is good because a non-responsive database is a relatively common cause for website failure. You have probably seen it yourself on numerous occasions in the past, where a website responds, but the page is filled with database access error messages.

And this approach has a bonus. The cool thing with monitoring a script like this is that you can add other internal tests to the script as well. You can use the same approach to monitoring basically anything locally on your web server, with one or multiple scripts.

Now we have used up two checks, and have even better monitoring coverage of our website.

Third step – Testing your DNS servers

If the authoritative DNS servers for your domain name stop working, all of a sudden web browsers around the world won’t be able to access your website.

The problem is that this change will not be noticed by everyone at the same time. The DNS lookups will be cached on some local DNS servers where your domain name has recently been accessed, but that will only last as long as your domain’s TTL (time to live), which can be anything from a couple of minutes to hours to days depending on your settings. In other words, it can be a hard problem to notice at first, since a lot of frequent users will have the lookup cached, but new visitors won’t be able to reach you.

To catch this right when it happens, it can be a good idea to set up monitoring of the authoritative DNS servers. Usually you have at least two.

Detects: This will detect if your DNS servers are down or unreachable, and since the DNS test also performs a lookup of your domain name, it will also make sure that it resolves to the correct IP address.

DNS check

Setting up the DNS check is pretty self explanatory when you do it, and Pingdom will list your authoritative DNS servers for you (but here is an explanation just in case). We will assume you set up monitoring of the primary and secondary DNS server for your domain name, thus spending another two checks.

Now you have one check left of the initial five.

Fourth step –Testing your image server or email server

If you have the images on your web page (for example UI elements or banners) hosted on a separate server, it can be a good idea to see that this server is responding and delivering images. You can test this with a regular HTTP check with the URL to a small image on your page.

Detects: Any problems reaching your image server, or your image server not delivering images.

An alternative way to spend the fifth check is to set up monitoring of a mail server, for example an SMTP server. This can be very important if your website for example sends out user registration information or newsletters or other information via email. You will want to know that the mail server you are using is up and running. There is a specific monitoring option for SMTP that you can use for this.

Detects: If your SMTP mail server stops responding or is unreachable, which would prevent your website from being able to send emails.

That’s it. We have now used all of the five checks that come with a basic Pingdom account.

Summary of the monitoring set up in this article

With the steps described above there is little that can happen to your website that Pingdom will not be able to detect. You can be alerted of any problems as soon as they happen. With just five checks, you have set up monitoring of:

  • Your website and web server
  • Your database
  • Your DNS servers
  • Your image server and/or email server depending on your needs

You can of course always add extra checks if you feel that five are not enough, but this shows that you can come pretty far with just a basic Pingdom account.

A note on test intervals

All Pingdom checks can be performed as often as every minute. We tend to recommend that our customers use a monitoring resolution of one or five minutes for good accuracy.

check resolution

Conclusion

Even the most reputable web hosts will run into trouble occasionally, and on top of this there are also problems you can accidentally cause yourself.

We hope you found this article helpful as a starting point to setting up monitoring that will catch and alert you of the most common problems that can affect a website.

Leave a Reply

Comments are moderated and not published in real time. All comments that are not related to the post will be removed.