VMware Plugin Issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: VMware Plugin Issue

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
benjohns
Posts: 20
Joined: Wed Jan 17, 2018 2:27 pm

Re: VMware Plugin Issue

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

Re: VMware Plugin Issue

Post 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"'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
benjohns
Posts: 20
Joined: Wed Jan 17, 2018 2:27 pm

Re: VMware Plugin Issue

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

Re: VMware Plugin Issue

Post by scottwilkerson »

sorry, let's do this a different way

Code: Select all

sudo su nagios
then

Code: Select all

./check_esx3.pl -H "[IP]" -f "/usr/local/nagiosxi/etc/components/vmware/[FQDN]_auth.txt" -l "CPU"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
benjohns
Posts: 20
Joined: Wed Jan 17, 2018 2:27 pm

Re: VMware Plugin Issue

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

Re: VMware Plugin Issue

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
benjohns
Posts: 20
Joined: Wed Jan 17, 2018 2:27 pm

Re: VMware Plugin Issue

Post 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 ?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: VMware Plugin Issue

Post 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.
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.
benjohns
Posts: 20
Joined: Wed Jan 17, 2018 2:27 pm

Re: VMware Plugin Issue

Post 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
Locked