VMWARE monitors not Working after installing SDK

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
faizanmalik
Posts: 8
Joined: Sat Feb 02, 2019 9:00 am

VMWARE monitors not Working after installing SDK

Post by faizanmalik »

Hi Folks,

I recently installed VMware SDK 7 but im getting below mentioned error. Any suggestions here?

OS version: CentOS Linux release 8.4.2105

Installed SDK: VMware-vSphere-Perl-SDK-7.0.0-16815913.x86_64.tar.gz

Error: Unknown-VMWARE_API UNKNOWN - Failed to load module VMware::VIRuntime. Download and install 'VMware vSphere SDK for Perl', available at https://my.vmware.com/group/vmware/downloads

Full error message: Can't locate VMware/VIRuntime.pm in @INC (you may need to install the VMware::VIRuntime module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/local/nagios/libexec/check_vmware_api.pl line 546.

Installed modules are:
App::cpanminus
Bytes::Random::Secure
Capture::Tiny
Class::Accessor
Convert::ASN1
Crypt::OpenSSL::Bignum
Crypt::OpenSSL::Guess
Crypt::OpenSSL::RSA
Crypt::OpenSSL::Random
Crypt::Random::Seed
Crypt::Random::TESHA2
Crypt::SSLeay
Crypt::X509
Devel::CheckLib
Exception::Class
Getopt::Long
HTTP::Date
IO::Interactive::Tiny
List::MoreUtils
List::MoreUtils::XS
Math::Random::ISAAC
Mock::Config
Module::Build
Nagios::Monitoring::Plugin
Net::INET6Glue
Params::Validate
Path::Class
Perl
Test::Fatal
Test::LeakTrace
Test::NoWarnings
Test::Requires
Time::Duration
Time::HiRes
UUID
UUID::Random
Best,
Fai
You do not have the required permissions to view the files attached to this post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: VMWARE monitors not Working after installing SDK

Post by gsmith »

Hi,

Did you install the prerequisites for the Perl SDK ?

You might as well go ahead and run these:

Code: Select all

yum install -y libxml2-devel libxml2 libuuid-devel perl-XML-LibXML perl-Env
yum remove perl-Crypt-SSLeay -y
export PERL_MM_USE_DEFAULT=1
cpan -i App::cpanminus
cpanm Crypt::SSLeay --dev
cpan -i Nagios::Monitoring::Plugin Nagios::Monitoring::Plugin::Functions
Let me know how you make out.

Thanks!
faizanmalik
Posts: 8
Joined: Sat Feb 02, 2019 9:00 am

Re: VMWARE monitors not Working after installing SDK

Post by faizanmalik »

Yes, i have installed the SDK pre-reqs.
1 cmd from the list has error. (cpanm Crypt::SSLeay --dev) (error: Finding Crypt::SSLeay on cpanmetadb failed)

[root@lnagiosapp ~]# yum install -y libxml2-devel libxml2 libuuid-devel perl-XML-LibXML perl-Env
Failed loading plugin "changelog": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "product-id": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "subscription-manager": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "upload-profile": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "spacewalk": bad magic number in 'six': b'\x03\xf3\r\n'
Last metadata expiration check: 1:49:23 ago on Thu 18 Nov 2021 05:12:09 PM IST.
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!
You have new mail in /var/spool/mail/root
[root@lnagiosapp ~]# yum remove perl-Crypt-SSLeay -y
Failed loading plugin "changelog": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "product-id": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "subscription-manager": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "upload-profile": bad magic number in 'six': b'\x03\xf3\r\n'
Failed loading plugin "spacewalk": bad magic number in 'six': b'\x03\xf3\r\n'
No match for argument: perl-Crypt-SSLeay
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
[root@lnagiosapp ~]# export PERL_MM_USE_DEFAULT=1
[root@lnagiosapp ~]# cpan -i App::cpanminus

Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/root/.local/share/.cpan/Metadata'
Database was generated on Wed, 27 Oct 2021 05:55:50 GMT
CPAN: LWP::UserAgent loaded ok (v6.34)
CPAN: Time::HiRes loaded ok (v1.9764)
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/root/.local/share/.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/.local/share/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Thu, 18 Nov 2021 12:41:02 GMT
.............
New CPAN.pm version (v2.28) 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/.local/share/.cpan/sources/modules/03modlist.data.gz'
DONE
Writing /root/.local/share/.cpan/Metadata
CPAN: Module::CoreList loaded ok (v5.20181130)
App::cpanminus is up to date (1.7044).
[root@lnagiosapp ~]# cpanm Crypt::SSLeay --dev
! Finding Crypt::SSLeay on cpanmetadb failed.
! cannot open file '/root/.cpanm/sources/http%www.cpan.org/02packages.details.txt.gz': No such file or directory opening compressed index
! Couldn't find module or a distribution Crypt::SSLeay
[root@lnagiosapp ~]# cpan -i Nagios::Monitoring::Plugin Nagios::Monitoring::Plugin::Functions
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/root/.local/share/.cpan/Metadata'
Database was generated on Thu, 18 Nov 2021 12:41:02 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).
You have new mail in /var/spool/mail/root
[root@lnagiosapp ~]#

