6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
144 VMware, Inc.
vCenterServerSNMPagent.TheSNMPagentincludedwithvCenterServercansendtrapswhenthe
vCenterServersystemisstartedorwhenanalarmistriggeredonvCenterServer.ThevCenterServer
SNMPagentfunctionsonlyasatrapemitteranddoesnotsupportotherSNMPoperations(forexample,
GET).
YoucanmanagethevCenterServeragentwiththevSphereWebClientbutnotwiththevCLIcommand.
HostbasedembeddedSNMPagent.ESXi4.0andlaterincludesanSNMPagentembeddedinthehost
daemon(hostd)thatcansendtrapsandreceivepollingrequestssuchasGETrequests.
YoucanmanageSNMPonESXihostswiththevicfg-snmpvCLIcommand,butnotwiththevSphere
Clientor
withtheESXCLIcommand.
NetSNMPbasedagent.VersionsofESXreleasedbeforeESX/ESXi4.0includeaNetSNMPbasedagent.
YoucancontinuetousethisNetSNMPbasedagentinESX4.xwithMIBssuppliedbyyourhardware
vendorandotherthirdpartymanagementapplications.However,tousetheVMwareMIBfiles,
youmust
usethehostbasedembeddedSNMPagent.
TousetheNETSNMPbasedagentandhostbasedembeddedSNMPagentatthesametime,makeoneofthe
agentslistenonanondefaultport.Bydefault,bothagentsusethesameport.
ThehostbasedembeddedSNMPagentis
disabledbydefault.Configuringandenablingtheagentrequires
thatyouperformthefollowingtasks:
1ConfigureSNMPCommunities.See“ConfiguringSNMPCommunities”onpage 144.
2ConfiguretheSNMPAgent.Youhavethefollowingchoices:
“ConfiguringtheSNMPAgenttoSendTrapsonpage 144
“ConfiguringtheSNMPAgentforPolling”onpage 145
Configuring SNMP Communities
BeforeyouenabletheESXiembeddedSNMPagent,youmustconfigureatleastonecommunityfortheagent.
AnSNMPcommunitydefinesagroupofdevicesandmanagementsystems.Onlydevicesandmanagement
systemsthataremembersofthesamecommunitycanexchangeSNMPmessages.Adeviceormanagement
systemcan
beamemberofmultiplecommunities.
ToconfigureSNMPcommunities,runesxcli system snmp setorvicfg-snmp -c,specifyinga
commaseparatedlistofcommunities.Forexample:
esxcli system snmp set -c public, internal
vicfg-snmp <conn_options> -c public, internal
Eachtimeyouspecifyacommunitywiththiscommand,thesettingsthatyouspecifyoverwritetheprevious
configuration.
Configuring the SNMP Agent to Send Traps
YoucanusetheSNMPagentembeddedinESXitosendvirtualmachineandenvironmentaltrapsto
managementsystems.Toconfiguretheagenttosendtraps,youmustspecifyatarget(receiver)address,the
community,andanoptionalport.Ifyoudonotspecifyaport,theSNMPagentsendstraps
toUDPport162
onthetargetmanagementsystembydefault.
Configuring a Trap Destination with ESXCLI
1Makesureacommunityissetup.
esxcli system snmp get <conn_options>
Current SNMP agent settings:
Enabled: 1
UDP port: 161
Communities: public
Notification targets: