Versions Compared

Key

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

...

When a device is queried, most of it's specific information is stored in the 'system' table. If data from another table (an attribute table, say hard_drive) is required a join must be created.

With the release of 1.10, the below has changed (with the exception of the sys_hw_network_card_ip table). See the release notes for 1.10 here - Release Notes for Open-AudIT v1.10

There is now only a single join required an attribute table to the system table. As well, most tables have been renamed. Using the old example below, we would select items like this:

Code Block
languagesql
processor.system_id = system.system_id and processor.current = "y"

 

Open-AudIT stores its data using two main keys. sys_hw_processor.system_id = system.system_id is pretty obvious. The second key should use the timestamps. This way you will return current attribute rows. If you omit this you will receive all attribute rows, whether they're current or not. So sys_hw_processor.timestamp = system.timestamp. FYI - Using the timestamps you can easily find out what's not current by specifying sys_hw_processor.timestamp != system.timestamp.

So your attribute joins should look like this:

Code Block
languagesql
LEFT JOIN sys_hw_processor ON (sys_hw_processor.system_id = system.system_id AND sys_hw_processor.timestamp = system.timestamp)

...