9

Anyone know of a way to get a bunch of information for a list of service tags, does Dell have a section on their site for this? I would also be open to any Perl / Python libraries or *nix shell scripts.

Right now I mostly want some sort of date for each tag.

3
  • What, exactly, do you mean when you ask to "get a bunch of information" from Dell?
    – eleven81
    Sep 22, 2009 at 16:05
  • Warranty end date would be something I'd look for. Ship date would also be nice. Sep 22, 2009 at 16:49
  • A quick search gave me lots of people who want to query machines for service tags, but very little about people querying the Dell web site. Spiceworks links the service tag to a driver download page which takes the service tag as an URL argument. Navigating from that page to the "System Configuration" page, in turn, uses that service tag supplied by Spiceworks (though it's no longer in the URL at that point). It looks like you're not just going to find an URL that you can pass the service tag in that will return some HTML you can screen-scrape. A pity, too. That would be handy. Sep 22, 2009 at 16:52

11 Answers 11

19

Download the following URL (replacing SVCTAG at the end with the actual service tag) for each tag:

http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&l=en&s=gen&ServiceTag=SVCTAG

Parsing the resulting page for the info you're interested in is left as an exercise for the reader :-)

2
  • 2
    the page format recently changed and it's now more difficult to parse. There seems to be an api available at xserv.dell.com/services/assetservice.asmx?WSDL. Quick script to query it: gist.github.com/1893036
    – Daniel
    Feb 23, 2012 at 21:22
  • @Daniel this web service & example script is the best solution IMO, and probably not well known. You should repost it as a proper answer, I'll +1 it!
    – Patrick
    Mar 29, 2013 at 23:14
3

Add your system in the dell support site, in the section "my Systems". You can handle up to 100 systems.

You have to have an account to Dell site of course.

Unfortunately I don't know about a batch system to do the job, even if you can of course use curl, snoopy or whatever you are familiar with in order to automatically do the login, retrieve the list and parse the results.

3

I know this is an old post, but I've spent a decent number of hours on this and thought I'd help anyone else that ran into this. Dell's new site is all javascript and I couldn't figure out how to code against it to query service tag data. After sometime I thought of using their mobile site instead (mobile = no javascript) and that worked for me using perl/LWP to pull data down on each service tag. I'm a perl hacker, so someone else may be able to write this a little more cleanly. The below pulls the original system config. The idea is that the first URL 'get' pulls a cookie with the service tag and the second URL get pulls the data you want about the service tag. You can then parse the "$answer" of the second get for the data you are looking for.

#!/usr/bin/perl

use strict;
use LWP::Simple;
use LWP::UserAgent;

my $inputfile  = $ARGV[0];

my ($url,$response,$answer);

open (DATA, $inputfile) or die "Can't open $inputfile \n";
foreach my $serviceTag (<DATA>)
{
   chomp $serviceTag;
   print "\n$serviceTag";

   ##### Allow Cookies
   my $browser = LWP::UserAgent->new;
   $browser->cookie_jar({});
   $browser->cookie_jar( HTTP::Cookies->new(
      'file' => 'cookies.lwp',  # where to read/write cookies
      'autosave' => 0           # do not save it to disk when done
   ));

   # declare agent as mozilla, not perl LWP
   $browser->agent("Mozilla/8.0");

   my $urlPartA = "http://m.dell.com/mt/www.dell.com/support/troubleshooting/us/en/19/Servicetag/";
   my $urlPartB = "?s=BIZ&un_jtt_redirect";
   my $firstURL = join('', $urlPartA,$serviceTag,$urlPartB);
   #print "\nURL = $firstURL";


   $url = URI->new("$firstURL");
   $response = $browser->get( $url );
   $answer = $response->content;
   #print "\nAnswer:\n$answer\n\n";

   $url = URI->new('http://m.dell.com/mt/www.dell.com/support/troubleshooting/us/en/555/TroubleShooting?name=TroubleShooting_SystemConfigurationTab');
   $response = $browser->get( $url );
   $answer = $response->content;
   #print "\nAnswer:\n$answer\n\n";
}
2

Service Tag is generally analogous with serial number.

The WMI Win32_BaseBoard.SerialNumber class contains this information. Google "wmi serial number" and you'll find several example solutions for getting this data. We use a script at build time to name the box using serial number and other prepended characters as our workstation hostnames, which makes troubleshooting much easier with large numbers of clients.

2
  • 2
    I think Kyle already has the service tags. He wants to query Dell's web site to get information about the service tags-- warranty end dates, shipping dates, etc. Sep 22, 2009 at 16:50
  • Duh, I'm an idiot! Sep 23, 2009 at 12:26
2

Dell now have an option to save your service tags. You need to create a login with them and that is all. It also shows which servers warranties are expiring and you can export from it.

1
#!/usr/bin/python

# dell_warranty.py v0.1
# Written by Frode Egeland <egeland[at]gmail.com> - Copyright 2009
# Released under the terms of the GNU GPL v3 - see http://www.gnu.org/licenses/gpl-3.0.html
#
# Version History
# 0.1 - 2009-10-12 - Frode Egeland - Initial version. Tested with a simple csv list of service tags only.
# 

import urllib2, csv, re
from BeautifulSoup import BeautifulSoup

url="http://support.dell.com/support/topics/global.aspx/support/my_systems_info/details?c=us&l=en&s=gen&ServiceTag=%s"

stlist = []

# generate a list of servicetags from a csv
csvfile = csv.reader(open('taglist.csv'))

for line in csvfile:
 for entry in line:
  stlist.append(entry)

fixdate = re.compile("(\d{1,2})\/(\d{1,2})\/(\d{4})")

print "Service Tag, Warranty Type, Provider, Start Date, End Date, Days Remaining"

for currtag in stlist:
 page = urllib2.urlopen(url % (currtag,))

 for line in page.readlines():
  if "Parts only Warranty" in line:
   soup = BeautifulSoup(line)
   break
 table = soup.find('table',{'class':"contract_table"})
 rows = table.findAll('tr')
 rows = rows[1:]
 for row in rows:
  output = "%s" % (currtag,)
  cells = row.findAll('td')
  for cell in cells:
   if cell.a: # link / formatted text
    txt = cell.a.string
   elif cell.b: # bold text
    txt = cell.b.string
   elif cell.i: # italic
    txt = cell.i.string
   else: #normal text
    txt = cell.string
   match = fixdate.search(txt)
   if match:
    txt = "%d-%d-%d" % (int(match.group(3)),int(match.group(1)),int(match.group(2)))
   output = "%s,%s" % (output,txt)
  output = output.strip()
  print output
1

I know this is quite an old thread (I only found it because it was linked from a newer one) , but maybe you can use this nagios plugin: nagios exchange

python check_dell_warranty.py
OK: Service Tag: tag Warranty: Next Business Day, Provider: DELL, Start: 2010-02-24, End: 2013-02-25, Days left: 860 Warranty: NBD ProSupport For IT On-Site, Provider: DELL, Start: 2010-02-24, End: 2013-02-25, Days left: 860

The script queries standard localhost, trying dmidecode. You can also run it against a remote host using SNMP or you could run it from NRPE. Quite handy.

0

Very old thread, but since it tops my Google search results: The official way I found https://techdirect.dell.com/portal/AboutAPIs.aspx is too complex for now. I pimped my spreadsheet with this formula =HYPERLINK(CONCATENATE("https://www.dell.com/support/search/en-us#q=",[@[Service Tag or Serial Number]],"&sort=relevancy&f:langFacet=[en]"),"Lkp") which helps a little.

-1
dmidecode -s system-serial-number

will return the service tag

you can use ssh to remotely run it on all your systems in a batch. assuming they are all running Linux of course

5
  • 2
    I think you're misunderstanding. Kyle already has the service tags. He wants to query Dell's web site to get information about the service tags. Sep 22, 2009 at 16:48
  • Evan is right about what I am after ... Sep 22, 2009 at 17:08
  • oh, I stand corrected then :)
    – dyasny
    Sep 22, 2009 at 19:55
  • I get 'dmidecode' is not recognized as an internal or external command, operable program or batch file. on my dell laptop. May 11, 2015 at 17:17
  • then you need to install dmidecode
    – dyasny
    May 11, 2015 at 19:32
