1 |
|
|
2 |
|
# |
3 |
|
# This is the full definition of our (initially empty) |
4 |
< |
# SQL database for i-scream logging. |
4 |
> |
# SQL database for i-scream logging. This includes |
5 |
> |
# test tables which (unsuprisingly) are for testing! |
6 |
|
# |
7 |
+ |
# $Author$ |
8 |
+ |
# $Id$ |
9 |
|
|
7 |
– |
|
10 |
|
# |
11 |
< |
# Please note that as most records logged are stored |
12 |
< |
# over more than one table, it will be ESSENTIAL to |
11 |
< |
# place a write lock on all affected tables, removing |
12 |
< |
# it when done. |
11 |
> |
# This reflects our revised design for the structure |
12 |
> |
# of the database. |
13 |
|
# |
14 |
|
|
15 |
– |
|
15 |
|
# Host: localhost Database : co600_10_db |
16 |
|
|
18 |
– |
|
17 |
|
# -------------------------------------------------------- |
18 |
|
# |
19 |
< |
# Table structure for table 'cpu' |
19 |
> |
# Table structure for table 'packet' |
20 |
|
# |
21 |
|
|
22 |
< |
CREATE TABLE cpu ( |
23 |
< |
id bigint(20) DEFAULT '0' NOT NULL, |
24 |
< |
cpu_no tinyint(4) DEFAULT '0' NOT NULL, |
25 |
< |
cpu_load float(10,2) DEFAULT '0.00' NOT NULL, |
22 |
> |
CREATE TABLE packet ( |
23 |
> |
id bigint(20) DEFAULT '0' NOT NULL auto_increment, |
24 |
> |
ip varchar(15) NOT NULL, |
25 |
> |
machine_name varchar(31) NOT NULL, |
26 |
> |
seq_no bigint(20) DEFAULT '0' NOT NULL, |
27 |
> |
sent_date bigint(20) DEFAULT '0' NOT NULL, |
28 |
> |
receipt_date bigint(20) DEFAULT '0' NOT NULL, |
29 |
> |
PRIMARY KEY (id), |
30 |
|
KEY id (id), |
31 |
< |
KEY id_2 (id), |
30 |
< |
KEY id_3 (id) |
31 |
> |
UNIQUE id_2 (id) |
32 |
|
); |
33 |
|
|
34 |
|
|
35 |
+ |
# -------------------------------------------------------- |
36 |
+ |
# |
37 |
+ |
# Table structure for table 'packet_test' |
38 |
+ |
# |
39 |
|
|
40 |
+ |
CREATE TABLE packet_test ( |
41 |
+ |
id bigint(20) DEFAULT '0' NOT NULL auto_increment, |
42 |
+ |
ip varchar(15) NOT NULL, |
43 |
+ |
machine_name varchar(31) NOT NULL, |
44 |
+ |
seq_no bigint(20) DEFAULT '0' NOT NULL, |
45 |
+ |
sent_date bigint(20) DEFAULT '0' NOT NULL, |
46 |
+ |
receipt_date bigint(20) DEFAULT '0' NOT NULL, |
47 |
+ |
PRIMARY KEY (id), |
48 |
+ |
KEY id (id), |
49 |
+ |
UNIQUE id_2 (id) |
50 |
+ |
); |
51 |
+ |
|
52 |
+ |
|
53 |
|
# -------------------------------------------------------- |
54 |
|
# |
55 |
< |
# Table structure for table 'disk' |
55 |
> |
# Table structure for table 'parameter' |
56 |
|
# |
57 |
|
|
58 |
< |
CREATE TABLE disk ( |
59 |
< |
id bigint(20) DEFAULT '0' NOT NULL, |
60 |
< |
p tinyint(4) DEFAULT '0' NOT NULL, |
61 |
< |
disk_free bigint(20) DEFAULT '0' NOT NULL, |
62 |
< |
disk_total bigint(20) DEFAULT '0' NOT NULL, |
63 |
< |
KEY id (id) |
58 |
> |
CREATE TABLE parameter ( |
59 |
> |
id bigint(20) DEFAULT '0' NOT NULL auto_increment, |
60 |
> |
packet_id bigint(20) DEFAULT '0' NOT NULL, |
61 |
> |
name varchar(63) NOT NULL, |
62 |
> |
value varchar(63) NOT NULL, |
63 |
> |
PRIMARY KEY (id), |
64 |
> |
KEY id (id), |
65 |
> |
UNIQUE id_2 (id) |
66 |
|
); |
67 |
|
|
68 |
|
|
69 |
|
# -------------------------------------------------------- |
70 |
|
# |
71 |
< |
# Table structure for table 'packet' |
71 |
> |
# Table structure for table 'parameter_test' |
72 |
|
# |
73 |
|
|
74 |
< |
CREATE TABLE packet ( |
74 |
> |
CREATE TABLE parameter_test ( |
75 |
|
id bigint(20) DEFAULT '0' NOT NULL auto_increment, |
76 |
< |
ip varchar(15) NOT NULL, |
77 |
< |
seq_no bigint(20) DEFAULT '0' NOT NULL, |
78 |
< |
date bigint(20) DEFAULT '0' NOT NULL, |
59 |
< |
machine_name varchar(31) NOT NULL, |
60 |
< |
mac_address varchar(31), |
61 |
< |
os_name varchar(63), |
62 |
< |
os_version varchar(31), |
63 |
< |
load1 float(10,2), |
64 |
< |
load2 float(10,2), |
65 |
< |
load3 float(10,2), |
66 |
< |
mem_free bigint(20), |
67 |
< |
mem_total bigint(20), |
68 |
< |
swap_free bigint(20), |
69 |
< |
swap_total bigint(20), |
70 |
< |
users varchar(255), |
71 |
< |
full_xml text, |
76 |
> |
packet_id bigint(20) DEFAULT '0' NOT NULL, |
77 |
> |
name varchar(63) NOT NULL, |
78 |
> |
value varchar(63) NOT NULL, |
79 |
|
PRIMARY KEY (id), |
80 |
|
KEY id (id), |
81 |
|
UNIQUE id_2 (id) |
82 |
|
); |
83 |
+ |
|
84 |
+ |
# end! |