Page 1 of 2

VMWARE SDK install broke WMI perl plugin

Posted: Tue Jan 25, 2022 4:17 pm
by mcockram
Continued from https://support.nagios.com/forum/viewto ... 16&t=62856
Following the Nagios installation document:

Code: Select all

# bash -x ./install_vmplugin.bash 
+ yum install -y libxml2-devel libxml2 libuuid-devel perl-XML-LibXML perl-Env
Updating Subscription Management repositories.
8 prod                                                                                                                   27 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                    43 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                 33 kB/s | 2.8 kB     00:00    
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                                                                 68 kB/s | 2.8 kB     00:00    
Package libxml2-devel-2.9.7-9.el8_4.2.x86_64 is already installed.
Package libxml2-2.9.7-9.el8_4.2.x86_64 is already installed.
Package libuuid-devel-2.32.1-28.el8.x86_64 is already installed.
Package perl-XML-LibXML-1:2.0132-2.el8.x86_64 is already installed.
Package perl-Env-1.04-395.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
+ echo 0
0
+ yum remove perl-Crypt-SSLeay -y
Updating Subscription Management repositories.
No match for argument: perl-Crypt-SSLeay
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
+ echo 0
0
+ export PERL_MM_USE_DEFAULT=1
+ PERL_MM_USE_DEFAULT=1
+ echo 0
0
+ cpan -i App::cpanminus
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 20 Apr 2021 17:17:03 GMT
CPAN: LWP::UserAgent loaded ok (v6.34)
CPAN: Time::HiRes loaded ok (v1.9758)
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
CPAN: Compress::Zlib loaded ok (v2.081)
............................................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Tue, 25 Jan 2022 20:29:03 GMT
.............
  New CPAN.pm version (v2.29) available.
  [Currently running version is v2.18]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


...............................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/03modlist.data.gz
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.cpan/Metadata
Running install for module 'App::cpanminus'
Fetching with LWP:
http://www.cpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
CPAN: Digest::SHA loaded ok (v6.02)
Fetching with LWP:
http://www.cpan.org/authors/id/M/MI/MIYAGAWA/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz ok
'YAML' not installed, will not store persistent state
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v2.150010)
CPAN: CPAN::Meta loaded ok (v2.150010)
CPAN: Module::CoreList loaded ok (v5.20181130)
Configuring M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for App::cpanminus
Writing MYMETA.yml and MYMETA.json
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/perl Makefile.PL -- OK
Running make for M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
cp lib/App/cpanminus/fatscript.pm blib/lib/App/cpanminus/fatscript.pm
cp lib/App/cpanminus.pm blib/lib/App/cpanminus.pm
cp bin/cpanm blib/script/cpanm
"/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpanm
Manifying 1 pod document
Manifying 2 pod documents
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/happy_cpantesters.t .. 1/1 # App::cpanminus/1.7044
t/happy_cpantesters.t .. ok   
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.04 cusr  0.01 csys =  0.08 CPU)
Result: PASS
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying 1 pod document
Manifying 2 pod documents
Installing /usr/local/share/perl5/App/cpanminus.pm
Installing /usr/local/share/perl5/App/cpanminus/fatscript.pm
Installing /usr/local/share/man/man1/cpanm.1
Installing /usr/local/share/man/man3/App::cpanminus.3pm
Installing /usr/local/share/man/man3/App::cpanminus::fatscript.3pm
Installing /usr/local/bin/cpanm
Appending installation info to /usr/lib64/perl5/perllocal.pod
  MIYAGAWA/App-cpanminus-1.7044.tar.gz
  /usr/bin/make install  -- OK
