Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

How do we process and store data?

NOTE - Updated for 1.12.8 with new fields and logic.

Each system (computer, network device, printer, et al) has an entry in the "system" table. Each system (from the "system" table) has a an "system_id" column. This value is unique - it's an auto incrementing id. A system is determined to be unique by a the table below.

A system is audited and the result submitted to the server. The first table processed is the "system" table. The "system_id" is determined and passed (along with the other details) to each other section (table). Every table has two timestamp columns, "first_timestampseen" and "timestamplast_seen". The "first_timestampseen" value is populated whenever an insert occurs - hence this value reflects the first time an item was reported in the audit script. The "timestamplast_seen" value is inserted when an item is first seen, or updated when an item is seen in subsequent audit script(s). There is a an "oa_audit_log" table that contains details of each time an audit is submitted (including timestamp). Each sub-table also contains a 'current' column which is an enum with possible values of 'y' and 'n'.

So, for an example - "hard_drive".

  • The " system_.id " is retrieved, along with the timestamp of the previous audit submission and the "status" column.
  • For each entry in the hard_drive audit result, the database is queried.
  • It checks for hard drive model, serial, index and size.
  • These values vary according to the item being processed - see the relevant model PHP pages (in code_igniter/application/models/).
  • If it gets a match on the above values, combined with the system_id, the current timestamp OR the previous timestamp, and a status of "production", then an existing entry exists for this piece of equipment.
  • In the case of hard drives, it simply updates the timestamp to reflect the current audit timestamp.
  • If it does not get a match, it does an insert of the relevant details.

...