We have migrated our machines from centos to linux 8 version. And after this the Nagios has been upgrade to 4.4.14 version. In which it keeps reporting about the check_mysql_health plugin error.
(No output on stdout) stderr: my variable self masks earlier declaration in same scope at /usr/lib64/nagios/plugins/check_mysql_health line 1064.
Even I am not able to check the plugin version
[root@nagios-data plugins]# ./check_mysql_health -V
"my" variable $self masks earlier declaration in same scope at ./check_mysql_health line 1064.
"my" variable $message masks earlier declaration in same scope at ./check_mysql_health line 1065.
"my" variable $self masks earlier declaration in same scope at ./check_mysql_health line 1070.
"my" variable $message masks earlier declaration in same scope at ./check_mysql_health line 1071.
syntax error at ./check_mysql_health line 1050, near "$llevel qw(CRITICAL WARNING UNKNOWN OK)"
Global symbol "$llevel" requires explicit package name (did you forget to declare "my $llevel"?) at ./check_mysql_health line 1051.
Global symbol "$self" requires explicit package name (did you forget to declare "my $self"?) at ./check_mysql_health line 1052.
Global symbol "$llevel" requires explicit package name (did you forget to declare "my $llevel"?) at ./check_mysql_health line 1052.
Can't redeclare "my" in "my" at ./check_mysql_health line 1059, near "my"
syntax error at ./check_mysql_health line 1061, near "}"
Can't redeclare "my" in "my" at ./check_mysql_health line 1065, near "my"
syntax error at ./check_mysql_health line 1067, near "}"
Can't redeclare "my" in "my" at ./check_mysql_health line 1071, near "my"
syntax error at ./check_mysql_health line 1073, near "}"
./check_mysql_health has too many errors.
Nagios check_mysql_health has been failing with plugin error
Re: Nagios check_mysql_health has been failing with plugin error
You may need to reinstall the script using that docs include with its tar file.
Re: Nagios check_mysql_health has been failing with plugin error
Can you share the step for that or any reference document
Re: Nagios check_mysql_health has been failing with plugin error
I saw that earlier but in my existing one I have only two file under plugin check_mysql_health and check_mysql_health.pl
In the latest repo I could see it is a directory. Do i need to replace that directory for check_mysql_health ?
In the latest repo I could see it is a directory. Do i need to replace that directory for check_mysql_health ?
Re: Nagios check_mysql_health has been failing with plugin error
Hi @kg2857,
Can you respond on this
Can you respond on this
Re: Nagios check_mysql_health has been failing with plugin error
I saw that earlier but in my existing one I have only two file under plugin check_mysql_health and check_mysql_health.plkg2857 wrote: ↑Tue May 20, 2025 12:22 am Follow the links.
https://exchange.nagios.org/directory/m ... th/details
In the latest repo I could see it is a directory. Do i need to replace that directory for check_mysql_health ?
Re: Nagios check_mysql_health has been failing with plugin error
Don't extract the tar file in the plugins dir.
Re: Nagios check_mysql_health has been failing with plugin error
What are the perl packages required for this
[root@nagios-data plugins]# perl -cw ./check_mysql_health
Can't locate Time/HiRes.pm in @INC (you may need to install the Time::HiRes module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./check_mysql_health line 803.
BEGIN failed--compilation aborted at ./check_mysql_health line 803.
[root@nagios-data plugins]#
If I update this version perl-Time-HiRes-1.9764-459.module+el8.10.0+90267+7012ad3b then seeing the error message shared in the post
[root@nagios-data plugins]# perl -cw ./check_mysql_health
Can't locate Time/HiRes.pm in @INC (you may need to install the Time::HiRes module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./check_mysql_health line 803.
BEGIN failed--compilation aborted at ./check_mysql_health line 803.
[root@nagios-data plugins]#
If I update this version perl-Time-HiRes-1.9764-459.module+el8.10.0+90267+7012ad3b then seeing the error message shared in the post