check_dell_warranty version 1.1 released

Trond Hasle Amundsen t.h.amundsen at usit.uio.no
Tue Jun 9 11:50:22 CDT 2009


Erinn Looney-Triggs <erinn.looneytriggs at gmail.com> writes:

> Number one has now been implemented. give it a try and thanks for the
> idea. Number two will take a bit, but I want to go in that direction.

Erinn,

Sorry for the late reply. I gave it a try, and instantly encountered a
problem. This is from a plain M600 blade server:

  $ ./check_dell_warranty.py 
  Invalid serial number: 98CBS3J98CBS3J741BS3J exiting!

I see that you're using XML output from omreport. That could lead to
problems if you're not using some sort of XML parser, and you're
not. The problem is this snippet of code:

        pattern = '''<ServiceTag>(\S+)</ServiceTag>'''
        regex = re.compile(pattern, re.X)
        serial_number = "".join(regex.findall(text))

The re.findall() catches all three occurences of the pattern, which is
the blade's serialnumber two times, and one time the serial number of
the blade chassis. I have no idea why it does that, but XML output
generally has more info than the other modes.

What I do in my check_openmanage plugin is this (simplified):

  1. first run 'omreport -?' to determine if the command "mainsystem" is
     available. If so, this is a blade and I will use "mainsystem"
     instead of "chassis".

  2. run 'omreport chassis info' or 'omreport mainsystem info' based on
     the test in 1) and use the value that matches 'Chassis Service Tag'
     or 'Service Tag'.

BTW, I use '-fmt ssv' as options to omreport as this is easier to handle
than XML. Unless you would go for an XML parser, which in my opinion
would be overkill for one simple command like this :)

Cheers,
-- 
Trond Hasle Amundsen <t.h.amundsen at usit.uio.no>
Center for Information Technology Services, University of Oslo



More information about the Linux-PowerEdge mailing list