<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert &amp;quot;LagTimeTS&amp;quot; output for Snapmirror into Days... in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64776#M3245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not difficult.&amp;nbsp; First, here we have a snapmirror with a 200-day lag time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; Get-NaSnapmirror dunn:vol2 | select LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;---------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;200.03:28:47&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's get the last mirror date by subtracting that interval from the current date/time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lagTime = Get-NaSnapmirror dunn:vol2 | select -ExpandProperty LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lastDate = [DateTime]::Now.Subtract($lagTime)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lastDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;Tuesday, March 20, 2012 12:30:34 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Don't forget to check for null values of LagTimeTS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Oct 2012 10:33:13 GMT</pubDate>
    <dc:creator>cknight</dc:creator>
    <dc:date>2012-10-06T10:33:13Z</dc:date>
    <item>
      <title>Convert "LagTimeTS" output for Snapmirror into Days...</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64770#M3244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i try to make a script to check snapmirror status and lagtimets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;/PRE&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Connect-NaController netapp-bap1 -Credential root&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;Get-NaSnapmirror | Format-Table -AutoSize SourceLocation,DestinationLocation,Status,State,LagTimeTS,LastTransferSize,LastTransferDuration&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;The output for this command give me this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;SourceLocation&amp;nbsp;&amp;nbsp;&amp;nbsp; DestinationLocation Status State&amp;nbsp; LagTimeTS&amp;nbsp; LastTransferSize LastTransferDuration&lt;/P&gt;&lt;P&gt;--------------&amp;nbsp;&amp;nbsp;&amp;nbsp; ------------------- ------ -----&amp;nbsp; ---------&amp;nbsp; ---------------- --------------------&lt;/P&gt;&lt;P&gt;netapp-bap1:Prod1 netapp-bap2:Prod1&amp;nbsp;&amp;nbsp; idle&amp;nbsp;&amp;nbsp; source 2.15:15:19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 471040&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any ways to extract the date of the last successful snapmirror from LagTimeTS ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to have something like :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the last date of successful Snapmirror is "..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or The Last successful Snapmirror date back to "..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx for your help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:17:48 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64770#M3244</guid>
      <dc:creator>BAPTISTE_REVERET</dc:creator>
      <dc:date>2025-06-05T06:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert "LagTimeTS" output for Snapmirror into Days...</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64776#M3245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not difficult.&amp;nbsp; First, here we have a snapmirror with a 200-day lag time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; Get-NaSnapmirror dunn:vol2 | select LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;---------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;200.03:28:47&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's get the last mirror date by subtracting that interval from the current date/time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lagTime = Get-NaSnapmirror dunn:vol2 | select -ExpandProperty LagTimeTS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lastDate = [DateTime]::Now.Subtract($lagTime)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;PS C:\&amp;gt; $lastDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;Tuesday, March 20, 2012 12:30:34 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Don't forget to check for null values of LagTimeTS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2012 10:33:13 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64776#M3245</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-10-06T10:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert "LagTimeTS" output for Snapmirror into Days...</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64785#M3246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left; color: #575757; text-indent: 0px;"&gt;It seems to work but the date have changed between two launch of my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left; color: #575757; text-indent: 0px;"&gt;I can see that in the file where i make the output of the command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt; mercredi 3 octobre 2012 20:50:21&lt;/P&gt;&lt;P&gt;mercredi 3 octobre 2012 20:50:29&lt;/P&gt;&lt;P&gt;mercredi 3 octobre 2012 20:50:38&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2012 13:29:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64785#M3246</guid>
      <dc:creator>BAPTISTE_REVERET</dc:creator>
      <dc:date>2012-10-06T13:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert "LagTimeTS" output for Snapmirror into Days...</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64790#M3247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally, i find my own way to get the time info :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;P&gt;$controller = "XXX"&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;$vol = Get-NaVol&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;Connect-NaController $controller -Credential root&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "SNAPMIRROR"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;foreach ($snapmirror in $vol)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;$status = (Get-NaSnapmirror $snapmirror).Status&lt;/P&gt;&lt;P&gt;$first = (Get-NaSnapmirror $snapmirror).LagTimeTS&lt;/P&gt;&lt;P&gt;$second = $first.Seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ($second) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Get-NaSnapmirror $snapmirror.name).LagTimeTS | foreach {write-host "Le SnapMirror du volume $snapmirror date de" $_.Days "jour" $_.Hours "heures" $_.Minutes "minutes | Status - $status"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Host "&amp;nbsp; "&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Clinton for your help and the clue on 'null values'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 12:49:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Convert-quot-LagTimeTS-quot-output-for-Snapmirror-into-Days/m-p/64790#M3247</guid>
      <dc:creator>BAPTISTE_REVERET</dc:creator>
      <dc:date>2012-10-11T12:49:43Z</dc:date>
    </item>
  </channel>
</rss>

