VMWare Wizard issue

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 Wizard issue

Post by rajasegar »

Nagios XI Enterprise 5.6.14
Red Hat Enterprise Linux Server release 7.6 (Maipo)

Trying to get VMWare wizard to work but got this <It appears as though you have not installed the VMware SDK or ESX plugins on your Nagios XI server. You must have these components properly installed on your system before using this wizard>.

Tried everything but no luck, VMWare SDK installed just fine.


Run check_esx3.pl as nagios

Code: Select all

[nagios@myucbrnagiapp05 libexec]$ ./check_esx3.pl
ESX3 UNKNOWN - Missing perl 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 Perl SDK from VMware.

You may need to install additional packages and Perl modules on your server,
see https://library.nagios.com/library/products/nagios-xi/documentation/monitoring-vmware-with-nagios-xi/
more information on installing the vSphere Perl SDK for CentOS/RHEL 6 & 7.

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

    cd /root
    tar xvzf VMware-vSphere-Perl-<version>.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 <version> 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 <version> 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.
[nagios@myucbrnagiapp05 libexec]$
Running the same thing as root
[nagios@myucbrnagiapp05 libexec]$ sudo ./check_esx3.pl
Usage: check_esx3.pl -D <data_center> | -H <host_name> [ -C <cluster_name> ] [ -N <vm_name> ]
-u <user> -p <pass> | -f <authfile>
-l <command> [ -s <subcommand> ] [ -T <timeshift> ] [ -i <interval> ]
[ -x <black_list> ] [ -o <additional_options> ]
[ -t <timeout> ] [ -w <warn_range> ] [ -c <crit_range> ]
[ -V ] [ -h ]

Missing argument: command
[nagios@myucbrnagiapp05 libexec]$
Running check_vmware_api.pl as nagios and root
[nagios@myucbrnagiapp05 libexec]$ ./check_vmware_api.pl
Socket object version 2.010 does not match bootstrap parameter 2.029 at /usr/lib64/perl5/DynaLoader.pm line 213.
Compilation failed in require at /usr/local/lib64/perl5/Net/SSL.pm line 5.
BEGIN failed--compilation aborted at /usr/local/lib64/perl5/Net/SSL.pm line 5.
Compilation failed in require at ./check_vmware_api.pl line 44.
BEGIN failed--compilation aborted at ./check_vmware_api.pl line 44.


[nagios@myucbrnagiapp05 libexec]$ sudo ./check_vmware_api.pl
Usage: check_vmware_api.pl -D <data_center> | -H <host_name> [ -C <cluster_name> ] [ -N <vm_name> ]
-u <user> -p <pass> | -f <authfile>
-l <command> [ -s <subcommand> ] [ -T <timeshift> ] [ -i <interval> ]
[ -x <black_list> ] [ -o <additional_options> ]
[ -t <timeout> ] [ -w <warn_range> ] [ -c <crit_range> ]
[ -V ] [ -h ]

Missing argument: command
[nagios@myucbrnagiapp05 libexec]$


sudo yum list installed | grep 'libxml2-devel\|xml2\|libuuid-devel'

Code: Select all

[nagios@myucbrnagiapp05 libexec]$ sudo yum list installed | grep 'libxml2-devel\|xml2\|libuuid-devel'
libuuid-devel.x86_64             2.23.2-63.el7               @rhel-7-server-rpms
libxml2.x86_64                   2.9.1-6.el7.4               @rhel-7-server-rpms
libxml2-devel.x86_64             2.9.1-6.el7.4               @rhel-7-server-rpms
libxml2-python.x86_64            2.9.1-6.el7.4               @rhel-7-server-rpms
xml2.x86_64                      0.5-7.el7                   @epel
cpan -a > /tmp/cpan.txt
cpan.txt
sudo yum list installed | grep 'libxml2-devel\|xml2\|libuuid-devel'

Code: Select all

libuuid-devel.x86_64             2.23.2-63.el7               @rhel-7-server-rpms
libxml2.x86_64                   2.9.1-6.el7.4               @rhel-7-server-rpms
libxml2-devel.x86_64             2.9.1-6.el7.4               @rhel-7-server-rpms
libxml2-python.x86_64            2.9.1-6.el7.4               @rhel-7-server-rpms
xml2.x86_64                      0.5-7.el7                   @epel
perl -e 'print join("\n",@INC)' as nagios user and root

