VMware {code} Community
martinkj
Contributor
Contributor
Jump to solution

Problem using vSphere™ SDK for Perl instead of VI Perl Toolkit 1.6

We are currently running VI Perl Toolkit 1.6 on SLES 10 SP1 64bit. When I run a test query using 1.6 I get the expected result. When I uninstall 1.6 and install vSphere SDK for Perl and run the same query I get this response:

Can't load '/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/auto/XML/LibXML/Common/Common.so' for module XML::LibXML::Common: /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/auto/XML/LibXML/Common/Common.so: wrong ELF class: ELFCLASS32 at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.

at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/XML/LibXML.pm line 12

Compilation failed in require at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/XML/LibXML.pm line 12.

BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/XML/LibXML.pm line 12.

Compilation failed in require at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 11.

BEGIN failed--compilation aborted at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 11.

Compilation failed in require at /usr/lib/perl5/5.8.8/VMware/VIRuntime.pm line 15.

Compilation failed in require at /usr/lib/vmware-vcli/apps/performance/viperformance.pl line 11.

BEGIN failed--compilation aborted at /usr/lib/vmware-vcli/apps/performance/viperformance.pl line 11.

I have installed a prerequisite perl modules and rpms. Any ideas?

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
stumpr
Virtuoso
Virtuoso
Jump to solution

Looks like its a 32bit shared library, not 64 (despite the name).

I would try reinstalling LibXML with CPAN.

Reuben Stump | http://www.virtuin.com | @ReubenStump

View solution in original post

Reply
0 Kudos
9 Replies
stumpr
Virtuoso
Virtuoso
Jump to solution

Looks like its a 32bit shared library, not 64 (despite the name).

I would try reinstalling LibXML with CPAN.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
martinkj
Contributor
Contributor
Jump to solution

Installing XML::LibXML again did solve the problem. This requirement is only listed under the "Installing the vSphere SDK for Perl from Source Code" section and not the "Installing a vSphere SDK for Perl Package" section. Thank you for your help.

Reply
0 Kudos
ileidi
Contributor
Contributor
Jump to solution

I have the same error on a Centos 5.6 machine with the Vsphere 4.1 SDK. When i tried to check the status of my ESX Server with nagios i have that problem:

/usr/local/icinga/libexec/check_esx.pl -H 192.168.xxx.xxx -u xxxxxxxx -p xxxxxxxxxxxx -l cpu
CHECK_ESX.PL  CRITICAL - Server version unavailable at  'https://192.168.xxx.xxx:443/sdk/vimService.wsdl' at  /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 545.

I check the Vsphere 4.1 SDK Documentation and i had already install all the requirments (Perl Modules, Openssl and libxml2).

I tried to re-install the XML::LibXML without results Smiley Sad

Reply
0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

Find out what module path is being loaded.  LibXML is common and often loaded multiple times...though usually I see the problem with Windows, not with Nix.

Check your %INC for the LibXML module, make sure it's the one you want to use.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
SKuntzelman
Contributor
Contributor
Jump to solution

I had the same problem ( CHECK_ESX CRITICAL - Server version unavailable ), and I spent a lot of time searching.  Most of the suggestions were to set the environment variable to tell the IO::Socket::SSL to not check the self-signed certificate (adding the following line near the top of the check_esx script):

$ENV{SSL_verify_mode} = 0x00;

This didn't work for me, and after much debugging I figured out that the script isn't using IO::Socket::SSL -- it's using LWP.  The proper change to check_esx when using LWP is:

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

I put it after the line  use File::Basename;  so it looks like:

use Nagios::Plugin;
use File::Basename;

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

my $perl_module_instructions="
Download the latest version of Perl Toolkit from VMware support page.

After making this change, the check_esx plugin again works perfectly.

Additionally, please note that this worked fine for me previously - it only broke after my last yum update on my CentOS server hosting Nagios.

Reply
0 Kudos
mmcasti
Contributor
Contributor
Jump to solution

I have the same problem.

It's not necessary to modify any file. Just restart mgmt-vmware service on remote server and try again.


/etc/init.d/mgmt-vmware restart

Reply
0 Kudos
Joseph_Tingiris
Contributor
Contributor
Jump to solution

I had a similar problem and believe this is an issue related to the latest version of a more recent LWP::UserAgent Perl module (above 6.x).

Adding the following to my environment fixed errors related to /usr/lib/perl5/5.8.8/VMware/VICommon.pm

export PERL_LWP_SSL_VERIFY_HOSTNAME=0

Reply
0 Kudos
roddam
Contributor
Contributor
Jump to solution

Hi All,

     I just got through the installation of vCLI and perl SDK. I installed  all  this in my vCenter SUSE VM it self. The vCenter is bootstrapped  into the  cluster. I am trying to reboot a host in my cluster using,

    vicfg-hostsops --operation reboot --server 10.243.xxx.xxx --username root  --password <server_password>

    I get this error - Server version unavailable at  'https://<server>/sdk/vimService.wsdl' at  /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 545

     The solution for this from vmware support site is

Workaround: Follow these steps to resolve the  issue:

  1. Make sure the version of the LWP::UserAgent Perl module is above  6.0.4.
  2. Turn off host name verification by running the following  command:
    export  PERL_LWP_SSL_VERIFY_HOSTNAME=0

       The latest LWP::UserAgent perl module is 6.04 and nothing here which I  have installed.

       Exported the variable and assigned it to 0.

I did all this but I still get the same error - server version  unavailable.

Any ideas?

Reply
0 Kudos
MicroMarket
Contributor
Contributor
Jump to solution

im have this error

root@hostname# ./check_esx3-0.5.orig.pl -H Hostname -u nagios -p User -l cpu -s usage -w85 -c90

CHECK_ESX3-0.5.ORIG.PL CRITICAL - Error: Server version unavailable at 'https://hostname:443/sdk/vimService.wsdl'

how im can fix it ?

Reply
0 Kudos