Since I’m interested in all things statistics in vSphere I decided to tackle the question. Finding the metrics to use for this kind of report is not too difficult. Under the PerformanceManager Network section we find the metrics net.received.average and net.transmitted.average. And, provided your Statistics Level is set to 3 for the timeframe you want to report on, the metrics capture statistics on the device level.

Great, exactly what we need! A quick check in the Performance tab in the vSphere Client showed an additional problem to solve. The instance didn’t mention Network Adapter 1 but a number.

Background

It turns out that this number is the internal Key used for the vNICs. Could have been a bit more user-friendly in the vSphere Client 🙂

The solution is quite simple, the script fetches all the vNICs of a VM and then stores the Key together with the human-understandable name in a hash table. This hash table allows the script to replace the Instance value by the Name of the vNIC.