Nagios check_mysql_health has been failing with plugin error
Posted: Mon May 19, 2025 10:36 pm
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.
(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.