You are here

check_vmware_api.pl will not run as user nagios

4 posts / 0 new
Last post
JTok
JTok's picture
check_vmware_api.pl will not run as user nagios

I am having an odd issue. I am not able to monitor my VMware Host (ESXi) becase the service check times out. 
I have noticed that if I run "./check_vmware_api.pl -H ip -u username -p password -l mem -s usage" as the conf user, I immediately get a result of "CHECK_VMWARE_API.PL OK - mem usage=13.03 % | mem_usage=13.03%;;". 
However, if I run that same command as nagios, after several minutes I will get a large amount of xml back with the top line as "CHECK_VMWARE_API.PL CRITICAL - SOAP request error - possibly a protocol issue:".

I have verified that the permissions on check_vmware_api.pl are correctly set for nagios. I am assuming that my VMware Perl SDK is correctly installed along with its dependencies since I am able to run the command successfully as conf.

Any suggestions would be appreciated.

Thanks.

rvdigital
rvdigital's picture
Re: check_vmware_api.pl will not run as user nagios

I have the same problem and I'm still investigating, what I know is that it has to do with the specific sh profile for the nagios user in /usr/local/nagios/bin/profile, especially the PERL5LIB environment variable.

If, like me, you had to install some Perl modules from CPAN to make the Nagios plugin work, it could be that you also have to symlink some of the system perl libraries (/usr/local/lib64/perl5/) in /opt/opsview/perl/lib/perl5.

rvdigital
rvdigital's picture
Re: check_vmware_api.pl will not run as user nagios
Michael Lawler
pclawler's picture
Do you grant permissions?

I cannot see the post. Says Access Denied.