Skip to main content

Hello. I collect display serials via an extension attribute. Recently I was looking for a display serial number and noticed that the serial number of the attached thunderbolt display was not showing in the extension attribute. So I ssh'd into the machine and ran system_profiler SPDisplaysDataType. That got me nothing but video hardware on the attached MacBook Pro, 9,1 running 10.8.3.



Graphics/Displays:
Intel HD Graphics 4000:

Chipset Model: Intel HD Graphics 4000
Type: GPU
Bus: Built-In
...
gMux Version: 1.9.23

NVIDIA GeForce GT 650M:

Chipset Model: NVIDIA GeForce GT 650M
Type: GPU
Bus: PCIe
....
gMux Version: 1.9.23


I looked in the GUI System Profiler, and yup, it there, showing as attached to the GeForce 650M, and shows the serial number - C02K80BPF2GC. I tried to find that anywhere in system_profiler



system_profiler | grep -i C02K80BPF2GC



I still get nothing. Is there a reason that I can't get the display serial number via the command line?

Does this help?



#!/bin/sh

serial=`system_profiler SPDisplaysDataType | grep -i "Display Serial Number" | sed -e 's/^[ ]*//' | cut -d " " -f 4`

if [ "$serial" != "" ]; then

echo "<result>$serial</result>"

else

echo "<result>Display Not Found</result>"

fi

exit 0

Does ioreg -a | grep -i C02K80BPF2GC yield any hits?



I'd probably file a bug with Apple since system_profiler sure should dump the Display Serial from my way of thinking, but you might be able to craft an alternate command for the mean time if you need these serials collected.


weird



system_profiler | grep -i <serial>


returns the serial number from my T-bolt display, also running 10.8.3.


Well, I'm not sure if this is strage or not, but I had to use sudo. The user 00 is an admin user, but apparently more rights are needed?



If this is the issue (none of the other displays seem to require this), then can I just add sudo to the extension attribute? I'm not really sure what user context the commands run in.



Here's the interesting part:
Logged in as a non-admin mobile account (the console owner) I can see the serial#. If from that user's terminal session I "su 00 -" and go into the 00 user context, I no longer get attached thunderbolt display info.



So:
Local logged in user: serial is displayed.
SSH in to 00 session: serial is not displayed
user 00 with sudo: serial is displayed.



3696-mbp:~ 00$ system_profiler SPDisplaysDataType
Graphics/Displays:

Intel HD Graphics 4000:

Chipset Model: Intel HD Graphics 4000
Type: GPU
Bus: Built-In
VRAM (Total): 384 MB
Vendor: Intel (0x8086)
Device ID: 0x0166
Revision ID: 0x0009
gMux Version: 1.9.23

NVIDIA GeForce GT 650M:

Chipset Model: NVIDIA GeForce GT 650M
Type: GPU
Bus: PCIe
PCIe Lane Width: x8
VRAM (Total): 512 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0fd5
Revision ID: 0x00a2
ROM Revision: 3682
gMux Version: 1.9.23

3696-mbp:~ 00$ sudo !!
sudo system_profiler SPDisplaysDataType
Password:
Graphics/Displays:

Intel HD Graphics 4000:

Chipset Model: Intel HD Graphics 4000
Type: GPU
Bus: Built-In
VRAM (Total): 384 MB
Vendor: Intel (0x8086)
Device ID: 0x0166
Revision ID: 0x0009
gMux Version: 1.9.23

NVIDIA GeForce GT 650M:

Chipset Model: NVIDIA GeForce GT 650M
Type: GPU
Bus: PCIe
PCIe Lane Width: x8
VRAM (Total): 512 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0fd5
Revision ID: 0x00a2
ROM Revision: 3682
gMux Version: 1.9.23
Displays:
Color LCD:
Display Type: LCD
Resolution: 1440 x 900
Pixel Depth: 32-Bit Color (ARGB8888)
Mirror: Off
Online: Yes
Built-In: Yes
Thunderbolt Display:
Display Type: LCD
Resolution: 2560 x 1440
Pixel Depth: 32-Bit Color (ARGB8888)
Display Serial Number: C02K80FPF2GC
Main Display: Yes
Mirror: Off
Online: Yes
Rotation: Supported
Connection Type: DisplayPort


It looks like the display info is the only thing that doesn't show



3696-mbp:~ 00$ system_profiler > nonsudo.txt
3696-mbp:~ 00$ sudo system_profiler > sudo.txt
Password:
3696-mbp:~ 00$ diff sudo.txt nonsudo.txt
245,262d244
< Displays:
< Color LCD:
< Display Type: LCD
< Resolution: 1440 x 900
< Pixel Depth: 32-Bit Color (ARGB8888)
< Mirror: Off
< Online: Yes
< Built-In: Yes
< Thunderbolt Display:
< Display Type: LCD
< Resolution: 2560 x 1440
< Pixel Depth: 32-Bit Color (ARGB8888)
< Display Serial Number: C02K80FPF2GC
< Main Display: Yes
< Mirror: Off
< Online: Yes
< Rotation: Supported
< Connection Type: DisplayPort
1448c1430
< Available: 328.73 GB (328,733,896,704 bytes)
---
> Available: 328.73 GB (328,734,072,832 bytes)
1457d1438
< File System: Journaled HFS+
1489c1470
< User Name: System Administrator (root)
---
> User Name: 00 (00)
1497c1478
< Available: 328.73 GB (328,733,892,608 bytes)
---
> Available: 328.73 GB (328,734,072,832 bytes)

Reply