Device Overview:
The Isilon cluster itself is a number of FreeBSD systems (nodes) joined together via and infiniband backend to create a single NAS. While normally this would not be an issue, network connectivity to the device and SNMP response from the cluster have been. In my configuration I have a total of 8 nodes each node has 2 network interfaces. Of these 16 network interfaces only 2 are accessible/on the same network as my RMS (em1 node2, em1 node4).
Device SNMP Design:
While the cluster is highly dynamic the SNMP sub-systems are not. The MIB created by Isilon does not join the whole of the cluster into an index for SNMP polling. I can only poll a single nodes OID's. To over come this limitation Isilon implemented SNMP-Proxy or comtosec within the system. This allowed me to poll node 3 by changing the community name for the OID I was polling from the discovered name to <discoveredname>_node_3.
MP Design:
Now I'm not the best at MP design since I rarely work within SCOM so don't laugh too hard... I reused items from Kristopher's Cisco MP and created a number of classes for discovery and item hosting. To address the limitation I found within SCOM for dynamic discovery and 1 IP address 1 Community Name, I created a class property within the root called ConfiguredNodes. I can poll the Isilon an populate this value (8). Then I created a sub-class property value called NodeCommStr to fill in all the custom community names I generate using a VB script with Base64 encode/decode, the discovery community name and the ConfiguredNodes value, in the data source for sub-class discovery. public_node_1 public_node_2 etc...
All in all this is working well however I have run into a few design roadblocks and I have some questions.
1. When I discover a set of items within the Isilon cluster the health explorer is not sorting this information alphabetically. Is there a value I can include in the dependency roll-up to correct this?
2. I have run into an issue with the Isilon MIB and I'm looking for the best way to overcome the MIB's design. They included a fan table with fan information and speed of the fans however there is no status (success{0}, warning{1}, error{2}). I created a monitor type to compensate for this and included overrides for the warning and critical event points. This is where I found the curve ball, seems that the fans are not the same.... There are 2 sets of fans - Chassis and Power Supply - and they have different thresholds *rolls eyes*. Some I'm asking for the best design advice, should I create 2 classes, discoveries, monitor types, etc.? Or can I address this issue by creating 2 monitor types with a string filter?
3. I've been successful in creating this MP and displaying the information as a single device however I was wondering if there was a way to create dynamic groups with sub groups. This would have to be 100% dynamic since I can add a 9th 10th 192nd (yes 192) node to the cluster.
Cluster
-ClusterNode1
-ClusterNode1Power
-ClusterNode1Fans
-etc
The information is there in the NodeCommStr, I'm just in brain lock on how to design it right now.
Again, code is raw and a work in progress so please no giggling. Oh this is a multi post... Code is too long.
<Manifest>
<Identity>
<ID>IsilonSNMP</ID>
<Version>1.0.1.2</Version>
</Identity>
<Name>IsilonSNMP</Name>
<References>
<Reference Alias="MicrosoftSystemCenterNetworkDeviceLibrary">
<ID>Microsoft.SystemCenter.NetworkDevice.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="Snmp">
<ID>System.Snmp.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="SystemHardwareLibrary">
<ID>System.Hardware.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="Windows">
<ID>Microsoft.Windows.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="SystemPerformanceLibrary">
<ID>System.Performance.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="System">
<ID>System.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="SC">
<ID>Microsoft.SystemCenter.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference Alias="Health">
<ID>System.Health.Library</ID>
<Version>6.0.6278.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
</References>
</Manifest>
<TypeDefinitions>
<EntityTypes>
<ClassTypes>
<ClassType ID="IsilonSNMP.Class.IsilonCluster" Accessibility="Public" Abstract="false" Base="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice" Hosted="false" Singleton="false">
<Property ID="Hostname" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
<Property ID="ConfiguredNodes" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
<!-- <Property ID="NodeCommStr" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" /> -->
</ClassType>
<ClassType ID="IsilonSNMP.Class.IsilonCluster.Nodes" Accessibility="Public" Abstract="false" Base="SystemHardwareLibrary!System.Chassis" Hosted="true" Singleton="false">
<Property ID="Name" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
</ClassType>
<ClassType ID="IsilonSNMP.Class.IsilonCluster.PhysicalDisk" Accessibility="Public" Abstract="false" Base="SystemHardwareLibrary!System.PhysicalDisk" Hosted="true" Singleton="false">
<Property ID="Index" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
<!-- <Property ID="ConfiguredNodes" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" /> -->
<Property ID="NodeCommStr" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
<Property ID="BayIndex" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
</ClassType>
<ClassType ID="IsilonSNMP.Class.IsilonCluster.PhysicalFan" Accessibility="Public" Abstract="false" Base="SystemHardwareLibrary!System.Fan" Hosted="true" Singleton="false">
<Property ID="Index" Type="string" Key="true" CaseSensitive="false" Length="256" MinLength="0" />
<Property ID="NodeCommStr" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
<Property ID="FanNumber" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0" />
</ClassType>
<ClassType ID="IsilonSNMP.Group.IsilonClusters" Accessibility="Public" Abstract="false" Base="System!System.Group" Hosted="false" Singleton="true" />
</ClassTypes>
<RelationshipTypes>
<RelationshipType ID="IsilonSNMP.Relationship.ClusterHostsNodes" Accessibility="Internal" Abstract="false" Base="System!System.Hosting">
<Source>IsilonSNMP.Class.IsilonCluster</Source>
<Target>IsilonSNMP.Class.IsilonCluster.Nodes</Target>
</RelationshipType>
<RelationshipType ID="IsilonSNMP.Relationship.IsilonClustersGroupContainsIsilonClusters" Accessibility="Public" Abstract="false" Base="System!System.Containment">
<Source>IsilonSNMP.Group.IsilonClusters</Source>
<Target>IsilonSNMP.Class.IsilonCluster</Target>
</RelationshipType>
<RelationshipType ID="IsilonSNMP.Relationship.NodesHostsPhysicalDisk" Accessibility="Public" Abstract="false" Base="System!System.Hosting">
<Source>IsilonSNMP.Class.IsilonCluster.Nodes</Source>
<Target>IsilonSNMP.Class.IsilonCluster.PhysicalDisk</Target>
</RelationshipType>
<RelationshipType ID="IsilonSNMP.Relationship.NodesHostsPhysicalFan" Accessibility="Public" Abstract="false" Base="System!System.Hosting">
<Source>IsilonSNMP.Class.IsilonCluster.Nodes</Source>
<Target>IsilonSNMP.Class.IsilonCluster.PhysicalFan</Target>
</RelationshipType>
</RelationshipTypes>
</EntityTypes>
<ModuleTypes>
<DataSourceModuleType ID="IsilonSNMP.DataSource.BasicSNMPProbe" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="Interval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="IPAddress" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="CommStr" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="OID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Interval" Selector="$Config/Interval$" ParameterType="int" />
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/Interval$</Interval>
<SyncTime />
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID="SNMPProbe" TypeID="Snmp!System.SnmpProbe">
<IsWriteAction>false</IsWriteAction>
<IP>$Config/IPAddress$</IP>
<CommunityString>$Config/CommStr$</CommunityString>
<SnmpVarBinds>
<SnmpVarBind>
<OID>$Config/OID$</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
</SnmpVarBinds>
</ProbeAction>
<ConditionDetection ID="ValueFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">/DataItem/SnmpVarBinds/SnmpVarBind[1]/Value</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String" />
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="ValueFilter">
<Node ID="SNMPProbe">
<Node ID="Scheduler" />
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Snmp!System.SnmpData</OutputType>
</DataSourceModuleType>
<DataSourceModuleType ID="IsilonSNMP.DataSource.DiscoverContainmentClasses" Accessibility="Internal" Batching="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ParamListSchema</SchemaType>
<SchemaType>System!System.Discovery.MapperSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element minOccurs="1" name="IPAddress" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="ClassID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="InstanceSettings" type="SettingsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>60</Interval>
<SyncTime />
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ConditionDetection ID="Mapper" TypeID="System!System.Discovery.ClassSnapshotDataMapper">
<ClassId>$Config/ClassID$</ClassId>
<InstanceSettings>$Config/InstanceSettings$</InstanceSettings>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapper">
<Node ID="Scheduler" />
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>
<DataSourceModuleType ID="IsilonSNMP.DataSource.DiscoverCluster" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="Interval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="IP" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="CommunityString" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="SystemOID" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Interval" Selector="$Config/Interval$" ParameterType="int" />
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">$Config/Interval$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID="Probe" TypeID="Snmp!System.SnmpProbe">
<IsWriteAction>false</IsWriteAction>
<IP>$Config/IP$</IP>
<CommunityString>$Config/CommunityString$</CommunityString>
<SnmpVarBinds>
<SnmpVarBind>
<OID>.1.3.6.1.4.1.12124.1.1.4.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.4.1.12124.1.1.1.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.2.1.1.5.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.2.1.1.1.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.2.1.1.4.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.2.1.1.6.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
<SnmpVarBind>
<OID>.1.3.6.1.2.1.1.2.0</OID>
<Syntax>0</Syntax>
<Value VariantType="8" />
</SnmpVarBind>
</SnmpVarBinds>
</ProbeAction>
<ConditionDetection ID="Mapper" TypeID="System!System.Discovery.FilteredClassSnapshotDataMapper">
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>/DataItem/SnmpVarBinds/SnmpVarBind[1]/Value</XPathQuery>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>1.3.6.1.4.1.12124.</Pattern>
</RegExExpression>
</Expression>
<ClassId>$MPElement[Name="IsilonSNMP.Class.IsilonCluster"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/IPAddress$</Name>
<Value>$Data/Source$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/Name$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[5]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/SystemDescription$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[4]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/SystemContact$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[3]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/SystemLocation$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[2]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice"]/SystemOID$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[1]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[5]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="IsilonSNMP.Class.IsilonCluster"]/Hostname$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[6]/Value$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="IsilonSNMP.Class.IsilonCluster"]/ConfiguredNodes$</Name>
<Value>$Data/SnmpVarBinds/SnmpVarBind[7]/Value$</Value>
</Setting>
</Settings>
</InstanceSettings>
</ConditionDetection>
<ConditionDetection ID="SystemOIDFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<RegExExpression>
<ValueExpression>
<Value>$Config/SystemOID$</Value>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>1.3.6.1.4.1.12124.</Pattern>
</RegExExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapper">
<Node ID="Probe">
<Node ID="SystemOIDFilter">
<Node ID="Scheduler" />
</Node>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>
<DataSourceModuleType ID="IsilonSNMP.DataSource.DiscoverPhysicalDisk" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element minOccurs="1" name="IPAddress" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="CommStr" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="Interval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="ConfiguredNodes" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="BayIndex" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" name="NodeCommStr" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Interval" Selector="$Config/Interval$" ParameterType="int" />
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/Interval$</Interval>
<SyncTime />
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID="ScriptDiscovery" TypeID="Windows!Microsoft.Windows.ScriptDiscoveryProbe">
<ScriptName>DiscoverIsilonDisk.vbs</ScriptName>
<Arguments>$Config/IPAddress$ $Config/CommStr$ $MPElement$ $Target/Id$ $Config/ConfiguredNodes$</Arguments>
<ScriptBody>
<![CDATA['Discover PhysicalDisk
Dim oAPI, oDiscoveryData, oInst, objWMIServices, objWMILocator, oArgs
set oArgs = Wscript.Arguments
if oArgs.Count <5 Then
Wscript.Quit -1
End If
DeviceIP = oArgs(0)
CommStr = oArgs(1)
SourceID = oArgs(2)
ManagedEntityId = oArgs(3)
StrConfiguredNodes = oArgs(4)
CommStr = Decode(CommStr)
ConfiguredNodesCommStr = cstr(CommStr)
wscript.echo CommStr
Set oAPI = CreateObject("MOM.ScriptAPI")
set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
Set objWMILocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIServices = objWMiLocator.ConnectServer("","root\snmp\localhost")
'Name community name
GetPhysicalDisks
'Created community names
For i = 1 to StrConfiguredNodes
CommStr = ConfiguredNodesCommStr & "_node_" & i
GetPhysicalDisks
Next
'Return all data to SCOM
Call oAPI.Return(oDiscoveryData)
Sub GetPhysicalDisks
on error resume next
Set objWmiNamedValueSet = CreateObject("WbemScripting.SWbemNamedValueSet")
objWmiNamedValueSet.Add "AgentAddress", cstr(DeviceIP)
objWmiNamedValueSet.Add "AgentReadCommunityName", cstr(CommStr)
Set colPhysicalDisk = objWmiServices.InstancesOf("SNMP_ISILON_MIB_diskTable", , objWMINamedValueset)
For each objItem in colPhysicalDisk
nIndex = objItem.diskBay
sDesc = objItem.diskSerialNumber
if nIndex > 0 then
set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='IsilonSNMP.Class.IsilonCluster.PhysicalDisk']$")
call oInst.AddProperty("$MPElement[Name='MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice']/IPAddress$", DeviceIP)
call oInst.AddProperty("$MPElement[Name='IsilonSNMP.Class.IsilonCluster.PhysicalDisk']/Index$", cstr(CommStr) & "-" & cdbl(nIndex))
call oInst.AddProperty("$MPElement[Name='IsilonSNMP.Class.IsilonCluster.PhysicalDisk']/NodeCommStr$", Encode(CommStr))
call oInst.AddProperty("$MPElement[Name='IsilonSNMP.Class.IsilonCluster.PhysicalDisk']/BayIndex$", cdbl(nIndex))
call oInst.AddProperty("$MPElement[Name='IsilonSNMP.Class.IsilonCluster.Nodes']/Name$", "Cluster")
call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "SNMP Host " & cstr(CommStr) & " - Bay " & nIndex & " - Serial Number " & HexToString(sDesc))
'call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", HexToString(sDesc))
call oDiscoveryData.AddInstance(oInst)
'Test Section
'wscript.echo Base64Encode(CommStr)
'wscript.echo Base64Encoder(CommStr)
'wscript.Echo CommStr
'wscript.Echo nIndex
'Wscript.Echo HexToString(sDesc)
'wscript.echo cdbl(nIndex) & cstr(CommStr)
end if
Next
on error goto 0
End Sub
Function Decode(strB64)
strXML = "<B64DECODE xmlns:dt=" & Chr(34) & _
"urn:schemas-microsoft-com:datatypes" & Chr(34) & " " & _
"dt:dt=" & Chr(34) & "bin.base64" & Chr(34) & ">" & _
strB64 & "</B64DECODE>"
Set oXMLDoc = CreateObject("MSXML2.DOMDocument.3.0")
oXMLDoc.LoadXML(strXML)
decode = oXMLDoc.selectsinglenode("B64DECODE").nodeTypedValue
set oXMLDoc = nothing
End Function
Function Encode(Str)
'Use ADODB.Stream to write Ansi string to Unicode stream
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 2
objStream.Open
objStream.Charset = "unicode"
objStream.WriteText Str
objstream.Flush
'Read the stream back as a byte array
objStream.Position = 0
objStream.Type = 1
temp = objstream.read(2) 'read two bytes of the stream to discard the byte order mark
bArray = objStream.Read
objStream.Close
'Convert byte array to Base64
set objXML = createobject("MSXML2.DOMDocument.3.0")
Set objNode = objXML.createElement("b64")
objNode.dataType = "bin.base64"
objNode.nodeTypedValue = bArray
Encode = objNode.Text
Set Stream = Nothing
set objNode = nothing
set objXML = nothing
End Function
Function HexToString(str)
on error resume next
sOutput = ""
For x = 1 To len(str) Step 2
sChar = Chr(Clng("&h" & Mid(str,x,2)))
sOutput = sOutput & sChar
Next
if err.number = 0 then
HexToString = sOutput
Else
HexToString = str
end if
End Function
set oInst = nothing
set oDiscoveryData = nothing
set oArgs = nothing
set oAPI = nothing
set objWMILocator = nothing
set objWMIServices = nothing
set objWMINamedValueSet = nothing
]]>
</ScriptBody>
<TimeoutSeconds>120</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="ScriptDiscovery">
<Node ID="Scheduler" />
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>