Changes between Version 44 and Version 45 of Internal/InventoryV3


Ignore:
Timestamp:
Apr 27, 2011, 6:35:53 PM (13 years ago)
Author:
ssugrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/InventoryV3

    v44 v45  
    55Versions:
    66
    7  * gather.rb:2.23
    8  * inventory-5.2.rb:...
     7 * gather.rb:2.30
     8 * inventoryNode.rb: (Written by Ivan, Live in the /root directory of the respective console).
    99
    1010It's plan is to be simpler and less ambitious than it's predecessor, but still respect the sql table structure ("as much as possible.")
     
    407407The update method in network has an error, it's comparing inventory ids, and incorrectly updating if those don't match. I'll need to drop them out of the set of things to compare. Had to modify the storage types in motherboard, to be bigints so I could store the converted numbers, and then pull them out the same way.
    408408
    409 === 1/25/20100 ===
     409=== 1/25/2011 ===
    410410
    411411The script is mostly done. I've added an update method to the USB class (a subclass of device). There were a few sanity check tweaks that had to be added (empty vendor string, disks with no size e.g. cdroms). That being said the omf-5.2 setup required a complete rewrite of the calling/executing script. The newst version is now named inventory-5.2.rb.
     
    419419
    420420In the inventory script I call gatherer.rb with a -d -l /tmp/gatherer.log so I can check the log if any thing goes wrong. Since We're using the def application facility, if the script throw any errors, the framework captures them and brings them back to console.
     421
     422=== 4/27/2011 ===
     423I've switched to git to do version tracking from Version 2.23 up:
     424There were a couple of tweaks to the way things work, I've catalogued them in git commit messages which are enumerated here:
     425{{{
     426c9afc57806b835f72ce7b99fc2190e2641034126 some documentation changes, and some addtional error output
     427d229e4ce5d1c31d432667f5cfc24a3ae4053e357 minor tweak for nil mb_sn entries, Since I can't get it some times, I just push a string with the HD serial duplicated
     4281182052c78f98b1c0eec4755f16bc31d166e780a cleaner implemention of the fqdn checks
     4298ca9e15bd53fad4e06b32ff1afb8f9d4ac00f3dd fixed the fqdn to try diffrent portions of the domain. This should be functional on inventory2 and 52 now
     430d9ef189f2919f987abb9cd55bbe258054bd09244 pushing in what ever I fixed, going to add fqdn support
     43160c9512abbfff8db6bd046523a26788a4e3df379 fixed a sql_query bug, where it should return an empty array if zero results were collected.
     4322eb417654e1da36a55beec7fe8ac8ddd74e74c06 Changed the way we identify network devies to use MBID and bus address instead of mac, this should be more forgiving to the pxe image
     4338cf565b6a34002a31a9cc1835e244ab3582e57ad made the script more tolerant of missing information so that it works on the pxe image, and a few bug fixes
     434dde0a2ce9cdf55888e691193bdbea4fc6a3cac07 Fixed tool tips, and corrected Motherboard.updates code, preforms less checks of @UUID
     4352a5d937cf0b46fe056fe0a3b8ac5e0e71968ed35 Fixed Motherboard.update because the sql matches were breaking
     436751f9c2794cbc9b87f712703ceb0d5062d366031 Fixed motherboard.update/get_mb_id to deal with missing UUID
     437984a36ce4b73c65d44e5454cb2023540ce4eb4fd modified the get_location_id to include console information
     438d587df7477f4f6e23d84c1a3a5d7f31ae462e974 Initial commit, version 2.23
     439}}}
     440
     441The core operation remains there same, however there were a few major revisions for functionality they are:
     442
     443 * changed the way sql_query returns to always return an array
     444 * when checking for loc_id, I split the fqdn into strings and then try each string
     445 * Instead of pushing an empty string in for MB_serial when I don't have it, I instead push a string that uses the Disk serial to make them distinct
     446 * if I can't find the motherbard serial, I use the Disk serial instead to get the motherboard Id
     447
     448Most of tweaks and adjustments were done to accommodate the new method of inventorying. Instead of imaging the nodes then running inventory as an experiment, we've moved the script to a initramfs image, and then boot into a pxe image and run the inventory from this memory initramfs. The snag is that this kernel/initramfs image doesn't load a full compliment of drivers so some of the information that would be gathered and populated, doesn't get collected (e.g. mother board serial number).  That was the bulk of moidifcations. We're currently live now and running the updates agains the working inventotry52 database (which is read by omf-5.2).
     449
     450The only tweak I had to do with the Tables was to modify the memory, cpu speed and disk size data types. I changed them to floats, it makes the internal representation a little cleaner. Thus I had to add a convert to float string function in the data handler portion, It's part of the Component class.
     451
     452Note: The current inventory command assumes that you want to do all nodes, you can invoke it with a flag to change the node set. It's syntax is not intuitive.
     453{{{
     454All nodes:
     455root@console:/root# omf-5.2 exec inventoryNode.rb
     456
     457Nodes [3,1..12]:
     458omf-5.2 exec inventoryNode.rb -- --nodes [3,1..12]
     459NOTE THE LACK OF AN = sign
     460}}}
     461
     462I may branch off a threaded version to make it a little faster but that might right into blocking issues with concurrent runs of lshw. Also on the Horizon is the idea of using a full Diskless ubuntu server pxe image to house the inventory process. This should resolve some of the missing info/driver issues.
     463