This week we(Frank Denneman and I) played around with vscsiStats, it’s a weird command and hard to get used to when you normally dive into esxtop when there are performance issues. While asking around for more info on the metrics and values someone emailed us nfstop. I assumed it was NDA or at least not suitable for publication yet but William Lam pointed me to a topic on the VMTN Communities which contains this great script. Definitely worth checking out. This tool parses the vscsiStats output into an esxtop format. Below a screenshot of what that looks like:
After changing the python path on the first-line from /bin/python to /usr/bin/python, which seems to be the default on Vsphere, the script fails with a parse error:
Same error with ESX3.5 U4
It works on ESXi, the ternary operator being used on line 233 is only available with python 2.5. If the version of python you are using is < 2.5 you will need to change the script to do something like the following:
# Construct a column header
def colHdr(name, just=COL_RIGHT):
if cols[name][2]:
if just == COL_RIGHT:
return cols[name][0].rjust(cols[name][1]) + ' '
else:
return cols[name][0].ljust(cols[name][1]) + ' '
else:
return ' '
If that fixes the error on line 233 you will have to make similar changes to other functions that use the ternary operator.
It works on ESXi 4.0, the ternary operator used on line 233 was first made available in version 2.5 of Python. If the python version on classic ESX 3.5/4.0 is < 2.5 you will have to change that code to something like the following:
# Construct a column header
def colHdr(name, just=COL_RIGHT):
if cols[name][2]:
if just == COL_RIGHT:
return cols[name][0].rjust(cols[name][1]) + ' '
else:
return cols[name][0].ljust(cols[name][1]) + ' '
else:
return ' '
If that fixes the syntax error on line 233 you will have to make similar changes to the 'colSVal' and 'colFval' functions.
Same error me for me, running on 4.0.0 – 175625.
I was able to use it on ESXi 4.0, if you look at the original thread on the communities forum the author has posted an upated version that will supposedly work on classic.
had to change this line in ESX4.0U1 to make it work
VSCSI_CMD = “/usr/lib/vmware/bin/vscsiStats”
however still fails on ESX 3.5U4
Traceback (most recent call last):
File “./nfstop”, line 404, in ?
sys.exit(main())
File “./nfstop”, line 399, in main
refresh(float(duration))
File “./nfstop”, line 326, in refresh
parseHistos(curr, vscsiStats[1])
File “./nfstop”, line 138, in parseHistos
parseHisto(VMS, stats)
File “./nfstop”, line 112, in parseHisto
hist[‘min’] = int(stats.pop().split(‘,’)[1])
ValueError: int() literal too large: 18446744073691345273
I don’t have a classic ESX 3.5 machine to test on (ESXi 3.5 doesn’t have python at all) but I suspect the vscsiStats histogram output might have changed. Can you compare ‘vscsiStats -p all’ output on 3.5 vs 4.0 to see if the formatting looks different ?
Just looked at the script again, looks like you’ll need to compare “vscsiStats -c -p all” output.
There is a version posted on the VMware Communities thread that works in 3.5.
http://communities.vmware.com/message/1511493#1511493
Shara and enjoy!
could you please advice where can I download a copy of vscsistats from?
is this a vmware utils for 3rd party?
thanking you in advance for your help.
Steve