- Table "Users" added to schema
[public/netxms.git] / sql / schema.sql
CommitLineData
cbcaf8c8
VK
1--
2-- System configuration table
3--
4
49826a80 5CREATE TABLE Config
cbcaf8c8 6(
9e6c6d05
VK
7 name varchar(64) not null,
8 value varchar(255),
9 PRIMARY KEY(name)
cbcaf8c8
VK
10);
11
12
9b057805
VK
13--
14-- Users
15--
16
17CREATE TABLE Users
18(
19 id integer not null,
20 name varchar(64) not null,
21 password varchar(64),
22 PRIMARY KEY(id)
23);
24
25
49826a80
VK
26--
27-- Nodes to be added
28--
29
30CREATE TABLE NewNodes
31(
32 id integer not null,
33 ip_addr integer not null,
34 ip_netmask integer not null,
35 discovery_flags integer not null
36);
37
38
cbcaf8c8
VK
39--
40-- Nodes information
41--
42
49826a80 43CREATE TABLE Nodes
cbcaf8c8 44(
9e6c6d05 45 id integer not null,
cbcaf8c8
VK
46 name varchar(64),
47 status integer,
49826a80 48 is_deleted integer not null,
cbcaf8c8 49 primary_ip integer,
49826a80
VK
50 is_snmp integer,
51 is_agent integer,
52 is_bridge integer,
53 is_router integer,
83f01fdf 54 is_local_mgmt integer,
49826a80 55 snmp_version integer,
a713e82e 56 community varchar(32),
e5c63a9b 57 snmp_oid varchar(255),
49826a80 58 discovery_flags integer,
a713e82e
VK
59 auth_method integer,
60 secret varchar(64),
61 agent_port integer,
62 status_poll_type integer,
9e6c6d05
VK
63 PRIMARY KEY(id)
64);
65
66
cbcaf8c8
VK
67--
68-- Subnets
69--
70
49826a80 71CREATE TABLE Subnets
cbcaf8c8 72(
9e6c6d05 73 id integer not null,
cbcaf8c8
VK
74 name varchar(64),
75 status integer,
49826a80 76 is_deleted integer not null,
cbcaf8c8 77 ip_addr integer,
9e6c6d05
VK
78 ip_netmask integer,
79 PRIMARY KEY(id)
cbcaf8c8
VK
80);
81
82
83--
84-- Nodes' interfaces
85--
86
a713e82e 87CREATE TABLE Interfaces
cbcaf8c8 88(
9e6c6d05 89 id integer not null,
cbcaf8c8 90 name varchar(64),
49826a80
VK
91 status integer,
92 is_deleted integer,
93 node_id integer not null,
cbcaf8c8
VK
94 ip_addr integer,
95 ip_netmask integer,
49826a80
VK
96 if_type integer,
97 if_index integer,
98 PRIMARY KEY(id),
99 KEY(node_id)
cbcaf8c8
VK
100);
101
102
103--
104-- Nodes to subnets mapping
105--
106
a713e82e 107CREATE TABLE nsmap
cbcaf8c8 108(
49826a80
VK
109 subnet_id integer not null,
110 node_id integer not null,
25e01e36 111 KEY (subnet_id)
cbcaf8c8
VK
112);
113
114
115--
116-- Data collection items
117--
118
119create table ITEMS
120(
9e6c6d05 121 id integer not null,
cbcaf8c8
VK
122 node_id integer,
123 name varchar(255),
124 description varchar(255),
125 datatype integer,
126 polling_interval integer,
127 retention_time integer
128);
129
130
131--
132-- Collected data
133--
134
135create table IDATA
136(
137 item_id integer not null,
138 timestamp integer,
139 val_integer integer,
cbcaf8c8
VK
140 val_string varchar(255)
141);
142
143
144--
145-- Events configuration
146--
147
b36b6578 148CREATE TABLE Events
cbcaf8c8 149(
9e6c6d05 150 id integer not null,
cbcaf8c8 151 severity integer,
c1142e46 152 flags integer,
cbcaf8c8 153 message varchar(255), -- Message template
b36b6578
VK
154 description blob,
155 PRIMARY KEY(id)
cbcaf8c8
VK
156);
157
158
159--
160-- Event log
161--
162
c1142e46 163CREATE TABLE EventLog
cbcaf8c8
VK
164(
165 event_id integer,
166 timestamp integer,
c1142e46 167 source integer, -- Source object ID
cbcaf8c8 168 severity integer,
c1142e46
VK
169 message varchar(255),
170 KEY(event_id),
171 KEY(timestamp)
cbcaf8c8
VK
172);
173
174
175--
176-- Actions on events
177--
178
9e6c6d05 179CREATE TABLE ACTIONS
cbcaf8c8 180(
9e6c6d05 181 id integer not null,
cbcaf8c8 182 type integer,
9e6c6d05
VK
183 command varchar(255),
184 PRIMARY KEY(id)
cbcaf8c8 185);
cbcaf8c8 186