Posted on 05-19-2011 10:37 AM
I would like to see the model identifier (keep model name as well) in the JSS. anyone else?
![external image link](attachments/3c57963254c34beba8f3074305596f40)
![external image link](attachments/aa059015e54d40deb259fc39cd530e82)
Posted on 05-19-2011 12:17 AM
I'm new to Casper. Would you be willing to share what you're entering for the Extension Attribute? I would guess it includes sysctl hw.model, but I'm not quite sure how to format the script to display that value correctly.
Thanks.
Joe Friedel, iCIT
University of Wisconsin - Whitewater
Andersen Library, Room 2003F
(262) 472-1658
Posted on 05-19-2011 12:25 AM
heres what i did....
#!/bin/bash
echo "<result>`system_profiler | grep 'Model Identifier:' | awk '{print $3}'`<result>"
Posted on 05-19-2011 11:25 AM
Do you mean have both "MacBook Pro (15-inch, Early 2011)" AND MacBookPro8,2? On May 19, 2011, at 12:37 PM, Eric Winkelhake wrote:
If so, I agree...
Posted on 05-19-2011 11:27 AM
precisely.
![external image link](attachments/5f082da9161d4ef5847f5e22b00f3046)
Posted on 05-19-2011 11:30 AM
We created an Extension Attribute to show the Model Identifier.
Don
Posted on 05-19-2011 11:51 AM
good call...i just set that up. didn't even occur to me to do that, thanks.
![external image link](attachments/7a6dcad35152458b9fa350acc3937151)
![external image link](attachments/b95ed3c102ce468c91eb595eb69ad49c)
Posted on 05-19-2011 04:16 PM
I got a few off list requests to post the Extension Attribute...here it is...I stole the idea from an April post (thanks to Sean Gallagher!). I tweaked it a bit....
------------- begin -------------
#!/bin/sh
#
# Stolen from a Sean Gallagher script! :)
Devices=system_profiler SPHardwareDataType | grep -e "Model Identifier" | awk '{print $3}'
echo "<result>$Devices</result>"
-------------- end --------------
Posted on 05-19-2011 04:34 PM
slightly shorter:
system_profiler SPHardwareDataType | awk '/Model Identifier/ {print $NF}'
Posted on 05-19-2011 05:16 PM
Hi Nate,
This is awesome! Ya know, it's like the old school uphill bike racers used to say when discussing low gear ratios...the smaller the better! :)
Pardon me while I copy/paste into JSS...
Don
Posted on 05-19-2011 06:05 PM
easier still, install the latest version of facter and get the same fact like so:
facter sp_machine_model
my result: MacBookPro7,1
os x pkgs are here: https://sites.google.com/a/explanatorygap.net/puppet/
puppet depends on facter to generate "facts" about nodes, but you can use it as a standalone utility, too.
so you could simplify the extension attribute like this:
#!/bin/bash
echo "<result>$(/usr/bin/facter sp_machine_model)</result>"
run facter with no arguments to see all the stats it generates.
nice.
Posted on 05-19-2011 08:05 PM
Going for shorter... :)
On Thu, May 19, 2011 at 7:34 PM, Nate St. Germain <nate at techsuperpowers.com>wrote:
sysctl hw.model | awk '{print $2}'
- Justin
Posted on 05-19-2011 08:28 PM
Nice!!! Tested fine...i'll update JSS mañana. :)
Justin Rummel wrote:
Don