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