The Message Integration discovery checks the registry location "HKLM\SOFTWARE\Microsoft\SNA Server\CurrentVersion\Monitoring\" for the existence of the “Opt-Out” key DisableMessageIntegrationMonitoring. If the key exists, no further action is taken. If the key does not exist, the Host Integration Server 2016 Management Pack queries MSI to verity that the feature MQ_CONNECTORS has been installed. If the feature is installed, the Host Integration Server 2016 Management Pack creates an instance of the MsgInt class.
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:\\" & TargetComputer & "\root\default:StdRegProv")
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 MsgIntDiscovery()
CONST HIS_MI_PATTERN = "MqChannel"
Dim intMsgInt
intMsgInt = 0
If NOT bDisableMIMonitoring Then
' =============================================================
' Check for MSI feature installed
intMsgInt = FindFeature(HIS_MI_PATTERN)
if NOT intMsgInt = 0 then
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.HostIntegrationServer.2016.MsgInt']$")
call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer)
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "Message Integration")
call oDiscoveryData.AddInstance(oInst)
end if
End If
End Sub 'MsgIntDiscovery
Function FindFeature(strFeatureName)
' Query MSI to determine if the specified HIS feature name is installed or advertised.
' Return 1 if true, 0 if false
'
CONST HIS_2016_PRODUCT_CODE = "{283BEF3A-0848-4119-B408-FA1AE9AAFB53}"
CONST INSTALLSTATE_LOCAL = 3
dim installer, feature, features, state
set installer = CreateObject("WindowsInstaller.Installer")
set features = installer.Features(HIS_2016_PRODUCT_CODE)
On Error Resume Next
for each feature in features
if feature = strFeatureName then
state = installer.FeatureState(HIS_2016_PRODUCT_CODE, feature)
if state = INSTALLSTATE_LOCAL then
FindFeature = 1
else
FindFeature = 0
end if
Exit Function
end if
next
FindFeature = 0
Exit Function
End function 'FindFeature </Script></ScriptBody>
<TimeoutSeconds>360</TimeoutSeconds>
</DataSource>
</Discovery>