VMware Cloud Community
houghtp
Contributor
Contributor
Jump to solution

Get-stat counter not available

I'm trying to run following line

Get-vm TestVM | get-stat -stat mem.swapused.kilobytes

but get error

Get-Stat : 03/11/2009 16:10:49 Get-Stat The metric counter "mem.swapused.kilobytes" doesn't exist for entity "TestVM".

At line:1 char:9

+ Get-stat <<<< -entity (get-vm svr-sccm-cdc01) -stat mem.swapused.kilobytes -IntervalMins 5

+ CategoryInfo : ResourceUnavailable: (Smiley Happy , VimException

+ FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.Commands.GetViStats

the stats level in VC is 2 and I can see this stats through VI client. Also if i run Get-TKEperformanceCounter form the Community Extensions this stat is listed for the VM.

I can see level 1 type stats like

get-vm testvm | get-stat -stat mem.usage.average

I'm running PowerCli 4 162509

thanks.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

That is a known "feature" in the current PowerCLI build.

You get the error message but also the values.

See also Yavor's reply in


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik, there is no metric named mem.swapused.kilobytes.

Where do you see this in the VIC ?

If you go into and slect Memory you should look at the Internal Name and Rollup columns to determine the metric.

The only ones I know of are: swapped, swaptarget, swapin and swapout (for a VM) and the rollup is minimum, maximum or average (depending on the statistics level you specified for the interval)


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

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

ok thanks that makes sense, I was looking at the results of Get-TKEPerformanceCounters which showed this stat for the entity. I'd got my counters mixed up when looking in VC.

what does this funtion show then? counters available through VC rather than powerCli?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The Get-TKEPerformanceCounter function returns correct results.

You just have to take care when composing your metric.

Use this order: Group,Name,RollupType

But note that not all metrics are available for all entities.

To see the available metrics for a specific entity you can use my script in and use the -QueryMetrics parameter.


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

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

ok thanks Luc, but if i run:

get-vmhost testVMHost | get-stat -stat disk.deviceWriteLatency.average -realtime

i get an error then the performance data follows.

Get-Stat : 04/11/2009 13:29:14 Get-Stat The metric counter "disk.devicewritelatency.average" doesn't exist fo

r entity "svr-vmh-crcla07.lbcamden.net".

At line:1 char:51

+ get-vmhost testVMHost | get-stat <<<< -stat disk.deviceWriteLatency.average -realtime

+ CategoryInfo : ResourceUnavailable: (Smiley Happy , VimException

+ FullyQualifiedErrorId : Client20_RuntimeDataServiceImpl_CheckUserMetrics_MetricDoesntExist,VMware.VimAutomation.

Commands.GetViStats

MetricId Timestamp Value Unit

-


-


-


-


disk.deviceWriteLatenc... 04/11/2009 13:29:10 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:28:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:28:30 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:28:10 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:27:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:27:30 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:27:10 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:26:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:26:30 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:26:10 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:25:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:25:30 3 millise...

disk.deviceWriteLatenc... 04/11/2009 13:25:10 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:24:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:24:30 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:24:10 2 millise...

disk.deviceWriteLatenc... 04/11/2009 13:23:50 1 millise...

disk.deviceWriteLatenc... 04/11/2009 13:23:30 1 millise...

any ideas?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is a known "feature" in the current PowerCLI build.

You get the error message but also the values.

See also Yavor's reply in


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

0 Kudos
houghtp
Contributor
Contributor
Jump to solution

ha! thats funny it was me who started that thread

thanks for your help anyway.

0 Kudos
yboychev
Hot Shot
Hot Shot
Jump to solution

Hi all,

The problem that was causing errors to be thrown for some of the metrics was addressed in the newly released version of PowerCLI - 4.0 Update 1. Give it a try and I'll be happy to get further feedback in case you still experience some problems in the specified cases!

\Yavor

0 Kudos