This looks good.. What do you get when it runs from within Nagios?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
VMware Plugin Issue
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: VMware Plugin Issue
Re: VMware Plugin Issue
I'm getting the same results when running these checks from within Nagios.
-host checks time out
-not able to add a guest vm
-host checks time out
-not able to add a guest vm
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: VMware Plugin Issue
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:
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
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
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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: VMware Plugin Issue
sorry, let's do this a different way
then
Code: Select all
sudo su nagiosCode: Select all
./check_esx3.pl -H "[IP]" -f "/usr/local/nagiosxi/etc/components/vmware/[FQDN]_auth.txt" -l "CPU"Re: VMware Plugin Issue
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
# 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
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: VMware Plugin Issue
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
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
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 ?
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
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.
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.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: VMware Plugin Issue
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
ls -al /usr/lib/vmware-vcli/VMware/share/VMware/
-r--r--r--. 1 root root 90818 Feb 23 13:14 VICommon.pm