[Beaker-devel] Tool for Inventory gathering

Amit Saha asaha at redhat.com
Tue Jul 9 06:51:08 UTC 2013



----- Original Message -----
> From: "Amit Saha" <asaha at redhat.com>
> To: "Beaker development" <beaker-devel at lists.fedorahosted.org>
> Sent: Tuesday, July 9, 2013 3:32:53 PM
> Subject: Re: [Beaker-devel] Tool for Inventory gathering
> 
> 
> 
> ----- Original Message -----
> > From: "Amit Saha" <asaha at redhat.com>
> > To: "Beaker development" <beaker-devel at lists.fedorahosted.org>
> > Sent: Monday, July 8, 2013 4:53:59 PM
> > Subject: [Beaker-devel] Tool for Inventory gathering
> > 
> > Hi all,
> > 
> > I spent some time on Friday to see how the lshw based inventory task is
> > doing
> > by running on one of our test systems - both in terms of what it gets
> > and how does it compare to the existing smolt based task.
> > 
> > I didn't go far with the comparison. Why? Because, lshw's parsing script
> > broke due to the XML being different for the particular CPU I was running
> > on
> > and what the parsing script was expecting. I could fix it (like I have done
> > earlier) to accommodate for this formatting change..and do the same for
> > similar errors when I come across one.
> > 
> > But, here is what I am thinking:
> > 
> > Why don't we just get rid of the smolt and lshw tasks and instead query
> > directly from the /proc and /sys (procfs and sysfs)?
> > I have done some exploration in this area [1] and [2]. In [1], I am reading
> > directly off /proc and using Python's in built text
> > processing methods to get the information I want. Today I explored using
> > pyudev (Python interface to libudev for accessing the device
> > attributes from /sys) which you can see in [2].
> > 
> > From what I can see these are the information we usually look to get from
> > our
> > inventory task and how
> > we could get them using one/both of the approaches (/proc and/or /sys):
> > 
> > - CPU details (easily done by reading /proc/cpuinfo)

The 'lshw' based inventory task also uses /proc/cpuinfo in addition to it's own 
profiled information for the CPU details.

Currently the inventory gathered from 'lshw' is used for the CPU details, the
memory details and the device details. I think it's worth a shot to see if reading
from udev's database (via pyudev) can substitute the last purpose of lshw and hence
just be free from the external tools.

Suggestions and thoughts welcome.

Best,
-Amit.

-- 
Amit Saha <http://echorand.me>
Infrastructure Engineering and Development
Red Hat, Inc.


More information about the Beaker-devel mailing list