Start a Conversation

Unsolved

This post is more than 5 years old

20476

February 20th, 2011 20:00

Powershell Scripts for Collecting, Processing and Federating esxtop storage adapter data

These scripts are meant to assist in simplifying and collecting esxtop storage adapter performance information from ESX/i host(s) in a synchronized manner.  The scripts will allow you to run one command to start performance collections from all hosts at one time.   The data is collected in CSVs and can then be leveraged in many ways.  A script that is also included in this set is one that helps to federate and filter the data to the screen to allow for custom views across hosts and for specific metrics.

Highlights

  • One command to start esxtop collections for all available storage metrics from many hosts
  • See performance information from a fan-out perspective on all ESX/i hosts at one time for paths, adapters, or datastores
  • Synchornized collections happen on a "best attempt" basis where hosts do collections on set intervals
  • Federated visibility of data by way of the show_ script
  • Scalability in allowing for many powershell windows viewing live data coming from CSVs
  • VAAI statistics

Updates

03/05/11 - updated to fix XP job bug, job hanging

MD5: 47CC9CE0500815B7D691C01574C1371C

5 Attachments

3 Posts

March 2nd, 2011 01:00

if I run the other, I get :

[vSphere PowerCLI] C:\emc> Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin : Cannot add Windows PowerShell snap-in VMware.VimAutomation.Core because it is already added. Verify the name of the snap-in and try ag
ain.
At line:1 char:13
+ Add-PSSnapin <<<<  VMware.VimAutomation.Core
    + CategoryInfo          : InvalidArgument: (VMware.VimAutomation.Core:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

but

[vSphere PowerCLI] C:\emc> .\collect_esxtop_adapters.ps1 -esxip  192.168.5.193,192.168.5.245,192.168.5.102,192.168.5.104,192.168.5.128,192.168.150.78,192.168.5.142 -username root -password xxx

ESXTOP collection and processing

an EMC vSpecialist Production

Everything VMware at EMC

https://community.emc.com/community/connect/everything_vmware?view=overview

This powershell window will have jobs running in the background, either run get-job | stop-job or close the window to stop get-esxtop collections

Expect to see significantly high CPU utilization on different cores of this system during the first sampling for each host, this is due to loading da

tastore information

Load will lessen, but will still be noticeable after the first sampling

This may take up to 30 seconds per ESX server to begin samplings

Stopping previously running jobs in this powershell window before continuing

Id              Name            State      HasMoreData     Location             Command

--              ----            -----      -----------     --------             -------

1               192.168.5.193   Running    True            localhost            ...

Kicked off job and waiting for first sampling to complete before moving on..

Timed out waiting for a program to execute. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpat

hs @"C:\Documents and Settings\adminfj\Local Settings\Temp\9tgxuera.cmdline".

    + CategoryInfo          : NotSpecified: (:) [Add-PSSnapin], ExternalException

    + FullyQualifiedErrorId : System.Runtime.InteropServices.ExternalException,Microsoft.PowerShell.Commands.AddPSSnapinCommand

The term 'get-powercliversion' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,

or if a path was included, verify that the path is correct and try again.

    + CategoryInfo          : ObjectNotFound: (get-powercliversion:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

Failed to connect to 192.168.5.193 using credentials specified.

:/

4 Posts

March 2nd, 2011 05:00

I'm trying to collect info from 5 ESX hosts but for some reason it only starts with the first ip

This is the command I use and the output

-----

[vSphere PowerCLI] C:\esxscripts> .\collect_esxtop_adapters.ps1 -esxip X.X.X.58,X.X.X.59,X.X.X.60,X.X.X.61,X.X.X.62 -username XXXXXX -password XXXXXX

ESXTOP collection and processing

an EMC vSpecialist Production
Everything VMware at EMC

This powershell window will have jobs running in the background, .....
......after the first sampling

This may take up to 30 seconds per ESX server to begin samplings
Stopping previously running jobs in this powershell window before continuing


Id              Name           State       HasMoreData    Location       Command
--              ----                -----          -----------             --------           -------
5               X.X.X.58       Running    True                 localhost       ...

Kicked off job and waiting for first sampling to complete before moving on..

-----

If i'm correct it should start with the 5 ip addresses or am I mistaken?

Also it just "hangs"in this state. It never goes back to the prompt so the sampeling does not complete?

the command

.\cust_get_esxtop_adapters.ps1 -esxhost ip1 -esxuser root -esxpassword password -interval 5

runs without any issues

Help is appreciated

56 Posts

March 2nd, 2011 06:00

this is the command I'm running

.\collect_esxtop_adapters.ps1 -esxip 10.30.34.70,10.30.34.45,10.30.34.47,172.18.9.5,172.18.9.10,172.18.9.15,172.18.9.20 -username root -password XXXXXX

and still getting the errors.

4 Posts

March 2nd, 2011 07:00

Trying the same thing with 4 hosts and getting the same output only the first host is listed, i'm going home now, when i come home ill logon and see if it added some more hosts.

Beste Regards Otto D

March 2nd, 2011 14:00

Are you sure that you are running PowerShell v2 and PowerCLI 4.1.1?

March 2nd, 2011 14:00

If the collect script isn't working you can always run the commands in their own windows with an "-outcsv" to generate the same output.  Try doing a ctl-c and running "get-job | receive-job".  This will show what the script is outputting.  For the script to move on it is expecting a "Writing output to".  If the command listed above doesn't have that then this is why it is hanging and I'm curious to see what is is saying.

Thanks for the feedback.

9 Posts

March 3rd, 2011 03:00

Hi,

Could you tell me which 3th party tools i can use to interprete the csv files?

regards

hans

4 Posts

March 3rd, 2011 04:00

Yes Powershell v2 (version for win 2003 x64) and PowerCLI 4.1.1 but I tested on a machine that runs Windows XP 64 bit. This machine gives the issue.

I tested on a win 7 x64 machine as well and this seems to run fine.

March 4th, 2011 08:00

Misteriks,

Thanks for the feedback, interesting info about it not working the same from WinXP 64-bit as it does from Win7, I need to test WinXP 64b.  I am assuming this is the root of your problem where only one host can be queried at a time from the script.  I posted this a couple of times but you can run this command from individual powershell windows and will get the same sync'd up results as you would if you just ran all of the ips together.  I will work through the issues though and get it resolved.

9 Posts

March 4th, 2011 08:00

Hi Clinton,

I have an issue running the esxtop scripts.

The .\collect_esxtop_adapters.ps1 -esxip xxx.xxx.xxx.21 -securepw doesn't popup for the login/password as expected.

Note that the .\cust_get_esxtop_adapters.ps1 -esxhost 192.168.30.21 -securepw -interval 5 does popup for login/password

I have properly installed PowerShell CLI 4.1.1 and PowerShell 2.0.

The server from where the scripts are launch is a Windows 2003 w32 virtual machine.

Only two ESX servers for this collection, version 4.0U1 build 208167.

Can you help please?

Cheers,

Didier

March 4th, 2011 08:00

I wrote a document that shows you how to use powershell scripts to monitor CSV file in a powershell window or leverage a tool like PowerGadgets to visualize the results or even the live operations.  At the moment the document is more of a howto than an easy button.  I am working on making it very easy for all to use PG to create nice graphs of the data that was collected.  As an alternative, Excel is a last resort than can easily be leveraged to see the results.

https://community.emc.com/message/532809?tstart=0

March 4th, 2011 08:00

The collect script was primarily tested on a 4.1 platform.  If the cust_get_esxtop_adapters script is acting as expected, then you can run this by itself to collect the results in separate powershell windows for each host.  Not exactly the easy button, but it will get the job done.  All results are sync'd by way of hard coded seconds (ie 05,10,15) so you will see the same sync'd results even without the collect script.

Here is the command that the collect script is running if you want to do it manually.

.\cust_get_esxtop_adapters.ps1 -esxhost ip -esxuser esxuser -esxpassword esxpassword -interval 5 -outcsv hostip.csv -rollout -synchinterval

There are a few other posts that have similar issues and I will followup separately with anyone who is having this issue.

9 Posts

March 4th, 2011 09:00

Hi Clinton and thx for the follow up.

It works and currently collecting data!

Cheers,

Didier

96 Posts

March 4th, 2011 10:00

Running "collect_esxtop_adapters" on a 32-bit Windows XP SP3 computer with an Intel COre Duo CPU @ 2.33 GHz with 3.23 GB RAM against 4 ESX 4.0 U1 hosts.

It says "Kicked off job and waiting for first sampling to complete before moving on.." and seems to be stuck (20 minutes so far).  I was observing higher CPU utilization on the first ESX host, but it seemed to go back toward normal utilization after 5 minutes

I am not observing much CPU utilization on the Windows XP computer.

The workstation is not in the same subnet as our ESX hosts - we do have a good connection between subnets, though.  Any issues there?
Any advice on being "stuck?"
Is it inadvisable to run this on a VM?

Thanks!

March 4th, 2011 11:00

Other users have pointed out some issues when running from XP.  You should be able to run the cust_get_esxtop_adapters by itself without issues as others have done.  Try the command below which will need to be run in a separate powershell window per host.  The testing I did for the scripts was mainly from Windows 7 which if you have Powershell v2 and PowerCLI 4.1.1 works great.  I will expand the testing out to other versions of Windows to update the scripts for everyone.

.\cust_get_esxtop_adapters.ps1 -esxhost ip -esxuser esxuser -esxpassword esxpassword -interval 5 -outcsv hostip.csv -rollout -synchinterval

No Events found!

Top