Automated Website Monitoring 0
Posted Sunday, March 25, 2007 12:37
When you’re using a shared host, you’re generally depending on the hosting provider to monitor your system and keep it healthy. But if you’re running your own server, whether a VPS (virtual private server) or a dedicated server, you’re the one responsible for setting up monitoring and paying attention to the results (unless you’re paying for a fully managed server).
Automated monitoring is a crucial technique for increasing reliability of your systems. If you can catch a problem while it is developing, you can proactively resolve it instead of waiting for it to take your server down and create a panic.
Manually monitoring the server is far too much work to do on an ongoing basis. If this is how you’re checking up on your site, it’s only a matter of time before something goes wrong and you don’t notice it until it’s been a problem for some time. Monitoring is a task that scripts can perform much better than humans.
Fortunately, there’s a wide assortment of free and low-cost tools that automate the vast majority of the work and, once set up, make it almost painless to closely monitor the operation of your server. You can get emails or SMS alerts when any sort of threshold is crossed, so you’ll know as soon as possible if there’s something that should be looked into. And failed services can be restarted automatically.
No one tool does everything. You need to look at the system in different ways, from different angles, and with different timescales. So it takes a handful of tools providing complementary functions.
Note: There’s many different programs and services available for each of these tasks. The ones I list here are the ones I ended up using, and they worked for me. If you’re using something else that you like, please add a comment. I’m introducing the products briefly in this post, and will go into more detail on each in a dedicated post.
Monit
Monit is a program that you install on your server and configure for the services that you want it to monitor. For each service, you can specify a series of conditions (such as memory or CPU usage rising above a threshold) that will cause an alert to be generated, and other conditions that will cause an automatic attempt to restart the service. You can also configure it to provide a password-protected web page for see the statistics for all the monitored services.
Logwatch
Logwatch is a program you install on your server and typically set to run once a day. It scours the multitude of system and application logs and creates a daily summary, which you can receive by email. The program is highly configurable but comes with a set of defaults that will get you started quickly. (I’m not entirely sure that I feel better, however, knowing that there were 612 attempts to log in as root yesterday, and 485 different common names were attempted as logins.)
Site24×7
Site24×7 is a hosted service that pings your web sites, generates alerts for slow or failing loads, and logs performance statistics. It can look for specific words on the page, so you can ensure that the database is working and the application is functioning at some level. You can set it up to send an SMS message to your cell phone if a site goes down or crosses a performance threshold.
Google Analytics
Google Analytics you no doubt already know about. It is a great, free, hosted analytics service. It’s more for looking at the traffic patterns than ensuring that everything is running, but a regular check on the analytics can be another source of hints about issues that need investigation.
Each of these tools needs a post of its own to do it justice. Those posts will be forthcoming over the next few days.
