vscsiStats output in esxtop format?

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:




You can skip to the end and leave a response. Pinging is currently not allowed.

9 Responses to “vscsiStats output in esxtop format?”

  1. Coen says:

    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:

    [code]
    File "./nfstop", line 233
    return (cols[name][0].rjust(cols[name][1]) if cols[name][2] else '') + ' '
    ^
    SyntaxError: invalid syntax
    [/code]

  2. vishy says:

    Same error with ESX3.5 U4

  3. Jeff says:

    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.

  4. Jeff says:

    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.

  5. James says:

    Same error me for me, running on 4.0.0 – 175625.

  6. Jeff says:

    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.

  7. vishy says:

    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

  8. Jeff says:

    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 ?

  9. Jeff says:

    Just looked at the script again, looks like you’ll need to compare “vscsiStats -c -p all” output.

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!