Monitor Serial Number

(imported topic written by samuel7791)

Is there any method to get serial numbers of monitors into bigfix?

Thanks,

Samuel

(imported comment written by BenKus)

Hi Samuel,

I researched this for a while and I found some cool stuff… based on the results, I made a relevance query that returns model number, serial number, and date manufactured of each monitor:

q: ((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)
A: DELL 2001FP, C06465381C7L, 2/2005

Couple notes:

  • Not all computers have serial numbers (laptops don’t seem to have them)
  • I have only tested this on a couple computers
  • if you want just the model number add a item 0 of to the beginning of the relevance above, for only serial number add item 1 of, and for only date, add item 2 of

Let me know if this seems to work for you…

Ben

(imported comment written by SystemAdmin)

Ben,

Could this be added to the default Hardware Information Analyses (feature request)? And is there a way to grab it for OSX and Linux?

john

(imported comment written by SystemAdmin)

It appears the thread here answers my mac osx question - http://forum.bigfix.com/viewtopic.php?id=2266

I’d also like to request that this be added to the Hardware Information Analyses for Windows, Mac and Linux.

(imported comment written by NoahSalzman)

You can get monitor details out of Mac OS X – using the command “system_profiler SPDisplaysDataType” – but it does not include the serial number.

(imported comment written by SystemAdmin)

Ben,

A good percent of our systems are showing %0a at the end of the make and / or model. Is there a way to filter that? Some systems are showing the same monitor info twice under . Others are showing eithe or <multiple results, error>. Dual monitor systems are only showing one monitor on a multi monitor system.

Noah,

I tried to utilize the relevance in the thread that I linked here but seem to get back on my os x test machine. I have not tried the method you suggested because quite frankly I have zero knowledge of os x at this point in time. Could you elaborate on your method a little more?

(imported comment written by NoahSalzman)

This is what the output looks like on my Mac. Before donating some ActionScript/Relevance to this thread, my questions to you would be:

  • Do you just want the display name (“DELL 2007FP”) or other tid-bits as well? Resolution?
  • In the case of an external display do you want both display names or just the external?

$ system_profiler SPDisplaysDataType

Graphics/Displays:

ATI Radeon X1600:

Chipset Model: ATY,RadeonX1600

Type: GPU

Bus: PCIe

PCIe Lane Width: x16

VRAM (Total): 256 MB

Vendor: ATI (0x1002)

Device ID: 0x71c5

Revision ID: 0x0000

ROM Revision: 113-xxxxxx-158

EFI Driver Version: 01.00.158

Displays:

Color LCD:

Resolution: 1440 x 900

Pixel Depth: 32-Bit Color (ARGB8888)

Mirror: Off

Online: Yes

Built-In: Yes

DELL 2007FP:

Resolution: 1600 x 1200 @ 60 Hz

Pixel Depth: 32-Bit Color (ARGB8888)

Main Display: Yes

Mirror: Off

Online: Yes

Rotation: Supported

(imported comment written by SystemAdmin)

Noah, thanks for the willingness to donate some relevance!

What we’d like to see is the same info we collect on the windows side. So we’d like to see the graphics cards and all monitors / lcds that are either built in or external to the system with the manufacurer, model and serial # along with the display settings.

Ex (with your data):

Video Controller - ATI Radeon

Monitor Manufacturer - Built In, DELL

Monitor Model - LCD, 2007FP

Monitor Serial # -

Monitor Resolution - 1440 x 900 x 32-Bit Color, 1440 x 900 x 32-Bit Color

Does that make sense?

John

(imported comment written by NoahSalzman)

OK… it’s not perfect, but it may get you far enough along to be satisfactory.

First, some notes:

There were two ways to get the System Profiler output: formatted or xml. The former is nice to read but hard to parse programatically. The latter is easy to parse using the Relevance inspector (for Mac plist’s) but has the drawback that some of the strings are less “clean” than those presented in the formatted system_profiler output.

I used the xml output for ease of parsing. Also, there is a lame sed hack in the Action Script one-liner; it makes the xml output readable by our plist inspector as it expects the top level to be “dict” not “array”. That hack will break if Apple changes the output format in a future version of system_profiler.

This should work on Mac OS X 10.4 through 10.6… haven’t tried 10.3. However, if on your boxes the system_profiler utility spits out the dictionary items in a different order than what I saw on our boxes then these queries will likely fail.

That value for the Dell serial number does not match the serial number on my monitor, so Apple may have a bug there – this would explain why that value only exists in the xml output and is not surfaced in the formatted output.

Your ActionScript needs to be:

wait /bin/sh -c “system_profiler -xml SPDisplaysDataType | sed ‘/^</*array>/d’ > /tmp/display_info.xml”

Your Relevance queries for your custom properties should look like this for the first display:

Q:

string “_name” of dictionary 0 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: Color LCD

Q:

string “spdisplays_resolution” of dictionary 0 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: 1440 x 900

Q:

string “spdisplays_depth” of dictionary 0 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: CGSThirtytwoBitColor

For the 2nd display use “dictionary 1” of the array:

Q:

string “_name” of dictionary 1 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: DELL 2007FP

Q:

string “spdisplays_resolution” of dictionary 1 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: 1600 x 1200 @ 60 Hz

Q:

string “spdisplays_depth” of dictionary 1 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: CGSThirtytwoBitColor

Q: string “_spdisplays_display-serial-number” of dictionary 1 of array “spdisplays_ndrvs” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: 31313153

And, finally, use this query if you want the GPU:

Q:

string “sppci_model” of dictionary 0 of array “_items” of dictionary of file “/tmp/display_info.xml”

A: ATY,RadeonX1600

(imported comment written by SystemAdmin)

Thanks Noah. It’s about 50 / 50 in terms of results. Perhaps a DSS / HAM product is on the horizon that will gather this information :slight_smile:

(imported comment written by JackCoates91)

Visibility of monitor serial numbers is highly dependent on the driver in Windows, and it’s entirely possible that some gear simply doesn’t have a number (this is true of a lot of USB storage media too, FWIW). It may be possible to get more information by trying harder in different places, but this might also be as good as it gets.

EDIT: I realize this thread is also looking at monitors attached to OSX machines, just wanted to point out that there’s a software component involved which may or may not be getting handled properly in the case of a non-Apple monitor.

(imported comment written by NoahSalzman)

jspanitz

Thanks Noah. It’s about 50 / 50 in terms of results. Perhaps a DSS / HAM product is on the horizon that will gather this information :slight_smile:

Can you post the system_profiler output

the xml version, please

here for one of the machines that is not returning results? And, is there any correlation between OS version and “not returning results”?

(imported comment written by SystemAdmin)

Jack / Noah, We are using some utilities like DisplayConfigX (http://3dexpress.de) or SwitchResX or or MonInfo (http://www.entechtaiwan.com/util/moninfo.shtm) to grab the data which is what we are comparing to BigFix.

Here is the output from BigFix (display_info.xml). Running displayconfigx or switchresx on the mac system shows:

Monitor: Acer AL1916W

Model: ad86

Resolution: 1024x768

I have two test os x machines, one with 10.4.1 and the other 10.5.8. Right now the 10.5.8 machine is having issues. I’ll try on our production units tomorrow.

John

(imported comment written by NoahSalzman)

The xml you posted shows that Apple’s System Profiler utility is not gathering any details about the monitor; it only shows the NVIDIA card/GPU and no other info. It would appear that DisplayConfigX is working at the driver level.

So, this approach – parsing Apple’s System Profiler xml output – is clearly deficient in certain cases. It’s a shame DisplayConfigX lacks a command line, otherwise we could leverage that utility.

We can put in a feature request for new Mac inspectors that mirror DisplayConfigX’s output… but, honestly, it would be very far down the list of priorities.

(The other possibility would involve other Mac command line utilities – like kextfind or kextstat?? – that could produce the info we need with a minimum of “driver-ID to friendly-name” translation. However, I think that is probably DisplayConfigX’s secret sauce: performing that translation.)

(imported comment written by NoahSalzman)

So, as it turns out our “iokit registry” inspector can get the raw data we need, but there are a couple problems. One, the raw form of the data we get out of the iokit is usually a hexdump or a vendor ID code for which we don’t have a mapping. Two, we don’t have a map of all the possible node maps for each vendor (e.g. “ATY_Wormy” is specific to ATI, nVidia would be a different path).

Here is an example:

Q: data “IODisplayEDID” of dictionary of node “AppleBacklightDisplay” of node “display0” of node “ATY_Wormy” of node whose (path of it contains “ATY,Wormy@0”) of node “display” of node “IOPCI2PCIBridge” of node “PEGP” of node “AppleACPIPCI” of node “PCI0” of node “AppleACPIPlatformExpert” of service plane of iokit registry

A: %00%ff%ff%ff%ff%ff%ff%00%06%10`%9c%00%00%00%00%04%10%01%03%80"%16x%0a%1c%f5%97XP%8e’'PT%00%00%00%01%01%01%01%01%01%01%01%01%01%01%01%01%01%01%01%9f%25%a0@Q%84%0c0@ 3%00K%cf%10%00%00%19%00%00%00%01%00%06%100%00%00%00%00%00%00%00%00%0a %00%00%00%fe%00B154PW01 V0%0a %00%00%00%fc%00Color LCD%0a %00%bc

Sooo… at the moment you would need to gather sample data (to figure out what each vendor/model looks like in the iokit tree) or you could hire professional services to do it.

(imported comment written by NoahSalzman)

Ha! This has already been figured out… never thought to search the Forum first. Sigh.

http://forum.bigfix.com/viewtopic.php?pid=8978#p8978

(imported comment written by USMC175)

I’m using the below relevance to successfully obtain monitor serial numbers from WinXP desktop instances.

q: ((if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

a: HP L1940T%0a%0a%0a, CNK73013DT%0a , 7/2007

Couple of questions:

  1. How do I filter out the unexpected ‘%0a’ that is affixed to the end of the model and serial number outputs?

  2. For WinXP Laptops, can the relevance be revised to obtain external monitor model and serial numbers?

  3. Does the new release of BigFix (8) allow for additional capabilities to obtain external monitor model and serial numbers from WinXP or Win7 Laptops?

(imported comment written by BenKus)

Hey uscm175,

  1. Probably the easiest way to remove unwanted characters is this expression:

concatenation of substrings separated by “%0a” of …

So your expression would look like:

q: (concatenation of substrings separated by “%0a” of (if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”), concatenation of substrings separated by “%0a” of (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”), (hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

  1. I think it depends on if XP itself knows the details of the monitor… I don’t know the details exactly, but we have seen that XP monitors on Laptops behave differently than Windows 7. I just tried for a while and I couldn’t figure out how to get an XP laptop to see the monitor (although my Win7 laptop is working fine).

  2. BigFix 8.0 has new inspectors that can count how many external monitors are available, but it doesn’t know their model number or serial number so I am not sure if that helps much…

Ben

(imported comment written by SystemAdmin)

Ben is there anyway to account for multiple displays?

I have a workstation with 2 monitors however I only get 1 monitor returned on the results page. Also I get a lot of “Error” results “Singular expression refers to a nonexistant object.” any idea how to fix that? out of 6k computers about 2k of them are coming back with that error.

Thanks,

Alex

(imported comment written by BenKus)

Hi Alex,

There are probably lost of reasons you could get an error if the format of the string doesn’t match what my computer says…

I tried to add some error checking to skip unknown values… This syntax will work in 8.0+ agents:

q: ((concatenation of substrings separated by “%0a” of (if (exists first “000000fc00” of it) then hexadecimal string (first 24 of following texts of first “000000fc00” of it ) else “n/a”) | “n/a”), (concatenation of substrings separated by “%0a” of (if (exists first “000000ff00” of it) then hexadecimal string (first 24 of following texts of first “000000ff00” of it ) else “n/a”)) | “n/a”, ((hexadecimal integer (first 2 of following text of position 32 of it )/4) as string & “/” & (1990+(hexadecimal integer (first 2 of following text of position 34 of it ))) as string) | “n/a”) of (it whose (length of it > 32 AND it contains “000000ff00”)) of (values “EDID” of keys ((“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum” & it & “\Device Parameters”) of (string values of selects “PNPDeviceID from Win32_DesktopMonitor” of wmi) ) of registry as string)

A: DELL 2007FP, C953667C1FLL, 7/2006

Ben