NetApp snapmirror lagtime check cdot with PowerShell

# Snapmirror cleanup – update all snapmirrors with lagtime over one week and idle

$mirrors = @()

Get-NcSnapmirror | %{
$sm = “” | Select “Source”,”Destination”,”Status”,”State”,”LagTime”

$sm.Source = $_.SourceLocation
$sm.Destination = $_.DestinationLocation
$sm.Status = $_.Status
$sm.State = $_.MirrorState
$sm.LagTime = $_.LagTime

$mirrors += $sm

}

$mirrors

write-output $mirrors | export-csv snap.csv

# write-output $mirrors | Format-table -AutoSize

# write-Output $mirrors | where- {$sm.LagTime -gt 604800 -and $sm.Status -eq “idle”} | Format-Table -AutoSize

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s