PowerCLI

If you prefer PowerCLI, you can use it for CLI-based monitoring as well. From my perspective, it is an excellent tool because it allows you to monitor not only an individual ESXi hypervisor, but you can connect directly to vCenter Server to monitor multiple objects in your inventory.

So, let's start with the monitoring itself.

As a first step, you need to connect to your ESXi hypervisor or vCenter Server, as follows:

Connect-VIServer

If you are not sure what parameters are available with a particular command, you can always check the help of a command using the Get-Help command.

As a next step, you will probably want to know what statistics are available for a particular object through the following command:

Get-StatType -Entity VMname

Based on your statistics-level configuration, different metrics will be available, as follows:

cpu.usage.average
cpu.usagemhz.average
cpu.ready.summation
mem.usage.average
disk.usage.average
net.usage.average
sys.uptime.latest
disk.used.latest
disk.provisioned.latest
disk.unshared.latest

Lastly, you can retrieve particular metric using the Get-Stat command, as follows:

Get-Stat -Entity VMname -Disk -IntervalSecs 30

A similar output will be retrieved:

MetricId Timestamp Value Unit Instance
-------- --------- ----- ---- --------
disk.usage.average 2/15/2019 11:16:20 AM 51 KBps
disk.usage.average 2/15/2019 11:16:00 AM 46 KBps
disk.usage.average 2/15/2019 11:15:40 AM 165 KBps
disk.usage.average 2/15/2019 11:15:20 AM 81 KBps
disk.usage.average 2/15/2019 11:15:00 AM 67 KBps
disk.usage.average 2/15/2019 11:14:40 AM 60 KBps
disk.usage.average 2/15/2019 11:14:20 AM 52 KBps

For more information, feel free to visit the official PowerCLI reference guide available at https://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset