...A place where sharing IT monitoring knowledges

Thursday, 29 December 2011

Monitoring VMWare: Installing vSphere SDK for Perl


Considering the huge growth that virtualization platforms are experiencing in these last years, specially but not only VMWare based ones, monitoring these platforms and supported hosts becomes a must be for every monitoring administrator.

You can find a bunch of good plugins addressed to monitor VMWare platforms on Nagios compatible tools (Nagios itself, Icinga, Babel or Zenoss, among others), perhaps being the most adopted the versatile check_esx from OP5. Anyway, the key point is that the most of them are based on VMWare's vSphere SDK for Perl, a set of libraries acting as API, as interface, between plugins and VCenters/ESX(i) servers.

vSphere SDK is all but light in terms of disk space requirements... ok, maybe I was a bit extreme: It requires more than 80Mbytes of space in your Gigabyte drive, the most of this space being used by:
  • vCli: a shell client for managing vSphere based platforms.
  • WSMAN libraries for getting server hardware information by vSphere.
Well, the truth is that I don't want neither managing vSphere platforms nor getting hardware information by vSphere (I prefer getting it directly from the servers), so these components lack of interest for someone who only wants monitoring VCenter, ESX(i) and virtualized servers. The only thing I need is the Perl modules, a set of files located on lib/VMware/share/VMware installation package directory... and requiring 3Mbytes of disk space:
  • VICommon.pm
  • VICredStore.pm
  • VIExt.pm
  • VILib.pm
  • VIM2Runtime.pm
  • VIM2Stub.pm
  • VIM25Runtime.pm
  • VIM25Stub.pm
  • VIMRuntime.pm
  • VIRuntime.pm
So to start playing the only thing you must do it copying VMware libraries full directory to one of the locations where your distro stores Perl libraries (one of them is /usr/local/share/perl/ in Debian) and checking if all dependent libraries are properly installed, specifically:
  • Crypt-SSLeay-0.55 (0.55-0.9.7 or 0.55-0.9.8)
  • IO-Compress-Base-2.005
  • Compress-Zlib-2.005
  • IO-Compress-Zlib-2.005
  • Compress-Raw-Zlib-2.017
  • Archive-Zip-1.26
  • Data-Dumper-2.121
  • XML-LibXML-1.63
  • libwww-perl-5.805
  • LWP-Protocol-https-6.02
  • XML-LibXML-Common-0.13
  • XML-NamespaceSupport-1.09
  • XML-SAX-0.16
  • Data-Dump-1.15
  • URI-1.37
  • UUID-0.02
  • SOAP-Lite-0.710.08
  • HTML-Parser-3.60
  • version-0.78

I imagine that it must exist a right procedure for checking if these libraries are present in the system, but I recommend the "trial and error" approach as the fastest: Just download one of the most plugins the uses the API (as check_esx does), run it from the command line and install each non satisfied dependency the script dropped as runtime error.

Dealing with Debian platforms, you can find problems when trying to install XML::LibXML from CPAN (perl -MCPAN -e "install XML::LibXML"), specifically you can get  a MAKEFILE.pl error message talking about the impossibility of finding some libraries:
...
looking for -lxml2... no
looking for -llibxml2... no
libxml2 not found
...
The best way to solve it is installing the libxml-libxml-perl Debian package (apt-get install libxml-libxml-perl) instead of doing it by CPAN.



No comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes