Friday, May 4, 2012

Script to Query Dell Warranty Status

I'm sure there are more elegant ways of obtaining the warranty status for your Dell hardware, but none-the-less, here's a Ruby script I wrote that does just that :-)

Script: query_dell_st.rb

The script currently has two modes, single lookup and batch lookup.

Single lookup takes two arguments:
  • --host HOSTNANE
  • --svctag SERVICE_TAG
Bulk requires only a single argument pointing to an input file containing a single entry "HOSTNAME SERVICE_TAG" per line for each device.
  • --file FILE
Example single lookup:

$ ./query_dell_st.rb --svctag GT7D8P1 --host lin-srv01
Host: lin-srv01
 Model: PowerEdge R410
 Service Tag: GT7D8P1
 Warranty Exp: 617 days left


Over the next few days I'll add more features (CSV and tab delimited output, for example) as well as address bugs and error handling.

Hopefully the script is useful to others.