ESX host list from a specified DC

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
anil4u_04
Posts: 17
Joined: Tue Sep 24, 2013 5:28 am

ESX host list from a specified DC

Post by anil4u_04 »

HI All,

I am facing challenges to get the esx hosts list from the specified DC,i can get the VM's list from the specified esx hosts, but i am struggling to get it from the linux servers.

i am using the script check_esx3-0-5 (https://exchange.nagios.org/directory/P ... st/details) to get the all the VM's list from the esx host, but i am getting below error while i am using the same script.

Error : Server version unavailable at 'https://<DC>:443/sdk/vimService.wsdl' at /usr/share/perl5/VMware/VICommon.pm line 726

Command : ./check_esx3-0-5 -D <DC name> -H <vcenter hostname> -u <username> -p <password> -l runtime -s listhost

not sure whether i am using the command in wrong way, if yes can someone help in this regards,

appreciate your help, and thanks in advance.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: ESX host list from a specified DC

Post by lmiltchev »

Can you run your check again from the command line with "increased verbosity" (pass "-v", "-vv" or "-vvv"; whatever the plugin supports)?

BTW, I have seen similar issues resolved by adding the following line to the top of the plugin:

Code: Select all

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
Be sure to check out our Knowledgebase for helpful articles and solutions!
anil4u_04
Posts: 17
Joined: Tue Sep 24, 2013 5:28 am

Re: ESX host list from a specified DC

Post by anil4u_04 »

Thanks lmiltchev, appreciate your prompt response ,

i used -v , nothing more it is giving, and also i add the line $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; at the begging of the file (after !#/usr/bin/perl) , but still getting the same error.

Thanks again for your response.
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: ESX host list from a specified DC

Post by lgroschen »

I saw another person with this problem solve it by installing this package: perl-LWP-Protocol-https in addition to adding the $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; as ludmil suggested.
/Luke
anil4u_04
Posts: 17
Joined: Tue Sep 24, 2013 5:28 am

Re: ESX host list from a specified DC

Post by anil4u_04 »

Hi lgroschen,

Thanks for your response , but no luck, still getting the same error.

I have installed perl-LWP-Protocol-https , do i need it add line "use LWP::Protocol:https " something like this.


Thanks in advance.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: ESX host list from a specified DC

Post by rkennedy »

anil4u_04 wrote:Hi lgroschen,

Thanks for your response , but no luck, still getting the same error.

I have installed perl-LWP-Protocol-https , do i need it add line "use LWP::Protocol:https " something like this.


Thanks in advance.
Yes, try adding what @lmiltchev mentioned at the top of the plugin.
Former Nagios Employee
anil4u_04
Posts: 17
Joined: Tue Sep 24, 2013 5:28 am

Re: ESX host list from a specified DC

Post by anil4u_04 »

Thanks rkennedy , i have added what lmiltchev suggested, but still no luck :(

Any help will be much appropriated.

Thanks.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: ESX host list from a specified DC

Post by ssax »

Are you testing from the command line or after restarting nagios and through the interface? I'm wondering if it's a permissions/path issue for the nagios user.

Thank you
anil4u_04
Posts: 17
Joined: Tue Sep 24, 2013 5:28 am

Re: ESX host list from a specified DC

Post by anil4u_04 »

I am testing from the command line. That script works for all options for the singe esx servers, but when i am giving DC options it is giving the below error.

root@<servername>:~# /usr/local/nagios/libexec/check_esx3-0-5 -D <DC> -H <vcenter hostname> -u <username> -p <password> -l runtime -s listhost
ESX CHECK CRITICAL - Server version unavailable at 'https://<DC>:443/sdk/vimService.wsdl' at /usr/share/perl5/VMware/VICommon.pm line 726.

root@<servername>:~#cat /usr/local/nagios/libexec/check_esx3-0-5 | grep ENV
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
root@<servername>:~#ls -l /usr/local/nagios/libexec/check_esx3-0-5
-rwxr-xr-x 1 root root 132917 Sep 3 00:19 /usr/local/nagios/libexec/check_esx3-0-5
root@<servername>:~#
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: ESX host list from a specified DC

Post by tgriep »

It looks like the command line options is either -H or -D but not both. Try just using the -D option.
Try that and let us know if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked