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)
- Memory details (easily done by reading /proc/memenfo)
- Disk details (we could continue using libparted - we will need to deal with the shared
library version choices that we currently have).
The total size is easily gettable from /sys/block, but I don't see a way to get the
geometry details.
- Devices (Gettable from /sys/devices)
What do you all think?
Here are the links:
[1]
http://amitsaha.github.io/site/notes/articles/python_linux/article.html
[2]
http://nbviewer.ipython.org/5946601
Best, Amit.
--
Amit Saha <
http://echorand.me>
Infrastructure Engineering and Development
Red Hat, Inc.