6.5
Table Of Contents
- vSphere Command-Line Interface Concepts and Examples
- Contents
- About This Book
- vSphere CLI Command Overviews
- Introduction
- List of Available Host Management Commands
- Targets and Protocols for vCLI Host Management Commands
- Supported Platforms for vCLI Commands
- Commands with an esxcfg Prefix
- ESXCLI Commands Available on Different ESXi Hosts
- Trust Relationship Requirement for ESXCLI Commands
- Using ESXCLI Output
- Connection Options for vCLI Host Management Commands
- Connection Options for DCLI Commands
- vCLI Host Management Commands and Lockdown Mode
- Managing Hosts
- Managing Files
- Managing Storage
- Introduction to Storage
- Examining LUNs
- Detach a Device and Remove a LUN
- Reattach a Device
- Working with Permanent Device Loss
- Managing Paths
- Managing Path Policies
- Scheduling Queues for Virtual Machine I/O
- Managing NFS/NAS Datastores
- Monitor and Manage FibreChannel SAN Storage
- Monitoring and Managing Virtual SAN Storage
- Monitoring vSphere Flash Read Cache
- Monitoring and Managing Virtual Volumes
- Migrating Virtual Machines with svmotion
- Configuring FCoE Adapters
- Scanning Storage Adapters
- Retrieving SMART Information
- Managing iSCSI Storage
- iSCSI Storage Overview
- Protecting an iSCSI SAN
- Command Syntax for esxcli iscsi and vicfg-iscsi
- iSCSI Storage Setup with ESXCLI
- iSCSI Storage Setup with vicfg-iscsi
- Listing and Setting iSCSI Options
- Listing and Setting iSCSI Parameters
- Enabling iSCSI Authentication
- Set Up Ports for iSCSI Multipathing
- Managing iSCSI Sessions
- Managing Third-Party Storage Arrays
- Managing Users
- Managing Virtual Machines
- Managing vSphere Networking
- Introduction to vSphere Networking
- Retrieving Basic Networking Information
- Troubleshoot a Networking Setup
- Setting Up vSphere Networking with vSphere Standard Switches
- Setting Up Virtual Switches and Associating a Switch with a Network Interface
- Retrieving Information About Virtual Switches
- Adding and Deleting Virtual Switches
- Checking, Adding, and Removing Port Groups
- Managing Uplinks and Port Groups
- Setting the Port Group VLAN ID
- Managing Uplink Adapters
- Adding and Modifying VMkernel Network Interfaces
- Managing VMkernel Network Interfaces with ESXCLI
- Add and Configure an IPv4 VMkernel Network Interface with ESXCLI
- Add and Configure an IPv6 VMkernel Network Interface with ESXCLI
- Managing VMkernel Network Interfaces with vicfg-vmknic
- Add and Configure an IPv4 VMkernel Network Interface with vicfg-vmknic
- Add and Configure an IPv6 VMkernel Network Interface with vicfg-vmknic
- Setting Up vSphere Networking with vSphere Distributed Switch
- Managing Standard Networking Services in the vSphere Environment
- Setting the DNS Configuration
- Manage an NTP Server
- Manage the IP Gateway
- Setting Up IPsec
- Manage the ESXi Firewall
- Monitor VXLAN
- Monitoring ESXi Hosts
- Index
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 conguring 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 seing.
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 conguration 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. Conguring and enabling the agent requires
that you perform the following tasks.
1 Congure SNMP communities. See “Conguring SNMP Communities,” on page 166.
2 Congure the SNMP agent. You have the following choices.
n
“Conguring the SNMP Agent to Send Traps,” on page 166
n
“Conguring the SNMP Agent for Polling,” on page 168
Configuring SNMP Communities
Before you enable the ESXi embedded SNMP agent, you must congure at least one community for the
agent.
An SNMP community denes 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 congure 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 seings that you specify overwrite the previous
conguration.
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 congure 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.