Configuring VMWare ESX4i / vSphere for SNMP

Unlike its slightly older partner ESX3.5i, ESX4i supports both SNMP gets and traps, however to enable / configure it you need to install the new vSphere CLI utility – available from VMWare, you need to be registered, but its free..

Once you have the vSphere CLI, change the the directory where the vSphere binarys are installed, i.e /usr/bin

To configure the communities do the following:

vicfg-snmp.pl –server <hostname> –username <username> –password <password> -c <com1>.
Replace <com1> with the community name you wish to set. Each time you specify a community with this
command, the setings you specify overwrite the previous configuration. To specify multiple communities,
separate the community names with a comma.
For example, to set the communities public and internal on the host host.example.com, you might type
vicfg-snmp.pl –server host.example.com –username user –password password -c public,
internal.

vicfg-snmp.pl –server <hostname> –username <username> –password <password> -c <com1>.

Replace <com1> with the community name you wish to set. Each time you specify a community with this

command, the setings you specify overwrite the previous configuration. To specify multiple communities,

separate the community names with a comma.

For example, to set the communities public and internal on the host host.example.com, you might type

vicfg-snmp.pl –server host.example.com –username user –password password -c public,¬†internal.

To configure the SNMP agent traps do:

vicfg-snmp.pl –server <hostname> –username <username> –password <password> -t <target

address>@<port>/<community>.

Replace <target address>, <port>, and <community> with the address of the target system, the port number

to send the traps to, and the community name, respectively. Each time you specify a target with this

command, the settings you specify overwrite all previously specified settings. To specify multiple targets,

separate them with a comma.

For example, to send SNMP traps from the host host.example.com to port 162 on target.example.com using

the public community, type

vicfg-snmp.pl –server host.example.com –username user –password password -t

target.example.com@162/public.

Enable the SNMP agent by typing

vicfg-snmp.pl –server <hostname> –username <username> –password <password> –enable.

Send a test trap to verify that the agent is configured correctly by typing

vicfg-snmp.pl –server <hostname> –username <username> –password <password> –test.

The agent sends a warmStart trap to the configured target.

To configure the SNMP agent for polling do:

vicfg-snmp.pl –server <hostname> –username <username> –password <password> -p <port>.

Replace <port> with the port for the embedded SNMP agent to use for listening for polling requests.

If the SNMP agent is not enabled, enable it by typing

vicfg-snmp.pl –server <hostname> –username <username> –password <password> –enable.

And there you have it SNMP on ESX4i.

You can follow any responses to this entry through the RSS 2.0 feed.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This blog is kept spam free by WP-SpamFree.