Discovers the SNA Print Service.
Checks Opt-Out keys.
SNA Print sessions must be defined in order to be discovered.
Knowledge Base article:
Summary
The SNA Print Service discovery checks the registry location "HKLM\SOFTWARE\Microsoft\ SNA Server\CurrentVersion\Monitoring\" for the existence of the “Opt-Out” key (DisablePrintMonitoring). If the key is found, no further action is taken. If the key does not exist, the Host Integration Server 2009 Management Pack queries the WMI namespace “root\MicrosoftHIS”, looking for SNA print sessions defined on the server. If any sessions are found, the Host Integration Server 2009 Management Pack creates an instance of the SNAPrint 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_IPRESYNC_OPTOUT_KEY
bDisableIPResyncMonitoring = 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 PrintSvcsDiscovery()
Dim colSessions
Dim colWin32Services
Dim objWin32Service
Dim intPrintSessions
intPrintSessions = 0
' =============================================================
' Print Discovery
' Get the set of print sessions for this HIS server, and if > 0 add the
' Print state monitoring component in the HIS Svcs role.
'
if NOT bDisablePrintMonitoring then
Set Service = Locator.ConnectServer(TargetComputer, "root\MicrosoftHIS")
' Get Print session count
set colSessions = Service.ExecQuery("select * FROM MsSna_PrintSession where Service='" & strNetbiosName & "'",, 0)
if NOT colSessions.Count = 0 then
intPrintSessions = colSessions.Count
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2009.SNAPrint']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "SNA Print")
call oInst.AddProperty("$MPElement[Name='Microsoft.HostIntegrationServer.2009.SNAPrint']/SNAPrintDefs$", intPrintSessions)
call oDiscoveryData.AddInstance(oInst)
end if
end if
End Sub 'PrintSvcsDiscovery </Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>