Regards,
Fai
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: VMWARE monitors not Working after installing SDK

Post by gsmith »

hi
From a command line please run:

Code: Select all

wget http://www.cpan.org/modules/02packages.details.txt.gz
Was it able to get the file?

If not there is probably a proxy server between your server and the internet.

To add your proxy setting to cpan:

Code: Select all

cpan
 o conf /proxy/
Now look at your value for http_proxy, if it is empty proceed with next line:

Code: Select all

 o conf init http_proxy
Type ENTER, then enter the value.

Code: Select all

 http_proxy         [http://my_url_to_proxy:my_port]
Please let me know if that was the problem or if it is still causing problems.

Thanks
faizanmalik
Posts: 8
Joined: Sat Feb 02, 2019 9:00 am

Re: VMWARE monitors not Working after installing SDK

Post by faizanmalik »

cpan is already configured with proxy. i was able to download the file from
wget http://www.cpan.org/modules/02packages.details.txt.gz

However, now i saw that the below file does not exist: (VMware folder also didnt exist)
/usr/share/perl5/VMware/VICommon.pm

output:

cd /usr/local/share/perl5/
App/ Devel/ Math/ Test/
Bytes/ Exception/ Mock/ Time/
Capture/ Getopt/ Module/ UUID/
Class/ HTTP/ Nagios/ x86_64-linux-thread-multi/
Convert/ IO/ Net/
Crypt/ List/ Path/



vmware SDK was installed also several times. i doesn't show any errors.

[# ./vmware-install.pl EULA_AGREED=yes
A previous installation of vSphere CLI has been detected.

The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

/etc/vmware-vcli/installer.sh: line 186: db_answer_--EULA_AGREED=yes: command not found
You have a version of vSphere CLI installed. Continuing will remove it in
preparation for installing a new vSphere CLI. Do you want to continue?
[yes]

/etc/vmware-vcli/installer.sh: line 186: db_answer_--EULA_AGREED=yes: command not found
Uninstalling the tar installation of vSphere CLI.

The removal of vSphere CLI 7.0.0 build-16815913 for Linux completed
successfully.

Installing vSphere CLI 7.0.0 build-16815913 for Linux.

Not tested with Net::FTP version 3.11 at /usr/local/share/perl5/Net/INET6Glue/FTP.pm line 15.
somebody else already implements FTP IPv6 support - skipping Net::INET6Glue::FTP
In which directory do you want to install the executable files?
[/usr/bin]

Please wait while copying vSphere CLI files...

The installation of vSphere CLI 7.0.0 build-16815913 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
"/usr/bin/vmware-uninstall-vSphere-CLI.pl".

This installer has successfully installed the vSphere SDK for Perl.

The following Perl modules were found on the system but may be too old to work
with vSphere CLI:

Socket6 0.28 or newer

Enjoy,

--the VMware team
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: VMWARE monitors not Working after installing SDK

Post by gsmith »

Hi

It looks like the Perl SDK installed correctly, even though there might be an issue with IP v6
connections.

Did you try running the VMWare Config Wizard?

Thanks
faizanmalik
Posts: 8
Joined: Sat Feb 02, 2019 9:00 am

Re: VMWARE monitors not Working after installing SDK

Post by faizanmalik »

Yes i ran the VMWare wizard and added the host, but getting same error UNKNOWN (screenshot attached)

Full error Below:

Unknown
VMWARE_API UNKNOWN - Failed to load module VMware::VIRuntime. Download and install 'VMware vSphere SDK for Perl', available at https://my.vmware.com/group/vmware/downloads

Download the latest version of the vSphere SDK for Perl from VMware.
In this example we use VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz,
but the instructions should apply to other versions as well.

You may need to install additional packages and Perl modules on your server,
see https://kb.op5.com/x/pYEK for
more information and package names for op5 APS / CentOS 6 / RHEL 6.

Upload the .tar.gz file to your op5 Monitor server's /root dir and execute:

cd /root
tar xvzf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
./vmware-install.pl

Follow the on screen instructions, described below:

"Creating a new vSphere CLI installer database using the tar4 format.

Installing vSphere CLI 5.1.0 build-780721 for Linux.

You must read and accept the vSphere CLI End User License Agreement to
continue.
Press enter to display it."

<ENTER>

"Read through the License Agreement"
"Do you accept? (yes/no)

yes

"In which directory do you want to install the executable files? [/usr/bin]"

<ENTER>

"Please wait while copying vSphere CLI files...

The installation of vSphere CLI 5.1.0 build-780721 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command:
"/usr/bin/vmware-uninstall-vSphere-CLI.pl".

This installer has successfully installed both vSphere CLI and the vSphere SDK
for Perl.

The following Perl modules were found on the system but may be too old to work
with vSphere CLI:

Compress::Zlib 2.037 or newer
Compress::Raw::Zlib 2.037 or newer
version 0.78 or newer
IO::Compress::Base 2.037 or newer
IO::Compress::Zlib::Constants 2.037 or newer
LWP::Protocol::https 5.805 or newer

Enjoy,

--the VMware team"

Note: None of the Perl modules mentioned as "may be too old" are needed for check_vmware_api to work.

Full error message: Can't locate VMware/VIRuntime.pm in @INC (you may need to install the VMware::VIRuntime module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/local/nagios/libexec/check_vmware_api.pl line 546.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: VMWARE monitors not Working after installing SDK

Post by ssax »

What is the full output of these commands as root:

Code: Select all

find / -name VIRuntime.pm
find / -name VIRuntime.pm -exec ls -l {} \;
env
su - nagios
env
faizanmalik
Posts: 8
Joined: Sat Feb 02, 2019 9:00 am

Re: VMWARE monitors not Working after installing SDK

Post by faizanmalik »

Hi Sean,

Please find below:

[root@**NAG-HOST** tmp]# find / -name VIRuntime.pm
find: ‘/proc/820419’: No such file or directory
/root/vmware-vsphere-cli-distrib/lib/VMware/share/VMware/VIRuntime.pm
/usr/lib/vmware-vcli/VMware/share/VMware/VIRuntime.pm


[root@**NAG-HOST** tmp]# find / -name VIRuntime.pm -exec ls -l {} \;
find: ‘/proc/820670’: No such file or directory
-r--r--r-- 1 root root 510 Aug 28 2020 /root/vmware-vsphere-cli-distrib/lib/VMware/share/VMware/VIRuntime.pm
-r--r--r-- 1 root root 510 Nov 23 23:55 /usr/lib/vmware-vcli/VMware/share/VMware/VIRuntime.pm


[root@**NAG-HOST** tmp]# env
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.oga=01;36:*.opus=01;36:*.spx=01;36:*.xspf=01;36:
SSH_CONNECTION=172.36.0.31 59517 172.36.0.152 22
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
DISPLAY=localhost:10.0
HOSTNAME=**NAG-HOST**
OLDPWD=/root
S_COLORS=auto
which_declare=declare -f
XDG_SESSION_ID=28599
USER=root
PWD=/tmp
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/root
SSH_CLIENT=172.36.0.31 59517 22
XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
SSH_TTY=/dev/pts/0
MAIL=/var/spool/mail/root
TERM=xterm
SHELL=/bin/bash
TC_LIB_DIR=/usr/lib64/tc
SHLVL=1
GDK_BACKEND=x11
LOGNAME=root
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-6m5lzJwWCq,guid=3d342b54ccadbb385a273eaf61a5e3a2
XDG_RUNTIME_DIR=/run/user/0
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
HISTSIZE=1000
LESSOPEN=||/usr/bin/lesspipe.sh %s
BASH_FUNC_which%%=() { ( alias;
eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
}
_=/usr/bin/env



[root@**NAG-HOST** tmp]# su - nagios


[nagios@**NAG-HOST** ~]$ env
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.oga=01;36:*.opus=01;36:*.spx=01;36:*.xspf=01;36:
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
HOSTNAME=**NAG-HOST**
S_COLORS=auto
which_declare=declare -f
USER=nagios
PWD=/home/nagios
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/home/nagios
XDG_DATA_DIRS=/home/nagios/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
MAIL=/var/spool/mail/nagios
SHELL=/bin/bash
TERM=xterm
TC_LIB_DIR=/usr/lib64/tc
SHLVL=1
LOGNAME=nagios
PATH=/home/nagios/.local/bin:/home/nagios/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
HISTSIZE=1000
LESSOPEN=||/usr/bin/lesspipe.sh %s
BASH_FUNC_which%%=() { ( alias;
eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
}
_=/usr/bin/env
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: VMWARE monitors not Working after installing SDK

Post by ssax »

To fix this:

Code: Select all

bad magic number in 'six': b'\x03\xf3\r\n'
Do this:

Code: Select all

mv /usr/bin/six.pyc /usr/bin/six.pyc.bak
Then do this:

Code: Select all

ln -sfn /usr/bin/python3 /usr/bin/python
Then run through the guide again to uninstall/reinstall (if it detects it as installed it will uninstall it, then run it again to install it) and send us the entire output again:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Then send the output of this one after doing that:

Code: Select all

find / -name VIRuntime.pm -exec ls -l {} \;
Locked