Ad Widget

Collapse

VMware ESXi 6.0 monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stefferd
    Junior Member
    • Mar 2016
    • 4

    #1

    VMware ESXi 6.0 monitoring

    Hi,
    I am quite new to Zabbix but i have managed to find nearly all my answers in documentation and forums. Currently i am in a testing mode to see if Zabbix fits my needs - and it does more than what i initially needed / expected. Thanks for that, Zabbix devs!
    All the hosts i set up untill now are monitored perfectly. I had some itches and scratched them untill they worked.

    I am having issues though - and i have tried about anything i could find in docs and forums.

    I am running the appliance version of Zabbix 3.0 on Ubuntu server.

    So i need to monitor a single instance of a VMware ESXi 6.0 server.

    I've set up 4 different hosts pointing to the ESXi server - all with different tempates linked to it.

    -I tried to install the Zabbix agent on it - failed due to no /proc/stat available on it. Found that in the forums as well...

    -I set up SNMP on the ESXi host. The "Template SNMP OS ESXi" collects no data and no graphs become available (Allthough the "Template SNMP OS Linux" gathers datastore data an available RAM - so in some sort of way SNMP collection seems to work.

    - The host linked to the "Template virt vmware" has the right macros set up: $URL,$USER and $PASSWORD. All discovery rules and Items in the host show "Not Supported"

    -In the 'Template virt VMware hypervisor" template i changed all (HOST.HOST) entry's to $UUID as found in the forums, but same problem: Items show "Not Supportded". The error message shows "Cannot login due to an incorrect user name or password"
    I am sure that the $USER and $PASSWORD macros are correct in the host's configuration. I firts tried root as a user to connect to my ESXi host, which had the same problem - so i figured maybe the problem could be that my ESXi host refuses root acces through the sdk url, but I created a new user/password comination and it still doesn't work.
    FYI: between every change i rebooted the server, just to make sure...

    The zabbix-server.log shown no errors, though.

    What am I missing out here??? is there someone who might push me in the right direction?

    Tia,

    Stefferd
    Last edited by Stefferd; 21-03-2016, 11:28.
  • pc99096
    Senior Member
    • Oct 2011
    • 193

    #2
    one of the most common mistakes is not to have the following line in zabbix_server.conf:

    StartVMwareCollectors=1


    and then obviously zabbix-server restart

    Comment

    • Stefferd
      Junior Member
      • Mar 2016
      • 4

      #3
      Thanks, PC99096. But that line is in the conf file and the logfile shows that VMware collectors have started.

      The number is different, though. The manual states that the amount of collectors should be the double of running servers + 1 . Since it will not be the only monitored server after testing one, the line says:

      StartVMwareCollectors=20

      Could that be a problem? It can be set to a top of 250 collectors.

      Tia,

      Stefferd

      Comment

      • pc99096
        Senior Member
        • Oct 2011
        • 193

        #4
        StartVMwareCollectors=20 is fine

        this is definitely the right approach:
        - The host linked to the "Template virt vmware" has the right macros set up: $URL,$USER and $PASSWORD. All discovery rules and Items in the host show "Not Supported"

        BUT

        the correct macro names are
        {$PASSWORD}
        {$USERNAME}
        {$URL}

        where {$URL} = https://IP_OR_HOSTNAME/sdk

        Comment

        • Stefferd
          Junior Member
          • Mar 2016
          • 4

          #5
          Yes indeed, i set up the macro's between the brackets - that was filled in right. I just wrote it down the lazy way in this forum, wherefore i excuse myself - thing have to be right ofcourse...
          Now the funny thing is that i just checked the server and it started collecting data merely more than 24 hours after my last configuration change. So magically it all seems to work now.Now I just wonder why Zabbix had this delay and why it kept on saying that my credentials were wrong.
          I changed nothing in the configuration anymore after asking help on the forum, and changed nothing on the ESXi server...

          Thanks for your help, i will try to figure out what exactly has happened here.

          Comment

          • Stefferd
            Junior Member
            • Mar 2016
            • 4

            #6
            Same problem - different server

            Now i set up another ESXi6 server, and another Zabbix appliance. Both with the same ISO files that I used in the previous setup. I exported the working template from my ESXi server to the new Zabbix installation on the new ESXi server, did the nescessary changes zo the zabbix_server.conf file to make sure VMwarecollectors are starting and created a host with the imported template that works on my other ESXi server. Set the right macro's and configured the host and template well - as it is working on my first setup, and you know what?
            It states: "Cannot complete login due to an incorrect user name or password" - exactly the same problem i used to have on my previous server. I didn't know back then why it suddenly started working and i don't know now why it is not working (waited 48Hrs to see if it would just start - but it doesn't)
            Does anybody know why VMware monitoring is acting this way? It is really acting funny. Is there something i have to change on my ESXi host? Some firewall exception in the security setup? Something in the config that I have to change?
            It's the second time that i am biting my teeth over this issue and i can't figure out something more to do.
            Tia,
            Stefferd

            Comment

            • herta
              Senior Member
              • Sep 2011
              • 101

              #7
              this worked for me

              (Zabbix 3.0.2 on Ubuntu 14.04).

              Largely using the guidelines at https://www.zabbix.com/documentation...ing?s[]=vmware, this pretty much configured like a breeze, once I gave up trying to configure the nodes myself and let autodiscovery do the work.
              Especially the example towards the bottom of that page helped a lot.

              Perhaps a full step-by-step example can clarify things further.

              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

              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: dummy
              *** 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

              There was no need to replace HOST.HOST by $UUID as suggested in some other posts.

              If you want to speed up thing, you can temporarily set the Delay in the Discovery rule to a lower value. (Don't forget to switch it back afterwards.)

              Hope this helps someone.
              Last edited by herta; 19-05-2016, 11:45. Reason: correct typo in step 8 (Template Virt VMware -> Template XXX Virt VMware)

              Comment

              • george.hagi
                Junior Member
                • Aug 2016
                • 12

                #8
                New esxi problem?

                I try this way, and much much other ways, to collect data from esxi 6, some collectors like network or disk works, but the most needed memory not - any idea on compatible template on esxi 6?
                Last edited by george.hagi; 25-08-2016, 15:52.

                Comment

                • danielvansid
                  Junior Member
                  • Jan 2016
                  • 5

                  #9
                  Originally posted by herta
                  (Zabbix 3.0.2 on Ubuntu 14.04).
                  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

                  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: dummy
                  *** 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
                  Hi all,

                  I did everything as described, but it can't discover any host (
                  I put esxi ip not a vcenter - {$URL} => 'https://my-esxi-node(not vcenter)/sdk'
                  Any suggestions?

                  Comment


                  • ilfox
                    ilfox commented
                    Editing a comment
                    Can this method be used in a way to monitor the physical hosts running ESXi 6.5? Thanks.
                • mzimm88
                  Junior Member
                  • Oct 2016
                  • 5

                  #10
                  Have you allowed zabbix traffic through on the esxi firewall? when you curl the /sdk url what happens?

                  Comment

                  • danielvansid
                    Junior Member
                    • Jan 2016
                    • 5

                    #11
                    Originally posted by mzimm88
                    Have you allowed zabbix traffic through on the esxi firewall? when you curl the /sdk url what happens?
                    Thank you for response, but after few hours it discover all VMs

                    I didnt understand one thing. Why I need create discovery rule and action, if all discovery done by "dummy" host. And I still need to create dummy for each vcenter/esxi.

                    Comment

                    • redium
                      Junior Member
                      • Dec 2016
                      • 1

                      #12
                      HI,

                      Works this on all free ESXI versions so i don't have VCenter.

                      Comment

                      • vlam
                        Senior Member
                        Zabbix Certified Specialist
                        • Jun 2009
                        • 166

                        #13
                        Hi

                        Has anyone created any triggers for any of the monitored items for vmware and esx?

                        Thanks
                        4 Zabbix Frontend Servers (Load balanced)
                        2 Zabbix App Servers (HA)
                        2 Zabbix Database Servers (HA)
                        18 Zabbix Proxy Servers (HA)
                        3897 Deployed Zabbix Agents
                        6161 Values per second
                        X-Layer Integration
                        Jaspersoft report Servers (HA)

                        Comment

                        • vlam
                          Senior Member
                          Zabbix Certified Specialist
                          • Jun 2009
                          • 166

                          #14
                          Hi

                          When monitoring vSphere it works on some components and then for some I get the following:

                          47840:20171108:191608.637 cannot update performance statistics of vmware service "https://0.0.0.0/sdk": Timeout was reached

                          If I run

                          [root@vsphereproxy ~]# curl https://0.0.0.0/sdk
                          curl: (60) Peer's Certificate issuer is not recognized.
                          More details here: http://curl.haxx.se/docs/sslcerts.html

                          curl performs SSL certificate verification by default, using a "bundle"
                          of Certificate Authority (CA) public keys (CA certs). If the default
                          bundle file isn't adequate, you can specify an alternate file
                          using the --cacert option.
                          If this HTTPS server uses a certificate signed by a CA represented in
                          the bundle, the certificate verification probably failed due to a
                          problem with the certificate (it might be expired, or the name might
                          not match the domain name in the URL).
                          If you'd like to turn off curl's verification of the certificate, use
                          the -k (or --insecure) option.
                          [root@vsphereproxy ~]# curl https://0.0.0.0/sdk -k
                          [root@vsphereproxy ~]#

                          So curl does see it correctly from what I can see

                          It is also a ESXi 6.0/6.5 environment
                          4 Zabbix Frontend Servers (Load balanced)
                          2 Zabbix App Servers (HA)
                          2 Zabbix Database Servers (HA)
                          18 Zabbix Proxy Servers (HA)
                          3897 Deployed Zabbix Agents
                          6161 Values per second
                          X-Layer Integration
                          Jaspersoft report Servers (HA)

                          Comment

                          • ysus
                            Senior Member
                            • Mar 2016
                            • 100

                            #15
                            Make sure you could login to ESXi host

                            https://your host ip address/mob/?mo...are.systemInfo

                            _https://your host ip address/mob/?moid=ha-host&doPath=hardware.systemInfo

                            and note UUID parameter which you must use as Zabbix host name

                            Comment

                            Working...