6.0

Table Of Contents
VMware, Inc. 143
Chapter 10 Monitoring ESXi Hosts
esxcli system syslog Examples
Thefollowingworkflowillustrateshowyoumightuseesxcli system syslogforlogconfiguration.Specify
oneoftheoptionslistedin“ConnectionOptionsforvCLIHostManagementCommands”onpage 18inplace
of<conn_options>.
1Showconfigurationoptions.
esxcli <conn_options> system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Logto Unique Subdirectory: false
Remote Host: <none>
2Setalllogstokeeptwentyrotationsbeforeoverwritingtheoldestlog.
esxcli <conn_options> system syslog config set --default-rotate=20
3SettherotationpolicyforVMkernellogsto10rotations,rotatingat2MB.
esxcli <conn_options> system syslog config logger --id=vmkernel --size=2048 --rotate=10
4Sendlogstoremotehostmyhost.mycompany.com.Thelogswillusethedefaulttransport(UDP)andport
(514).
esxcli system syslog config set --loghost='myhost.mycompany.com'
5 Savethelocalcopyoflogsto/scratch/mylogsandsendanothercopytotheremotehost.
esxcli <conn_options> system syslog config set --loghost='tcp://myhost.mycompany.com:1514'
--logdir='/scratch/mylogs'
Yousetthedirectoryontheremotehostbyconfiguringtheclientrunningonthathost.Youcanusethe
vSphereWebClienttoredirectsystemlogstoaremotehostbychangingtheSystem.global.logHost
advancedsetting.
6Sendalogmessagetoalllogssimultaneously.
esxcli <conn_options> system syslog mark --message="this is a message!"
7Reloadthesyslogdaemonandapplyconfigurationchanges.
esxcli <conn_options> system syslog reload
Managing ESXi SNMP Agents
SimpleNetworkManagementProtocol(SNMP)allowsmanagementprogramstomonitorandcontrol
networkeddevices.YoucanmanagevSphere5.0SNMPagentswithvicfg-snmpcommandsdiscussedhere.
vCenterServerandESXisystemsincludedifferentSNMPagents.
config logger list Showcurrentlyconfiguredsubloggers.
config logger set Setconfigurationoptionsforaspecificsublogger.Useoneofthefollowingoptions.
--id=<str>IDoftheloggertoconfigure(required).
--reset=<str>Resetvaluestodefault.
--rotate=<long>Numberofrotatedlogstokeepforaspecificlogger(requires--id).
--size=<long>Sizeoflogsbeforerotationforaspecificlogger,inKB(requires--id).
Option Description
IMPORTANTSignificantenhancementstoSNMP,includingsupportforSNMPv3,areincludedinESXi5.1.The
newfunctionalityismanagedthroughESXCLIcommands.SeethevSphereMonitoringandPerformance
documentationthatisavailableinthevSphere5.1DocumentationCenter.