Difference between revisions of "Monitoring ESXi using Zabbix"
(Created page with "Home > CentOS > CentOS 8.x > Monitoring > Zabbix > Monitoring ESXi using Zabbix") |
|||
| Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x monitoring|Monitoring]] > [[CentOS 8.x Zabbix|Zabbix]] > [[Monitoring ESXi using Zabbix]] | [[Main Page|Home]] > [[CentOS]] > [[CentOS 8.x]] > [[CentOS 8.x monitoring|Monitoring]] > [[CentOS 8.x Zabbix|Zabbix]] > [[Monitoring ESXi using Zabbix]] | ||
= Monitor ESXi Using Zabbix = | |||
== ESXi Host Setup == | |||
=== 1. Login to ESXi Host === | |||
Login to the ESXi host as the root user. | |||
=== 2. Create New User for Zabbix === | |||
Navigate to: | |||
Manage > Security & Users > Users > Add User | |||
Create a new user with the following details: | |||
User Name: zabbix | |||
=== 3. Assign Permissions === | |||
Navigate to: | |||
Host > Actions > Permissions | |||
Add the user "zabbix" and assign Administrator permissions. | |||
== Zabbix Server Configuration == | |||
=== 1. Edit Zabbix Configuration File === | |||
Open the Zabbix server configuration file: | |||
<pre> | |||
# /etc/zabbix/zabbix_server.conf | |||
</pre> | |||
Add or update the following parameters: | |||
StartVMwareCollectors=3 | |||
VMwareFrequency=60 | |||
VMwarePerfFrequency=60 | |||
VMwareCacheSize=32M | |||
VMwareTimeout=120 | |||
CacheSize=256M | |||
=== 2. Restart Zabbix Server === | |||
<pre> | |||
# systemctl restart zabbix-server | |||
</pre> | |||
=== 3. Get ESXi UUID === | |||
SSH into the ESXi host and run the below command: | |||
<pre> | |||
# vim-cmd hostsvc/hostsummary | grep uuid | |||
</pre> | |||
Note down the ESXi UUID. | |||
== Zabbix Web UI Configuration == | |||
=== 1. Add ESXi Host === | |||
Login to Zabbix Web UI as Admin. | |||
Navigate to: | |||
Monitoring > Hosts > Create Host | |||
Enter the following details: | |||
Hostname: esxi | |||
Template: VMware, VMVMware Hypervisor | |||
Host Group: Hypervisor | |||
=== 2. Configure Macros === | |||
Go to the Macros tab and add the following macros: | |||
{$VMWARE.HV.SENSOR.DISCOVERY} = true | |||
{$VMWARE.HV.UUID} = 4c4c4544-0038-4b10-8032-c2c04f423333 (Esxi uuid) | |||
{$VMWARE.PASSWORD} = (zabbix user password) | |||
{$VMWARE.URL} = https://Esxi-ip-addr/sdk/vimService.wsdl | |||
{$VMWARE.USERNAME} = zabbix | |||
Note: It may take some time for the host to start collecting data. | |||
== Create Discovery Rule for ESXi == | |||
Navigate to: | |||
Data Collection > Discovery > Create Discovery Rule | |||
Provide the following details: | |||
Name: esxi | |||
IP Range: 172.31.1.1-255 | |||
Update Interval: 5 minutes | |||
Check Type: HTTP and HTTPS | |||
Uniqueness criteria: | |||
Host Name: IP address | |||
Visible Name: IP address | |||
== Disable VMware VM Monitoring (Optional) == | |||
By default, Zabbix monitors all virtual machines inside the ESXi host. | |||
To monitor only the ESXi host: | |||
Navigate to: | |||
Data Collection > Templates | |||
Search for: vmware | |||
Open Discovery settings | |||
Disable: VMware VM discovery | |||
After disabling, VM discovery will stop. | |||
== Simulating Errors == | |||
=== Reboot ESXi Server === | |||
Reboot the ESXi host. | |||
Expected result: | |||
The host is showing a warning in Zabbix web UI like "Problem started - VMware Hypervisor has been restarted " | |||
It will send problem mail alerts also | |||
=== Resolve the Issue === | |||
After the reboot, login into ESXI host | |||
Expected result: | |||
"Problem has been resolved - VMware Hypervisor has been restarted " | |||
It will send resolved mail alerts also | |||
Revision as of 12:57, 22 December 2025
Home > CentOS > CentOS 8.x > Monitoring > Zabbix > Monitoring ESXi using Zabbix
Monitor ESXi Using Zabbix
ESXi Host Setup
1. Login to ESXi Host
Login to the ESXi host as the root user.
2. Create New User for Zabbix
Navigate to: Manage > Security & Users > Users > Add User
Create a new user with the following details: User Name: zabbix
3. Assign Permissions
Navigate to: Host > Actions > Permissions
Add the user "zabbix" and assign Administrator permissions.
Zabbix Server Configuration
1. Edit Zabbix Configuration File
Open the Zabbix server configuration file:
# /etc/zabbix/zabbix_server.conf
Add or update the following parameters:
StartVMwareCollectors=3
VMwareFrequency=60
VMwarePerfFrequency=60
VMwareCacheSize=32M
VMwareTimeout=120
CacheSize=256M
2. Restart Zabbix Server
# systemctl restart zabbix-server
3. Get ESXi UUID
SSH into the ESXi host and run the below command:
# vim-cmd hostsvc/hostsummary | grep uuid
Note down the ESXi UUID.
Zabbix Web UI Configuration
1. Add ESXi Host
Login to Zabbix Web UI as Admin.
Navigate to: Monitoring > Hosts > Create Host
Enter the following details: Hostname: esxi
Template: VMware, VMVMware Hypervisor
Host Group: Hypervisor
2. Configure Macros
Go to the Macros tab and add the following macros:
{$VMWARE.HV.SENSOR.DISCOVERY} = true
{$VMWARE.HV.UUID} = 4c4c4544-0038-4b10-8032-c2c04f423333 (Esxi uuid)
{$VMWARE.PASSWORD} = (zabbix user password)
{$VMWARE.URL} = https://Esxi-ip-addr/sdk/vimService.wsdl
{$VMWARE.USERNAME} = zabbix
Note: It may take some time for the host to start collecting data.
Create Discovery Rule for ESXi
Navigate to: Data Collection > Discovery > Create Discovery Rule
Provide the following details:
Name: esxi
IP Range: 172.31.1.1-255
Update Interval: 5 minutes
Check Type: HTTP and HTTPS
Uniqueness criteria:
Host Name: IP address
Visible Name: IP address
Disable VMware VM Monitoring (Optional)
By default, Zabbix monitors all virtual machines inside the ESXi host.
To monitor only the ESXi host:
Navigate to: Data Collection > Templates
Search for: vmware
Open Discovery settings
Disable: VMware VM discovery
After disabling, VM discovery will stop.
Simulating Errors
Reboot ESXi Server
Reboot the ESXi host.
Expected result:
The host is showing a warning in Zabbix web UI like "Problem started - VMware Hypervisor has been restarted "
It will send problem mail alerts also
Resolve the Issue
After the reboot, login into ESXI host
Expected result:
"Problem has been resolved - VMware Hypervisor has been restarted "
It will send resolved mail alerts also