6.5

Table Of Contents
4 Send logs to remote host myhost.mycompany.com. The logs will use the default transport (UDP) and port
(514).
esxcli system syslog config set --loghost='myhost.mycompany.com'
5 Save the local copy of logs to /scratch/mylogs and send another copy to the remote host.
esxcli <conn_options> system syslog config set --loghost='tcp://myhost.mycompany.com:1514' --
logdir='/scratch/mylogs'
You can set the directory on the remote host by conguring the client running on that host. You can use
the vSphere Web Client to redirect system logs to a remote host by changing the System.global.logHost
advanced seing.
6 Send a log message to all logs simultaneously.
esxcli <conn_options> system syslog mark --message="this is a message!"
7 Reload the syslog daemon and apply conguration changes.
esxcli <conn_options> system syslog reload
Managing ESXi SNMP Agents
Simple Network Management Protocol (SNMP) allows management programs to monitor and control
networked devices. You can manage vSphere 5.0 SNMP agents by using vicfg-snmp commands.
The host-based embedded SNMP agent is disabled by default. Conguring and enabling the agent requires
that you perform the following tasks.
1 Congure SNMP communities. See “Conguring SNMP Communities,” on page 166.
2 Congure the SNMP agent. You have the following choices.
n
“Conguring the SNMP Agent to Send Traps,” on page 166
n
“Conguring the SNMP Agent for Polling,” on page 168
Configuring SNMP Communities
Before you enable the ESXi embedded SNMP agent, you must congure at least one community for the
agent.
An SNMP community denes a group of devices and management systems. Only devices and management
systems that are members of the same community can exchange SNMP messages. A device or management
system can be a member of multiple communities.
To congure SNMP communities, run esxcli system snmp set or vicfg-snmp -c, specifying a comma-
separated list of communities as shown in the following examples.
esxcli system snmp set -c public, internal
vicfg-snmp <conn_options> -c public, internal
Each time you specify a community with this command, the seings that you specify overwrite the previous
conguration.
Configuring the SNMP Agent to Send Traps
You can use the SNMP agent embedded in ESXi to send virtual machine and environmental traps to
management systems.
To congure the agent to send traps, you must specify a target address, also referred to as receiver address,
the community, and an optional port. If you do not specify a port, the SNMP agent sends traps to UDP port
162 on the target management system by default.
vSphere Command-Line Interface Concepts and Examples
166 VMware, Inc.