6.5

Table Of Contents
Example: Running Commands in Sequence
The following example shows how the commands are run in sequence.
vicfg-snmp <conn_options> –c public –t example.com@162/private --enable
# next validate your config by doing these things:
vicfg-snmp <conn_options> -–test
walk –v1 –c public esx-host
Configure the SNMP Agent for Polling with vicfg-snmp
You can use vicfg-snmp to congure the SNMP agent for polling.
Specify one of the options listed in “Connection Options for vCLI Host Management Commands,” on
page 19 in place of <conn_options>.
Procedure
1 Run vicfg-snmp --target with the target address, port number, and community.
vicfg-snmp <conn_options> -c public -t target.example.com@163/public
Each time you specify a target with this command, the seings you specify overwrite all previously
specied seings. To specify multiple targets, separate them with a comma.
You can change the port that the SNMP agent sends data to on the target by using the --targets
option. That port is UDP 162 by default.
2 (Optional) Specify a port for listening for polling requests.
vicfg-snmp <conn_options> -p <port>
3 (Optional) If the SNMP agent is not enabled, enable it.
vicfg-snmp <conn_options> --enable
4 Run vicfg-snmp --test to validate the conguration.
vicfg-snmp <conn_options> --test
Example: Running Commands in Sequence
The following example shows how the commands are run in sequence.
vicfg-snmp <conn_options> –c public –t example.com@162/private - -enable
# next validate your config by doing these things:
vicfg-snmp <conn_options> -–test
walk –v1 –c public esx-host
Retrieving Hardware Information
Commands in dierent ESXCLI namespaces might display some hardware information, but the esxcli
hardware namespace is specically intended to give you that information. The namespace includes
commands for geing and seing CPU properties, for listing boot devices, and for geing and seing the
hardware clock time.
You can also use the ipmi namespace to retrieve IPMI system event logs (SEL) and sensor data records
(SDR). The command supports both get (single return value) and list (multiple return values) commands
and returns raw sensor information.
See the vCLI Reference or the ESXCLI online help for details.
Chapter 10 Monitoring ESXi Hosts
VMware, Inc. 169