Chapter 19. Monitoring Your Systems

In Chapter 17, we discussed how to measure database performance. By taking regular measurements of the health of your systems, you can learn about database problems before they are happening, send a message as they are happening, and have information to help debug after they happen. This type of automated monitoring can make your job easier, whether monitoring alerts you when a system is down, or gives you the information necessary for capacity planning.

It is surprising how many organizations do not have any automated alerting, because "when the database is down, we know because users call us." Alerting frameworks are easy to set up and use and can let you know not only about current problems, but alert you to what may be a problem in the future. For example, a full disk will cause mysqld to hang and may cause corrupt data and log files. Alerting when a disk is approaching capacity can save a lot of problems—you can clear out some space and make sure the disk does not become full.

Sending an alert is as easy as sending an e-mail; most pagers and cell phones have e-mail addresses that can be set up to send the device a message. It may be tempting to schedule scripts that, when they fail, send an e-mail. However, there is a lot more flexibility in alerting systems that do not take much time to set up. Alerting systems come bundled with basic checks, ...

Get MySQL® Administrator's Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.