SNA Service Discovery

Microsoft.HostIntegrationServer.2009.SNAServiceDiscovery (Discovery)

Discovers the SNA Service.
SNA services (Nodes) must be defined in order to be discovered.

Knowledge Base article:

Summary

The SNA Service discovery queries the WMI namespace “root\ MicrosoftHIS” for instances of the SNA service that are configured on the local machine. If found, the Host Integration Server 2009 Management Pack creates an instance of the SNAService class.

Element properties:

TargetMicrosoft.HostIntegrationServer.2009.SNAGateway
EnabledTrue
Frequency43245
RemotableFalse

Object Discovery Details:

Discovered Classes and their attribuets:

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.TimedScript.DiscoveryProvider Default

Source Code:

<Discovery ID="Microsoft.HostIntegrationServer.2009.SNAServiceDiscovery" Enabled="true" Target="Microsoft.HostIntegrationServer.2009.SNAGateway" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.HostIntegrationServer.2009.SNAService">
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
<Property TypeID="Microsoft.HostIntegrationServer.2009.SNAService" PropertyID="SNAServiceName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>43245</IntervalSeconds>
<SyncTime/>
<ScriptName>HIS2009 SNAService Discovery.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>
'--------------------------------------------------------------------------------------------------
' &lt;name&gt;HIS2009 SNAService Discovery.vbs&lt;/name&gt;
' &lt;company&gt;Microsoft Corporation&lt;/company&gt;
' &lt;copyright&gt;Copyright (c) Microsoft Corporation 2009&lt;/copyright&gt;
' &lt;summary&gt;
' Microsoft Host Integration Server 2009 SNA service discovery script for use with SCOM 2007.
' Provides discovery functions for HIS SNA Services (SNA Node).
' &lt;/summary&gt;
'
' See Management Pack Guide for details on parameters and usage
'--------------------------------------------------------------------------------------------------


SetLocale("en-us")
Dim oAPI, oDiscoveryData, oInst
Set oAPI = CreateObject("MOM.ScriptAPI")

Dim oArgs
Set oArgs = WScript.Arguments
if oArgs.Count &lt; 3 Then
Wscript.Quit -1
End If

Dim SourceID, ManagedEntityId, TargetComputer

SourceId = oArgs(0)
ManagedEntityId = oArgs(1)
TargetComputer = oArgs(2)

set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)

Dim strNetbiosName
strNetbiosName = "$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/NetbiosComputerName$"

Dim colSNAServices, objSNAService
Dim intSNAServices, intInStr

' Get SNA Services
Set objWMIService = GetObject("winmgmts:\\" &amp; strNetbiosName &amp; "\root\MicrosoftHIS")
Set colSNAServices = objWMIService.ExecQuery("SELECT * FROM MsSna_ServiceSNA",,48)

For Each objSNAService in colSNAServices

'Need to make sure the service is on the local machine
'and not another machine in the SNA subdomain - was getting duplicates
intInStr = InStr(Ucase(objSNAService.Name), UCase(strNetbiosName))

If intInStr &gt; 0 then

set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2009.SNAService']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='Microsoft.HostIntegrationServer.2009.SNAService']/SNAServiceName$", objSNAService.Name)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", objSNAService.Name)
call oDiscoveryData.AddInstance(oInst)

End If
Next

call oAPI.Return(oDiscoveryData)
</Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>