Page 1 of 3
Monitoring Esxi host on nagios
Posted: Mon Sep 28, 2015 3:08 pm
by vinothg
Hi,
I have configured nagios server and i want to know how to configure and monitor esxi server on nagios.
Thank you
Re: Monitoring Esxi host on nagios
Posted: Mon Sep 28, 2015 3:13 pm
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.
Re: Monitoring Esxi host on nagios
Posted: Tue Sep 29, 2015 3:13 am
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
Re: Monitoring Esxi host on nagios
Posted: Tue Sep 29, 2015 2:11 pm
by lmiltchev
Can you also post the "box293_check_vmware" command definition?
Re: Monitoring Esxi host on nagios
Posted: Tue Sep 29, 2015 2:32 pm
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$\""
}
Re: Monitoring Esxi host on nagios
Posted: Tue Sep 29, 2015 2:42 pm
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
Re: Monitoring Esxi host on nagios
Posted: Wed Sep 30, 2015 9:25 am
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.
Re: Monitoring Esxi host on nagios
Posted: Wed Sep 30, 2015 9:39 am
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.
Re: Monitoring Esxi host on nagios
Posted: Wed Sep 30, 2015 11:48 am
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"
Re: Monitoring Esxi host on nagios
Posted: Wed Sep 30, 2015 1:13 pm
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]