+ echo 0
0
+ cpanm Crypt::SSLeay --dev
--> Working on Crypt::SSLeay
Fetching http://cpan.metacpan.org/authors/id/N/NA/NANIS/Crypt-SSLeay-0.73_06.tar.gz ... OK
==> Found dependencies: Devel::CheckLib
--> Working on Devel::CheckLib
Fetching http://cpan.metacpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.14.tar.gz ... OK
Configuring Devel-CheckLib-1.14 ... OK
==> Found dependencies: Mock::Config, Capture::Tiny
--> Working on Mock::Config
Fetching http://cpan.metacpan.org/authors/id/R/RU/RURBAN/Mock-Config-0.03.tar.gz ... OK
Configuring Mock-Config-0.03 ... OK
Building and testing Mock-Config-0.03 ... OK
Successfully installed Mock-Config-0.03
--> Working on Capture::Tiny
Fetching http://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/Capture-Tiny-0.48.tar.gz ... OK
Configuring Capture-Tiny-0.48 ... OK
Building and testing Capture-Tiny-0.48 ... OK
Successfully installed Capture-Tiny-0.48
Building and testing Devel-CheckLib-1.14 ... OK
Successfully installed Devel-CheckLib-1.14
Configuring Crypt-SSLeay-0.73_06 ... OK
==> Found dependencies: Bytes::Random::Secure
--> Working on Bytes::Random::Secure
Fetching http://cpan.metacpan.org/authors/id/D/DA/DAVIDO/Bytes-Random-Secure-0.29.tar.gz ... OK
Configuring Bytes-Random-Secure-0.29 ... OK
==> Found dependencies: Math::Random::ISAAC, Crypt::Random::Seed
--> Working on Math::Random::ISAAC
Fetching http://cpan.metacpan.org/authors/id/J/JA/JAWNSY/Math-Random-ISAAC-1.004.tar.gz ... OK
Configuring Math-Random-ISAAC-1.004 ... OK
==> Found dependencies: Test::NoWarnings
--> Working on Test::NoWarnings
Fetching http://cpan.metacpan.org/authors/id/H/HA/HAARG/Test-NoWarnings-1.06.tar.gz ... OK
Configuring Test-NoWarnings-1.06 ... OK
Building and testing Test-NoWarnings-1.06 ... OK
Successfully installed Test-NoWarnings-1.06
Building and testing Math-Random-ISAAC-1.004 ... OK
Successfully installed Math-Random-ISAAC-1.004
--> Working on Crypt::Random::Seed
Fetching http://cpan.metacpan.org/authors/id/D/DA/DANAJ/Crypt-Random-Seed-0.03.tar.gz ... OK
Configuring Crypt-Random-Seed-0.03 ... OK
==> Found dependencies: Crypt::Random::TESHA2
--> Working on Crypt::Random::TESHA2
Fetching http://cpan.metacpan.org/authors/id/D/DA/DANAJ/Crypt-Random-TESHA2-0.01.tar.gz ... OK
Configuring Crypt-Random-TESHA2-0.01 ... OK
Building and testing Crypt-Random-TESHA2-0.01 ... OK
Successfully installed Crypt-Random-TESHA2-0.01
Building and testing Crypt-Random-Seed-0.03 ... OK
Successfully installed Crypt-Random-Seed-0.03
Building and testing Bytes-Random-Secure-0.29 ... OK
Successfully installed Bytes-Random-Secure-0.29
Building and testing Crypt-SSLeay-0.73_06 ... OK
Successfully installed Crypt-SSLeay-0.73_06
9 distributions installed
+ echo 0
0
+ cpan -i Nagios::Monitoring::Plugin Nagios::Monitoring::Plugin::Functions
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 25 Jan 2022 20:29:03 GMT
CPAN: Module::CoreList loaded ok (v5.20181130)
Nagios::Monitoring::Plugin is up to date (0.51).
Nagios::Monitoring::Plugin::Functions is up to date (0.51).
+ echo 0
0

Code: Select all

su - nagios -c '/usr/local/nagios/libexec/check_wmi_plus.pl -H <ip> -u <username> -p <password> -m checkdrivesize -a C\: -w 88 -c 95'
Can't locate Devel/StackTrace.pm:   /usr/local/share/perl5/Devel/StackTrace.pm: Permission denied at /usr/share/perl5/vendor_perl/Specio/Exception.pm line 12.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Specio/Exception.pm line 12.
Compilation failed in require at /usr/share/perl5/vendor_perl/Specio/Constraint/Role/Interface.pm line 11.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Specio/Constraint/Role/Interface.pm line 11.
Compilation failed in require at /usr/share/perl5/vendor_perl/Role/Tiny.pm line 52.
Compilation failed in require at /usr/share/perl5/vendor_perl/Specio/Declare.pm line 12.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Specio/Declare.pm line 12.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/DateTime/Types.pm line 12.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/DateTime/Types.pm line 12.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/DateTime/Duration.pm line 12.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/DateTime/Duration.pm line 12.
Compilation failed in require at /usr/lib64/perl5/vendor_perl/DateTime.pm line 14.
BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/DateTime.pm line 14.
Compilation failed in require at /usr/local/nagios/libexec/check_wmi_plus.pl line 57.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_wmi_plus.pl line 57.
+ echo 2
2
+ exit
Tried reinstalling perl-Devel-StackTrace.

Code: Select all

