Checks Opt-Out registry keys
Checks for AS/400 definitions must assigned to the TN5250 service
Knowledge Base article:
Summary
The TN5250 Service discovery checks the registry location "HKLM\SOFTWARE\Microsoft\SNA Server\CurrentVersion\Monitoring\" for the existence of the “Opt-Out” key (Disable TN5250Monitoring). If the key exists, no further action is taken. If the key does not exist, the Host Integration Server 2016 Management Pack queries the WMI namespace “root\MicrosoftHIS”, looking for AS/400 definitions on the server. If any sessions are found, the Host Integration Server 2016 Management Pack creates an instance of the TN5250 class.
Case HIS_TN3_OPTOUT_KEY
bDisableTN3Monitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_TN5_OPTOUT_KEY
bDisableTN5Monitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_PRINT_OPTOUT_KEY
bDisablePrintMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_HIP_OPTOUT_KEY
bDisableHIPMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_LU62RESYNC_OPTOUT_KEY
bDisableLU62ResyncMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_SI_OPTOUT_KEY
bDisableSIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_MI_OPTOUT_KEY
bDisableMIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_DI_OPTOUT_KEY
bDisableDIMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
Case HIS_WIP_OPTOUT_KEY
bDisableWIPMonitoring = TRUE
'ScriptContext.Echo (strIndent2 & strValue)
End Select
next
end if
End Sub 'GetRegParams
Sub TN5250SvcsDiscovery()
Dim colTN5Defs
Dim colWin32Services
Dim objWin32Service
' =============================================================
' TN5250 Discovery
' Get the set of TN5250 definitions for this HIS server, and if > 0 add the
' TN5 state monitoring component in the HIS Svcs role.
'
if NOT bDisableTN5Monitoring then
Set Service = Locator.ConnectServer(TargetComputer, "root\MicrosoftHIS")
' Get TN5250 definition count
set colTN5Defs = Service.ExecQuery("select * FROM MsSna_TN5250Definition where Service='" & strNetbiosName & "'",, 0)
if NOT colTN5Defs.Count = 0 then
intTN5Defs = colTN5Defs.Count
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2016.TN5250']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='Microsoft.HostIntegrationServer.2016.TN5250']/TN5250Defs$", intTN5Defs )
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "TN5250")
call oDiscoveryData.AddInstance(oInst)
end if
end if
End Sub 'TN5250SvcsDiscovery </Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>