Changes between Version 20 and Version 21 of Internal/InventoryV3


Ignore:
Timestamp:
Nov 24, 2009, 4:37:13 AM (15 years ago)
Author:
ssugrim
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/InventoryV3

    v20 v21  
    11James is working on a second generation inventory script.
    22
    3 Currently on: reorganising code
     3Currently on: integrate lshw fully, verify data, tweak writer
    44
    55Versions:
    66
    7 Gather:0.87
    8 Writer:0.9
     7* Gather:0.87
     8* Writer:0.97
    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.")
     
    1414 1. executer: runs either wget or apt-get install and copies the latest version of the other parts of the scripts then
    1515    executes them
    16  1. gatherer: collects information using only  operating system based facilities (dmesg, lsusb, lspci, ifconfig, /sys). 
     16    '''DEPRECIATED''' - In lieu of image updates.
     17 1. gatherer: collects information using only  operating system based facilities (dmesg, lsusb, lspci, ifconfig, /sys, lshw). 
    1718 1. Writer: checks the mysql repository for changes from the current state. If different changes them.
    1819
    19 '''NOTE''' Gatherer and Writer are being merged into a single file which I will call inventory2_client.rb
    2020
    2121The sql structure is a bit of a bit mess, the major tables of interest are:
     
    2323 1. devices - List of deviced "connected" to mother boards
    2424 1. device_kinds - type identifier for connected devices (an attribute of a device).
    25  1. locations - Converts x,y coordinates to a single integer that maps directly to a mother board.
     25 1. locations - Converts x,y,testbed_id coordinates to a single integer
     26 1. nodes - maps motherboard to locations, also has an id for said mapping
    2627 1. inventories - records the start and stop time of the inventory pass.
    2728 1. testbeds - gives a testbed id for the specific domain, thus disambiguating node1-1
     
    2930A lot of the tables are full of unused colums. I guess we'll just ignore them for now.
    3031The basic crux of an update should be the following:
    31  1. examine our IP to determine our current location
     32 1. examine our IP (and hostname) to determine our current location
    3233 1. We gather information about the mother board:
    3334 1. '''Gatherer:'''
     
    3536  1. Memory Size (dmesg)
    3637  1. Cpu number (dmesg)
     38  1. motherboard serial number (lshw)
    3739  1. Gather information about attached devices:
    3840   1. 2 wired Ethernet addresses (ifconfig, /sys)
    3941   1. 2 wireless Ethernet addresses (ifconfig, /sys)
    4042   1. any usb devices (lsusb, /sys)
     43 1. export to xml
     44
    4145 1. '''Writer:'''
    42   1. get the mother board id from the location table
    43   1. update mother board information if diffrent, and stamp with current inventory number
     46  1. import xml output from gatherer
     47  1. collect identifiers from mysql based on gathered infromation (domain => testbed_id ;x,y,testbed_id => loc_id;
     48     mb_ser => mb_id ; loc_id => node_id ; )
     49  1. update mother board information if different, and stamp with current inventory number
    4450  1. add kinds if they don't exist already
    4551  1. update devices if diffrent and stamp with inventory number
     52  1. update node mb_id if loc, mb pair don't match
    4653 1. profit.
    4754
     
    245252   pretty close to this, but needs a little work.
    246253
     254=== 11/23/09 ===
     255
     256The previous was completed. There was a two bugs that needed tweaking
     257 * Update node did not update the inventory when it updated a node info.
     258 * Had to add a hack to prevent unknown dev_ids from getting double entered in update_adds when the id is unknown. If the device has
     259   multiple instances of a pice of unknown hardware (like 2 new Ethernet cards), the current routine will double add them.
     260  * this hack should be re-visited for efficiency, currently it double checks for a kind (in case one was added after the adds_array
     261    was populated). This is very wasteful as the missing kinds should be a rare event. I should probably switch to a different function
     262    or something if I've entered the rare "never seen it before" scenario.