Sorry I know it’s confusing.
Okay here's the deal. Please try to bear with me.
Right now the vCenter Server collects data at an interval duration of 5 minutes.
I have set the vCenter Server to save that data for 5 days. The statistic level is 4.
Yes, as you said I want 1 Avg and 1 Max value over 24 hours. That doesn’t change.
The first script you offered worked just fine for the average value, but when it comes to max value I noticed that getting 1 max value data from a 5 minute interval duration over 24 hours wasn’t going to be an accurate statistic (for example if some process used 95% of the cpu for only 20 seconds in a day and the rest of the day was only 5%, the first script would still pickup the 95% usage. And that wouldn’t be an accurate statistic)
So for the max value I decided that it would be better to first average the data hourly.
This means I would want the following.
The average of “5min duration data * 12 times” of cpu.usage.maximum
And after 24 hours you would get 24 max value results. (one per hour.)
I think the second script you offered did just that.
Finally in order for me to get 1 max value of the day, I would want the max value within those 24 max value results. And that would be the max value over 1 day (24 hours).
After collecting 1 month of this, I was thinking of using the Import-Csv command to combine all the csv files into one so that I could make a chart..
I’m sorry my explanation is no so good….
If you don’t understand please ask me where.