Tip #1: Monitoring SnapMirror relationships with PowerShell

In my first installment, I want to show a simple way to get the highest lag time of all your NetApp Snapmirror relationships, with Powershell.  This is useful for anyone running Orion, WhatsUpGold, Nagios, or any other monitoring tool which can call out to scripts and remote hosts for custom checks.

If you work in a windows environment, and you do not use or have Powershell and the NetApp DataONTAP toolkit, stop reading this, and go get it.  You’ll thank me later.

Let’s look at an environment running SnapMirror, where it is regularly out of sync due to network issues.:
fas3020a> snapmirror status
Snapmirror is on.
Source                      Destination                                       State          Lag        Status
prodfas3020a:ThinApp        fas3020a:ml_ThinApp                               Snapmirrored   –          In-sync
fas3020a:home               Prodfas3020a:fas3020a_home_SnapMirror             Source         11:16:05   Idle
fas3020a:SharePoint_Backup  fas3020b:SharePoint_Mirr_Backup                   Source         20546:22:43  Idle

Wow, that’s some bad lag!  I wish our monitoring system would have let us know before it was too late!  Wait, few monitoring systems can handle this sort of thing… but that is where Powershell can help!

You will first need to download and install the DataOntap Powershell Toolkit from here:  https://communities.netapp.com/community/products_and_solutions/microsoft/powershell

Next, create a simple SnapmirrorLag.ps1 script in notepad or your editor of choice.  Below,

If you have snapmirror relationships which are lagging, you will see output such as this:  CRITICAL: Highest LagTime 73966407  exceeded normal values!  You can format this output to match what your monitoring platform expects.


Be Sociable, Share!

, , ,