Monitoring Esxi host on nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Monitoring Esxi host on nagios

Post by vinothg »

Hi,

I have configured nagios server and i want to know how to configure and monitor esxi server on nagios.

Thank you
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring Esxi host on nagios

Post by Box293 »

I suggest using the box293_check_vmware plugin:

https://exchange.nagios.org/directory/P ... re/details

It has a detailed manual, let us know if you need help.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Re: Monitoring Esxi host on nagios

Post by vinothg »

Hi,

I have followed the manual and configured to check one esxi host and am getting the below error.

Error: (status information: check_by_ssh: invalid hostname\address: HOSTADDRESS). below is my configuration

#Host Esxi01
define host{
use server
host_name my esxi hostname
#alias VMWare ESXi 01
address 192.168.8.45
}

#Host OS Name and Version

define service {
host_name my esxi hostname
service_description ESXi Version
check_command box293_check_vmware!my vcenter hostname!Host_OS_Name_Version!--host!my esxi hostname
initial_state u
max_check_attempts 3
check_interval 1
retry_interval 7
active_checks_enabled 1
check_period 24x7
register 1
}

any help highly appreciated..

Thank you
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring Esxi host on nagios

Post by lmiltchev »

Can you also post the "box293_check_vmware" command definition?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Re: Monitoring Esxi host on nagios

Post by vinothg »

Hi,

Please find below command definition.

define command {
command_name box293_check_vmware
command_line $USER1$/check_by_ssh -E 1 -t 90 -l vi-admin -H 192.168.8.45 -C "nice -n19 ~/box293_check_vmware.pl --server $ARG1$ --check $ARG2$ \"$ARG3$\" \"$ARG4$\" \"$ARG5$\" \"$ARG6$\" \"$ARG7$\" \"$ARG8$\""
}
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Re: Monitoring Esxi host on nagios

Post by vinothg »

Hi

I want to define esxi host cpu usage and memory usage service definition. I am using the below steps, but i am getting error for the same. Please guide me how to configure service definition for this.

host cpu:
Command:
box293_check_vmware.pl --check Host_CPU_Usage --server 192.168.1.211 --host 192.168.1.210

Memory:

box293_check_vmware.pl --check Host_Memory_Usage --server 192.168.1.211 --host
192.168.1.210
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring Esxi host on nagios

Post by Box293 »

vinothg wrote:Hi

I want to define esxi host cpu usage and memory usage service definition. I am using the below steps, but i am getting error for the same. Please guide me how to configure service definition for this.

host cpu:
Command:
box293_check_vmware.pl --check Host_CPU_Usage --server 192.168.1.211 --host 192.168.1.210

Memory:

box293_check_vmware.pl --check Host_Memory_Usage --server 192.168.1.211 --host
192.168.1.210
In your vCenter inventory, is the ESX(i) host listed as "192.168.1.210" or by a FQDN like esxihost001.domain.com?

The --host argument requires the actual name of the host object as it appears in the inventory (CaSe sEnSatIve), not it's IP Address ... unless of course it is added to the inventory using the IP Address.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Re: Monitoring Esxi host on nagios

Post by vinothg »

In my vcenter inventory esxi listed as fqdn only and in my service definition i have configured fqdn only. but i am getting an error. Could you please share with me some sample service definition for esxi host cpu usage check memory usage check.

Thank you.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitoring Esxi host on nagios

Post by Box293 »

Is it working from the command line on the vMA?

Code: Select all

~/box293_check_vmware.pl --check Host_CPU_Usage --server vcenter_server_ip_or_fqdn --host esxi_host_ip_or_fqdn
Can you please post the full command and output here so we can see what is going on.

Then if that works, what do you get from your nagios server?

Code: Select all

su nagios
/usr/local/nagios/libexec/check_by_ssh -E 1 -t 90 -l vi-admin -H vma_ip_or_fqdn -C "nice -n19 ~/box293_check_vmware.pl --check Host_CPU_Usage --server vcenter_server_ip_or_fqdn --host esxi_host_ip_or_fqdn"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
vinothg
Posts: 15
Joined: Mon Aug 17, 2015 3:55 pm

Re: Monitoring Esxi host on nagios

Post by vinothg »

From the command line i am getting the correct output. Please find the below.

from vma:

OK: Host CPU {Free: 23.2 GHz} {Used: 0.2 GHz} {Total: 23.4 GHz}|'CPU Free'=23.2GHz 'CPU Used'=0.2GHz 'CPU Total'=23.4GHz [Host_CPU_Usage]

from nagios host:

OK: Host CPU {Free: 23.1 GHz} {Used: 0.3 GHz} {Total: 23.4 GHz}|'CPU Free'=23.1GHz 'CPU Used'=0.3GHz 'CPU Total'=23.4GHz [Host_CPU_Usage]
Locked