Page 1 of 1

[DEBIAN]check_vmware_api.pl-Server Version Unavailible

Posted: Mon Feb 06, 2017 2:15 am
by frankmaia
Hello guys,
I am new to nagios issues, and I am implementing this solution in the company where I work and would like to share the solution for monitoring ESXi Hosts servers with the subject script:

OS: Debian Jessie

- In this example we use VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz.
- Make sure the following packages are installed.
openssl-devel perl-Archive-Zip perl-Class-MethodMaker uuid-perl perl-SOAP-Lite perl-XML-SAX perl-XML-NamespaceSupport perl-XML-LibXML perl-MIME-Lite perl-MIME-Types perl-MailTools perl-TimeDate uuid libuuid perl-Data-Dump perl-UUID cpan libxml2-devel perl-libwww-perl perl-Test-MockObject perl-Test-Simple perl-Mon itoring-Plugin perl-Class-Accessor

When you download the api please open the file README has important information to follow

vi check_vmware_api.pl and change the line:
( direct_command("cat /etc/*-release | grep -i ubuntu") || direct_command("cat /proc/version | grep -i ubuntu") )

to: ( direct_command("cat /etc/*-release | grep -i debian") || direct_command("cat /proc/version | grep -i debian") )

::::::::::::::::::::::::::::::::::::::::::SERVER UNAVAILABLE::::::::::::::::::::::::::::::::::::::::::::::::::::::
SOLUTION

I have gotten the same problem and now, I found out the cause for my environment.

1. https_proxy
My environment is befind a proxy, and "export https_proxy=..." seemed to be evil for vCLI.
If you are using proxy, try "unset https_proxy".

2. Perl_module version
As mentioned in http://search.cpan.org/~gaas/libwww-per ... erAgent.pm,
LWP will for secure protocol schemes ensure it connects to servers that have a valid certificate matching the expected hostname.

In newer version than libwww-perl-5.837. libwww-perl-5.837 and earlier releases have no problem.

So what I did is,

remove ~/.cpan files and reinstall libwww-perl for my env.

cpan> i /libwww-perl/
...
Distribution GAAS/libwww-perl-5.837.tar.gz
Distribution GAAS/libwww-perl-6.01.tar.gz
Distribution GAAS/libwww-perl-6.04.tar.gz
Author LWWWP ("The libwww-perl mailing list" <libwww@perl.org>)

4 items found
cpan> install GAAS/libwww-perl-5.837.tar.gz
and now, my vCLI is working well.
Hope this help you. ;)