#SnapMirror LagTime returns strange value...
1 messages · Page 1 of 1 (latest)
Would be nice if it could return x-hours.... I guess the string returned makes some sense, but I fear that if I start to change the string, I will have to take into account days and months values?
Hi Buller, we are not using the latest Ontap toolkit but we fix ours with character modification so it displays as xx days, xx hours, xx mins within our snapmirror reports
How do you get that output? I'm running PSTK 9.14.1 and I'm getting it in seconds.
PS C:\Users\Home> Get-Module -Name NetApp.ONTAP
ModuleType Version PreRelease Name ExportedCommands
Manifest 9.14.1.24… NetApp.ONTAP {Add-NaAggr, Add-NaCifsShare, Add-NaCredential, A…
PS C:\Users\Home> Get-NcSnapmirror -ONTAPI | Select-Object LagTime
LagTime
3350
3350
PS C:\Users\Home>
Mostly curious. 🙂
This is actually ISO 8601 time span format:
https://en.wikipedia.org/wiki/ISO_8601#Durations
Here's a link to a PowerShell function that might help you get the end result you want (at least the regex stuff):
Once you grab the snapmirror entry in a variable, in our case it's in $vol, I used the following:
LagTimeMins = [math]::Round(($vol.LagTime/60),0)
LagTimeTS = New-TimeSpan -Minutes $LagTimeMins
LagTimeTotal = '{0:00}:{1:00}:{2:00}' -f $LagTimeTS.Days,$LagTimeTS.Hours,$LagTimeTS.Minutes
I use the following. connect-nccontroller <IP> Then to get the lag time Get-NcSnapmirror | Select-Object SourceLocation, Status, RelationshipStatus, IsHealthy, @{Name='LagTime (min)'; e= {[math]::Round(($_.Lagtime/60),2)}} | Sort-Object SourceLocation | ft