Page 3 of 3

Re: Monitoring MySQL Servers

Posted: Tue May 21, 2013 3:01 am
by MSPk
The plugin seems to be working fine. we now get a message saying "CRITICAL : Unable to get replication info" for all slave parameters - Slave I/O, Slave Lag, Slave SQL

I have chked with my DB admin and they say that the user has access to the replication info.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'USERID'@'%' IDENTIFIED BY PASSWORD 'somepassword' |

Also, Can you please let me know what kind of privilages are required for the user to monitor MySQL DB's in general (all the parameters from the wizard).

Re: Monitoring MySQL Servers

Posted: Tue May 21, 2013 4:43 pm
by slansing
To use all of the modes available in the check_mysql_health plugin the defined user must have access to these abilities:

Code: Select all

       connection-time          (Time to connect to the server)
       uptime                   (Time the server is running)
       threads-connected        (Number of currently open connections)
       threadcache-hitrate      (Hit rate of the thread-cache)
       slave-lag                (Seconds behind master)
       slave-io-running         (Slave io running: Yes)
       slave-sql-running        (Slave sql running: Yes)
       qcache-hitrate           (Query cache hitrate)
       qcache-lowmem-prunes     (Query cache entries pruned because of low memory)
       keycache-hitrate         (MyISAM key cache hitrate)
       bufferpool-hitrate       (InnoDB buffer pool hitrate)
       bufferpool-wait-free     (InnoDB buffer pool waits for clean page available)
       log-waits                (InnoDB log waits because of a too small log buffer)
       tablecache-hitrate       (Table cache hitrate)
       table-lock-contention    (Table lock contention)
       index-usage              (Usage of indices)
       tmp-disk-tables          (Percent of temp tables created on disk)
       slow-queries             (Slow queries)
       long-running-procs       (long running processes)
       cluster-ndbd-running     (ndnd nodes are up and running)
       sql                      (any sql command returning a single number)
The privilege definition will differ from what is defined above, but they will be fairly similar, you could crack open a privilege listing and compare the names.

Re: Monitoring MySQL Servers

Posted: Tue May 21, 2013 4:53 pm
by scottwilkerson
The plugin creator also has this to say in the README

Code: Select all

How to prepare the database for monitoring
--------------------------------------

GRANT USAGE ON *.* TO 'nagios'@'nagiosserver' IDENTIFIED BY 'nagiospassword';
Not totally helpful, but it looks like they are expecting user to have all permissions

Re: Monitoring MySQL Servers

Posted: Wed May 22, 2013 9:37 am
by MSPk
I have observed (and also reported in my earlier threads) that the slow-queries service is not getting created though we tick the checkbox against the slow queries parameter while configuring MySQL parameters via Wizard. I guess this is an issue with the wizard.

we are using Nagios XI 2012R1.8

Re: Monitoring MySQL Servers

Posted: Wed May 22, 2013 11:54 am
by slansing
I have confirmed this as a bug, and I am going to talk to the developer about it, can you also file a bug report at:

http://tracker.nagios.com/ on this? That would help us greatly! Thanks!

Re: Monitoring MySQL Servers

Posted: Wed May 22, 2013 12:23 pm
by scottwilkerson
No need to file the tracker, it has been fixed.

Install attached wizard through Admin -> Manage Wizards

Re: Monitoring MySQL Servers

Posted: Fri Jan 09, 2015 11:18 am
by eclypse
I was getting the error below even with version 1.2 of this wizard. This would happen to me when there was a legitimate issue with slave replication (aside from the slave just being behind).
Can't locate object method "errstr" via package "DBD::MySQL::Server::Connection::Dbi" at ./check_mysql_health line 368.

To fix it, I changed all instances of errstr() to {errstr} in check_mysql_health:

Code: Select all

diff check_mysql_health.bak check_mysql_health
366c366
<           "unable to get slave lag, because io thead is not running");
---
>           "unable to get slave lag, because io thread is not running");
369c369
<           $self->{handle}->errstr() ? $self->{handle}->errstr() : "");
---
>           $self->{handle}->{errstr} ? $self->{handle}->{errstr} : "");
380c380
<           $self->{handle}->errstr() ? $self->{handle}->errstr() : "");
---
>           $self->{handle}->{errstr} ? $self->{handle}->{errstr} : "");
391c391
<           $self->{handle}->errstr() ? $self->{handle}->errstr() : "");
---
>           $self->{handle}->{errstr} ? $self->{handle}->{errstr} : "");

I found the information for this fix here:
http://labs.consol.de/vanilla/index.php ... mment_1660

Re: Monitoring MySQL Servers

Posted: Fri Jan 09, 2015 11:32 am
by tmcdonald
Thank you for the post!

This topic is quite old so I will be locking it now.