VMware Cloud Community
Pinball
Enthusiast
Enthusiast
Jump to solution

Cluster capacity stats

Hi there

I found this great script on Ryan Johnson site http://tenthirtyam.org/ but would like to do it for all clusters in the connected vc, instead of specifying it and also save the output to csv.

As the first param asked for the cluster name and that same variable is used more than once in the script i tried to say that the paramater is = to the first variable in the script "Get-Cluster"

But i get the following:

PowerCLI C:\PS> .\Get-Cluster_Stats.ps1

At C:\PS\Get-Cluster_Stats.ps1:64 char:135

+ ... newvmcount    |

+                    ~

An empty pipe element is not allowed.

    + CategoryInfo          : ParserError: (:) [], ParseException

    + FullyQualifiedErrorId : EmptyPipeElement

Please guide me as to where i've gone wrong.

Thanks

Johan

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could write a script that gets all clusters, and then call the script for each cluster.

Something like

Get-Cluster | %{

   .\Get-Cluster_Stats.ps1 $_

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

You could write a script that gets all clusters, and then call the script for each cluster.

Something like

Get-Cluster | %{

   .\Get-Cluster_Stats.ps1 $_

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Pinball
Enthusiast
Enthusiast
Jump to solution

HI Luc

The last step I need to perform is to write the results of the attached script to a new MS SQL table. I found the below article on Alan's site. The question is if it is practicle to do this or if there is a better way you can think of to get the data from VC.db to a reporting.db

Thanks

Johan

http://www.virtu-al.net/2009/11/23/powercli-to-sql-databases/

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The method Alan describes will work.

Another option is to write the results to a CSV, and then import the CSV into an SQL table.

See Fast CSV Import in PowerShell to SQL Server


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos