Have you ever needed to collect data from SSH and push it into vRops because it cannot be collected any other way? well if so this next post is for you…. in this example I will collect data from net-stats and push it into vRops.

I had a request come through from some colleagues to extract data from esxi net-stats command and push it into vRops. This was after we experienced issues on NSX DLR’s due to VM’s receiving “bursts” of 100K+ packets per second causing the CPU to hit 100%, dropped packets, retransmits…. causing a world of pain for applications.

In this case I was only interested in extracting the values for vmnic3-pollWorldNetpollTx[00], but obviously you can adapt the script for your own needs…. this script does need some improvement but its not intended to run as a permanent solution….but for a few days / weeks during troubleshooting….

Executing net-stats -A -t WwQqihVvh | grep vmnic3 while SSHed into the esxi… you would get an output something like this:

“2097692”: {“id”: 2097692, “used”: 0.09, “ready”: 0.04, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[00]“,
“2097693”: {“id”: 2097693, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[01]”,
“2097694”: {“id”: 2097694, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[02]”,
“2097695”: {“id”: 2097695, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[03]”,
“2097696”: {“id”: 2097696, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[04]”,
“2097697”: {“id”: 2097697, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[05]”,
“2097698”: {“id”: 2097698, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[06]”,
“2097699”: {“id”: 2097699, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollTx[07]”,
“2097700”: {“id”: 2097700, “used”: 0.37, “ready”: 0.04, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[00]”,
“2097701”: {“id”: 2097701, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[01]”,
“2097702”: {“id”: 2097702, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[02]”,
“2097703”: {“id”: 2097703, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[03]”,
“2097704”: {“id”: 2097704, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[04]”,
“2097705”: {“id”: 2097705, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[05]”,
“2097706”: {“id”: 2097706, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[06]”,
“2097707”: {“id”: 2097707, “used”: 0.00, “ready”: 0.00, “cstp”: 0.00, “name”: “vmnic3-pollWorldNetpollRx[07]”,

Looking at this data in its raw form is a headache over time… so with the script below powershell, PoshSSH, regex does all the heavy lifting and pushes the data into vRops which can then be visualised / alerted on!!

Grab the script on my GitHub

Here is what the data looks like in vRops.


Hope this was helpful

vMan