Page 2 of 2

Re: Issues getting vSphere monitoring working

Posted: Fri Oct 19, 2012 12:41 pm
by kruegerandy
As requested:
------------------------------------------------------------------------------------------------
# ls -l /usr/local/nagiosxi/html/includes/configwizards/vmware/scripts/getguests.pl
-rwxrwxr-x 1 nagios nagcmd 5187 Oct 17 08:13 /usr/local/nagiosxi/html/includes/configwizards/vmware/scripts/getguests.pl
# cat /etc/group|grep nag
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache
------------------------------------------------------------------------------------------------


Also...I did a bit more looking at the logs....specifically the /var/log/httpd/* logs. When I access the "VMware Monitoring Wizard - Step 3" page the following error is generated in /var/log/httpd/error_log:
------------------------------------------------------------------------------------------------
Server version unavailable at 'https://servername.uwplatt.edu:443/sdk/vimService.wsdl' at /usr/share/perl5/VMware/VICommon.pm line 545.
------------------------------------------------------------------------------------------------

I ran the following command from the command line:
------------------------------------------------------------------------------------------------
#/usr/local/nagios/libexec/check_esx3.pl -H servername.uwplatt.edu -u username -p password -V
check_esx3.pl 0.2.0
# runuser -l nagios -c '/usr/local/nagios/libexec/check_esx3.pl -H servername.uwplatt.edu -u username -p password -V'
check_esx3.pl 0.2.0
# runuser -l nagios -c '/usr/local/nagiosxi/html/includes/configwizards/vmware/scripts/getguests.pl -H servername.uwplatt.edu -u username -p password'
servername137.104.???.???poweredOn
...
...
...
...
servername137.104.???.???poweredOff
------------------------------------------------------------------------------------------------

To rule this out as a permissions issue I temporarily changed /etc/passwd, such that the shell for apache is /bin/bash, so I could run the following commands:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# runuser -l apache -c '/usr/local/nagios/libexec/check_esx3.pl -H ferb.ad.uwplatt.edu -u username -p password -V'
check_esx3.pl 0.2.0
# runuser -l apache -c '/usr/local/nagiosxi/html/includes/configwizards/vmware/scripts/getguests.pl -H servername.uwplatt.edu -u username -p password'
servername137.104.???.???poweredOn
...
...
...
...
servername137.104.???.???poweredOff
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Again in the above I got the expected output. I don't think this is an issues of permissions as I can run the command interactively via command line as root, nagios and apache and don't get any errors.

Do you have any ideas why I get that error in the apache error log, but not when I run the command from the command line?

Re: Issues getting vSphere monitoring working

Posted: Fri Oct 19, 2012 1:36 pm
by scottwilkerson
By chance is the XI machine behind a proxy? Just thinking out loud here, if you had proxy environment variables set the interactive commands could be run, but the variables may not be set for the non-interactive execution.

Re: Issues getting vSphere monitoring working

Posted: Fri Oct 19, 2012 1:53 pm
by lmiltchev
What is the output of the following command?

Code: Select all

yum list installed perl-Crypt-SSLeay
You may try adding the following line:

Code: Select all

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
to the "getguests.pl" and "/check_esx3.pl" files, right after the "use File::Basename;" line, so it is going to look something like this:

Code: Select all

...
use File::Basename;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
...
Hope this helps.

Re: Issues getting vSphere monitoring working

Posted: Tue Oct 23, 2012 8:18 am
by kruegerandy
That seemed to fix the issues I was having. Thank you.

Re: Issues getting vSphere monitoring working

Posted: Tue Oct 23, 2012 10:46 am
by lmiltchev
I'm glad I could help! :D