LU6.2 Resync Discovery

Microsoft.HostIntegrationServer.2016.LU62ResyncDiscovery (Discovery)

Discovers the LU 6.2 Resync Must be enabled on Local and Remote LU's

Knowledge Base article:

Summary

The LU6.2 Resync discovery checks the registry location "HKLM\SOFTWARE\Microsoft\SNA Server\CurrentVersion\Monitoring\" for the existence of the “Opt-Out” key DisableLU62ResyncMonitoring. If the key is found, no further action is taken. If the key does not exist, the Host Integration Server 2016 Management Pack queries the WMI namespace “root\MicrosoftHIS”. First it looks for local APPC LU’s configured for resync support by setting SyncPoint=True. If found then, the Host Integration Server 2016 Management Pack will query WMI for remote APPC LU’s with resync enabled (SyncPoint=True) and confirm this LU is associated with a connection on the local server. If all the queries meet this criteria, the Host Integration Server 2016 Management Pack creates an instance of the LU62Resync class.

Element properties:

TargetMicrosoft.HostIntegrationServer.2016.SNAGateway
EnabledTrue
Frequency21600
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.2016.LU62ResyncDiscovery" Enabled="true" Target="Microsoft.HostIntegrationServer.2016.SNAGateway" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.HostIntegrationServer.2016.LU62Resync">
<Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>21600</IntervalSeconds>
<SyncTime/>
<ScriptName>HIS2016 LU62ResyncService Discovery.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
<ScriptBody><Script>
'--------------------------------------------------------------------------------------------------
' &lt;name&gt;HIS2016 LU62ResyncService Discovery.vbs&lt;/name&gt;
' &lt;company&gt;Microsoft Corporation&lt;/company&gt;
' &lt;copyright&gt;Copyright (c) Microsoft Corporation 2016&lt;/copyright&gt;
' &lt;summary&gt;
' Microsoft Host Integration Server 2016 LU62Resync service discovery script for use with SCOM 2016.
' Provides discovery functions for HIS LU62Resync.
' &lt;/summary&gt;
'
' See Management Pack Guide for details on parameters and usage
'--------------------------------------------------------------------------------------------------
Option Explicit
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 bDisableTN3Monitoring, bDisableTN5Monitoring, bDisablePrintMonitoring, bDisableHIPMonitoring, bDisableLU62ResyncMonitoring
Dim bDisableSIMonitoring, bDisableMIMonitoring, bDisableDIMonitoring, bDisableWIPMonitoring

bDisableTN3Monitoring = FALSE
bDisableTN5Monitoring = FALSE
bDisablePrintMonitoring = FALSE
bDisableHIPMonitoring = FALSE
bDisableLU62ResyncMonitoring = FALSE
bDisableSIMonitoring = FALSE
bDisableMIMonitoring = FALSE
bDisableDIMonitoring = FALSE
bDisableWIPMonitoring = FALSE

Dim Locator, Service
Set Locator = CreateObject("WbemScripting.SWbemLocator")

GetRegParams()
LUResyncSvcsDiscovery()

call oAPI.Return(oDiscoveryData)

Sub GetRegParams()

' Sub GetRegParams()
' Performs all registry lookups required for service discovery.

Const WMI_REG_HKLM = &amp;H80000002

Const HIS_OPTOUT_KEYPATH = "SOFTWARE\Microsoft\SNA Server\CurrentVersion\Monitoring\"
Const HIS_TN3_OPTOUT_KEY = "DisableTN3270Monitoring"
Const HIS_TN5_OPTOUT_KEY = "DisableTN5250Monitoring"
Const HIS_PRINT_OPTOUT_KEY = "DisablePrintMonitoring"
Const HIS_HIP_OPTOUT_KEY = "DisableHIPMonitoring"
Const HIS_LU62RESYNC_OPTOUT_KEY = "DisableLU62ResyncMonitoring"
Const HIS_SI_OPTOUT_KEY = "DisableSessionIntegratorMonitoring"
Const HIS_DI_OPTOUT_KEY = "DisableDataIntegrationMonitoring"
Const HIS_MI_OPTOUT_KEY = "DisableMessageIntegrationMonitoring"
Const HIS_WIP_OPTOUT_KEY = "DisableWIPMonitoring"

Dim oRegProvider
Dim intReturn
Dim colValues, strValue
Dim colTypes

' =============================================================
' Check for the possible set of monitoring opt-out keys, and for each that exists
' set the corresponding boolean variable to TRUE

set oRegProvider=GetObject("winmgmts:\\" &amp; TargetComputer &amp; "\root\default:StdRegProv")

intReturn = oRegProvider.EnumValues (WMI_REG_HKLM, HIS_OPTOUT_KEYPATH, colValues, colTypes)

if intReturn = 0 AND NOT(IsNull(colValues)) then

for each strValue in colValues

Select Case strValue

Case HIS_TN3_OPTOUT_KEY
bDisableTN3Monitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_TN5_OPTOUT_KEY
bDisableTN5Monitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_PRINT_OPTOUT_KEY
bDisablePrintMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_HIP_OPTOUT_KEY
bDisableHIPMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_LU62RESYNC_OPTOUT_KEY
bDisableLU62ResyncMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_SI_OPTOUT_KEY
bDisableSIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_MI_OPTOUT_KEY
bDisableMIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_DI_OPTOUT_KEY
bDisableDIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)

Case HIS_WIP_OPTOUT_KEY
bDisableWIPMonitoring = TRUE
'ScriptContext.Echo (strIndent2 &amp; strValue)
End Select
next
end if

End Sub 'GetRegParams

Sub LUResyncSvcsDiscovery()

Dim colWin32Services
Dim objWin32Service

Dim intRemoteResyncLUs, colLocalAPPCLUs, colRemoteAPPCLUs, colServerConnections
Dim objRemoteAPPCLU, objConnection
Dim intLUResync
intRemoteResyncLUs = 0

' =============================================================
' LU 6.2 Resync Service Discovery
' Get the instances of Local and Remote APPC LUs configured for LU 6.2 Resync support
' by this HIS server, and if &gt; 0 add the LUResync state monitoring component in the HIS Svcs role.
'

if NOT bDisableLU62ResyncMonitoring then

Set Service = Locator.ConnectServer(TargetComputer, "root\MicrosoftHIS")

' Get count of local APPC LUs configured for resync support
set colLocalAPPCLUs = Service.ExecQuery("select * from MsSna_LUAPPCLocal where SyncPoint=True and SyncPointClient='" &amp; strNetbiosName &amp; "'",, 0)

if NOT colLocalAPPCLUs.Count = 0 then

' Get count of remote APPC LUs configured for resync support,
' and count those on a connection on this server
set colRemoteAPPCLUs = Service.ExecQuery("select * from MsSna_LUAPPCRemote where SyncPoint=True",, 0)

if NOT colRemoteAPPCLUs.Count = 0 then

set colServerConnections = Service.ExecQuery("ASSOCIATORS OF {MsSna_Server.Name='" &amp; strNetbiosName &amp; "'} where ResultClass=MsSna_Connection",, 0)

for each objRemoteAPPCLU in colRemoteAPPCLUs
for each objConnection in colServerConnections
if objRemoteAPPCLU.Connection = objConnection.Name then
intRemoteResyncLUs = intRemoteResyncLUs + 1
exit for
end if
next
next

if NOT intRemoteResyncLUs = 0 then
intLUResync = 1
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2016.LU62Resync']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "LU6.2 Resync")
call oDiscoveryData.AddInstance(oInst)
end if
end if
end if
end if

End Sub 'LUResyncSvcsDiscovery
</Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>