Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The status of the "Query Rate" service return a critical state and with the message "(return code of 25 is out of bounds)" at each check #4

Open
iceripper opened this issue Jan 4, 2017 · 0 comments

Comments

@iceripper
Copy link

Problem:
If one falls in the case of nominal (OK), the method "mode_lastrun_varcomp" returns an uninitialized value of the variable "$ comp_res_code".
The variable "$ comp_res_code" is used in line 99:
if ($comp_res_code == WARNING) { …}
in the bloc of code:
case /varcomp/ {…}

Since its value is zero, we will systematically have the following error:
Use of uninitialized value $comp_res_code in numeric eq (==) at ./mysql_health_check.pl line 99.
Use of uninitialized value $comp_res_code in numeric eq (==) at ./mysql_health_check.pl line 102.
Use of uninitialized value $code in hash element at /usr/share/perl5/vendor_perl/Nagios/Plugin.pm line 177.
Use of uninitialized value $code in concatenation (.) or string at /usr/share/perl5/vendor_perl/Nagios/Plugin.pm line 177.
Invalid error code '' at ./mysql_health_check.pl line 110

Solution:

Initialize the return variable "$ comp_res_code" in the case of "OK", in the last block of else of the method "mode_lastrun_varcomp":
sub mode_lastrun_varcomp
{
......
} else {
pdebug("Parsed ($parsed_expr) = ($expr_res) | (".$expr_res . $np->opts->comparison_critical.") == (".$expr_res . $np->opts->comparison_warning.") == FALSE\n");
$comp_res_code = OK;
}
return $comp_res_code, $expr_res;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant