Wednesday, October 22, 2014

How to configure syslog with esxcli

Configuring Local and Remote Logging using the esxcli command

Local and Remote syslog functionality can be configured for a host using the esxcli command line utility, which can be used at the console of an ESXi host, in the vCLI, or in the vMA.

Open a ESXi Shell console session where the esxcli command is available, such as the vCLI or on the ESXi host directly.

If you want to display the current options for syslog, type the following.

# esxcli system syslog config get


Default Network Retry Timeout: 180
   Local Log Output: /scratch/log
   Local Log Output Is Configured: false
   Local Log Output Is Persistent: true
   Local Logging Default Rotation Size: 1024
   Local Logging Default Rotations: 8
   Log To Unique Subdirectory: false

   Remote Host: <none>

If you want to send the logs to a particular host, type the following.

# esxcli system syslog config set --loghost='tcp://10.1.1.1:514' (or udp)

If you want to specify a particular directory, type the following.

# esxcli system syslog config set --logdir=/directory1

To reload the configuration, type the following.

# esxcli system syslog reload

Log Files:

# tail -f /var/log/.vmsyslogd.err

2 comments:

Note: Only a member of this blog may post a comment.