Skip to main content
Question

UUID report

  • September 9, 2013
  • 13 replies
  • 64 views

Forum|alt.badge.img+10

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

Forum|alt.badge.img+8
  • Contributor
  • September 16, 2013

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.


Forum|alt.badge.img+10
  • Author
  • Contributor
  • September 16, 2013

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.


Forum|alt.badge.img+8
  • Contributor
  • September 16, 2013

Thanks for the quick reply!


Forum|alt.badge.img+8
  • Contributor
  • September 16, 2013

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.


Forum|alt.badge.img+10
  • Author
  • Contributor
  • September 16, 2013

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.


Forum|alt.badge.img+8
  • Contributor
  • September 16, 2013

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


Forum|alt.badge.img+23
  • Employee
  • September 16, 2013

@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


Forum|alt.badge.img+8
  • Contributor
  • September 16, 2013

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


Forum|alt.badge.img+16

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>'


Forum|alt.badge.img+3
  • New Contributor
  • March 11, 2014

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


Forum|alt.badge.img+18
  • Honored Contributor
  • May 27, 2014

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
Forum|alt.badge.img+24
  • Legendary Contributor
  • May 27, 2014

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}' )

Forum|alt.badge.img+18
  • Honored Contributor
  • May 27, 2014

Right you are! That is much faster! Thanks!