Data ONTAP: Collect SnapMirror Lag Time Counter Rule

DataONTAP.Monitoring.Rule.SnapMirror.LagTime (Rule)

This rule collects information about all monitored SnapMirror relationship lag times, over a specified period of time.

Knowledge Base article:

Summary

This rule collects information about all monitored SnapMirror relationship lag times, over a specified period of time.

Configuration

Several overrides are available for this rule. Sync Time and Interval Seconds determine when and how often the rule runs. Timeout Seconds determines how long System Center Operations Manager waits for this rule to complete.

Resolutions

If you suspect a problem with this rule, check the OnCommand and System Center Operations Manager event logs on the management server running the rule.

Element properties:

TargetDataONTAP.ManagementServer
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
SnapMirrorLagCounterDS DataSource System.SimpleScheduler Default
ExecuteScript WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<Rule ID="DataONTAP.Monitoring.Rule.SnapMirror.LagTime" Enabled="true" Target="DataONTAP.ManagementServer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="SnapMirrorLagCounterDS" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>21600</IntervalSeconds>
<SyncTime>22:40</SyncTime>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="ExecuteScript" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>CollectSnapMirrorLagTimeCounters.vbs</ScriptName>
<Arguments>$Target/Property[Type="DataONTAP.ManagementServer"]/Fqdn$</Arguments>
<ScriptBody><Script>
'**********************************************************************************
' Script Name - NetApp SnapMirror Lag Time Counter
'
' Description:
' Collect SnapMirror Lag Time counters
'
' (c) Copyright NetApp Inc. 2010 - All rights reserved
'**********************************************************************************

Option Explicit
SetLocale("en-us")


Dim oAPI
Set oAPI = CreateObject("MOM.ScriptAPI")

Dim oArgs
Set oArgs = WScript.Arguments

Dim errorMessage

If oArgs.Count &lt; 1 Then

errorMessage = "CollectSnapMirrorLagTimeCounters.vbs was called with the incorrect # of parameters (param count = " &amp; oArgs.Count &amp; ")."

WScript.Echo(errorMessage)

Call oAPI.LogScriptEvent("CollectSnapMirrorLagTimeCounters.vbs",1101,0,errorMessage)

Wscript.Quit -1

End If

Dim ManagementServer

ManagementServer = oArgs(0)


' Echo the parameters so we can see what has been passed in
WScript.Echo("ManagementServer = " &amp; ManagementServer)

Dim oNetAppSCOMAPI
Set oNetAppSCOMAPI = CreateObject("NetApp.OM.Server.SnapMirror.SnapMirror")

If Err Then

errorMessage = "Failed to create NetAppSCOM SnapMirror object" &amp; vbNewLine &amp; _
"Err.description = """ &amp; Err.description &amp; """" &amp; vbNewLine &amp; _
"Err.helpcontext = """ &amp; Err.helpcontext &amp; """" &amp; vbNewLine &amp; _
"Err.helpfile = """ &amp; Err.helpfile &amp; """" &amp; vbNewLine &amp; _
"Err.number = """ &amp; Err &amp; """ (&amp;H" &amp; hex(Err) &amp; ")" &amp; vbNewLine &amp; _
"Err.source = """ &amp; Err.source &amp; """" &amp; vbNewLine

WScript.Echo(errorMessage)

Call oAPI.LogScriptEvent("CollectSnapMirrorLagTimeCounters.vbs",1102,0,errorMessage)

WScript.Quit -1

End If

oNetAppSCOMAPI.pushSnapMirrorLagTimeForReportToDB(ManagementServer)

If Err Then

errorMessage = "Failed to get SnapMirror lag time counter" &amp; vbNewLine &amp; _
"Err.description = """ &amp; Err.description &amp; """" &amp; vbNewLine &amp; _
"Err.helpcontext = """ &amp; Err.helpcontext &amp; """" &amp; vbNewLine &amp; _
"Err.helpfile = """ &amp; Err.helpfile &amp; """" &amp; vbNewLine &amp; _
"Err.number = """ &amp; Err &amp; """ (&amp;H" &amp; hex(Err) &amp; ")" &amp; vbNewLine &amp; _
"Err.source = """ &amp; Err.source &amp; """" &amp; vbNewLine &amp; _
"Server = """ &amp; ManagementServer

WScript.Echo(errorMessage)

Call oAPI.LogScriptEvent("CollectSnapMirrorLagTimeCounters.vbs",1103,0,errorMessage)

WScript.Quit -1

End If

Call oAPI.LogScriptEvent("CollectSnapMirrorLagTimeCounters.vbs",1104,0,"Get SnapMirror Lag time counnter succeeded for " &amp; ManagementServer &amp; ".")

Set oNetAppSCOMAPI = Nothing
Set oAPI = Nothing
</Script></ScriptBody>
<TimeoutSeconds>3600</TimeoutSeconds>
</WriteAction>
</WriteActions>
</Rule>