Ich schreib gerade ein CLI-Tool welches mir Daten von FC (Fibre Channel) Adapter abfragt.
Dazu gibt es jede Menge WMI Klassen: Link zu den Beschreibungen der MPIO-Klassen
MPIO_DISK_INFO
MPIO_DISK_HEALTH
MSFC_FCAdapterHBAAttributes
habe ich schon erfolgreich umgesetzt,
immer nach dem gleichen Schema:
Func _Get_MSFC_FCAdapterHBAAttributes()
Local $o_WMIService ; Zeiger auf das WMI
Local $o_msfc_FCAdapter ; Zeiger auf die ganze MSFC_FCAdapterHBAAttributes Klasse
Local $o_FCAdapters ; Zeiger auf das Array mit den HBA Adaptern
Local $o_nodeWWN ; Zeiger auf das Array der WWN des Adapters
$o_WMIService = ObjGet("winmgmts:\\" & $s_TargetHost & "\root\WMI")
$o_msfc_FCAdapter = $o_WMIService.ExecQuery("SELECT * FROM MSFC_FCAdapterHBAAttributes", "WQL", 0x10 + 0x20)
If IsObj($o_msfc_FCAdapter) then
For $o_FCAdapters In $o_msfc_FCAdapter
$a_MSFC_FCAdapterHBAAttributes[0][0] = $a_MSFC_FCAdapterHBAAttributes[0][0] + 1
ReDim $a_MSFC_FCAdapterHBAAttributes[ $a_MSFC_FCAdapterHBAAttributes[0][0] + 1 ][19]
$a_MSFC_FCAdapterHBAAttributes[ $a_MSFC_FCAdapterHBAAttributes[0][0] ][1] = $o_FCAdapters.Active
; und so weiter ....
Next
EndiF
EndFunc
Alles anzeigen
Doch nun versuche ich mich an der Klasse "MSFC_FibrePortHBAAttributes"
https://msdn.microsoft.com/en-us/library/…0(v=vs.85).aspx
welche als Rückgabe (soweit komme ich noch) diese Struktur zurückgibt: https://msdn.microsoft.com/en-us/library/…9(v=vs.85).aspx
Ein Teil dieser Rückgabe ist die Eigenschaft/Wert/Struktur Attributes : https://msdn.microsoft.com/en-us/library/…0(v=vs.85).aspx
Ich greife auf "Attributes" per
<em>$o_WMIService = ObjGet("winmgmts:\\" & $s_TargetHost & "\root\WMI")</em>
<em> $o_msfc_FCPorts = $o_WMIService.ExecQuery("SELECT * FROM MSFC_FibrePortHBAAttributes", "WQL", 0x10 + 0x20)</em>
<em> If IsObj($o_msfc_FCPorts) then</em>
<em> For $o_FCPort In $o_msfc_FCPorts</em>
<em> $o_FCAttributes = $o_FCPort.Attributes</em>
<em> For $o_FCSinglePort In $o_FCAttributes</em>
Wenn ich $o_FCAttributes Teste so ist es vom Typ Object. Leider kann ich auf keinerlei Werte der Struktur Zugreifen. Da sind zwar auch ein paar Arrays drin, aber auch direkte Werte wie "PortSpeed"
Nutze ich Powershell ist das "ganz easy":
PS C:\> gwmi -Namespace root\wmi -Class MSFC_FibrePortHbaAttributes
__GENUS : 2
__CLASS : MSFC_FibrePortHBAAttributes
__SUPERCLASS :
__DYNASTY : MSFC_FibrePortHBAAttributes
__RELPATH : MSFC_FibrePortHBAAttributes.InstanceName="PCI\\VEN_1077&DEV_2532&SUBSYS_015D1077&REV_02\\4&3814a808&
0&0008_0"
__PROPERTY_COUNT : 5
__DERIVATION : {}
__SERVER : TESTSERVER
__NAMESPACE : root\wmi
__PATH : \\ECESRV182A\root\wmi:MSFC_FibrePortHBAAttributes.InstanceName="PCI\\VEN_1077&DEV_2532&SUBSYS_015D10
77&REV_02\\4&3814a808&0&0008_0"
Active : True
Attributes : System.Management.ManagementBaseObject
HBAStatus : 0
InstanceName : PCI\VEN_1077&DEV_2532&SUBSYS_015D1077&REV_02\4&3814a808&0&0008_0
UniquePortId : 18446738029665845256
__GENUS : 2
__CLASS : MSFC_FibrePortHBAAttributes
__SUPERCLASS :
__DYNASTY : MSFC_FibrePortHBAAttributes
__RELPATH : MSFC_FibrePortHBAAttributes.InstanceName="PCI\\VEN_1077&DEV_2532&SUBSYS_015D1077&REV_02\\4&3814a808&
0&0108_0"
__PROPERTY_COUNT : 5
__DERIVATION : {}
__SERVER : TESTSERVER
__NAMESPACE : root\wmi
__PATH : \\ECESRV182A\root\wmi:MSFC_FibrePortHBAAttributes.InstanceName="PCI\\VEN_1077&DEV_2532&SUBSYS_015D10
77&REV_02\\4&3814a808&0&0108_0"
Active : True
Attributes : System.Management.ManagementBaseObject
HBAStatus : 0
InstanceName : PCI\VEN_1077&DEV_2532&SUBSYS_015D1077&REV_02\4&3814a808&0&0108_0
UniquePortId : 18446738029668311048
PS C:\> gwmi -Namespace root\wmi -Class MSFC_FibrePortHbaAttributes | Select -Expandproperty Attributes
__GENUS : 2
__CLASS : MSFC_HBAPortAttributesResults
__SUPERCLASS :
__DYNASTY : MSFC_HBAPortAttributesResults
__RELPATH :
__PROPERTY_COUNT : 13
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
FabricName : {16, 0, 80, 235...}
NodeWWN : {32, 0, 0, 36...}
NumberofDiscoveredPorts : 2
PortActiveFc4Types : {0, 1, 0, 0...}
PortFcId : 2103040
PortMaxFrameSize : 2048
PortSpeed : 16
PortState : 2
PortSupportedClassofService : 8
PortSupportedFc4Types : {0, 1, 0, 0...}
PortSupportedSpeed : 26
PortType : 5
PortWWN : {33, 0, 0, 36...}
__GENUS : 2
__CLASS : MSFC_HBAPortAttributesResults
__SUPERCLASS :
__DYNASTY : MSFC_HBAPortAttributesResults
__RELPATH :
__PROPERTY_COUNT : 13
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
FabricName : {16, 0, 80, 235...}
NodeWWN : {32, 0, 0, 36...}
NumberofDiscoveredPorts : 2
PortActiveFc4Types : {0, 1, 0, 0...}
PortFcId : 2037504
PortMaxFrameSize : 2048
PortSpeed : 16
PortState : 2
PortSupportedClassofService : 8
PortSupportedFc4Types : {0, 1, 0, 0...}
PortSupportedSpeed : 26
PortType : 5
PortWWN : {33, 0, 0, 36...}
Alles anzeigen
Ich muss also etwas wie "Select -Expandproperty Attributes" in AutoIt machen ... stehe aber gerade ziemlich auf dem Schlauch ....
Gruß,
BLinzler