VMWare ESXi 4 = SNMP via RCLI

In VmWare ESXi 4, VMWare Inc has apparently restricted Remote Command Line Interface (RCLI) administration of the free version of ESXi. The write permission are not possible since we need to upgrade it to full licensed one. This simple tuto is to enable the snmp via rcli

The VSphere Client 4.0 cannot enable/configure snmp on the VmWare ESXi 4. I’ve found that we can enable/configure snmp on Vmware ESXi 4 through the RCLI (remote command line) that are available on Windows and Linux.

Download the RCLI application from the vmware site and install it.

After that, open the Vmware Vsphere CLI.
To start configure, type in the console(in this example, my ESXi IP is 192.168.117.116, destination is 192.168.117.115:

vicfg-snmp.pl –server 192.168.117.116 -c public -t 192.168.117.115@162/public

insert the esxi username and password.

To enable it type:

vicfg-snmp.pl –server 192.168.117.116 -E

To show config:

vicfg-snmp.pl –server 192.168.117.116 -s

To test configuration:

vicfg-snmp –server 192.168.117.116 -T

I have encountered issue with free licensed esxi since it gaves me this error in the first attempt. This is because the write permission has been disabled on the free version:

“Failed : fault.RestrictedVersion.summary”

But, there is a trick where we can write the configuration file:

Go to VMWare Vsphere Client -> Configuration -> Licensed Features -> Edit-> Change to evaluation mode, No License key (if u have not registered/no license, this shouldnt be a problem).

When you have change it, go back to RCLI and try again the first command. This should settle the read/write permission and you can set/configure snmp on Vmware esxi4.

p/s: if error still occur, try rebooting the hosts.

Example below are the configuration:
C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-snmp.pl –server 192.168.117.116 -s
Enter username: root
Enter password:********
Current SNMP agent settings:
Enabled : 1
UDP port : 161

Communities :
public

Notification targets :
192.168.117.115@162/public
——————————————————————
then, try to snmpwalk from another host:

$snmpwalk -v1 -c public 192.168.117.116
SNMPv2-MIB::sysDescr.0 = STRING: VMware ESX 4.0.0 build-181792 VMware, Inc. x86_ 64
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6876.4.1
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (15501613) 1 day, 19:03:36.13
SNMPv2-MIB::sysContact.0 = STRING: not set
SNMPv2-MIB::sysName.0 = STRING: VMserver.localdomain
SNMPv2-MIB::sysLocation.0 = STRING: not set
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
————-more————-

After we have finished setting up the snmp, we can insert back in the VMware VSphere Client our licensed that have been registered with the VMWare ESXi 4.

vmware-esx-snmp-trial
done.

Author: salawank on October 20, 2009
Category: Uncategorized
Tags: , ,
15 responses to “VMWare ESXi 4 = SNMP via RCLI”
  1. xanda says:

    gi cari remote dos VMWare ESX.. masih hangat di pasaran

  2. salawank says:

    ok,nanti ade mase aku main2 ngn benda tu hehe :)

  3. Atefeh says:

    It was really useful for me but still I don’t know how I can get snmp string from ESXi 4 server?

  4. salawank says:

    If you have done the steps above, u can do snmpwalk from another machine. In this example i’m using ubuntu

    $snmpwalk -v1 -c public 192.168.117.116

  5. Antonio says:

    The evaluation mode license has expired and i cannot change from the single server free license to get rid of that Failed : fault.RestrictedVersion.summary error.

    Any help ?

  6. salawank says:

    Hi there Antonio, I would recommend you to apply for another license, since i don’t have answer for that :)

  7. James says:

    Antonio, You might not see this, but for all the Google searches that hit this page,

    This site had a suggestion that worked for me: http://www.vm-help.com/esx40i/manage_without_VI_client_6.php

    You need to do this from the unsupported service console.

    “…I decided to change the ESXi temporarily back to evaluation mode. … I did the following:

    a) Edited /etc/vmware/vmware.lic and deleted the license key.

    b) Deleted the file /etc/vmware/license.cfg

    c) Ran the command services.sh restart

    d) I then queried the license information to check the status. The file /etc/vmware/license.cfg was automatically recreated. You’ll note that for the 1st attempt of the command I got the “514 Error connecting” error. This was due to the services restart sequence completing, but the hostd service not yet being fully up yet.”

  8. salawank says:

    @James: thanks for sharing :)

  9. nixgik says:

    On the console of the Free ESXi 4.0:

    1- Crtl-Alt-F1 (normal way to switch console in Linux)
    2- Type the word unsupported
    3- If 2 above was done right, you will get a password prompt – Enter your ESXi server’s password
    4- vi /etc/vmware/snmp.xml change enabled to ‘true’ and set a community string (save and close this file and snmp works)

  10. salawank says:

    @nixgik : cool! Haven’t try this yet, but it seems producing the same result if we do it via RCLI:

    < config >
    < snmpSettings >
    < communities >public< /communities >
    < enable >true< /enable >
    < targets >192.168.117.115@161 public< /targets >
    < /snmpSettings >
    < /config >

    thanks for sharing :)

    • nixgik says:

      I had the problem with “Failed : fault.RestrictedVersion.summary” and I didn’t want to fiddle with the license. I found that accessing the unsupported console would achieve, as you mentioned, the same result as as RCLI. When I found about the unsupported console I also enabled ssh and admin seems much better that RCLI.

      Does anyone know how to set sysLocation and sysContact

  11. Surfup says:

    Okay, I can get into the ESXi using the “Alt+F1″ and doing stuff. Now, I could not get out of the console prompt back to the “Yellow” screen of ESXi. Is there a “secret” combo key to get out? Help.

  12. Aben says:

    Hi ,

    Many thanks for your post. Got a lot of ideas from here and have also posted enabling SNMP and SSH on esxi post. http://3.ly/nJOe

  13. salawank says:

    Hi Aben,
    thanks for your comments..

    @Surfup, u can press back alt+f1 or f2 if i’m not mistaken.. hardly used it after enabling the ssh service.

  14. salawank says:

    @nixgik,

    i’ve tried as well searching where to set the SysLocation and sysContact. as for this version, there are no snmpd.conf or any snmp configuration to mingle around. i might insert it manually into my network health monitoring software manually.

Leave a Reply

Last articles

5 visitors online now
5 guests, 0 members
Max visitors today: 7 at 02:13 pm GMT-8
This month: 11 at 09-09-2010 11:25 am GMT-8
This year: 21 at 03-24-2010 06:49 pm GMT-8
All time: 43 at 10-20-2009 08:17 am GMT-8

salawank is Digg proof thanks to caching by WP Super Cache