check_mysql_health : Return code of 25 is out of bounds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

check_mysql_health : Return code of 25 is out of bounds

Post by vAJ »

Have a check of a MySQL database that is constantly throwing the error: (Return code of 25 is out of bounds)

Command:

Code: Select all

/usr/local/nagios/libexec/check_mysql_health --hostname=aus02nqhpmysq01.dev.*******.com --port=3306 --username=NagiosMon --password="**********" --database=information_schema --mode threadcache-hitrate --warning 90: --critical 80:
When I run this from he cl, I occasionally get this error:

Code: Select all

Illegal division by zero at /usr/local/nagios/libexec/check_mysql_health line 488.
Thoughts? I'm running the latest version of this wizard. check_mysql_health (2.1)
Andrew J. - Do you even grok?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mysql_health : Return code of 25 is out of bounds

Post by scottwilkerson »

Does it return correct sometimes?

By chance does aus02nqhpmysq01.dev.*******.com point to a loadbalancer IP or something of that nature, or is it a single server?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_mysql_health : Return code of 25 is out of bounds

Post by vAJ »

Single server and it responds well most of the time. One single poll will fail on occasion. Next poll corrects itself.

Looks like it's in the calculation of connections/sec, like python craps out on itself or something.
Andrew J. - Do you even grok?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mysql_health : Return code of 25 is out of bounds

Post by scottwilkerson »

Could this server be reaching it max-connections (configurable in /etc/my.cnf)?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_mysql_health : Return code of 25 is out of bounds

Post by vAJ »

It's a lightly used dev/test mysql database with 5000 max connections. Doubt it's getting close to that. I found a python junkie on our development team that is going to dig into this script.
Andrew J. - Do you even grok?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_mysql_health : Return code of 25 is out of bounds

Post by tmcdonald »

Did you mean to type a return of 255 or 25? If it is 25 I would suspect the script itself assigning the return value incorrectly (check the if/else clauses for the warn/crit values) but for 255 it could be anything really.
Former Nagios employee
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_mysql_health : Return code of 25 is out of bounds

Post by vAJ »

It's a 25.

The illegal division error when running from CLI makes me think it's a problem with the python itself. Looking at stats of the target in real time show it's doing absolutely nothing and I can only reproduce when execute the check in rapid fire.
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_mysql_health : Return code of 25 is out of bounds

Post by abrist »

vAJ wrote:The illegal division error when running from CLI makes me think it's a problem with the python itself. Looking at stats of the target in real time show it's doing absolutely nothing and I can only reproduce when execute the check in rapid fire.
I would suspect that this is internal to the script itself. Just to clarify, the issue only happens when you run the same check multiple times near simultaneously?
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.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_mysql_health : Return code of 25 is out of bounds

Post by vAJ »

Well, it happens occasionally as a scheduled check. My assumption is when the script returns the "Illeal Division" to Nagios, Nagios then displays that as "Return Code 25..."
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_mysql_health : Return code of 25 is out of bounds

Post by abrist »

Are these checks running through multiple gearman servers? (One of the servers could have an issue)
It could also be that occasionally the check returns a bad value or unexpected character that is breaking the check or it could be occasionally timing out.
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.
Locked