Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Sun Dec 08, 2019 10:04 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
PostPosted: Sat Feb 02, 2008 1:05 am 
Offline
Contributor

Joined: Fri Sep 28, 2007 12:07 am
Posts: 189
Hi,

Is it possible to also enumerate the serial number (IEEE number) of HBAs detected on hosts? In addition, can WMI also report on where/which Fiber Channel switch/port the card is connected to?

This would be good feature IMHO.

Thanks

Jason

_________________
OA Deployment:
Windows 2003 with XAMPP install
80 Windows Servers
250 Windows workstations (mixed XP and 2000)
5 MACs
Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 13, 2008 1:15 am 
Offline
Newbie

Joined: Thu Feb 07, 2008 2:13 am
Posts: 5
I know it's been a couple months, but have you had any luck with this? I have a decent size SAN deployment with Fibre Channel and this would be a tremendous help.

Do you have a vbscript that can do this already? I'm dececnt with vbscript, but haven't given this type of thing a go, yet. I'm guessing it might be as easy as looping through the hardware and checking for a known HBA... then kick off a query function to find the info.

If we can get that working, we might be able to extend the audit.vbs to include it.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 13, 2008 3:13 am 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Well in theory it can be done, and since it is possible to see most of the hardware through WMI I cant think why we would have any trouble seeing the Fiber cards and their details. Only trouble is... I dont have anything to test this on. So, you may have to do a bit of work and tell us what WMI query we need to use to find the information you require. Once we know this, we should be able to work out how to add it to OA fairly easily.

_________________
Andrew

OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2008 5:45 am 
Offline
Newbie

Joined: Thu Feb 07, 2008 2:13 am
Posts: 5
I've found multiple references to a Common HBA API that can be downloaded from Microsoft, but I can't find a download. I did find this:

http://www.microsoft.com/whdc/device/storage/FCTopology.mspx and I'm currently working my way through it. But, I keep getting a null return value for the enumSetAdapters array. The system I'm running against has Qlogic QLA23xx installed.

Also, I found this reference...

http://msdn2.microsoft.com/en-us/library/ms803430.aspx

Perhaps someone can put a test script together for queries against the classes.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2008 6:28 am 
Offline
Newbie

Joined: Thu Feb 07, 2008 2:13 am
Posts: 5
Quick update...

I've been able to install the fcinfo tool from Microsoft. This installs the needed API to access the HBA WMI classes. After installing the FCInfo tool (with the API), I run this script from the Audit server:
Code:
' (VBScript)
' Functions
Function WWNToString(arrayWWN)
    WWNToString = Hex0(arrayWWN(0))
    For I = 1 To 7
        WWNToString = WWNToString & ":" & Hex0(arrayWWN(I))
    Next
End Function

Function Hex0(n)
    Hex0 = Hex(n)
    If (n < &h10) Then Hex0 = "0" & Hex0
End Function

' Connect to WMI.
strComputer = "afnbrkhds1"
Set oWbemServices = GetObject("winmgmts:" & _
   "{impersonationLevel=impersonate}!\\" & strComputer & "\root\wmi")

' Enumerate the FC adapters.
Set enumSetAdapters = oWbemServices.InstancesOf("MSFC_FCAdapterHBAAttributes")
Set enumSetPorts = oWbemServices.InstancesOf("MSFC_FibrePortHBAAttributes")
nIndex = 0
For Each oEltAdapter in enumSetAdapters
    For Each oEltPort in enumSetPorts
        If (oEltAdapter.InstanceName = oEltPort.InstanceName) Then       
            sAdapterName = oEltAdapter.MfgDomain & _
                "-" & oEltAdapter.Model & "-" & nIndex
            WScript.Echo "  adapter: " & sAdapterName
            WScript.Echo " node_wwn: " & WWNToString(oEltAdapter.NodeWWN)
            WScript.Echo " port_wwn: " & _
                WWNToString(oEltPort.Attributes.PortWWN)
            WScript.Echo
            nIndex = nIndex + 1
        End If
    Next ' oEltPort
Next ' oEltAdapter


And... I get pretty output:
Code:
C:\si_scripts>cscript fcquery.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

  adapter: com.qlogic-QLA2340-0
 node_wwn: 20:00:00:E0:8B:93:EF:11
 port_wwn: 21:00:00:E0:8B:93:EF:11


So, the next step is figure out how to adjust the audit.vbs from Open-Audit, to check if the SCSI adapter is a FC HBA, then we querie a common value from the WMI storage class and this.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 30, 2009 2:05 am 
Offline
Newbie

Joined: Thu Apr 30, 2009 1:28 am
Posts: 1
Has anyone gotten this working or completed?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group