Enabling SSH and SNMP on your ESXI 4, Vsphere
There are two ways to go about with this depending upon your installation
a. If your esxi installation is new and/ or your evaluation license is still valid, then go to the section that says Enable SNMP via RCLI
b. If your esxi installation has been in production for a while / and or you got a license installed and your evaluation period has expired then go to the following section which is to enable SNMP via SSH. For this you will need to enable SSH first on your esxi host by following the steps detailed below.
Enabling SSH on your ESXI host.
- Shutdown all your running VM’s on the esxi host and place the host on Maintenance mode.
- Log onto your Esxi Console physically from the box by pressing F2
- Type in your root password
- Press ALT+ F1 to enter the Technical Support login. Beware that any changes from here will not be warranted for support with VMware. So please be careful and test this and practice on a test esxi host before going live with production.
- Type unsupported and press enter
- Type in your root password
at the prompt again and press enter - Now you need to edit the inetd.conf file. To do this type vi /etc/inetd.conf
- Scroll down using your down arrow key sort of towards the end of the screen where you would see two lines starting with #ssh. Place the cursor on top of the # and press delete. Do this for the next line as well.
- Now press SHIFT+: and type wq to save the file.
- Now you will be back at your #prompt. To restart the service type services.sh restart.
- Press ALT+F1 to return to the esxi host console page.
- Press ESC to log off
- Press F12 to initiate your restart of the esxi host.
- You will be promoted for your root password and press enter.
- Press F11 to restart the host.
- Once the esxi host is up and running again use your favourite SSH client mine is Putty and WinSCP to test SSH connectivity to your esxi host.
Enabling SNMP via SSH on your ESXI host.
- Once you got SSH running , download and install WinSCP on your workstation..
-
Open WinSCP and type in the details for your esxi host including IP address, root as the username and root password. Make sure you change connection type to SCP from default SFTP option as shown

-
Once logged in your WinSCP window will look like the follow. On the Esxi host side navigate to /etc/vmware and find the file called snmp.xml

-
Drag and drop the snmp.xml file from the right to the left of the screen.

-
Open the document with your favourite Notepad editor. I am using Notepad++

-
It would have the following default settings:

- First and foremost make a copy of the file before editing it and save it with a different file name so that if something goes wrong you always have a copy of the original.
-
Now do the following editing to it and save it with same file name snmp.xml.

-
Save the file and now go back to WinSCP and drag the file from the left to the right and accept the warning message to overwrite the file

- Once that is done restart your esxi host and test SNMP which will be followed up in the next section.
Enabling SNMP via RCLI ( Only works for New Installation of Esxi , Valuation License still valid state)
- Download the Remote Command Line Interface from Vmware RCLI Download for Vsphere.
- Install it on your workstation.
-
To start RCLI browse to your VMware folder under all programs and kick start the command line under vmware

- At the command prompt type cd bin and then do a dir. This Directory has all the scripts that are required to run a variety of tasks on your esxi and esx servers.
-
Type the following command
vicfg-snmp.pl –server ESXISERVERIP -c SNMPCOMMUNITYSTRING -t MONITORINGSERVERIP@162_or_161/SNMPCOMMUNITYSTRING
- To enable SNMP type vicfg-snmp.pl –server ESXISERVERIP –E
- To show the running config of SNMP on your esxi server type vicfg-snmp.pl –server ESXISERVERIP –s
- To test the SNMP confi type vicfg-snmp –server ESXISERVERIP –T
As you may have seen in the heading of this section this works only for new installation of esxi or those that have their Valuation license still valid (60 Days). For those who don’t fall into the category the only option is to go with SSH and then enabling SNMP option.
You will see this error if you try via RCLI

This is because remote write permission is disabled on the free version of esxi.

Now user your favourite SNMP monitoring station Cacti, Zenoss, Spiceworks there are so many to start monitoring your Esxi environment.
Next post update on this will be to check on Cacti monitoring these ladies
I would really appreciate some feedback for this article as to if this can be done in a simpler way or if there is a way to hack the write permission issue for the free esxi hosts.
Cheers
No related posts.
DIY Digital Photo Frame Exchange 2010 with Outlook 2003 issues « Steve Knutson’s IT Blog
Pingback: Enabling SSH and SNMP on your ESXI 4, Vsphere | scandals of an ITian
Pingback: Aben Samuel
Pingback: zenoss
Pingback: Ryan Trauntvein
Pingback: CaptainTweet
Pingback: Stephan Hadan
Pingback: Tweets that mention Enabling SSH and SNMP on your ESXI 4, Vsphere | scandals of an ITian -- Topsy.com
Pingback: Aben Samuel
Pingback: Aben Samuel
Pingback: Aben Samuel
Pingback: david.huang
Pingback: onion_soup
Pingback: Gabrie
Pingback: Matt Simmons
Pingback: Aben Samuel