Scripts

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

What are valid names for the -metrics parameter in the get-ntnxclusterstat cmdlet

Trailblazer

Re: What are valid names for the -metrics parameter in the get-ntnxclusterstat cmdlet

Hey @sandeepmp

 

Here is the ps version:

 

PsVersion.PNG

 

 

Seba

Highlighted
Nutanix Employee

Re: What are valid names for the -metrics parameter in the get-ntnxclusterstat cmdlet

@sverhoevne

The issue is due to the powershell version.

The Rest calls can be done from powershell v3 onwards.

Please update the powershell version to v3 or newer.

Regards
Sandeep MP
Trailblazer

Re: What are valid names for the -metrics parameter in the get-ntnxclusterstat cmdlet

Solved!

Thx

 

 

Seba

Scout

Re: What are valid names for the -metrics parameter in the get-ntnxclusterstat cmdlet

Confirmed today that this cdmlet now works on NOS 5.0.1. Yippe! Thanks sandeepmp for the epoch conversion.

 

example output

 

successful       : True
message          :
startTimeInUsecs : 1493225550000000
intervalInSecs   : 60
metric           : avg_io_latency_usecs
values           : {268, 238, 344, 272, 425, 664, 801, 453, 273, 219, 222, 344, 321, 1618, 329, 258, 248, 329, 259, 245, 296, 248, 241, 306, 244, 271, 365, 311, 342, 253, 276, 258, 234, 229, 266,
                   327, 221, 403, 396, 292, 353, 267, 331, 277, 290, 333, 274, 538, 405, 228, 307, 253, 261, 266, 319, 320, 472, 349, 613, 319, 295, 299, 422, 270, 446, 305, 222, 420, 365, 272, 301,
                   291, 339, 296, 251, 362, 276, 425, 387, 316, 274, 252, 235, 322, 255, 247, 302, 305, 337, 284, 309, 369, 264, 325, 371, 325, 288, 335, 384, 450, 456, 917, 275, 1665, 290, 309, 549,
                   385, 386, 302, 390, 308, 310, 1290, 1372, 270, 596, 1206, 1067, 296, 319, 260, 313, 316, 487, 333, 533, 556, 348, 300, 296, 351, 362, 268, 344, 294, 320, 269, 305, 234, 277, 311,}


sandeepmp wrote:

Hi geoffd,

 

StartTimeInUsecs value should be in "microseconds". So we need to convert the time to microseconds.

 

Please follow the below to do the same

 

#date input section

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

$epoch = Get-Date -Date "01/01/1970" #donot change this line

 

 

$startdate = get-date 'Provide date here'
$enddate = get-date 'provide date here'

 

#convert time to Microseconds
=============================

[int64]$date_start = ((New-TimeSpan -Start $epoch -End $startdate).TotalMilliseconds)*1000
[int64]$date_end = ((New-TimeSpan -Start $epoch -End $enddate).TotalMilliseconds)*1000

 

#Script

=======

 

get-ntnxclusterstat -Metrics 'avg_io_latency_usecs' -starttimeinusecs $date_start -endtimeinusecs $date_end -IntervalInSecs 60

 

Regards,

Sandeep MP