Dhattks
asked on
Need help with PowerCLI script for performace monitor.
Need help with PowerCLI script to get the CPU and memory usage (average, Max, Min and percentage) on hourly basis for past 3 days for select VM(s) only.
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for help.
I was able to get the results for one VM using $vms = Get-Vm MyParticularVM
But I have another script where it gets the data hourly basis for last 3 days but does not get me the Max, Min and percentage CPU and Memory. I only get average.
I some how need to get this script pull Max, Min and percentage as well.
Thanks in advance.
script.txt
I was able to get the results for one VM using $vms = Get-Vm MyParticularVM
But I have another script where it gets the data hourly basis for last 3 days but does not get me the Max, Min and percentage CPU and Memory. I only get average.
I some how need to get this script pull Max, Min and percentage as well.
Thanks in advance.
script.txt
Not correct. It only gets you the average memory, no CPU stats.
Why don't you use the script posted first?
Why don't you use the script posted first?
ASKER
The first script does not get me the hourly stats / data and the second one only gets me the average.
Yes, I have to change the memory to cpu in the script to get the cpu average.
Yes, I have to change the memory to cpu in the script to get the cpu average.
If I understood correctly, the first script will result in daily stats, and determining min and max from the average values of each hour. That is because VMWare seems not to provide any min/max values - would be difficult to do so for all arbitrary time perioids.
What exactly is your desired output? Best to provide a text example ...
What exactly is your desired output? Best to provide a text example ...
ASKER
The first script gives daily stats, and determining min and max from the average values.
the second one provides hourly data but average only.
see attachments.
1st-Script-Result.csv
2nd-Script-Result.csv
the second one provides hourly data but average only.
see attachments.
1st-Script-Result.csv
2nd-Script-Result.csv
That much is clear. I've asked for the desired output, not what you get from the scripts.
You cannot get a min/max each hour, as the only available value is the average. To get min/max, we need to consolidate data, e.g. daily.
You cannot get a min/max each hour, as the only available value is the average. To get min/max, we need to consolidate data, e.g. daily.
ASKER
Thanks everyone.
ASKER
I found this script online that probably gets the performance counters from vCenter for all the VMs.
Would you know if changing "$allvms = @()" to $server = "vmname" and then changing $allvms at the end to $server = "vmname" will get me the data only for one particular VM?
Thanks.
attached is the script.
performance-powercli.txt