BaldMansMojo / check_vmware_esx

chech_vmware_esx Fork of check_vmware_api.pl
GNU General Public License v2.0
124 stars 67 forks source link

Can't locate help.pm #47

Closed colinengland closed 5 years ago

colinengland commented 10 years ago

Hey,

Wonder if you can help, have been having issues with the plugin. I have installed all the pre-requesites as far as I can tell but cannot seem to get the plugin to run. The message I am getting is about a missing help.pm? But when looking on the web/cpan I cannot seem to find a help.pm module?

The error message is as follows:

./check_vmware_esx.pl

Possible precedence issue with control flow operator at /usr/local/lib/perl5/5.20.0/VMware/VICommon.pm line 2147. Can't locate help.pm in @INC (you may need to install the help module) (@INC contains: modules /usr/local/lib/perl5/site_perl/5.20.0/x86_64-linux /usr/local/lib/perl5/site_perl/5.20.0 /usr/local/lib/perl5/5.20.0/x86_64-linux /usr/local/lib/perl5/5.20.0 .) at ./check_vmware_esx.pl line 1171. BEGIN failed--compilation aborted at ./check_vmware_esx.pl line 1171.

Many Thanks

Colin England

BaldMansMojo commented 10 years ago

Hi Colin,

you haven't read the Readme carefully:

"Adjust the path for the modules directory (use lib "modules") to fit your system (for example: use lib "/usr/local/libexec/myplugins/modules")" Should be around line 87. To find all of the modules the plugin must know where to search. In my installation I have a directory /usr/lib/nagios/vmware (for the plugin, some helper scripts etc.) and within this directory / have the modules subdirectory. So I have:

use lib "/usr/lib/nagios/vmware/modules" Best regards Martin

miken32 commented 8 years ago

I had the same problem. This is kind of silly having to modify files, it makes updates difficult. Something like this is a bit awkward due to the check for symlinks, but it works for us:


use Cwd;

# Own modules
if ( -l __FILE__ )
   {
   use lib dirname(Cwd::abs_path(readlink(__FILE__))) . "/modules";
   }
else
   {
   use lib dirname(__FILE__) . "/modules";
   }
BaldMansMojo commented 8 years ago

Good idea. I will implement it in the next release.

miken32 commented 5 years ago

Here I am 3 years later doing a re-install on a new machine. Same problem as before...

BaldMansMojo commented 5 years ago

Should be same as before. You have to adapt the modules path in check_vmware_esx.pl. That should work.

To make it easier I will put all defaults in a config file with next release. I haveN#t implmented your patch because there are folks outside placing the modules in a complete different directory.

Regards Martin

BaldMansMojo commented 5 years ago

Give me a short notice if it works or if the problem still remains. Martin

miken32 commented 5 years ago

Since the people placing the modules in a completely different directory are already having to edit the file, my fix just makes it easier for the rest of us. I think that looking in the same directory as the script for a modules directory should be the default behaviour if nothing is specified in a config file. I'll check out your changes once they're committed.

BaldMansMojo commented 5 years ago

Ok - this issue was aopen as a reminder for me. But currently I'm working on moving all defaults etc to a config file to make it obsolete to adapt the code.