VMWare Monitoring in Zabbix

Ive pulled together information from a few places to get something that worked for me together so here goes….

Our setup is Zabbix 3 and ESXi 6.

Any questions just give me a shout…

1. on the ESXi hosts, enable SNMP:
– esxcli system snmp set -r
– esxcli system snmp set -c your-community-string
– esxcli system snmp set -C your-contact-info (e.g., e-mail address)
– esxcli system snmp set -e yes

While in the command line find the uuid of the host for later

# esxcli system uuid get

(note this down for each host)
2. create a user (e.g., ‘zabbix-vmw’) which has (read-only) access to the VMware environment

3. make full clones of the templates involved
– Configuration -> Templates -> Template Virt VMware
— click ‘Full clone’
— change the Template name e.g., to Template XXX Virt VMware
— click ‘Add’
– repeat for
— Template Virt VMware Guest
— Template Virt VMware Hypervisor
(This step is optional, but I found that having the original templates around helps when I make a mistake in adjusting a template)

4. on the zabbix server, edit the server config file (on my server: /etc/zabbix/zabbix_server.conf) and assign appropriate values for
– StartVMwareCollectors
– VMwareCacheSize
– VMwareFrequency
– VMwarePerfFrequency
– VMwareTimeout

5. in Zabbix, create a host group:
– Configuration -> Host groups -> Create host group
— Group name: VMware
— Hosts in:
—- Template XXX Virt VMware
—- Template XXX Virt VMware Guest
—- Template XXX Virt VMware Hypervisor

6. in zabbix, create a new host:
The new host I created on Zabbix is not a real host. It’s just a name I gave to an IP-address that is not in use.
– Configuration -> Hosts -> Create host
— Host
— Host name: This is where i had to use the UUID collected in stage one
— Display Name: Use the name of the host to recognise as you wont remember the UUID,
— Groups: VMware
— Agent interfaces: Remove
— SNMP interfaces: 10.10.10.199 – – IP – 161
— Description: dummy host for zabbix discovery
— Templates
— Template XXX Virt VMware
— Template XXX Virt VMware Guest
— Template XXX Virt VMware Hypervisor
— Macros
— Host macros
{$URL} => ‘https://your-vcenter-node/sdk’
{$USERNAME} => zabbix-vmw (i.e., the account created in step 2)
{$PASSWORD} => password of zabbix-vmw account

7. in zabbix, create a discovery rule:
– Configuration -> Discovery -> Create discovery rule
— Name: ‘discover VMware’
— IP range: 10.10.10.200-220,192.168.10.220
— Checks:
— ICMP ping
— SNMPv2 agent
—- Port range: 161
—- SNMP community: your-community-string
—- SNMP OID: 1.3.6.1.4.1.6876.1
— Device uniqueness criteria: IP address

8. in zabbix, create an action (basically telling Zabbix what to do when the discovery rule finds an ESXi host):
– Configuration -> Actions -> Create action
— Action
— Name: Auto discovery. VMware
— Conditions
— Type of calculation: A and B and C
— Conditions:
—- Label A: Discovery status = Up
—- Label B: Service type = SNMPv2 agent
—- Label C: Host IP = 10.10.10.200-220,192.168.10.220
— Operations
—- Add to host groups: VMware
—- Link to templates: Template XXX Virt VMware

3 thoughts on “VMWare Monitoring in Zabbix

  • For the host macro, this is the URL of Vsphere or one of the esxi servers itself?

    — Host macros
    {$URL} => ‘https://your-vcenter-node/sdk’

    so https://vsphere-ip/sdk
    or
    https://esxi-server-ip/sdk

    Also the OID, is this version specific, so different in 6.0 vs 6.5? what is this matching against? I have Vsphere 6.5 and when I do an snmpwalk and grep for that exact OID I don’t get a match, but I do for other similar ones.

    Thanks!

    • Im connecting and monitoring each host so my macros are

      {$PASSWORD}
      {$URL}
      {$USERNAME}

      The account im using is the root account and the URL i have is https:///sdk

      Im also running ESXi 6.5 Update 1 ive duplicated the Key (for exmample) vmware.hv.memory.size.ballooned[{$URL},{$UUID}] and i use vmware.hv.memory.size.ballooned[{$URL},{HOST.HOST}]

      Hope that helps.

      Mike

  • Thanks for a great post but I would like to verify something;
    In step 6 SNMP interfaces – do you put the vCenter IP or add multiple SNMP interfaces but adding the IPs of the ESXi hosts?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.