Code: Select all

[nagios@myucbrnagiapp05 libexec]$ perl -e 'print join("\n",@INC)'
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5

.[nagios@myucbrnagiapp05 libexec]$ sudo perl -e 'print join("\n",@INC)'
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
[nagios@myucbrnagiapp05 libexec]$
perl --version
[nagios@myucbrnagiapp05 libexec]$ perl --version

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 38 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[nagios@myucbrnagiapp05 libexec]$ sudo perl --version

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 38 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[nagios@myucbrnagiapp05 libexec]$
Please assist.
You do not have the required permissions to view the files attached to this post.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: VMWare Wizard issue

Post by benjaminsmith »

Hi @rajasegar,
It appears as though you have not installed the VMware SDK or ESX plugins on your Nagios XI server. You must have these components properly installed on your system before using this wizard
I just want to verify first that you have installed the VMware SDK? We have an official guide on installing this and any dependencies for this plugin, see:

Monitoring VMware With Nagios XI

Next, there is an error message about outdated Perl modules, to update any old Perl module, you can run the following command:

Code: Select all

cpanm <module>
Then run the following command and post the output for us to review. Thanks.

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl --version
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

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 Wizard issue

Post by rajasegar »

benjaminsmith wrote:Hi @rajasegar,
It appears as though you have not installed the VMware SDK or ESX plugins on your Nagios XI server. You must have these components properly installed on your system before using this wizard
I just want to verify first that you have installed the VMware SDK? We have an official guide on installing this and any dependencies for this plugin, see:

Monitoring VMware With Nagios XI

Next, there is an error message about outdated Perl modules, to update any old Perl module, you can run the following command:

Code: Select all

cpanm <module>
Then run the following command and post the output for us to review. Thanks.

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl --version
I have installed the VMWare SDK successfully by following your document. I think it is the version 7.0

See the result using root and nagios id.
root seems ok
[root@myucbrnagiapp05 ~]# /usr/local/nagios/libexec/check_esx3.pl --version
check_esx3.pl 0.7.1
[root@myucbrnagiapp05 ~]#
[root@myucbrnagiapp05 ~]# su - nagios
Last login: Wed Jun 3 11:34:07 +08 2020 on pts/0
[nagios@myucbrnagiapp05 ~]$ /usr/local/nagios/libexec/check_esx3.pl --version
ESX3 UNKNOWN - Missing perl 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 Perl SDK from VMware.

You may need to install additional packages and Perl modules on your server,
see https://library.nagios.com/library/prod ... nagios-xi/
more information on installing the vSphere Perl SDK for CentOS/RHEL 6 & 7.

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

cd /root
tar xvzf VMware-vSphere-Perl-<version>.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 <version> 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 <version> 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.
[nagios@myucbrnagiapp05 ~]$
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: VMWare Wizard issue

Post by benjaminsmith »

Hi @rajasegar,
See the result using root and nagios id.
root seems ok
Some good information here, thanks. First, let's just make sure the permissions are set right on the plugin itself.

Code: Select all

chown apache.nagios /usr/local/nagios/libexec/check_esx3.pl
chmod 775 /usr/local/nagios/libexec/check_esx3.pl
Then try to test once more as the Nagios user.

Code: Select all

su - nagios
/usr/local/nagios/libexec/check_esx3.pl --version
If it still doesn't work, I found a similar support case that was resolved by adding the following line to the check_esx3.pl plugin (on the top, below the comments):

Code: Select all

require IO::Socket::SSL; IO::Socket::SSL -> import(); IO::Socket::SSL::set_ctx_defaults( SSL_verify_mode => 0 );
Hopefully, that will take care of it, but If not, do you recall which version of the SDK you installed? We recommend using version 6.5.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

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 Wizard issue

Post by rajasegar »

benjaminsmith wrote:Hi @rajasegar,

If it still doesn't work, I found a similar support case that was resolved by adding the following line to the check_esx3.pl plugin (on the top, below the comments):

