The current inventory system was developed in 2008. It is derived from both the previous DCS and DAI systems. On the positive side, it introduced location discovery from switch reports. On the negative side, it failed to meet the prime requirement for redeveloping the previous system - keeping track of the growing number of self-managed machines. It is also overly complicated, inflexible and buggy.

Description of existing system

This diagram shows the individual parts of the current inventory system and the information flow between them.


The ordershost system dates back to the mid 1990s and was the main inventory system prior to the 2008 system. It holds the master copy of the orders - these are individual text files editable via "rfe orders/{order}". It also pulls inventory information (such as allocation, location, model) from the LCFG inventory profile using LCFG::Inventory. Both the orders data, and LCFG inventory information, are reloaded twice daily (using the nightly_reload script) into SQL tables. SQL is used primarily to make it easy to produce reports and allow queries against the orders/inventory data. The inventory information is pulled from LCFG because that is where the information used to be mastered. The ordershost web interface provides access to all tables, a number of derived views and a number of simple search queries.

The ordershost receives reports from each DICE machine twice daily. Each DICE machine runs /usr/sbin/clientreport which updates the SQL reports table with information such as model,sno,memory,monitor,monitor age,kernel version,mac addr. The reports table is pulled into Theon using "clientreporttoinfdb" - see the section on Theon.

The ordershost web interface provides access to all tables, a number of derived views and a number of simple search queries.

When an individual order file is edited, an associated XML file is updated. I believe the intention had been to replace the original plain text orders files with the XML files, but that has never happened. Post edit, xmltoinfdb is called to add or update the associated order entry in the Theon ing_order table. If Theon is unavailable at time of edit, the order will never be added to the Theon ing_order table.


  • dice-orders


po, description, sno, delivered, warranty, barcode, category, requestor, date, supplier, price, budget
hostname, make, model, sno, allocated, location, main, manager, owner, os, date, domain
hostname, make, model, sno, memory, kernel, rebootpending, date, monitor, monitorsno, monitoryear, mac, os


The LCFG server produces an inventory profile which contains inventory information such as hostname,model,sno,location, allocated,manager for each machine with an LCFG profile - including self-managed machines with LCFG profiles. The inventory profile is generated by the "inv" spanning map. The inv resources for each machine are derived from the associated sysinfo resource. The sysinfo resources for each machine are included into its LCFG profile via the /var/lcfg/conf/informatics_inventory/{host}/infdb_data.h header. These headers are generated on Theon and pulled down, using rmirror, from Theon.

The LCFG system is the master source of data for the mac address and OS (indirectly) of DICE machines.


  • none


The inventory in Theon consists of a number of related tables and some scripts to manipulate the data in those tables. These tables are related to other Theon tables such as space,?person?.

Information about orders is pushed into the ing_order table from the ordershost by the xmltoinfdb script when an individual order is created or edited. This script will create a record, in the item table, for each individual item in an order. If the item description matches a known description of a computer system (/var/rfedata/orders/systems) and the serial number is not empty, then a record in the system table will be created. A record in the part table will also be inserted, linking the item record to the system record.

The clientreporttoinfdb script is called twice a day to check the ordershost reports table for new, or modified, DICE machines. If the script find a report in the reports table from a DICE machine that does not already have a record in the system table, it will create such an entry along with an entry in the part and hostname tables. It will also change the model field in the item table to match what is reported, by the DICE machine, in the reports table : this means that for a batch of identical machines, you can have two different values for the model field. Note that this only happens for DICE machines - self-managed machines must be added to these tables manually using invedit. Note that if a DICE machine changes its OS version, a new hostname record will be created.

Information about machine location is loaded into the location table by the switchfoinfdb script. This script pulls down the MAChistory files from each sites' netmon web site and processes to give mac-addr and room location. For each mac-addr, if there is an associated entry in the system table with that mac address it updates the location of the item associated with that system (via the part table). Note that this means that location discovery is only possible for machines for which there is a valid mac address in a machine's entry in the system table - as this is typically only set by machines reporting to the ordershost using clientreport, location discovery is usually limited to DICE machines.

The invedit script is used by computing staff to record machine allocation, and create hostname to system mappings for self-managed machines.


  • switchtoinfdb
  • infdbtolcfg
  • dice-invtools
  • clientreporttoinfdb - can't find current source code (postgresql ported version)


ing_order, supplier, date, vat
item, ing_order, order_ref, department, type, category, description, maker, model, ing_grant, acq_date, dis_date, dis_method, serial, warranty, cost, funding
item, site, space, start_date, end_date
system, item, start_date, end_date
system, type, mac-addr, owner
system, hostname, start_date, end_date, manager, person(allocated), os

Derivation of data

serial number
orders / clientreport (DICE)
mac address
LCFG profile (DICE) / invedit (self-managed)
clientreport (DICE) / invedit (self-managed)
switches (where mac address known, mostly just DICE) / invedit
order / clientreport (DICE) / invedit
clientreport (DICE) / invedit

-- AlastairScobie - 15 Aug 2012

Topic revision: r5 - 10 Sep 2012 - 12:02:08 - AlastairScobie
DICE.InventoryImprovements146Description moved from DICE.InventoryImprovements146Review on 15 Aug 2012 - 15:33 by AlastairScobie - put it back
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies