Reporting on iMac screen sizes

shrop
New Contributor

I have been trying to figure out a way to have Casper pull iMac monitor sizes. We have iMacs with various size screens and often need to query by sizes in reports. Do you know of a way to do this in an automated fashion or do we have to add that info manually in extended attributes?

JAMF has filed this as an issue They say that computer information should display something like this "iMac (21.5-inch, Mid 2010)", but it doesn't right now.

Has anyone dealt with this?

Thanks!
Mark

9 REPLIES 9

jarednichols
Honored Contributor

Sounds like it's time to build an extension attribute. You can probably pull out some info from system_profiler to find out the screen resolution. With some digging, you can find what screen size equals which resolution. My only question is, since I haven't tested it, is if system_profiler under the Displays reports the native resolution of the display or the *current* resolution of the display.

If it's the current resolution, this method wouldn't work.

Tad
New Contributor III

The utility system_profiler gets us part way there:

system_profiler SPDisplaysDataType | grep Resolution

Unfortunately, as Jared points out, this gets the current resolution and not the native resolution. (Depending on your users, these may or may not be the same)

shrop
New Contributor

Jared, thanks for that suggestion. I haven't tried it, but I agree.. native resolution would help.

A fix that I just tested for 2010 and future iMacs (as long as the model# identifier remains different between screen sizes) is detailed below. Thanks to Joel and JAMF for getting this worked out the with QA team. Wow.. fast support.. all within a day.

I did test this and it works.. see below:

I just talked with our QA department regarding this issue. It looks like there is a workaround that we can use to fix this. It requires us to edit one xml file and then we should have what you need. The first thing that we need to verify where your Web Application is located. 1. What we are looking for is a the computerModels.xml file in either /Library/JSS/Tomcat/webapp/ROOT/WEB-INF/xml/compterModels.xml or /Library/Tomcat/webapp/ROOT/WEB-INF/xml/compterModels.xml. After you found this xml file copy it to your desktop so you have a backup of it.

  1. Once we have located this file we can do a nano /Library/JSS/Tomcat/webapp/ROOT/WEB-INF/xml/compterModels.xml or /Library/Tomcat/webapp/ROOT/WEB-INF/xml/compterModels.xml

3.Next we will need to arrow down in that file and locate the iMac section. Here we will want to edit ONLY the display name. Here is an example of what i did, <display_name>iMac 21.5 inch Intel (Mid 2010). I just added in the 21.5 inch. You will just need to compare the model name from http://support.apple.com/kb/ht1758. Anything before 2010 is hard to put a size with as the same model identifier is used for both the 21.5 and 27 inch models.

  1. After you've made the change you will want to do a control O to save the changes, you will have to hit enter to give it the same name and then it should say a number of lines that were written.

  2. Lastly we will need to restart tomcat by running the following commands,
    sudo launchctl unload /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist
    sudo launchctl load /Library/LaunchDaemons/com.jamfsoftware.tomcat.plist

  3. After this is done you should be able to force an inventory report on one of your iMacs and it should return the information that you entered. I've attached a screen shot of what my is displaying now for the one type of iMac that i edited.

Please let me know if you have any questions regarding this information. Feel free to post this information on the JAMF Nation after you've verified that it works for you.

shrop
New Contributor

Thanks Tad and Jared! So.. we may use that for pre-2010 models. It may get us close as long as we know it isn't perfect.

jreazor
New Contributor

What about the Model Identifier? I could be wrong but I think the Mid-2010 21.5s are all iMac11,2 and the 27s are iMac11,3. Like wise, the Mid-2011 21.5s are iMac12,1 and the 27s are iMac12,2.

tlarkin
Honored Contributor

If you're feeling like using some Unix wizardry you could script something out that grabs the model number from system_profiler then parses data from here: http://support.apple.com/kb/HT1758 then uses curl (or wget) to grab the proper screen size and then rename the file

ktappe
New Contributor III

system_profiler SPDisplaysDataType is a tricky beast. It works on some models, but on others there is no "Resolution:" line output. I've not been able to determine a pattern.

It works on:
2008 iMac
2011 iMac
2010 MacBook Air

It does not work on:
2011 MacBook Pro
2005 iMac G5
2011 Mac Pro

Frustrating.

sean
Valued Contributor

The problem is login window; resolution, along with other stuff, will not be available at login window, but is when logged in.
If you really need it at the login screen, then you may be able to access the information with objective C, otherwise ensure your scripts requests the info when someone is logged into the machine.

BaddMann
Contributor

We are looking for login Resolution as well. Any chance we can add another node to computer_model. Something like <Login_Resolution></Login_Resolution>, I'm not sure how to access this xml outside of the directory Structure, but I could see the augmented info being useful. Just don't know how much it would blowup Casper.