Oxalide / vsphere-influxdb-go

Collect VMware vSphere, vCenter and ESXi performance metrics and send them to InfluxDB
GNU General Public License v3.0
215 stars 61 forks source link

How to fetch network usage? #100

Closed aledalla closed 4 years ago

aledalla commented 4 years ago

I'm working into similar project but i can't fetch network usage. Are you been able to fetch the vnics usage?

BrandonAUS commented 4 years ago

Is it enabled in your config file? Also, does your vcenter appliance have the correct logging level enabled?

aledalla commented 4 years ago

I am using Pyvmomi which is the python library, anyway i just need to know where to fetch from networks usage (in vnics packets terms or also in the phisical nics). In my project I'm quering Esxi directly, but I decided to contact you because I can't find these info anywhere. I found this metric but results unset for me

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/fe08899f-1eec-4d8d-b3bc-a6664c168c2c/7fdf97a1-4c0d-4be0-9d43-2ceebbc174d9/doc/vim.host.RuntimeInfo.PnicNetworkResourceInfo.html

sofixa commented 4 years ago

You need to use PerfManager ( an example on the pyvmomi community samples https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/esxi_perf_sample.py ) with the appropriate metrics, which you can see here http://www.virten.net/2015/05/vsphere-6-0-performance-counter-description/

aledalla commented 4 years ago

Thank you, Now i have another question: i am using the metric called received(average) to gather average of download speed during the 20 seconds interval, not editable for just esxi. The problem is that the value is totally wrong; i tried to download a large file in a virtual machine, and in the meanwhile checking the returned metric; if I download the file in the vm with 3 MB/s I can't figure out how is possible that that metric always return a "fake value" like 100 (in the doc they say the returned value is expressed in kb/s)

A "fake" value is also reported in the network monitoring by Vmware web client. I tried also with other metrics like "net average" to cover down and up links togheter but the probleb is the same, all these data seem fake to me; I really don't know why. Hope someone help

sofixa commented 4 years ago

Hi @aledalla sorry for the delay, don't know if you got it fixed or not, but iirc the "20 second" interval is "realtime", so the values you get are just the latest in a bunch, you should be looking at one minute average/maximums