VCenter Appliance (Ver 6.5) Monitoring using Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by vy3734 »

Hi,
I am currently monitoring VMWare ESXI hosts using VCenter(Windows Machines) server in Nagios with the help of check_vmware_esx.pl plugin.
Everything is working fine until these ESXI hosts were moved to a new VCenter server (which now runs on Linux). I'm getting authentication failures when trying to get the data from the new VCenter server. The same userid and password when used to login to the VCenter sevrer using the web console is working fine. But when tried from nagios to get the data using the plugin authentication failure is what i'm seeing. Is there a newer version of the plugin that i'm supposed to use or an additonal flag in the command that i have to add to get this working.
The command that i'm currently using looks like this
./check_vmware_esx.pl -D $VCenter_Server -H $ESXI_Host -u ###### -p ####### -S cpu -s usage -w 85 -c 90

Thanks in Advance!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by lmiltchev »

Is this a typo?
./check_vmware_esx.pl -D $VCenter_Server -H $ESXI_Host -u ###### -p ####### -S cpu -s usage -w 85 -c 90
It's supposed to be:

Code: Select all

./check_vmware_esx.pl -D $VCenter_Server -H $ESXI_Host -u ###### -p ####### -l cpu -s usage -w 85 -c 90
Can you try using the connect.pl as described in this post - https://support.nagios.com/forum/viewto ... 0&start=20, in order to see if you are going to be able to connect to the server?

Also, have you checked the logs on VCenter for authentication errors?

Can you post an example of you service config?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by vy3734 »

Hi,
Thank you so much for responding.

I tried using the connect.pl to connect to the Vcenter server.
"
[nagios@nagiosserver general]$ ./connect.pl --url https://xx.xx.xx.xxx/sdk/vimService --username uname -password passwd
Error: Cannot complete login due to an incorrect user name or password.
"
But the same username and password works for the Vcenter web-console.

The command above should not change if my Vcenter server is windows based or Linux based. Correct?

This is the services definition in services_$host.cfg file for monitoring CPU Usage

define service {
host_name $host
service_description ESXI_Cpu_Usage
servicegroups Services
check_command check_vmware_esx_host!$host!cpu!-s usage!-w 85 -c 90!
max_check_attempts 3
check_interval 15
retry_interval 10
check_period 24x7
notification_interval 15
contact_groups ContactTeam
notification_period 24x7
notifications_enabled 0
notification_options c,r
_xiwizard nrpe
register 1
}

My username/password has special characters, i tried the same using quotes too, still the same error.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by lmiltchev »

My username/password has special characters, i tried the same using quotes too, still the same error.
Have you tried using single quotes?

Example:

Code: Select all

/usr/lib/vmware-vcli/apps/general/connect.pl --url https://x.x.x.x/sdk/vimService --username 'username' --password 'password'

Connection Successful
Server Time : 2018-05-29T15:23:43.530818Z
Can you show us the config of the "check_vmware_esx_host" command as well?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by vy3734 »

this is the command definition
define command {
command_name check_vmware_esx_host
command_line $USER1$/check_vmware_esx.pl -D $HOSTADDRESS$ -H $ARG1$ -u $USER18$ -p $USER19$ -S $ARG2$ $ARG3$ $ARG4$
}

I also tried updating the vSphere SDK version to 6.5 still the same Error: Cannot complete login due to an incorrect user name or password.
vy3734
Posts: 109
Joined: Tue Sep 29, 2015 4:48 pm

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by vy3734 »

Thank you so much for your time and suggestions. I was able to get the data from the esxi hosts, i had to upgrade to vSphere SDK version from 6.0 to 6.5 and play with quotes around the username and password. It finally worked! :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: VCenter Appliance (Ver 6.5) Monitoring using Nagios

Post by scottwilkerson »

Glad to hear it is working!!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked