Page 1 of 1

VMWare Plugin Error

Posted: Wed Apr 01, 2015 10:42 pm
by rajasegar
The perl plugin was working fine under mod gearman.
It was the redirected to the external gearman worker. Was getting errors so decided to revert back to local gearman worker.
However this error does not go away anymore.

From command line it works fine. Just when using gearman it screws up.

Please assist as all our vmware monitoring is down now.


From Command Line

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl -H "10.17.12.20" -u "root" -p 'test!' -l "CPU" ""-s usage"" -w "70%" -c "85%"  ""  ""
Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 14
ESX3 OK - cpu usage=42.90 % | cpu_usage=42.90%;70;85

From Gearman Execution. It is using integrated Perl interpreter

Code: Select all

**ePN failed to compile /usr/local/nagios/libexec/check_esx3.pl: "Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 14
BEGIN failed--compilation aborted at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 7,
Compilation failed in require at /usr/local/share/perl5/Nagios/Plugin.pm line 5.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Nagios/Plugin.pm line 5.
Compilation failed in require at (eval 1) line 40.
BEGIN failed--compilation aborted at (eval 1) line 40." at /usr/share/mod_gearman/mod_gearman_p1.pl line 240.

Code: Select all

[nagios@nagiosprodcol1 debug]$ vi /usr/local/share/perl5/Nagios/Plugin/Functions.pm
package Nagios::Plugin::Functions;

use strict;
use warnings;
use base 'Monitoring::Plugin::Functions';

# Remember to update Nagios::Plugins as well
our $VERSION = "0.37";

BEGIN {
    warnings::warnif("deprecated", "Nagios::Plugin is deprecated, use Monitoring::Plugin instead.")
        unless $Monitoring::Plugin::deprecated_warned;
    $Monitoring::Plugin::deprecated_warned = 1;
};

our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);

Please advice how to fix this problem.

Re: VMWare Plugin Error

Posted: Thu Apr 02, 2015 10:49 am
by jdalrymple
The simple solution is probably to not use the embedded perl for that plugin:

https://labs.consol.de/nagios/mod-gearm ... edded_perl

Modify the plugin per the note there to disable EPN.

Re: VMWare Plugin Error

Posted: Thu Apr 02, 2015 10:56 am
by lmiltchev
How did you install "check_esx3.pl" plugin? What is the version of the plugin that you are currently using?

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl -V

Re: VMWare Plugin Error

Posted: Thu Apr 02, 2015 5:59 pm
by rajasegar
lmiltchev wrote:How did you install "check_esx3.pl" plugin? What is the version of the plugin that you are currently using?

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl -V
Just copied it to the libexec directory. It was working fine running under Gearman for almost 1 year.
Did not do any changes to gearman last few day or Perl.

Code: Select all

Original Version
[nagios@nagiosprodxi1 libexec]$ ./check_esx3.pl.org -V
Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 14.
check_esx3.pl.org 0.2.0

Original version with all Nagios::Plugin changed to Monitoring::Plugin
[nagios@nagiosprodxi1 libexec]$ ./check_esx3.pl -V
check_esx3.pl 0.2.0

Latest
[nagios@nagiosprodxi1 libexec]$ ./check_esx3-0.5.pl -V
check_esx3-0.5.pl 0.5.0
As of them give errors when executed through gearman although it works fine from the command line.

Code: Select all

[nagios@nagiosprodxi1 libexec]$ mod_gearman_mini_epn /usr/local/nagios/libexec/check_esx3.pl -H "10.10.10.10" -u "root" -p 'test' -l "CPU" ""-s usage"" -w "70%" -c "85%"  ""  ""
plugin return code: 3
perl plugin output: '**ePN /usr/local/nagios/libexec/check_esx3.pl: plugin did not call exit()
**ePN /usr/local/nagios/libexec/check_esx3.pl: "Use of uninitialized value $opt in string eq at /usr/share/perl5/Getopt/Long.pm line 487,".

[nagios@nagiosprodxi1 libexec]$ mod_gearman_mini_epn /usr/local/nagios/libexec/check_esx3.pl.org -H "10.17.12.20" -u "root" -p 'test' -l "CPU" ""-s usage"" -w "70%" -c "85%"  ""  ""
embedded perl ran /usr/local/nagios/libexec/check_esx3.pl.org with error **ePN failed to compile /usr/local/nagios/libexec/check_esx3.pl.org: "Nagios::Plugin is deprecated, use Monitoring::Plugin instead. at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 7,
BEGIN failed--compilation aborted at /usr/local/share/perl5/Nagios/Plugin/Functions.pm line 14.
Compilation failed in require at /usr/local/share/perl5/Nagios/Plugin.pm line 5.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Nagios/Plugin.pm line 5.
Compilation failed in require at (eval 1) line 40.
BEGIN failed--compilation aborted at (eval 1) line 40." at /usr/share/mod_gearman/mod_gearman_p1.pl line 240.

[nagios@nagiosprodxi1 libexec]$ mod_gearman_mini_epn /usr/local/nagios/libexec/check_esx3-0.5.pl -H "10.10.10.10" -u "root" -p 'test' -l "CPU" ""-s usage"" -w "70%" -c "85%"  ""  ""
embedded perl ran /usr/local/nagios/libexec/check_esx3-0.5.pl with error **ePN failed to compile /usr/local/nagios/libexec/check_esx3-0.5.pl: "Variable "$blacklist" will not stay shared at (eval 1) line 3797," at /usr/share/mod_gearman/mod_gearman_p1.pl line 240.


Re: VMWare Plugin Error

Posted: Thu Apr 02, 2015 6:15 pm
by rajasegar
jdalrymple wrote:The simple solution is probably to not use the embedded perl for that plugin:

https://labs.consol.de/nagios/mod-gearm ... edded_perl

Modify the plugin per the note there to disable EPN.
Got around the problem by setting # nagios: -epn in the script header.
If anybody got a permanent solution which fixes all the compilation issues, please update.

Thanks.

Re: VMWare Plugin Error

Posted: Fri Apr 03, 2015 9:17 am
by jdalrymple
rajasegar wrote:If anybody got a permanent solution which fixes all the compilation issues, please update.
Since you asked I'll (try) to leave it open but also mark it solved.

Thanks rajasegar

Re: VMWare Plugin Error

Posted: Sun Apr 05, 2015 6:13 pm
by rajasegar
jdalrymple wrote:
rajasegar wrote:If anybody got a permanent solution which fixes all the compilation issues, please update.
Since you asked I'll (try) to leave it open but also mark it solved.

Thanks rajasegar
Please close this case. Thanks.