Logging in vSphere 5 has been significantly enhanced. You now have fine-grained control over system logs, the location where logs are sent, and, for each log, default size and rotation policy. You can set up logging with the vSphere Web Client or with the esxcli system syslog command. You can also set up logging behavior for a host by using the Host Profiles interface in the vSphere Web Client and can then import that host profile into other hosts.
■
■
■ vCenter Server and ESXi have SNMP agents. You can set up the vCenter Server SNMP agent with the vSphere Web Client. You can set up the ESXi SNMP agent with the vSphere Web Client or the esxcli system snmp commands. See vSphere Command-Line Interface Solutions and Examples.The esxcli system syslog command allows you to configure the logging behavior of your ESXi system. You can perform the same customizations with the vSphere Web Client, as discussed in vSphere Documentation Center. The command has the following options:
■ --logdir=<path> – Save logs to a given path.
■ --loghost=<host> – Send logs to a given host (see discussion on loghost format below)
■ --logdir-unique=<true|false> – Specify whether the log should go to a unique subdirectory of the directory specified in logdir.
■ --default-rotate=<int> – Default number of log rotations to keep
■ --default-size=<int> – Size before rotating logs, in kilobytes.
■ --id=<str> – ID of the logger to configure (required)
■ --reset=<str> – Reset values to default
■ --rotate=<long> – Number of rotated logs to keep for a specific logger (requires --id)
■ --size=<long> – Set size of logs before rotation for a specific logger, in kilobytes (requires --id)The following workflow illustrates how you might use esxcli system syslog for log configuration.
4 Send logs to remote host myhost.mycompany.com. The logs will use the default UDP port, 514.
5 In the ESX 4.x shell, the location for logs is /var/log. In the ESXi Shell, you can also find all current logs in the /var/log directory. Some of the logs are symbolic links to the /var/run/log directory.Most logs are at top level and not inside a directory under /var/run/log. Available logs depend on which plugins are installed and what other changes might have been made to the system. The following table lists some frequently used logs in the ESXi Shell.
■ Create a diagnostic partition on SAN storage. Each host must have a diagnostic partition of 100MB. If multiple hosts share a SAN, configure a diagnostic partition with 100MB for each host.
■ Install and configure ESXi Dump Collector. New in ESXi, the Dump Collector service allows you to send core dumps to a network server. ESXi Dump Collector is especially useful for determining reasons for failure of ESXi hosts provisioned with Auto Deploy.You can use esxcli system coredump to configure a remote or local core dump partition. You can also use the Network Configuration host profile to set up hosts to use ESXi Dump Collector. For either case, you can apply the host profile of a host that uses ESXi Dump Collector to other hosts.ESXi Dump Collector is one of the services you can install using the vCenter Server system installation package. See vSphere Installation and Setup.
2 Set up ESXi systems that should use ESXi Dump Collector with commands in the esxcli system coredump namespace.
■ get: Retrieve one of the dump partition values.
■ list: List all partitions on the system that have a partition type matching the VMware Core partition type.
■ set: Set the core dump partition for this system.
■ get: Get the currently configure parameters for ESXi Dump Collector (network coredump), if enabled.
■ set: Set the parameters used for network coredump.