Script to poll graphics chipset

jarednichols
Honored Contributor

Hi-

I just whipped up a little script to poll the graphics chipset and lay down a dummy package for it. Not sure if anyone will find it useful, but what the heck, here ya go.

j

Contents:

#!/bin/sh

# This script will poll for the graphics card chipset and set a dummy package
# for Casper to pickup on inventory.
# Written by Jared F. Nichols

chipset=Graphics-system_profiler -detaillevel mini | grep Chipset | cut -d : -f 2 | sed 's/ //g'.pkg
touch /Library/Application Support/JAMF/Receipts/$chipset
jamf recon
exit 0

--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

3 REPLIES 3

abenedict
New Contributor II

You could take this a step further and make it into an extension attribute,
it just takes a slight change of the code and you are good to go.

#!/bin/sh

chipset=Graphics-`system_profiler -detaillevel mini | grep Chipset | cut -d
: -f 2 | sed 's/ //g'`
echo "<result>$chipset<result/>"

Here is what it looks like in the JSS...

[image: Screen shot 2010-04-27 at 11.11.09 AM.png]

And after inventory, it will look like this in the computer Details...

[image: Screen shot 2010-04-27 at 11.10.27 AM.png]

--
Alan Benedict
?
Macintosh Technician
The Integer Group
http://www.integer.com

jarednichols
Honored Contributor

That's good to know for when we update to take advantage of those.

j

--
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436

chris_kemp
Contributor III

Thanks for this - thanks to your help, I've come up with a better version!

#!/bin/sh

chipset=`system_profiler SPDisplaysDataType | grep Chipset | cut -d : -f 2`

echo "<result>$chipset<result/>"

The thing about system_profiler is that it's very resource-intensive to poll the entire machine every time you want to ask about a single piece of hardware - so the commands shown in the previous posts will absolutely work, but slowly. By limiting the query to one data type (in this case SPDisplaysType) we get MUCH better response to the command.

This version will return output like "NVIDIA Quadro 4000" or "ATI Radeon HD 4870".