I believe the problem with gathering the serial number on Compaq systems is the DMI interface with inventory. Compaq is inconsistent in this regard. What I have done is used the compaq insight manager agents on all systems. The inventory executes a custom after-inventory script which executes "collect.exe" (provided by the Compaq insight manager). The output is in a mif file which has to be reformatted for storage. Basically this provides all of the data that Tivoli cannot collect from a compaq system. Which is then stored in a custom table in the inventory database. The following code (in Winbatch) performs this function.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File: Normalize.wbt
; Purpose: Tivoli Inventory runs "c:\windows\collect.exe /F c:\tivoli\scan\output\raw_compaq.mif"
; after the Tivoli inventory is executed, a endpoint script is executed. This is the
; script. This script processes the "raw_compaq.mif" data and converts it into a form that
; Tivoli can store in the database.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Mif File Processing Rules
;
; The MIF file must have the following format
;
; Convert 1st non-space character after NAME = xxx to all upper case with _ "underscore" instead of spaces
; The MIF Table Structure, table names, and row names must EXACTLY match the oracle tables
;
;;;;; Run Collect ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;;;;; Hide The WinBatch Icon ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;WinHide(""

;IntControl(1002,0, 0, 0, 0)
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;debug(@on)
if winmetrics(-4)==4 then
if WinVersion(@MAJOR)== 3 then OpSys="NT 3.51"
if WinVersion(@MAJOR)== 4 then OpSys="NT 4.00"
end if
if Winmetrics(-4)==5 then
if WinVersion(@MINOR)== 0 then Opsys="WIN95"
if WinVersion(@MINOR)== 10 then Opsys="WIN98"
end if
VerMaj=WinVersion(@MAJOR)
VerMin=WinVersion(@MINOR)
;
if Opsys=="WIN95"||OpSys=="WIN98" then
WinCom=StrCat(DirWindows(0),"collect.exe"
RunHideWait(WinCom," /F c:\tivoli\scan\output\raw_compaq.mif /SE"

end if
if OpSys=="NT 4.00" then
WinCom=StrCat(DirWindows(1),"collect.exe"

RunHideWait(WinCom," /F c:\tivoli\scan\output\raw_compaq.mif /SE"

endif
;
While WinExist("COLLECT"

delay(1)
endwhile
;
;;;;; Process Output File ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
found=0
header=0
video=0
;
if FileExist("c:\tivoli\scan\output\compaq.mif"

then FileDelete("c:\tivoli\scan\output\compaq.mif"

FileNum=FileOpen ("c:\tivoli\scan\output\raw_compaq.mif", "READ"

FileNum2=FileOpen ("c:\tivoli\scan\output\compaq.mif", "WRITE"

Line=""
While Line != "*EOF*"
Line = FileRead(FileNum)
if found==1 then
if header==1 then
if StrIndex(line,"Start Attribute",0,@FWDSCAN) !=0 then
header=0
FileWrite(FileNum2, '%line%')
endif
else
if StrIndex(line,"End Group",0,@FWDSCAN) !=0 then line=StrUpper(line)
if StrIndex(line,'NAME =',0,@FWDSCAN) !=0 then
Pnum= ParseData(line)
for i=3 to Pnum
if i==3 then
NewStr=StrCat(PARAM%i%)
else
NewStr=StrCat(NewStr,"_"PARAM%i%)
endif
next
NewStr=StrUpper(NewStr)
NewStr=StrReplace (NewStr, " ","_"

line=StrCat(" ",PARAM1," ",PARAM2," ",NewStr)
endif
FileWrite(FileNum2, '%line%')
endif
endif
if StrIndex(line,'"COMPAQ SYSTEM"',0,@FWDSCAN) !=0 then
FileWrite(FileNum2, 'START COMPONENT')
FileWrite(FileNum2, ' NAME="COMPAQ.MIF"')
FileWrite(FileNum2, ' START GROUP')
FileWrite(FileNum2, ' NAME = "COMPAQ_SYSTEM"')
FileWrite(FileNum2, ' ID=1"')
found=1
header=1
endif
if StrIndex(line,'"COMPAQ VIDEO MONITOR"',0,@FWDSCAN) !=0 then
FileWrite(FileNum2, 'START COMPONENT')
FileWrite(FileNum2, ' NAME = "WORKSTATION"')
FileWrite(FileNum2, ' START GROUP')
FileWrite(FileNum2, ' NAME = "COMPAQ_VIDEO_MONITOR"')
FileWrite(FileNum2, ' ID = 1')
FileWrite(FileNum2, ' CLASS = "COMPAQ|MONITOR|1.1"')
FileWrite(FileNum2, ' KEY = 1')
found=1
Video=1
header=1
endif
if found==1 & StrIndex(line,"END GROUP",0,@FWDSCAN) !=0 then
FileWrite(FileNum2, 'END COMPONENT')
FileWrite(FileNum2, '')
found=0
endif
Endwhile
if Video==0 then
FileWrite(FileNum2, 'START COMPONENT')
FileWrite(FileNum2, ' NAME = "WORKSTATION"')
FileWrite(FileNum2, ' START GROUP')
FileWrite(FileNum2, ' NAME = "COMPAQ_VIDEO_MONITOR"')
FileWrite(FileNum2, ' ID = 1')
FileWrite(FileNum2, ' CLASS = "COMPAQ|MONITOR|1.1"')
FileWrite(FileNum2, ' KEY = 1')
FileWrite(FileNum2, ' Start Attribute')
FileWrite(FileNum2, ' NAME = "DESCRIPTION"')
FileWrite(FileNum2, ' ID = 1')
FileWrite(FileNum2, ' TYPE = STRING(128)')
FileWrite(FileNum2, ' VALUE = ""')
FileWrite(FileNum2, ' End Attribute')
FileWrite(FileNum2, ' Start Attribute')
FileWrite(FileNum2, ' NAME = "NAME"')
FileWrite(FileNum2, ' ID = 2')
FileWrite(FileNum2, ' TYPE = STRING(128)')
FileWrite(FileNum2, ' VALUE = ""')
FileWrite(FileNum2, ' End Attribute')
FileWrite(FileNum2, ' Start Attribute')
FileWrite(FileNum2, ' NAME = "SERIAL_NUMBER"')
FileWrite(FileNum2, ' ID = 3')
FileWrite(FileNum2, ' TYPE = STRING(48)')
FileWrite(FileNum2, ' VALUE = ""')
FileWrite(FileNum2, ' End Attribute')
FileWrite(FileNum2, ' Start Attribute')
FileWrite(FileNum2, ' NAME = "MAXIMUM_HORIZONTAL_PIXELS"')
FileWrite(FileNum2, ' ID = 4')
FileWrite(FileNum2, ' TYPE = INTEGER')
FileWrite(FileNum2, ' VALUE = 0')
FileWrite(FileNum2, ' End Attribute')
FileWrite(FileNum2, ' Start Attribute')
FileWrite(FileNum2, ' NAME = "EDID_VERSION"')
FileWrite(FileNum2, ' ID = 5')
FileWrite(FileNum2, ' TYPE = STRING(5)')
FileWrite(FileNum2, ' VALUE = ""')
FileWrite(FileNum2, ' End Attribute')
FileWrite(FileNum2, ' END GROUP')
FileWrite(FileNum2, 'END COMPONENT')
endif
FileClose(FileNum)
FileClose(FileNum2)
exit