Most of the Nagios plugins included with the Percona Monitoring Plugins are purpose-built for specific scenarios that I found in my research to be frequent, severe, or subtle causes of problems in MySQL systems. They are intentionally not generic because I wanted to focus on doing one thing with each plugin, and doing it excellently. This makes the plugins easier to set up and use, and I believe it should help avoid some of the common problems such as spammy alerts.
There is one “generic, flexible” plugin, however, which you can use for fairly arbitrary checks of status counters and variables. This is the pmp-check-mysql-status plugin, which can perform computations on status variables. By default, I recommend using it only for two purposes:
- Check whether the Uptime variable is too small, indicating the server has been restarted
- Check whether Threads_connected is approaching max_connections, which can be inconvenient to solve in some environments
However, there’s no reason not to use the plugin for other purposes if you want. Here are some of the things you could do:
- Compare a counter to a threshold
- Compare a counter to a variable or another counter
- Add, subtract, multiply, and divide counters or variables
- Transform a ratio into a percentage
- Compute the rate of change over time for one or more counters (e.g. queries per second)
The documentation contains examples of how to do all of these things, if you so desire.