Command-line management in vsphere 5.0 for service console users
Command-line management in vsphere 5.0 for service console users
Command-line management in vsphere 5.0 for service console users
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Table 3. esxcli syslog Options (Cont<strong>in</strong>ued)<br />
Option Description<br />
config logger list Show currently configured sub-loggers.<br />
esxcli system syslog Examples<br />
<strong>Command</strong>-L<strong>in</strong>e Management <strong>in</strong> vSphere 5 <strong>for</strong> Service Console Users<br />
config logger set Set configuration options <strong>for</strong> a specific sublogger. Use one of the follow<strong>in</strong>g options:<br />
The follow<strong>in</strong>g workflow illustrates how you might use esxcli system syslog <strong>for</strong> log configuration.<br />
1 Show configuration options.<br />
esxcli system syslog config get<br />
Default Rotation Size: 1024<br />
Default Rotations: 8<br />
Log Output: /scratch/log<br />
Logto Unique Subdirectory: false<br />
Remote Host: <br />
2 Set all logs to keep twenty versions, then start overwrit<strong>in</strong>g the oldest log.<br />
esxcli system syslog config set --default-rotate=20<br />
3 Set the rotation policy <strong>for</strong> VMkernel logs to 10 rotations, rotat<strong>in</strong>g at 2MB.<br />
esxcli system syslog config logger --id=vmkernel --size=2048 --rotate=10<br />
4 Send logs to remote host myhost.mycompany.com. The logs will use the default UDP port, 514.<br />
esxcli system syslog config set --loghost='myhost.mycompany.com'<br />
5 Send logs /scratch/mylogs on the remote host myhost.mycompany.com us<strong>in</strong>g TCP/IP port 1514.<br />
esxcli system syslog config set --loghost='tcp://myhost.mycompany.com:1514'<br />
--logdir='/scratch/mylogs'<br />
6 Send a log message <strong>in</strong>to all logs simultaneously.<br />
esxcli system syslog mark --message="this is a message!"<br />
7 Reload the syslog daemon and apply configuration changes.<br />
esxcli system syslog reload<br />
View<strong>in</strong>g Logs <strong>in</strong> the ESXi Shell<br />
--id= – ID of the logger to configure (required)<br />
--reset= – Reset values to default<br />
--rotate= – Number of rotated logs to keep <strong>for</strong> a specific logger (requires<br />
--id)<br />
--size= – Set size of logs be<strong>for</strong>e rotation <strong>for</strong> a specific logger, <strong>in</strong> kilobytes<br />
(requires --id)<br />
In the ESX 4.x shell, the location <strong>for</strong> logs is /var/log. In the ESXi Shell, you can also f<strong>in</strong>d all current logs <strong>in</strong> the<br />
/var/log directory. Some of the logs are symbolic l<strong>in</strong>ks to the /var/run/log directory.<br />
Most logs are at top level and not <strong>in</strong>side a directory under /var/run/log. Available logs depend on which<br />
plug<strong>in</strong>s are <strong>in</strong>stalled and what other changes might have been made to the system. The follow<strong>in</strong>g table lists<br />
some frequently used logs <strong>in</strong> the ESXi Shell.<br />
ESX 4.x shell ESXi 5.x shell Description<br />
/var/log/vmware/hostd.log /var/log/hostd.log Log <strong>for</strong> the host daemon.<br />
/var/log/vmkwarn<strong>in</strong>g /var/log/vmkwarn<strong>in</strong>g.log<br />
/var/log/vmksummary /var/log/vmksummary.log<br />
VMware, Inc. 12