Data ONTAP: Discover Recent Network Devices Rule

DataONTAP.DiscoverRecentNetworkDevices (Rule)

This rule discovers network devices that have been recently added to System Center Operations Manager, and determines which devices are Data ONTAP storage controllers so OnCommand can begin monitoring.

Knowledge Base article:

Summary

This rule discovers network devices that have been recently added to System Center Operations Manager, and determines which devices are Data ONTAP storage controllers so OnCommand can begin monitoring.

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.

Additional

Event ID

Severity

Description

1050

INFO

Recent network devices have been added to System Center Operations Manager.

Element properties:

TargetDataONTAP.ManagementServer
CategoryDiscovery
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.SimpleScheduler Default
WA WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<Rule ID="DataONTAP.DiscoverRecentNetworkDevices" Enabled="true" Target="DataONTAP.ManagementServer" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Discovery</Category>
<DataSources>
<DataSource ID="DS" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>600</IntervalSeconds>
<SyncTime>00:02</SyncTime>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>LogRecentNetworkDevices.vbs</ScriptName>
<Arguments>$Target/Property[Type="DataONTAP.ManagementServer"]/Fqdn$</Arguments>
<ScriptBody><Script>'**********************************************************************************
' Script Name - NetApp Discover Recent Network Devices
'
'
' Description:
' Discover network devices recently added and log them so another rule can listen
' for that event and check if it is a NetApp controller and discover it.
'
' (c) Copyright NetApp Inc. 2010 - All rights reserved
'**********************************************************************************

Option Explicit

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

Dim oArgs
Set oArgs = WScript.Arguments

Dim errorMessage
if oArgs.Count &lt; 1 Then

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

WScript.Echo(errorMessage)

Call oAPI.LogScriptEvent("LogRecentNetworkDevices.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.Discovery.NetworkDeviceDiscovery")

If Err Then

errorMessage = "Failed to create NetAppSCOM 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("LogRecentNetworkDevices.vbs",1102,0,errorMessage)

WScript.Quit -1

End If

Dim boolDiscoverySucceeded
boolDiscoverySucceeded = oNetAppSCOMAPI.CheckRecentNetworkDevices(ManagementServer)

If Err Then

errorMessage = "Failed to do storage discovery" &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("LogRecentNetworkDevices.vbs",1103,0,errorMessage)

WScript.Quit -1

End If

Call oAPI.LogScriptEvent("LogRecentNetworkDevices.vbs",1104,0,"Network device discovery succeeded for " &amp; ManagementServer &amp; ".")

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