DB Schema - component tables

Open-AudIT links device components of a device to the "system" table. The system table contains the main pieces of information for every device. If a device is in Open-AudIT, it has an entry in the system table.

Every component table contains six standard columns. These are explained on the page for Changes.

Each component table is joined to the system table by component.system_id = system.id and uses "on delete cascade". Hence if you delete the entry in the system table for a device, the joined component tables will also have the data for this device deleted.


Name
Type
Default
Max Length
Valid Values
idint
10
system_idint
10
currentenumy
('y', 'n')
last_seendatetime2000-01-01 00:00:00

first_seendatetime2000-01-01 00:00:00

namevarchar
200

Other attributes are also stored, depending on the component in question (size, etc).

The following are the tables for the relevant attributes - attachment, bios, disk, dns, file, ip, log, memory, module, monitor, motherboard, netstat, network, nmap, optical, pagefile, partition, print_queue, processor, route, san, scsi, server, server_item, service, share, software, software_key, sound, task, user, user_group, variable, video, vm, windows.

The schema for these tables can be view in the application if you have the admin role. Go to menu -> Admin -> Database -> List Tables and then click the View button for any table.

Below is the table for partition (a typical example).

CREATE TABLE `partition` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `system_id` int(10) unsigned DEFAULT NULL,
  `current` enum('y','n') NOT NULL DEFAULT 'y',
  `first_seen` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
  `last_seen` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
  `name` varchar(200) NOT NULL DEFAULT '',
  `serial` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `device` varchar(100) NOT NULL DEFAULT '',
  `hard_drive_index` varchar(100) NOT NULL DEFAULT '',
  `partition_disk_index` varchar(50) NOT NULL DEFAULT '',
  `mount_type` enum('mount point','partition','other') NOT NULL DEFAULT 'partition',
  `mount_point` varchar(100) NOT NULL DEFAULT '',
  `size` int(10) unsigned NOT NULL DEFAULT '1',
  `free` int(10) unsigned NOT NULL DEFAULT '1',
  `used` int(10) unsigned NOT NULL DEFAULT '1',
  `format` varchar(20) NOT NULL DEFAULT '',
  `bootable` varchar(10) NOT NULL DEFAULT '',
  `type` varchar(100) NOT NULL DEFAULT 'local',
  PRIMARY KEY (`id`),
  KEY `system_id` (`system_id`),
  CONSTRAINT `partition_system_id` FOREIGN KEY (`system_id`) REFERENCES `system` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;