Enabling SNMP on ESXi 5

Some people have asked how to enable SNMP on ESXi 5.  The process is identical to how you would on ESXi 4.x.  Here’s how:

  1. Connect to your vMA instance through Putty, SecureCRT or whatever app you use.
  2. Add the server:  vifp addserver vs-esxi.vsential.com (This is only needed if you haven’t already added the target!)
  3. Set your target:  vifptarget -s vs-esxi.vsential.com
  4. Configure SNMP Community:  vicfg-snmp –communities vscomname
  5. Configure SNMP Trap Host:  vicfg-snmp –targets TrapHostIP@161/vscomname
  6. Enable SNMP on the ESXi host:  vicfg-snmp –enable

You can show the configuration by typing:  vicfg-snmp –show

That’s it…now you can snmpwalk the host from the Trap host you configured earlier by typing:  snmpwalk -v2c -cvscomname vs-esxi.vsential.com

You can check out VMware KB Article 1008065 for information on how to configure this as well which uses VMware vSphere RCLI instead of the vMA.

If you have any questions, comments, or suggestions then please sound off in the comments!

  • Josh

    Is there a way to set the location and contact attributes?

    • James Bowling

      Off of the top of my head, I don’t believe so. Let me do some digging around and I will post back.

  • dry4ng

    There is a small typo: vifcfg-snmp –enable
    Thanks for the useful guide.

    • James Bowling

      Thanks for pointing that out! I have updated the post.

  • http://nxwiki.blogspot.com raj

    by default there is no snmp package installed on esxi5.0

    • James Bowling

      Actually, and SNMP daemon IS installed by default. You just need to enable it through the ESXi firewall.

  • http://twitter.com/withanHdammit With an H

    Any luck on finding how to set Contact & Location attributes?

    • James Bowling

      I have not…sorry. I will see what I can find over the weekend for you!

      • http://twitter.com/withanHdammit With an H

        Thanks!!

        • http://vsential.com/ James Bowling

          From what I have found so far there isn’t a way. I will keep digging just in case.

  • http://twitter.com/hamador Anthony

    Hi, I can’t enable snmp on esxi 5 :(

    D:Program FilesVMwareVMware vSphere CLI>vicfg-snmp.pl –show
    Current SNMP agent settings:
    Enabled : 0
    UDP port : 161
    Communities :
    Notification targets :
    Options :
    EnvEventSource=indications

    D:Program FilesVMwareVMware vSphere CLI>vicfg-snmp.pl –enable
    Enabling agent…
    Failed : fault.RestrictedVersion.summary

    • http://vsential.com/ James Bowling

      You seem to be missing the information for what server you are connecting to in your vSphere CLI commands there. I believe you need to do:

      vicfg-snmp.pl –server ESXiHostOrIP –username root –password Password –enable

      I don’t typically use the vSphere CLI. Let me know if that works.

      • http://twitter.com/hamador Anthony

        J’utilisais déjà ces paramètres ! (nettoyage lors du copier/coller pour le poste précédent)

        J’ai cru voir sur Internet qu’il n’est pas possible d’activer snmp sur ESXi 5 (mais seulement ESX 5 :/)

        Vous utilisiez quoi pour l’activation du snmp service ?

        • http://vsential.com/ James Bowling

          Well, SNMP works on ESXi 5 hence I wouldn’t have posted this article! :P And there is no such thing as ESX 5 as ESX Classic was discontinued back a while ago. I use the vMA or vSphere Management Assistant in full.

        • http://vsential.com/ James Bowling

          Also, are you using the free version of ESXi? If so, you might get that error you are getting because the vCLI/rCLI only gets read-only access to the file system.

  • http://www.facebook.com/paul.poppleton Paul Poppleton

    Using this tool I get an error if I try to add more than 3 targets… is this a limitation of esx?

    • http://vsential.com/ James Bowling

      As far as I know there isn’t a limit. Let me do some testing and I will let you know what I find.
      James Bowling