Getting info with the vsish command (esxi only)

VMkernel system information shell (known as vsish) is a great tool for troubleshooting network performance issue. vsish runs in the ESXi shell and lets you look at advanced system parameters and performance information of the ESXi host and associated objects like the VMs.

The vsish tool provides access to vmkernel’s VSI nodes. Other than non-interactive mode’s get and set commands, this tool offers abbreviated command options only.

Note: VSI nodes are to vmkernel what proc nodes are to Linux kernel. They are memory-based hierarchical structures of the various vmkernel components’ runtime settings. To access these nodes, use the ESXi utility vsish (VSI Shell). VSI nodes can change between releases and even with update releases. Therefore, you should not depend on the current naming and location of any nodes to remain unchanged if you plan to automate or script any functionalities using these nodes.

Listing vsish command-line options:

vsish --help

vsish: [options] [commands]

-e: non-interactive mode. Executes commands specified on the cmdline. All text following this flag is assumed to be part of a command.
-E [status]: checks for status, currently requires -e. see vmkapi_status.h for error code strings.
-b: batch mode. doesn't print prompt
-f: ignore vsi version check
-l [level]: set loglevel
-r: raw output mode.
-p: python output mode.
-d: drsa output mode.
-c [file]: use [file] instead of live kernel
-m: print the VSI MD5 checksum corresponding to the running vmkernel
-R [new root]: use [new root] as the root node instead of '/'
-h: print friendly help message

Once the command is typed, the ls command shows the contents of a working directory and the cat command can be used to see the contents of a file. Finally, the cd command can be used to change directories.

Example 1

The first example shows how to get the maximum transfer unit for a particular vmnic.

/bin # vsish
/> cd net
/net/> cd pNics
/net/pNics/> ls
vmnic0/
vmnic1/
vmnic2/
vmnic3/
/net/pNics/> cd vmnic1
/net/pNics/vmnic1/> cat mtu
MTU {
   mtu:1500
}
/net/pNics/vmnic1/> q

Example 2

The second example shows how to gather cpu related information for a host.

/bin # vsish
/> cd hardware
/hardware/> cd cpu
/hardware/cpu/> ls
packageList/
cpuList/
cpuModelName
cacheInfo
cpuInfo
/hardware/cpu/> cat cpuInfo
CPU global information {
   Hyperthreading state:Hyperthreading state: 3 -> enabled
   HV state:HV state: 3 -> HV Enabled
   Number of packages:2
   Number of cores:8
   Number of CPUs (threads):16
   HV Replay capable:1
   Reason replay is disabled on Host:Reason replay is disabled on Host: 0 -> HV Replay is supported
}
/hardware/cpu/> q

Note

The following are some VSI Shell commands for navigation and other common operations:

  • cd: Move down the nodes tree.
  • cd ..: Move up to the previous level.
  • ls—List: the content of the current node.
  • ls [path]: List the content of the node at the end of the specified path.
  • get: List the content of a leaf object in the node. This is the command option used earlier in this section, with the non-interactive mode -e parameter.
  • cat: Do the same thing as the get command but in interactive mode.
  • set: Modify the value of the key/value pair of a leaf object. You can use this option with non-interactive mode to modify vmkernel VSI nodes. For example, to set a value in a VSI node via the command line, run the following command:
    vsish -e set [value] [path/node]
Related Post