Favorite command Next to ESXTOP for many VMware administrators will be ESXCLI. It provides you with the handfull of information, which you are really looking for.You can manage many aspects of an ESXi host with the ESXCLI command set.You can run ESXCLI commands as vCLI commands or run them in the ESXi Shell in troubleshooting situations.You can also run ESXCLI commands from the PowerCLI shell by using the Get-EsxCli cmdlet. Below are the Available namespaces which are available as part of ESXCLI command.
Formatting the Output of ESXCLI:
Let’s focus on how to use the ESXCLI command to get the output formatted. In may use cases, We may want to import the output data to Excel Spreedsheet to send the report to your manager or even it can be used during maintenance. Default output of esxcli command will not really allow you to properly copy the formatted data for excel because of default formatter. Even you may also not interested with the all the fields of your ESXCLI output. You may be interested with some specific fields in the ouput.
Let’s consider the output of the command: esxcli network nic list
esxcli –formatter=csv –fromat-param-fields=”Name,Driver,Speed,MTU” network nic list
I have total of 24 CPU’sThe below command gives me output for around 5 pages but i am only interested with ID, Brand,Corespeed & ClockSpeed.
esxcli hardware cpu list
esxcli –formatter=csv –format-param=fields=”ID,Brand,Core Speed,Bus Speed” hardware cpu list
Data is simply exported into Excel spreadsheet.