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.

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Subash

Hi All,

I am new to Percona plugins for monitoring MySQL in nagios.

Can anyone please elobrate the process and help me to succeesfullly apply the plugins in my environemtn.

Thanks,
subash

Tom Diederich

Hi Subash, you should ask that question on our Percona forums. Here’s the URL to the Percona Monitoring Plugins category: http://www.perconaforum.com/index.php?t=thread&frm_id=15&

matteo

Hi,
Is there any issue tracker ?
when trying to check string with special char the script crash on awk.

/usr/lib64/nagios/plugins/pmp-check-mysql-status -C ‘!=’ -T str -x datetime_format -c “%Y-%m-%d %H:%i:%s” OR
/usr/lib64/nagios/plugins/pmp-check-mysql-status -C ‘!=’ -T str -x log_error -c /var/log/mysql/error.log

awk: cmd. line:8: if ( /var/log/mysql/error.log != /var/log/mysql/error.log ) {
awk: cmd. line:8: ^ syntax error
awk: cmd. line:8: if ( /var/log/mysql/error.log != /var/log/mysql/error.log ) {
awk: cmd. line:8: ^ syntax error
awk: cmd. line:8: if ( /var/log/mysql/error.log != /var/log/mysql/error.log ) {
awk: cmd. line:8: ^ syntax error
awk: cmd. line:8: if ( /var/log/mysql/error.log != /var/log/mysql/error.log ) {
awk: cmd. line:8: ^ syntax error
awk: cmd. line:21: if ( /var/log/mysql/error.log != 0 ) {
awk: cmd. line:21: ^ syntax error
awk: cmd. line:21: if ( /var/log/mysql/error.log != 0 ) {
awk: cmd. line:21: ^ syntax error

The link provided above as percona forum goes to an empty page.

Thanks