Monitoring MySQL Servers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring MySQL Servers

Post by abrist »

MSPk wrote:The new issue I have is with multiple instances on a single server. we have a server where multiple MySQL databases are configured to listen on different ports (3306,3307,3308,3309). while configuring the DB's on ports 3307,3308,3309, if we use the respective Instance names I get an error, however if we use the name of the instance on port 3306 it works fine....I'm trying to understand if we are indeed getting the values from different databases from these checks or not.
If you are indeed checking different ports, you should be receiving the metrics for the instance running on that port.
MSPk wrote: The other issue is, we dont seem to get the slow_queries service created even if we check the box while configuring, seems to be an issue with the wizard itself. Please check and confirm.
Could you post an example (full command) of one of your slow_queries checks that is failing?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Monitoring MySQL Servers

Post by MSPk »

I meant the check itself isn't created if we go via the wizard. We have configured around 5 DB's today using the mysql server wizard with the checkbox against slow queries ticked, but none of the checks were created.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MySQL Servers

Post by lmiltchev »

...if we use the respective Instance names I get an error, however if we use the name of the instance on port 3306 it works fine....
Yes, you need to use the correct port number for each instance. You can double check the ports by running:

Code: Select all

netstat -nlp | grep mysql
Be sure to check out our Knowledgebase for helpful articles and solutions!
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Monitoring MySQL Servers

Post by MSPk »

Hi,

I have configured the parameters Slave I/O, Slave Lag and Slave SQL on few servers and on each server these parameters show the status as critical and the status information as Null without any other information. Please suggest
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Monitoring MySQL Servers

Post by abrist »

Can you run the check from the cli? What are the full commands for the checks?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Monitoring MySQL Servers

Post by MSPk »

This is the output we get when run through cli

[root@localhost libexec]# ./check_mysql_health --hostname ipaddress --port 3306 --username userid --password "pwd" --database mysql --mode slave-lag
Can't locate object method "errstr" via package "DBD::MySQL::Server::Connection::Dbi" at ./check_mysql_health line 368.

[root@localhost libexec]# ./check_mysql_health --hostname ipaddress --port 3306 --username userid --password "pwd" --database mysql --mode slave-io-running
Can't locate object method "errstr" via package "DBD::MySQL::Server::Connection::Dbi" at ./check_mysql_health line 379.

[root@localhost libexec]# ./check_mysql_health --hostname ipaddress --port 3306 --username userid --password "pwd" --database mysql --mode slave-sql-running
Can't locate object method "errstr" via package "DBD::MySQL::Server::Connection::Dbi" at ./check_mysql_health line 390.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Monitoring MySQL Servers

Post by slansing »

Are you able to run the plugin with a mode other than the slave derivatives you showed as an example?

I did a bit of digging and there was an old bug with the usage of this mode, if we can verify others work for you we may be able to back track to the source of this problem.. can you send us a copy of your check_mysql_health as well? To make it easier you can download it from the XI UI in your browser at Admin > Manage Plugins. Thanks a ton! Additionally, what version of Nagios Xi are you running?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MySQL Servers

Post by lmiltchev »

In addition, you may want to check out this link:

http://labs.consol.de/forum/#/index.php ... health-/p1

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Monitoring MySQL Servers

Post by MSPk »

Yes the other modes work fine, it only the slave parameters which end up with an error on the cli and a (null) on the nagios interface.

Here is a copy of the check_mysql_health plugin.
New Compressed (zipped) Folder.zip
we are using the latest version of nagios available for download on your website - Nagios XI 2012R1.8
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring MySQL Servers

Post by scottwilkerson »

I believe I have it fixed in the attached file...

Lets make a backup of you current file

Code: Select all

cp /usr/local/nagios/libexec/check_mysql_health /usr/local/nagios/libexec/check_mysql_health~
Then unzip the attached file and upload through Admin -> Manage Plugins
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked