Home > Command Line > SnapMirror Monitoring

SnapMirror Monitoring

January 18th, 2009

I run this from ESX servers as some of them are already registered with the SSH keys for the NetApp, so I have to use an email perl script to get this sent out, if you have a linux host just substitute this for a sendmail line. The following script simply monitors the DR filer (again, easily adapted to monitor more than one filer) for any snapmirror lag that is greater than 30 hours. Easily customized to give different protection monitoring times. Run daily as a cron and should do the job. Obviously Protection Manager does this, but not everyone wants or has that. 

#!/bin/sh

 

ssh -c 3des fas3040 snapmirror status | sed -n ‘/[3-9][0-9]\:[0-9][0-9]\:[0-9][0-9]/p’ > snapmirror_status.txt

 

 

if [ `wc -l snapmirror_status.txt | awk '{print $1}'` -gt 0 ]; then

 echo Emailing snapmirror out of protection

 /root/snapmirror_status.pl

fi

 

rm snapmirror_status.txt

VN:F [1.9.11_1134]
Rate this post:
Rating: 0.0/10 (0 votes cast)

Command Line

  1. Daniel malcor
    February 20th, 2010 at 01:12 | #1

    I like this idea. Simple and effective. I have some suggestions:

    Replace sed with a much clear perl grep: grep -P “[3-9]\d:\d\d:\d\d”

    And the shell can detect a zero length file with:

    if [[ -s snapmirror_status.txt ]]; then
    cat snapmirror_status.txt | while read line;do
    # Hopefully you have a central syslog and can alert from there
    logger “WARNING: Broken SnapMirror – $line”
    done
    fi

  2. February 24th, 2010 at 12:43 | #2

    Cheers Daniel, I’m not always too efficient with my scripting, so cheers for the feedback!

  1. No trackbacks yet.



This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.

Bad Behavior has blocked 1128 access attempts in the last 7 days.

© 2009-2012 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.