VMWare Plugin Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

VMWare Plugin Error

Post 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.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: VMWare Plugin Error

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: VMWare Plugin Error

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: VMWare Plugin Error

Post 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.

Last edited by rajasegar on Thu Apr 02, 2015 7:19 pm, edited 1 time in total.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: VMWare Plugin Error

Post 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.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: VMWare Plugin Error

Post 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
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: VMWare Plugin Error

Post 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.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked