Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have just tried check_mysqld that I found on monitoringexchange.org, but it turned out that it outputs in a format that either NRPE 2.12 or Nagios 3.2.1 doesn't understand.

Can anyone recommend a check plugin for Nagios 3 that works with NRPE?

share|improve this question

closed as off-topic by Magellan, cole, Tim Brigham, Sven, Ward Oct 12 '13 at 1:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they tend to become obsolete quickly. Instead, describe your situation and the specific problem you're trying to solve." – Magellan, cole, Tim Brigham, Sven, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

up vote 1 down vote accepted

Well, I tried the check_mysqld plugin from William Leibzon and it works great. You can indeed control much more variables than the standard nagios plugin. I just dropped the plugin in /usr/local/nagios/libexec and ran it from the cli and it works. I added it to the nagios (opsview, in fact, but the engine is nagios) checks and now I have nice graphics. So maybe there is something you did not set up properly with it.

A few things: run the plugin as user nagios from the shell. If the database is a remote server, verify that the user and server you are using the plugin from may query the mysql server and the database you are pulling data from (standard is database: mysql).

My check is like this:

nagios@host:$ cd /usr/local/nagios/libexec
$./check_mysqld.pl -H hostname -u user -a slow_queries -w 44 -c 55 -f
MYSQL 5.0.51a-24+lenny4 OK - slow_queries=0 | slow_queries=0

the -u is the mysql user at the database server. This database user has no password to query the mysql database.

share|improve this answer
    
I now gave it another try since you wrote it worked for you. I figured it didn't support NRPE or Nagios 3.x. The problem was that I had to change the library path for utils.pm. When done, it worked right away! =) Btw. Are 44 and 55 the values you use for slow_queries? I am looking for good values to use. –  Sandra Jul 26 '10 at 19:21
    
sorry for the delay, holidays ;-). You should ask your DBA as to what slow_queries values are correct for your environment. Check the mysql docs: dev.mysql.com/doc/refman/5.0/en/… –  natxo asenjo Aug 11 '10 at 18:35

What would you like to check?

I am using the check_mysql that comes with the plugins package on my Centos nagios box to remotely monitor MySQL. There is no need for NRPE with this setup.

share|improve this answer
    
Very interesting. I have compiled Nagios, so I dare not to install the RPM's. I am using Centos 5. If possible would I like to check threads_running, threads_connected, and threads_cached. But I don't know what "normal practice" is to monitor on mysql. What are you monitoring? I like using NRPE because it makes life easier for me, as all the other plugins are configured to use NRPE =) –  Sandra Jul 21 '10 at 3:14
    
If you compiled nagios, compile the nagios plugins as well :-) nagios.org/download/plugins –  natxo asenjo Jul 21 '10 at 9:40
    
I have =) My Nagios setup works for all the default plugins like check_load, check_disk, check_http and so on. I just need a plugin for checking mysql that works with NRPE... –  Sandra Jul 21 '10 at 11:07
    
so is check_mysql not among the plugins that got compiled? I do not know where the rest are, but just cd to that folder and see if it's there. I just install the packages (rpm, deb) from the distribution repositories and so far, so good. –  natxo asenjo Jul 23 '10 at 8:30

There is a very good need for NRPE in situations where MSQL is not to be open to queries from hosts other than localhost, or when the mysqld process cannot be bumped to allow a configuration change.

~

Adding commands to check via NRPE is really simple. For Mysql Add the following line to your nrpe.cfg file:

command[check_mysql]=sudo /usr/lib/nagios/plugins/check_mysql -u'user' -p'pass'

Here is your Command definition for Nagios: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_mysql

Add this line to your /etc/sudoers: nagios ALL=(ALL) NOPASSWD:/usr/lib/nagios/plugins/check_mysql

Make sure you aren't allowing command line parameters to be passed to the command: dont_blame_nrpe=0

~

To create any other NRPE command replace 'check_mysql' with the name of the command you wish to create, and the path to the actual command after sudo. Same for the sudoers file.

  • HTH ~ Dan.
share|improve this answer
    
Note that this command leaves your password in the process list, which means a user which can see your privileges can see your mysql password, by, for example, using the top command. –  droope Oct 8 '13 at 3:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.