Page 2 of 4
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 10:22 am
by scottwilkerson
benjohns wrote:They are on the same subnet. CPU usage is only ~9%, memory usage at ~50%
When I run the command manually, I do get the correct output:
# ./check_esx3.pl -H [IP] -u [username] -p [password] -l CPU
ESX3 OK - cpu usage=3785.00 MHz (5.87%) | cpu_usagemhz=3785.00Mhz;; cpu_usage=5.87%;;
When I manually run the command listed in XI, it also works:
# ./check_esx3.pl -H "[IP]" -f "/usr/local/nagiosxi/etc/components/vmware/[FQDN]_auth.txt" -l "CPU"
ESX3 OK - cpu usage=4318.00 MHz (6.70%) | cpu_usagemhz=4318.00Mhz;; cpu_usage=6.70%;;
FWIW: Those manual checks come back in ~3 seconds
This looks good.. What do you get when it runs from within Nagios?
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 2:32 pm
by benjohns
I'm getting the same results when running these checks from within Nagios.
-host checks time out
-not able to add a guest vm
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 2:39 pm
by scottwilkerson
can you share your configs from within XI? So we can make sure we are testing the exact command that nagios is using.
Also, can we verify the nagios user can run the command with something like the following:
Code: Select all
sudo su nagios -c './check_esx3.pl -H "[IP]" -f "/usr/local/nagiosxi/etc/components/vmware/[FQDN]_auth.txt" -l "CPU"'
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 3:26 pm
by benjohns
Running the command as the nagios user errors out parsing the quotes around the destination IP address:
ESX3 CRITICAL - Server version unavailable at 'https://%E2%80%9C
If I remove the quotes around the -H "[IP]" argument, the command spins for ~3 minutes, then returns:
ESX3 CRITICAL - HOST CPU Unknown error
The permissions on the auth file are:
-rw-r--r--. 1 apache nagios 37 Feb 27 15:00 [FQDN]_auth.txt
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 4:44 pm
by scottwilkerson
sorry, let's do this a different way
then
Code: Select all
./check_esx3.pl -H "[IP]" -f "/usr/local/nagiosxi/etc/components/vmware/[FQDN]_auth.txt" -l "CPU"
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 5:25 pm
by benjohns
Same result, spins for 4 mins, 45 seconds then errors out:
# sudo su nagios
bash-4.2$ cd /usr/local/nagios/libexec
bash-4.2$ ./check_esx3.pl -H "IP" -f "/usr/local/nagiosxi/etc/components/vmware/HOST_auth.txt" -l "CPU"
ESX3 CRITICAL - HOST CPU Unknown error
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 5:34 pm
by scottwilkerson
you are changing IP for the actual IP of the ESXi right?
If so we are actually getting somewhere because the same command you were able to run as root but not nagios.
Can you add --verbose to the command and run again
Re: VMware Plugin Issue
Posted: Wed Feb 28, 2018 5:52 pm
by benjohns
Yes, I am using the ESXi IP & hostname in the command.
Here's what I get adding '--verbose' to the command (I tried adding it to the front & back):
bash-4.2$ ./check_esx3.pl -H "IP" -f "/usr/local/nagiosxi/etc/components/vmware/HOST_auth.txt" -l "CPU" --verbose
ESX3 CRITICAL - HOST CPU Unknown error
bash-4.2$ ./check_esx3.pl --verbose -H "IP" -f "/usr/local/nagiosxi/etc/components/vmware/HOST_auth.txt" -l "CPU"
ESX3 CRITICAL - HOST CPU Unknown error
Let me make sure I'm not making a poor assumption here, this is the full path of the command:
/usr/local/nagios/libexec/check_esx3.pl
Should I be testing with this path / version:
/usr/local/nagiosxi/html/includes/configwizards/vmware/plugins/check_esx3.pl ?
Re: VMware Plugin Issue
Posted: Thu Mar 01, 2018 3:06 pm
by cdienger
I suspect either will work but for these tests run with /usr/local/nagios/libexec/check_esx3.pl
There may be permission issues with the SDK that was installed. What is set for /usr/lib/vmware-vcli/VMware/share/VMware/VICommon.pm ?
Try giving read permissions to everyone on this file:
chmod +r /usr/lib/vmware-vcli/VMware/share/VMware/VICommon.pm
I've attached a directory listing showing the permissions for the files so you can check them against a working install.
Re: VMware Plugin Issue
Posted: Thu Mar 01, 2018 4:13 pm
by benjohns
Those permissions were already in place:
ls -al /usr/lib/vmware-vcli/VMware/share/VMware/
-r--r--r--. 1 root root 90818 Feb 23 13:14 VICommon.pm