UUID report

hkim
Contributor II

Is it possible to query Inventory via UUID? Basically I have a UUID, I want it to spit out back at me the computer in JSS.

13 REPLIES 13

althea
Contributor

Did you find an answer, hkim? I'd like to be able to do this as well. Seems like it should be do-able via an extension attribute that looks at System Information, but I don't want to reinvent the wheel if it already exists out there.

hkim
Contributor II

I was able to use MySQL Workbench to look directly into the tables in question and have them match up. Basically exporting a CSV from MySQL Workbench manually for reach group (UUID and Computer Name).

You could do it via EA, but that would require each of the computers to resubmit inventory, but again that is re-inventing the wheel since the data is already there.

althea
Contributor

Thanks for the quick reply!

althea
Contributor

Huh. In the JSS, there's already an entry in every managed system's record for a UDID, and this appears to be the same as UUID. But doing an inventory search for a string from one of the managed system's UUID's (aka UDID apparently) doesn't get me any results. Not sure why this data is not searchable.

hkim
Contributor II

It just isn't searchable. *shrug* Thus there's no way to match it up. That's why I just used the raw data in MySQL and extracted it that way.

althea
Contributor

Ah, gotcha, you're way ahead of me. :)

Joel_Peasley
Contributor
Contributor

@hikim and @althea

What version of the JSS are you currently on? With version 9.x of the JSS you can do this search and have it pull back the computer record properly. If you are using version 9.x and this isn't working please contact your JAMF Software Account Manager to resolve this issue.

Thanks,
Joel

althea
Contributor

We're running 8.64, and will continue to do so for awhile yet.

seanjsgallagher
Contributor

I have the same thing here. we have not moved on to Version 9. I created an extension attribute for this info. Here it is.

#!/bin/sh
#This script is to be used with JSS version 8.7
#Pulls UUID number.

Devices=system_profiler SPHardwareDataType | grep 'Hardware UUID' | cut -c 21-60

#Output for extension attribute
echo '<result>'$Devices'</result>'

tpeterson
New Contributor

We are on 8.73, I can't get the UUID to populate is it compatible with 8.73?

dgreening
Valued Contributor II

I updated this script to use awk instead of cut. This is working successfully in our 8.73 environment.

#!/bin/sh
#This script is to be used with JSS version 8.73
#Pulls UUID number.

UUID=system_profiler SPHardwareDataType | grep 'Hardware UUID' | awk '{ print $3 }'

#Output for extension attribute
echo '<result>'$UUID'</result>'

mm2270
Legendary Contributor III

I would consider using ioreg to pull that information since its way faster than calling system_profiler in a script

UUID=$( ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformUUID/{print $4}' )

dgreening
Valued Contributor II

Right you are! That is much faster! Thanks!