Issues getting vSphere monitoring working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
kruegerandy
Posts: 7
Joined: Wed Oct 10, 2012 3:22 pm

Re: Issues getting vSphere monitoring working

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Issues getting vSphere monitoring working

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues getting vSphere monitoring working

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kruegerandy
Posts: 7
Joined: Wed Oct 10, 2012 3:22 pm

Re: Issues getting vSphere monitoring working

Post by kruegerandy »

That seemed to fix the issues I was having. Thank you.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Issues getting vSphere monitoring working

Post by lmiltchev »

I'm glad I could help! :D
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked