Unsolved

This post is more than 5 years old

1 Message

35713

February 10th, 2012 12:00

Warranty Check on Linux via script

We've been using the NAGIOS plugin 'check_dell_warranty.py' to save off warranty information during our system builds.

However, we've found that recent changes to the underlying site that the script uses makes the script unreliable, and we've had to look for alternatives.

We found an alternate method  which uses a SOAP client to grab the data. Since we're not great PERL fans here, we converted it into a Ruby script, a basic version is posted here for your leverage. Hopefully it will save someone some time!

---------------------------

#!/bin/ruby

WSDL_URL    = 'http://xserv.dell.com/services/assetservice.asmx?WSDL'


GUID = '11111111-1111-1111-1111-111111111111'
App  = 'Test'
ST   = 'YOUR SERVICE TAG'

require 'soap/wsdlDriver'

driver    = SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
result = driver.GetAssetInformation(:guid => GUID, :applicationName => App, :serviceTags => ST)

puts '------------------'
result.getAssetInformationResult.asset.entitlements.entitlementData.each do | entitlement |
    puts entitlement.entitlementType
    puts entitlement.serviceLevelDescription
    puts entitlement.provider
    puts entitlement.serviceLevelCode
    puts entitlement.startDate
    puts entitlement.endDate
    puts entitlement.daysLeft
    puts '------------------'
end



1 Message

April 24th, 2012 18:00

Thank you; works great.

8 Posts

June 29th, 2012 01:00

Thanks for this simple example.  Not having Ruby installed on my machine, I took your approach and converted this to a Bash shell script using curl.  It's actually not as sophisticated (all I wanted was the warranty expiration date) but it needs few dependencies (just curl and awk), doesn't have to download and parse the WSDL for every request, and can be easily changed if other information is desired from the server response.  The script is available at gist.github.com/3015619 - hopefully this will also save someone some time!

0 events found

No Events found!

Top