# yum reinstall -y perl-Devel-StackTrace
Updating Subscription Management repositories.
8 prod                                                                                                                   22 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                    49 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)                                                                 38 kB/s | 2.8 kB     00:00    
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)                                                                 28 kB/s | 2.8 kB     00:00    
Dependencies resolved.
========================================================================================================================================================
 Package                              Architecture          Version                       Repository                                               Size
========================================================================================================================================================
Reinstalling:
 perl-Devel-StackTrace                noarch                1:2.03-2.el8                  codeready-builder-for-rhel-8-x86_64-rpms                 35 k

Transaction Summary
========================================================================================================================================================

Total download size: 35 k
Installed size: 47 k
Downloading Packages:
perl-Devel-StackTrace-2.03-2.el8.noarch.rpm                                                                             322 kB/s |  35 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                   304 kB/s |  35 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1 
  Reinstalling     : perl-Devel-StackTrace-1:2.03-2.el8.noarch                                                                                      1/2 
  Cleanup          : perl-Devel-StackTrace-1:2.03-2.el8.noarch                                                                                      2/2 
  Running scriptlet: perl-Devel-StackTrace-1:2.03-2.el8.noarch                                                                                      2/2 
  Verifying        : perl-Devel-StackTrace-1:2.03-2.el8.noarch                                                                                      1/2 
  Verifying        : perl-Devel-StackTrace-1:2.03-2.el8.noarch                                                                                      2/2 
Installed products updated.

Reinstalled:
  perl-Devel-StackTrace-1:2.03-2.el8.noarch 

Re: VMWARE SDK install broke WMI perl plugin

Posted: Tue Jan 25, 2022 4:20 pm
by mcockram
Diagnostic steps from previous topic:

Code: Select all

# bash -x /tmp/diagnose.bash 
+ getenforce
Disabled
+ find /usr/ -type f -name StackTrace.pm
+ read -r fn
++ dirname /usr/share/perl5/vendor_perl/Devel/StackTrace.pm
+ ls -lad /usr/share/perl5/vendor_perl/Devel
drwxr-xr-x. 3 root root 45 Jan 25 16:07 /usr/share/perl5/vendor_perl/Devel
++ dirname /usr/share/perl5/vendor_perl/Devel/StackTrace.pm
+ ls -la /usr/share/perl5/vendor_perl/Devel
total 24
drwxr-xr-x.  3 root root    45 Jan 25 16:07 .
drwxr-xr-x. 71 root root  4096 Jun 17  2021 ..
drwxr-xr-x.  2 root root    22 Jan 25 16:07 StackTrace
-rw-r--r--   1 root root 15692 Nov 18  2017 StackTrace.pm
+ read -r fn
+ perl -MDevel::StackTrace -e exit
+ perl -MDateTime -e exit

Re: VMWARE SDK install broke WMI perl plugin

Posted: Wed Jan 26, 2022 1:55 pm
by dchurch
What's the output from running the following 3 commands as root:

Code: Select all

su - nagios -c 'perl -MDevel::StackTrace -e exit'

su - nagios -c 'strace -etrace=file perl -MDevel::StackTrace -e exit'

su - nagios -c 'strace -etrace=file /usr/local/nagios/libexec/check_wmi_plus.pl -H <ip> -u <username> -p <password> -m checkdrivesize -a C\: -w 88 -c 95'
Note: you may need to install the strace package.

Re: VMWARE SDK install broke WMI perl plugin

Posted: Tue Feb 01, 2022 3:31 pm
by mcockram

Code: Select all

# su - nagios -c 'perl -MDevel::StackTrace -e exit'
Can't locate Devel/StackTrace.pm:   /usr/local/share/perl5/Devel/StackTrace.pm: Permission denied.
BEGIN failed--compilation aborted.

Code: Select all

# su - nagios -c 'strace -etrace=file perl -MDevel::StackTrace -e exit'
execve("/usr/bin/perl", ["perl", "-MDevel::StackTrace", "-e", "exit"], 0x7fff2b152930 /* 22 vars */) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libperl.so.5.26", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_IDENTIFICATION", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_TELEPHONE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_TELEPHONE", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_ADDRESS", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_ADDRESS", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_NAME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_NAME", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_PAPER", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_PAPER", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_MONETARY", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_TIME", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 3
readlink("/proc/self/exe", "/usr/bin/perl", 4095) = 13
openat(AT_FDCWD, "/dev/null", O_RDONLY) = 3
stat("/usr/local/share/perl5/sitecustomize.pl", 0x5613db21a530) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/Devel/StackTrace.pmc", 0x7fff1221bf50) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/Devel/StackTrace.pm", 0x7fff1221bf50) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl5/Devel/StackTrace.pmc", 0x7fff1221bf50) = -1 EACCES (Permission denied)
stat("/usr/local/share/perl5/Devel/StackTrace.pm", 0x7fff1221bf50) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
Can't locate Devel/StackTrace.pm:   /usr/local/share/perl5/Devel/StackTrace.pm: Permission denied.
BEGIN failed--compilation aborted.
+++ exited with 13 +++
su - nagios -c 'strace -etrace=file /usr/local/nagios/libexec/check_wmi_plus.pl -h: attached.