-1

I have an auto-it script that create a csv file from a list of service tag by polling the Dell support website.

You could follow the same logic to extract other information and put them into csv format

http://fei-automation.blogspot.hk/2014/09/how-to-check-model-for-list-of-dell-pc.html

-1

Note: This is edited repost of this answer

Dell have changed their website recently.

I have updated the above Perl script to allow for this change.

I was only interested in dumping the shipping dates of each machine to a text file so only parsed that out but I am sure the code can be easily modified to grab whatever data you want.

===

#!/usr/bin/perl

use strict;
use LWP::Simple;
use LWP::UserAgent;
use Mojo::DOM;

my $inputfile  = $ARGV[0];

my ($url,$response,$html);
my $outputfile = "result.txt";
open (DATA, $inputfile) or die "Can't open $inputfile \n";
open OUTPUT, ">>".$outputfile or die "Could not open '$outputfile'\n";
foreach my $serviceTag (<DATA>)
{
   chomp $serviceTag;
   print "\n$serviceTag\n";
   print OUTPUT $serviceTag."\t";
   ##### Allow Cookies
   my $browser = LWP::UserAgent->new;
   $browser->cookie_jar({});
   $browser->cookie_jar( HTTP::Cookies->new(
      'file' => 'cookies.lwp',  # where to read/write cookies
      'autosave' => 0           # do not save it to disk when done
   ));

   # declare agent as mozilla, not perl LWP
   $browser->agent("Mozilla/8.0");
    #    
   my $urlPartA = "http://www.dell.com/support/home/us/en/19/product-support/servicetag/";
    #   configuration
   my $urlPartB = "/configuration";
   my $firstURL = join('', $urlPartA,$serviceTag,$urlPartB);
   #print "\nURL = $firstURL";

   $url = URI->new("$firstURL");
   $response = $browser->get( $url );
   $html = $response->content;
   #print "\nAnswer:\n$html\n\n";

   my @values;
   my $dom = Mojo::DOM->new;
   $dom->parse($html);
   my $skip;
   for my $dd ($dom->find('div.col-lg-4.col-md-4.col-sm-3.col-xs-6')->each) {
    push(@values, $dd->text) if $skip++;
    #print $dd->text, "\n" if $skip++;
   }
    print $values[1]."\n";
    if ( $values[1] =~ m/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/ )

    {   # format date better for Excel
        #print OUTPUT $values[1]."\n";
        print OUTPUT "$3-$1-$2\n";
    }

    print $values[1]."\n";
    print "$3-$1-$2\n";
}


close OUTPUT or die $!;
1
  • 2
    Should be an edit to the original answer. Jan 16, 2015 at 13:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .