Warranty End Extension Attribute

stibebu
New Contributor II

This is in reference to the previous thread here, https://jamfnation.jamfsoftware.com/discussion.html?id=4270 . I believe this has been working fine, but currently none of my systems are showing warranty end dates. Is Apple's site just down temporarily? Tried putting the URL in manually using a good serial number and I get "We're sorry, our system is not available at this time.". I'm just hoping this is temporary.

On a related note, is there a good method of retaining historical information on extension attributes and other data? For example, if I had a weekly report that gave me all of this info, today I could go to a previous report to find the warranty end dates of all my systems...

Thanks!

1 ACCEPTED SOLUTION

rockpapergoat
Contributor III

apple changed the format and output from selfsolve.apple.com.

check this for a working implementation in python: https://github.com/pudquick/pyMacWarranty

or this in ruby: https://github.com/glarizza/scripts/blob/master/ruby/warranty.rb

my methods of parsing selfsolve output cached the results to /etc, so any future runs of the script used to populate the extension attribute didn't actually have to do a lookup unless something changed.

View solution in original post

8 REPLIES 8

rockpapergoat
Contributor III

apple changed the format and output from selfsolve.apple.com.

check this for a working implementation in python: https://github.com/pudquick/pyMacWarranty

or this in ruby: https://github.com/glarizza/scripts/blob/master/ruby/warranty.rb

my methods of parsing selfsolve output cached the results to /etc, so any future runs of the script used to populate the extension attribute didn't actually have to do a lookup unless something changed.

stibebu
New Contributor II

I was able to just add the <result></result> to your ruby script to get exactly what I needed. Thank you so much!

luisgiraldo
New Contributor II

jwelsh, would you mind sharing how you modified the ruby script? Not knowing Ruby, I've tried a couple of options but am getting an empty result.

Thanks!

clifhirtle
Contributor II

+1 on how to integrate to JSS extension attribute. Could just echo on shell/bash, but Ruby? Tried a few obvious options and no luck

result = get_warranty(serial)
  print "<result>$result</result>"

Nope.

philwillchen
New Contributor III

Simply put:

puts "<result>" + result + "</result>"

jhbush
Valued Contributor II
puts "<result>"+ (warranty_status ? "#{expiration_date}" : 'Expired') +"</result>"

returns <result>December 10, 2016</result>

Santosh
New Contributor III

is this script working for anybody ?I have added the script to the EA but unable to display the results.

can someone please advise

PatCMP
New Contributor III

That script is not working anymore since Apple added a Captcha on the checkwarranty site.. Currently there is no way to populate Warranty info without GSX it seems.