dchurch wrote:What's the output from running the following 3 commands as root:

Code: Select all

su - nagios -c 'perl -MDevel::StackTrace -e exit'

su - nagios -c 'strace -etrace=file perl -MDevel::StackTrace -e exit'

su - nagios -c 'strace -etrace=file /usr/local/nagios/libexec/check_wmi_plus.pl -H <ip> -u <username> -p <password> -m checkdrivesize -a C\: -w 88 -c 95'
Note: you may need to install the strace package.

Re: VMWARE SDK install broke WMI perl plugin

Posted: Tue Feb 01, 2022 5:41 pm
by dchurch
What's the output from the following command?

Code: Select all

ls -lad /usr/local/share/perl5/Devel/StackTrace.pm /usr/local/share/perl5/Devel/ /usr/local/share/perl5/ /usr/local/share/

Re: VMWARE SDK install broke WMI perl plugin

Posted: Mon Feb 07, 2022 7:17 pm
by mcockram
Attached

Re: VMWARE SDK install broke WMI perl plugin

Posted: Tue Feb 08, 2022 6:15 pm
by ssax
Please send the full output as we need to see the permissions on them:

Code: Select all

ls -lad /usr/local/share/perl5/Devel/StackTrace.pm /usr/local/share/perl5/Devel/ /usr/local/share/perl5/ /usr/local/share/
Additionally, if you've changed the umask you can see this issue:

Code: Select all

umask

Re: VMWARE SDK install broke WMI perl plugin

Posted: Wed Feb 09, 2022 9:26 am
by mcockram
I apologize, its attached.
Screen Shot 2022-02-09 at 9.25.31 AM.png

Re: VMWARE SDK install broke WMI perl plugin

Posted: Wed Feb 09, 2022 9:31 am
by mcockram
It is not there before the install either, but /usr/local/nagios/libexec/check_wmi_plus.pl is working fine before I run the below commands from the install document.
###yum install -y libxml2-devel libxml2 libuuid-devel perl-XML-LibXML perl-Env; echo $?
###yum remove perl-Crypt-SSLeay -y; echo $?
###export PERL_MM_USE_DEFAULT=1; echo $?
###cpan -i App::cpanminus; echo $?
###cpanm Crypt::SSLeay --dev; echo $?
###cpan -i Nagios::Monitoring::Plugin Nagios::Monitoring::Plugin::Functions; echo $?

Output Before I run the install and check_wmi_plus.pl works fine:
[~]$ ls -lad /usr/local/share/perl5/Devel/StackTrace.pm /usr/local/share/perl5/Devel/ /usr/local/share/perl5/ /usr/local/share/
ls: cannot access '/usr/local/share/perl5/Devel/StackTrace.pm': No such file or directory
ls: cannot access '/usr/local/share/perl5/Devel/': No such file or directory
drwxr-xr-x. 6 root root 62 Jun 21 2021 /usr/local/share/
drwxr-xr-x. 11 root root 144 Apr 20 2021 /usr/local/share/perl5/
[~]$ umask
0077

Re: VMWARE SDK install broke WMI perl plugin

Posted: Thu Feb 10, 2022 2:28 pm
by ssax
Yeah, I think the umask on the system was changed (which basically impacts the global default permissions mask when creating files/dirs), you'll need to do this to fix the directory permissions but there are likely other permissions issues on the system given the umask is different:

Run this as root to fix the directory permissions for those perl modules:

Code: Select all

find /usr/local/share/perl5 -type d -exec chmod 0755 {} \;
Then test as the nagios user:

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_wmi_plus.pl -H X.X.X.X -u 'username' -p 'password' -m checkdrivesize -a C\: -w 88 -c 95'
Running your system with custom umask changes will usually cause permissions issues because XI doesn't expect the permissions to be different from the defaults (not something we test against).