VMware | Install vCLI at Redhat/Centos to check with Nagios
Schrittweise Anleitung zur Installation der VMware vCLI unter Redhat/Centos
HowTo install Vmware vCLI under Redhat/Centos OS
1.) Install epel Repository
yum install epel-release
2.) Install a huge amount of yum perl Librarys
yum install openssl-devel libxml2-devel e2fsprogs-devel expat-devel perl-YAML perl-Devel-CheckLib perl-CPAN libxml2-devel.x86_64 perl-Archive-Zip gcc libuuid libuuid-devel uuid-perl uuid-devel perl-SOAP-Lite perl-libxml-perl perl-SOAP-Lite perl-XML-SAX perl-XML-Simple perl-Crypt-SSLeay perl-Data-Dump glibc.i686 perl-Class-MethodMaker perl-Time-Piece perl-XML-SAX perl-Nagios-Plugin perl-XML-LibXML perl-Nagios-Plugin
3.) Install PHP (maybe some other php librarys are necessary)
yum install php56w php56w-common php56w-devel
4.) Install CPAN Dependencies
cpan -f -i GAAS/libwww-perl-5.837.tar.gz
5.) Install following CPAN Modules –> many thanks to http://morgajel.net/2015/05/20/1681
install Locale::Maketext::Simple
install Params::Check
install Class::Inspector
install Class::MethodMaker
install Compress::Raw::Bzip2
install Crypt::OpenSSL::RSA
install Crypt::OpenSSL::Random
install Crypt::X509
install Data::Dump
install Devel::CheckLib
install Digest::MD5
install Encode::Locale
install Env
install ExtUtils::CBuilder
install ExtUtils::MakeMaker
install File::Listing
install HTML::Parser
install HTML::Tagset
install HTTP::Cookies
install HTTP::Daemon
install HTTP::Date
install HTTP::Message
install HTTP::Negotiate
install IO::CaptureOutput
install IO::Compress
install IO::HTML
install IO::SessionData
install IO::Socket::INET6
install IO::Socket::SSL
install IPC::Cmd
install Import::Into
install JSON::PP
install LWP
install LWP::MediaTypes
install LWP::Protocol::https
install Module::Build
install Module::CoreList
install Module::Load
install Module::Load::Conditional
install Module::Metadata
install Module::Runtime
install Mozilla::CA
install Net::HTTP
install Net::INET6Glue
install Net::SSLeay
install Path::Class
install Perl::OSType
install SOAP::Lite
install Socket6
install Sub::Uplevel
install Task::Weaken
install Test::Simple
install Test::Warn
install URI
install UUID
install UUID::Random
install WWW::RobotRules
install XML::LibXML
install XML::Parser::Lite
install XML::SAX
install XML::SAX::Base
install autodie
install version
4.) Download vCLI from VMWare
5.5 (https://my.vmware.com/group/vmware/get-download?downloadGroup=VCLI55U2)
I prefer the 5.1 Version because of the easy install and less problems at working. Version 5.1. vCLI are also working with vSphere 5.5.
5.) Installation of vCLI
– Copy / download / Upload the VMWare vCLI file at your Redhat/Centos server
I have choosen the /tmp directory
– Unpack the tar file
tar -zxvf VMware-vSphere-CLI-5xxxxxxxx.tar.gz
– Open the unpacked directory
cd vmware-vsphere-vcli-distrib
– Set Proxy Settings (vmware will need some Proxy information at installing. Set them before you start the install. In my case I do not use a proxy Server so I set (export http_proxy=). If I do not set a URL after = it means no proxy
export http_proxy=
export ftp_proxy=
export PERL_LWP_SSL_VERIFY_HOSTNAME=0
– Install vCLI
./vmware-install.pl --prefix=/opt/vmwarecli EULA_AGREED=yes
<...>
Do you want to install precompiled Perl modules for RHEL?
[yes] no
<...>
Now the vCLI tools are correct installed.
If there are any Problems where the VMware sdk cannot be reached:
yum install perl-IO-Socket-SSL
Edit the perl https.pm
vi /usr/lib/perl5/site_perl/5.8.8/LWP/Protocol/https.pm
or
vi /usr/local/share/perl5/LWP/Protocol/https.pm
Look for the following line near the top:
$ssl_opts{SSL_verify_mode} ||= 1;
Change it to:
$ssl_opts{SSL_verify_mode} ||= 0;
This is on CentOS 5.5, you might have different paths on different platforms
If there are any Problems with Zlib/Extra.pm:
sed -i 's/length(/scalar(/g' /usr/lib64/perl5/IO/Compress/Zlib/Extra.pm
If you follow those steps you will get an successfully installation of the vmware vCLI Tools.
6.) VMWare Nagios Check
I´m using this nagios check script from box293 published on exchange.nagios.org:
With the obove steps (1 to 5) I was able to use any centos machine instead of the VMWare vMA