--- projects/cms/source/server/db/empty.sql 2000/11/28 10:10:07 1.1 +++ projects/cms/source/server/db/empty.sql 2001/03/01 19:24:27 1.6 @@ -1,74 +1,32 @@ # # This is the full definition of our (initially empty) -# SQL database for i-scream logging. +# SQL database for i-scream logging. This reflects the +# changes made after our original design proved to be +# too large after a short amount of time. Now, the +# original XML strings are stored in the database, keyed +# only by a few essential fields. # - - +# $Author: pjm2 $ +# $Id: empty.sql,v 1.6 2001/03/01 19:24:27 pjm2 Exp $ # -# Please note that as most records logged are stored -# over more than one table, it will be ESSENTIAL to -# place a write lock on all affected tables, removing -# it when done. -# - - # Host: localhost Database : co600_10_db - - -# -------------------------------------------------------- # -# Table structure for table 'cpu' # - -CREATE TABLE cpu ( - id bigint(20) DEFAULT '0' NOT NULL, - cpu_no tinyint(4) DEFAULT '0' NOT NULL, - cpu_load float(10,2) DEFAULT '0.00' NOT NULL, - KEY id (id), - KEY id_2 (id), - KEY id_3 (id) -); - - - -# -------------------------------------------------------- +# Table structure for table 'ipacket' # -# Table structure for table 'disk' -# -CREATE TABLE disk ( - id bigint(20) DEFAULT '0' NOT NULL, - p tinyint(4) DEFAULT '0' NOT NULL, - disk_free bigint(20) DEFAULT '0' NOT NULL, - disk_total bigint(20) DEFAULT '0' NOT NULL, - KEY id (id) -); +# Drop the table if it already exists. +DROP TABLE IF EXISTS ipacket; - -# -------------------------------------------------------- -# -# Table structure for table 'packet' -# - -CREATE TABLE packet ( +# Create the table. +CREATE TABLE ipacket ( id bigint(20) DEFAULT '0' NOT NULL auto_increment, ip varchar(15) NOT NULL, - seq_no bigint(20) DEFAULT '0' NOT NULL, - date bigint(20) DEFAULT '0' NOT NULL, - machine_name varchar(31) NOT NULL, - mac_address varchar(31), - os_name varchar(63), - os_version varchar(31), - load1 float(10,2), - load2 float(10,2), - load3 float(10,2), - mem_free bigint(20), - mem_total bigint(20), - swap_free bigint(20), - swap_total bigint(20), - users varchar(255), - full_xml text, + machine_name varchar(32) NOT NULL, + sent_date bigint(20) DEFAULT '0' NOT NULL, + receipt_date bigint(20) DEFAULT '0' NOT NULL, + xml mediumtext NOT NULL, PRIMARY KEY (id), KEY id (id), UNIQUE id_2 (id)