Code: Select all

require IO::Socket::SSL; IO::Socket::SSL -> import(); IO::Socket::SSL::set_ctx_defaults( SSL_verify_mode => 0 );
Hopefully, that will take care of it, but If not, do you recall which version of the SDK you installed? We recommend using version 6.5.
The permission was right.
After I added the require line above got this new error message.
Running as root still works

Code: Select all

[nagios@myucbrnagiapp05 libexec]$ ./check_esx3.pl
Socket object version 2.010 does not match bootstrap parameter 2.029 at /usr/lib64/perl5/DynaLoader.pm line 213.
Compilation failed in require at /usr/lib64/perl5/IO/Socket.pm line 13.
BEGIN failed--compilation aborted at /usr/lib64/perl5/IO/Socket.pm line 13.
Compilation failed in require at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 16.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 16.
Compilation failed in require at ./check_esx3.pl line 35.

I installed VMware-vSphere-Perl-SDK-7.0.0-15889270.x86_64.tar.gz. Will see if I can find version 6.5
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: VMWare Wizard issue

Post by benjaminsmith »

Hello,
I installed VMware-vSphere-Perl-SDK-7.0.0-15889270.x86_64.tar.gz. Will see if I can find version 6.5
I would recommend trying that as we had issues with other versions. It's available from the SKD page ( select the version from the drop-down menu):

https://code.vmware.com/web/sdk/6.5/vsphere-perl

Document Reference:
Monitoring VMware With Nagios XI
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

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 Wizard issue

Post by rajasegar »

benjaminsmith wrote:Hello,
I installed VMware-vSphere-Perl-SDK-7.0.0-15889270.x86_64.tar.gz. Will see if I can find version 6.5
I would recommend trying that as we had issues with other versions. It's available from the SKD page ( select the version from the drop-down menu):

https://code.vmware.com/web/sdk/6.5/vsphere-perl

Document Reference:
Monitoring VMware With Nagios XI
Just trying to understand If the SDK version is wrong, how come using root it works fine?
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: VMWare Wizard issue

Post by benjaminsmith »

Hi rajasegar,

Quite honestly, I'm not exactly sure what is causing that behavior. I did find the following forum post, and the user was able to resolve by making some modifications to the plugin.

Vmware plugin not working as Nagios User

To help troubleshoot, try running some sample checks from the command line as nagios user with the -v verbose option, there may be some error output that will help diagnose this.

The other option is to downgrade the SDK to 6.5. It is mentioned in the doc that we have found incompatibilities with higher versions (see page 3 of the documentation).

Monitoring VMware With Nagios XI
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

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 Wizard issue

Post by rajasegar »

benjaminsmith wrote:Hi rajasegar,

Quite honestly, I'm not exactly sure what is causing that behavior. I did find the following forum post, and the user was able to resolve by making some modifications to the plugin.

Vmware plugin not working as Nagios User

To help troubleshoot, try running some sample checks from the command line as nagios user with the -v verbose option, there may be some error output that will help diagnose this.

The other option is to downgrade the SDK to 6.5. It is mentioned in the doc that we have found incompatibilities with higher versions (see page 3 of the documentation).

Monitoring VMware With Nagios XI
Downgraded the SDK to 6.5. Still same problem, root is still ok without errors.

Code: Select all

[nagios@myucbrnagiapp05 libexec]$ ./check_esx3.pl
Socket object version 2.010 does not match bootstrap parameter 2.029 at /usr/lib64/perl5/DynaLoader.pm line 213.
Compilation failed in require at /usr/lib64/perl5/IO/Socket.pm line 13.
BEGIN failed--compilation aborted at /usr/lib64/perl5/IO/Socket.pm line 13.
Compilation failed in require at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 16.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 16.
Compilation failed in require at ./check_esx3.pl line 35.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: VMWare Wizard issue

Post by benjaminsmith »

Hi @rajasegar,

Thanks for your patience on this. The fact that it runs as root without errors suggests there may be some environmental variables that differ between the nagios user account and root on this server.

Let's move this over to a support ticket so we can possibly do a remote session to resolve.

To open a support ticket, go to:

https://support.nagios.com/tickets/
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked