6.0

Table Of Contents
VMware, Inc. 145
Chapter 10 Monitoring ESXi Hosts
2Setthetargetaddress,portnumber,andcommunity.
esxcli <conn_options> system snmp set -t target.example.com@163/public
Eachtimeyouspecifyatargetwiththiscommand,thesettingsyouspecifyoverwriteallpreviously
specifiedsettings.Tospecifymultipletargets,separatethemwithacomma.
YoucanchangetheportthattheSNMPagentsendsdatatoonthetargetusingthe--targetsoption.
ThatportisUDP162
bydefault.
3 (Optional)EnabletheSNMPagentifitisnotyetrunning.
esxcli <conn_options> system snmp set --enable=yes
4 (Optional)Sendatesttraptoverifythattheagentisconfiguredcorrectly.
esxcli <conn_options> system snmp test
TheagentsendsawarmStarttraptotheconfiguredtarget.
Configuring a Trap Destination with vicfg-snmp
1Makesureacommunityissetup.
vicfg-snmp <conn_options> --show
Current SNMP agent settings:
Enabled: 1
UDP port: 161
Communities: public
Notification targets:
2Runvicfg-snmp --targetwiththetargetaddress,portnumber,andcommunity.
vicfg-snmp <conn_options> -t target.example.com@163/public
Eachtimeyouspecifyatargetwiththiscommand,thesettingsyouspecifyoverwriteallpreviously
specifiedsettings.Tospecifymultipletargets,separatethemwithacomma.
YoucanchangetheportthattheSNMPagentsendsdatatoonthetargetusingthe--targetsoption.
ThatportisUDP162bydefault.
3 (Optional)EnabletheSNMPagentifitisnotyetrunning.
vicfg-snmp <conn_options> --enable
4 (Optional)Sendatesttraptoverifythattheagentisconfiguredcorrectly.
vicfg-snmp <conn_options> --test
TheagentsendsawarmStarttraptotheconfiguredtarget.
Configuring the SNMP Agent for Polling
IfyouconfiguretheESXiembeddedSNMPagentforpolling,itcanlistenforandrespondtorequestssuchas
GETrequestsfromSNMPmanagementclientsystems.
Bydefault,theembeddedSNMPagentlistensonUDPport161forpollingrequestsfrommanagement
systems.Youcanusethevicfg-snmpcommandto
configureanalternativeport.Toavoidconflictswithother
services,useaUDPportthatisnotdefinedin/etc/services.
Configuring the SNMP Agent for Polling with ESXCLI
1Runvicfg-snmp --targetwiththetargetaddress,portnumber,andcommunity.
vicfg-snmp <conn_options> -c public -t target.example.com@163/public
IMPORTANTBoththeembeddedSNMPagentandtheNetSNMPbasedagentavailableintheESX4.xservice
consolelistenonUDPport161bydefault.IfyouareusinganESX4.xsystem,changetheportforoneagent
toenablebothagentsforpolling.