~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002101903

« back to all changes in this revision

Viewing changes to src/libs/zbxdbhigh/dbschema.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2009-04-05 19:10:27 UTC
  • mfrom: (1.1.9 upstream) (8.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090405191027-lxd44l6jqdcfp2bi
Tags: 1:1.6.4-1
* New upstream release.
* Fix zabbix-frontend-php.template, add missing questions for
  zabbix-server and port (Closes: #522076)
* Loosen up depends for libgnutls (Closes: #522074)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
ZBX_TABLE       tables[]={
24
24
        {"slideshows",  "slideshowid",  ZBX_SYNC,
25
25
                {
26
 
                {"slideshowid", ZBX_TYPE_ID,    ZBX_NOTNULL},
27
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
28
 
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
26
                {"slideshowid", ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
27
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
28
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
29
29
                {0}
30
30
                }
31
31
        },
32
32
        {"slides",      "slideid",      ZBX_SYNC,
33
33
                {
34
 
                {"slideid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
35
 
                {"slideshowid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
36
 
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
37
 
                {"step",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
38
 
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
34
                {"slideid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
35
                {"slideshowid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "slideshows"},
 
36
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "screens"},
 
37
                {"step",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
38
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
39
39
                {0}
40
40
                }
41
41
        },
42
42
        {"drules",      "druleid",      ZBX_SYNC,
43
43
                {
44
 
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
45
 
                {"proxy_hostid",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
46
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
47
 
                {"iprange",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
48
 
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
49
 
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
50
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
 
44
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
45
                {"proxy_hostid",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
 
46
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
47
                {"iprange",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
48
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
49
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
50
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
51
51
                {0}
52
52
                }
53
53
        },
54
54
        {"dchecks",     "dcheckid",     ZBX_SYNC,
55
55
                {
56
 
                {"dcheckid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
57
 
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
58
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
59
 
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
60
 
                {"snmp_community",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
61
 
                {"ports",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
 
56
                {"dcheckid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
57
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     "drules"},
 
58
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
59
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
60
                {"snmp_community",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
61
                {"ports",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
62
62
                {0}
63
63
                }
64
64
        },
65
65
        {"dhosts",      "dhostid",      ZBX_SYNC,
66
66
                {
67
 
                {"dhostid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
68
 
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
69
 
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
70
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
71
 
                {"lastup",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
72
 
                {"lastdown",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
67
                {"dhostid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
68
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "drules"},
 
69
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
70
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
71
                {"lastup",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
72
                {"lastdown",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
73
73
                {0}
74
74
                }
75
75
        },
76
76
        {"dservices",   "dserviceid",   ZBX_SYNC,
77
77
                {
78
 
                {"dserviceid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
79
 
                {"dhostid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
80
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
81
 
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
82
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
83
 
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
84
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
85
 
                {"lastup",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
86
 
                {"lastdown",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
78
                {"dserviceid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
79
                {"dhostid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "dhosts"},
 
80
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
81
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
82
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
83
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
84
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
85
                {"lastup",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
86
                {"lastdown",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
87
87
                {0}
88
88
                }
89
89
        },
90
90
        {"ids", "nodeid,table_name,field_name", 0,
91
91
                {
92
 
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL},
93
 
                {"table_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL},
94
 
                {"field_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL},
95
 
                {"nextid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
 
92
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL,    "nodes"},
 
93
                {"table_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
94
                {"field_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
95
                {"nextid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
96
96
                {0}
97
97
                }
98
98
        },
99
99
        {"httptest",    "httptestid",   ZBX_SYNC,
100
100
                {
101
 
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
102
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
103
 
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
104
 
                {"lastcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
105
 
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
106
 
                {"curstate",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
107
 
                {"curstep",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
108
 
                {"lastfailedstep",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
109
 
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
110
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
111
 
                {"macros",      ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
112
 
                {"agent",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
113
 
                {"time",        ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
114
 
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
101
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
102
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
103
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "applications"},
 
104
                {"lastcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
105
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
106
                {"curstate",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
107
                {"curstep",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
108
                {"lastfailedstep",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
109
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
110
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
111
                {"macros",      ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
112
                {"agent",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
113
                {"time",        ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
 
114
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
115
115
                {0}
116
116
                }
117
117
        },
118
118
        {"httpstep",    "httpstepid",   ZBX_SYNC,
119
119
                {
120
 
                {"httpstepid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
121
 
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
122
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
123
 
                {"no",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
124
 
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
125
 
                {"timeout",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
126
 
                {"posts",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
127
 
                {"required",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
128
 
                {"status_codes",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
120
                {"httpstepid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
121
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "httptest"},
 
122
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
123
                {"no",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
124
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
125
                {"timeout",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
126
                {"posts",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
127
                {"required",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
128
                {"status_codes",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
129
129
                {0}
130
130
                }
131
131
        },
132
132
        {"httpstepitem",        "httpstepitemid",       ZBX_SYNC,
133
133
                {
134
 
                {"httpstepitemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
135
 
                {"httpstepid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
136
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
137
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
134
                {"httpstepitemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
135
                {"httpstepid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "httpstep"},
 
136
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
 
137
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
138
138
                {0}
139
139
                }
140
140
        },
141
141
        {"httptestitem",        "httptestitemid",       ZBX_SYNC,
142
142
                {
143
 
                {"httptestitemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
144
 
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
145
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
146
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
143
                {"httptestitemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
144
                {"httptestid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "httptest"},
 
145
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
 
146
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
147
147
                {0}
148
148
                }
149
149
        },
150
150
        {"nodes",       "nodeid",       0,
151
151
                {
152
 
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL},
153
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL},
154
 
                {"timezone",    ZBX_TYPE_INT,   ZBX_NOTNULL},
155
 
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL},
156
 
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL},
157
 
                {"slave_history",       ZBX_TYPE_INT,   ZBX_NOTNULL},
158
 
                {"slave_trends",        ZBX_TYPE_INT,   ZBX_NOTNULL},
159
 
                {"nodetype",    ZBX_TYPE_INT,   ZBX_NOTNULL},
160
 
                {"masterid",    ZBX_TYPE_INT,   ZBX_NOTNULL},
 
152
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
153
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
154
                {"timezone",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
155
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
156
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
157
                {"slave_history",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
158
                {"slave_trends",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
159
                {"nodetype",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
160
                {"masterid",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
161
161
                {0}
162
162
                }
163
163
        },
164
164
        {"node_cksum",  "",     0,
165
165
                {
166
 
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL},
167
 
                {"tablename",   ZBX_TYPE_CHAR,  ZBX_NOTNULL},
168
 
                {"recordid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
169
 
                {"cksumtype",   ZBX_TYPE_INT,   ZBX_NOTNULL},
170
 
                {"cksum",       ZBX_TYPE_TEXT,  ZBX_NOTNULL},
171
 
                {"sync",        ZBX_TYPE_CHAR,  ZBX_NOTNULL},
 
166
                {"nodeid",      ZBX_TYPE_INT,   ZBX_NOTNULL,    "nodes"},
 
167
                {"tablename",   ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
168
                {"recordid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
169
                {"cksumtype",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
170
                {"cksum",       ZBX_TYPE_TEXT,  ZBX_NOTNULL,    NULL},
 
171
                {"sync",        ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
172
172
                {0}
173
173
                }
174
174
        },
175
175
        {"services_times",      "timeid",       ZBX_SYNC,
176
176
                {
177
 
                {"timeid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
178
 
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
179
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
180
 
                {"ts_from",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
181
 
                {"ts_to",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
182
 
                {"note",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
177
                {"timeid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
178
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "services"},
 
179
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
180
                {"ts_from",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
181
                {"ts_to",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
182
                {"note",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
183
183
                {0}
184
184
                }
185
185
        },
186
186
        {"alerts",      "alertid",      ZBX_HISTORY,
187
187
                {
188
 
                {"alertid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
189
 
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
190
 
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
191
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
192
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
193
 
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL},
194
 
                {"sendto",      ZBX_TYPE_CHAR,  ZBX_NOTNULL},
195
 
                {"subject",     ZBX_TYPE_CHAR,  ZBX_NOTNULL},
196
 
                {"message",     ZBX_TYPE_BLOB,  ZBX_NOTNULL},
197
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL},
198
 
                {"retries",     ZBX_TYPE_INT,   ZBX_NOTNULL},
199
 
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL},
200
 
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL},
201
 
                {"esc_step",    ZBX_TYPE_INT,   ZBX_NOTNULL},
202
 
                {"alerttype",   ZBX_TYPE_INT,   ZBX_NOTNULL},
 
188
                {"alertid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
189
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    "actions"},
 
190
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    "events"},
 
191
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "users"},
 
192
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
193
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL,    "media_type"},
 
194
                {"sendto",      ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
195
                {"subject",     ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
196
                {"message",     ZBX_TYPE_BLOB,  ZBX_NOTNULL,    NULL},
 
197
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
198
                {"retries",     ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
199
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
200
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
201
                {"esc_step",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
202
                {"alerttype",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
203
203
                {0}
204
204
                }
205
205
        },
206
206
        {"history",     "",     0,
207
207
                {
208
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
209
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
210
 
                {"value",       ZBX_TYPE_FLOAT, ZBX_NOTNULL},
 
208
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
209
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
210
                {"value",       ZBX_TYPE_FLOAT, ZBX_NOTNULL,    NULL},
211
211
                {0}
212
212
                }
213
213
        },
214
214
        {"history_sync",        "id",   ZBX_HISTORY_SYNC,
215
215
                {
216
 
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL},
217
 
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
218
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC},
219
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC},
220
 
                {"value",       ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_HISTORY_SYNC},
 
216
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
217
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "nodes"},
 
218
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC, "items"},
 
219
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
 
220
                {"value",       ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
221
221
                {0}
222
222
                }
223
223
        },
224
224
        {"history_uint",        "",     0,
225
225
                {
226
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
227
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
228
 
                {"value",       ZBX_TYPE_UINT,  ZBX_NOTNULL},
 
226
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
227
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
228
                {"value",       ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
229
229
                {0}
230
230
                }
231
231
        },
232
232
        {"history_uint_sync",   "id",   ZBX_HISTORY_SYNC,
233
233
                {
234
 
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL},
235
 
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
236
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC},
237
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC},
238
 
                {"value",       ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_HISTORY_SYNC},
 
234
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
235
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "nodes"},
 
236
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC, "items"},
 
237
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
 
238
                {"value",       ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
239
239
                {0}
240
240
                }
241
241
        },
242
242
        {"history_str", "",     0,
243
243
                {
244
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
245
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
246
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL},
 
244
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
245
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
246
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
247
247
                {0}
248
248
                }
249
249
        },
250
250
        {"history_str_sync",    "id",   ZBX_HISTORY_SYNC,
251
251
                {
252
 
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL},
253
 
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
254
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC},
255
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC},
256
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_HISTORY_SYNC},
 
252
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
253
                {"nodeid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "nodes"},
 
254
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_HISTORY_SYNC, "items"},
 
255
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
 
256
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_HISTORY_SYNC, NULL},
257
257
                {0}
258
258
                }
259
259
        },
260
260
        {"history_log", "id",   ZBX_HISTORY,
261
261
                {
262
 
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL},
263
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
264
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
265
 
                {"timestamp",   ZBX_TYPE_INT,   ZBX_NOTNULL},
266
 
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL},
267
 
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL},
268
 
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL},
 
262
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
263
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
264
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
265
                {"timestamp",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
266
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
267
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
268
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL,    NULL},
269
269
                {0}
270
270
                }
271
271
        },
272
272
        {"history_text",        "id",   ZBX_HISTORY,
273
273
                {
274
 
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL},
275
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
276
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
277
 
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL},
 
274
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
275
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
276
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
277
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL,    NULL},
278
278
                {0}
279
279
                }
280
280
        },
281
281
        {"proxy_history",       "id",   0,
282
282
                {
283
 
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL},
284
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
285
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
286
 
                {"timestamp",   ZBX_TYPE_INT,   ZBX_NOTNULL},
287
 
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL},
288
 
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL},
289
 
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL},
 
283
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
284
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
285
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
286
                {"timestamp",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
287
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
288
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
289
                {"value",       ZBX_TYPE_TEXT,  ZBX_NOTNULL,    NULL},
290
290
                {0}
291
291
                }
292
292
        },
293
293
        {"proxy_dhistory",      "id",   0,
294
294
                {
295
 
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL},
296
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
297
 
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
298
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL},
299
 
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL},
300
 
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL},
301
 
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL},
302
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL},
303
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL},
 
295
                {"id",  ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
296
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
297
                {"druleid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    "drules"},
 
298
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
299
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
300
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
301
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
302
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
303
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
304
304
                {0}
305
305
                }
306
306
        },
307
307
        {"events",      "eventid",      ZBX_HISTORY,
308
308
                {
309
 
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
310
 
                {"source",      ZBX_TYPE_INT,   ZBX_NOTNULL},
311
 
                {"object",      ZBX_TYPE_INT,   ZBX_NOTNULL},
312
 
                {"objectid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
313
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
314
 
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL},
315
 
                {"acknowledged",        ZBX_TYPE_INT,   ZBX_NOTNULL},
316
 
                {0}
317
 
                }
318
 
        },
319
 
        {"trends",      "itemid,clock", ZBX_HISTORY_TRENDS,
320
 
                {
321
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
322
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
323
 
                {"num", ZBX_TYPE_INT,   ZBX_NOTNULL},
324
 
                {"value_min",   ZBX_TYPE_FLOAT, ZBX_NOTNULL},
325
 
                {"value_avg",   ZBX_TYPE_FLOAT, ZBX_NOTNULL},
326
 
                {"value_max",   ZBX_TYPE_FLOAT, ZBX_NOTNULL},
327
 
                {0}
328
 
                }
329
 
        },
330
 
        {"trends_uint", "itemid,clock", ZBX_HISTORY_TRENDS,
331
 
                {
332
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
333
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
334
 
                {"num", ZBX_TYPE_INT,   ZBX_NOTNULL},
335
 
                {"value_min",   ZBX_TYPE_UINT,  ZBX_NOTNULL},
336
 
                {"value_avg",   ZBX_TYPE_UINT,  ZBX_NOTNULL},
337
 
                {"value_max",   ZBX_TYPE_UINT,  ZBX_NOTNULL},
 
309
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
310
                {"source",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
311
                {"object",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
312
                {"objectid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
313
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
314
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
315
                {"acknowledged",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
316
                {0}
 
317
                }
 
318
        },
 
319
        {"trends",      "itemid,clock", 0,
 
320
                {
 
321
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
322
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
323
                {"num", ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
324
                {"value_min",   ZBX_TYPE_FLOAT, ZBX_NOTNULL,    NULL},
 
325
                {"value_avg",   ZBX_TYPE_FLOAT, ZBX_NOTNULL,    NULL},
 
326
                {"value_max",   ZBX_TYPE_FLOAT, ZBX_NOTNULL,    NULL},
 
327
                {0}
 
328
                }
 
329
        },
 
330
        {"trends_uint", "itemid,clock", 0,
 
331
                {
 
332
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "items"},
 
333
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
334
                {"num", ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
335
                {"value_min",   ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
336
                {"value_avg",   ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
 
337
                {"value_max",   ZBX_TYPE_UINT,  ZBX_NOTNULL,    NULL},
338
338
                {0}
339
339
                }
340
340
        },
341
341
        {"acknowledges",        "acknowledgeid",        ZBX_HISTORY,
342
342
                {
343
 
                {"acknowledgeid",       ZBX_TYPE_ID,    ZBX_NOTNULL},
344
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
345
 
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
346
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
347
 
                {"message",     ZBX_TYPE_CHAR,  ZBX_NOTNULL},
 
343
                {"acknowledgeid",       ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
344
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "users"},
 
345
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    "events"},
 
346
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
347
                {"message",     ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
348
348
                {0}
349
349
                }
350
350
        },
351
351
        {"auditlog",    "auditid",      ZBX_HISTORY,
352
352
                {
353
 
                {"auditid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
354
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
355
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
356
 
                {"action",      ZBX_TYPE_INT,   ZBX_NOTNULL},
357
 
                {"resourcetype",        ZBX_TYPE_INT,   ZBX_NOTNULL},
358
 
                {"details",     ZBX_TYPE_CHAR,  ZBX_NOTNULL},
 
353
                {"auditid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
354
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "users"},
 
355
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
356
                {"action",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
357
                {"resourcetype",        ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
358
                {"details",     ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
359
359
                {0}
360
360
                }
361
361
        },
362
362
        {"service_alarms",      "servicealarmid",       ZBX_HISTORY,
363
363
                {
364
 
                {"servicealarmid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
365
 
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
366
 
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL},
367
 
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL},
 
364
                {"servicealarmid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
365
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    "services"},
 
366
                {"clock",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
367
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
368
368
                {0}
369
369
                }
370
370
        },
371
371
        {"actions",     "actionid",     ZBX_SYNC,
372
372
                {
373
 
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
374
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
375
 
                {"eventsource", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
376
 
                {"evaltype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
377
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
378
 
                {"esc_period",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
379
 
                {"def_shortdata",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
380
 
                {"def_longdata",        ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
381
 
                {"recovery_msg",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
382
 
                {"r_shortdata", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
383
 
                {"r_longdata",  ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
 
373
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
374
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
375
                {"eventsource", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
376
                {"evaltype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
377
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
378
                {"esc_period",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
379
                {"def_shortdata",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
380
                {"def_longdata",        ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
381
                {"recovery_msg",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
382
                {"r_shortdata", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
383
                {"r_longdata",  ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
384
384
                {0}
385
385
                }
386
386
        },
387
387
        {"operations",  "operationid",  ZBX_SYNC,
388
388
                {
389
 
                {"operationid", ZBX_TYPE_ID,    ZBX_NOTNULL},
390
 
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
391
 
                {"operationtype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
392
 
                {"object",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
393
 
                {"objectid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
394
 
                {"shortdata",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
395
 
                {"longdata",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
396
 
                {"esc_period",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
397
 
                {"esc_step_from",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
398
 
                {"esc_step_to", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
399
 
                {"default_msg", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
400
 
                {"evaltype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
389
                {"operationid", ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
390
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "actions"},
 
391
                {"operationtype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
392
                {"object",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
393
                {"objectid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, NULL},
 
394
                {"shortdata",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
395
                {"longdata",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
396
                {"esc_period",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
397
                {"esc_step_from",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
398
                {"esc_step_to", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
399
                {"default_msg", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
400
                {"evaltype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
401
401
                {0}
402
402
                }
403
403
        },
404
404
        {"opconditions",        "opconditionid",        ZBX_SYNC,
405
405
                {
406
 
                {"opconditionid",       ZBX_TYPE_ID,    ZBX_NOTNULL},
407
 
                {"operationid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
408
 
                {"conditiontype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
409
 
                {"operator",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
410
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
406
                {"opconditionid",       ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
407
                {"operationid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "operations"},
 
408
                {"conditiontype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
409
                {"operator",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
410
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
411
411
                {0}
412
412
                }
413
413
        },
414
414
        {"escalations", "escalationid", 0,
415
415
                {
416
 
                {"escalationid",        ZBX_TYPE_ID,    ZBX_NOTNULL},
417
 
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
418
 
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
419
 
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
420
 
                {"r_eventid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
421
 
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL},
422
 
                {"esc_step",    ZBX_TYPE_INT,   ZBX_NOTNULL},
423
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL},
 
416
                {"escalationid",        ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
417
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    "actions"},
 
418
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    "triggers"},
 
419
                {"eventid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    "events"},
 
420
                {"r_eventid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    "events"},
 
421
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
422
                {"esc_step",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
423
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
424
424
                {0}
425
425
                }
426
426
        },
427
427
        {"applications",        "applicationid",        ZBX_SYNC,
428
428
                {
429
 
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL},
430
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
431
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
432
 
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
429
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
430
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
 
431
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
432
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "applications"},
433
433
                {0}
434
434
                }
435
435
        },
436
436
        {"conditions",  "conditionid",  ZBX_SYNC,
437
437
                {
438
 
                {"conditionid", ZBX_TYPE_ID,    ZBX_NOTNULL},
439
 
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
440
 
                {"conditiontype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
441
 
                {"operator",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
442
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
438
                {"conditionid", ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
439
                {"actionid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "actions"},
 
440
                {"conditiontype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
441
                {"operator",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
442
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
443
443
                {0}
444
444
                }
445
445
        },
446
446
        {"config",      "configid",     ZBX_SYNC,
447
447
                {
448
 
                {"configid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
449
 
                {"alert_history",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
450
 
                {"event_history",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
451
 
                {"refresh_unsupported", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
452
 
                {"work_period", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
453
 
                {"alert_usrgrpid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
454
 
                {"event_ack_enable",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
455
 
                {"event_expire",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
456
 
                {"event_show_max",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
457
 
                {"default_theme",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
458
 
                {"authentication_type", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
459
 
                {"ldap_host",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
460
 
                {"ldap_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
461
 
                {"ldap_base_dn",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
462
 
                {"ldap_bind_dn",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
463
 
                {"ldap_bind_password",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
464
 
                {"ldap_search_attribute",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
448
                {"configid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
449
                {"alert_history",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
450
                {"event_history",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
451
                {"refresh_unsupported", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
452
                {"work_period", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
453
                {"alert_usrgrpid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "usrgrp"},
 
454
                {"event_ack_enable",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
455
                {"event_expire",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
456
                {"event_show_max",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
457
                {"default_theme",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
458
                {"authentication_type", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
459
                {"ldap_host",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
460
                {"ldap_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
461
                {"ldap_base_dn",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
462
                {"ldap_bind_dn",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
463
                {"ldap_bind_password",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
464
                {"ldap_search_attribute",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
465
465
                {0}
466
466
                }
467
467
        },
468
468
        {"functions",   "functionid",   ZBX_SYNC,
469
469
                {
470
 
                {"functionid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
471
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
472
 
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
473
 
                {"lastvalue",   ZBX_TYPE_CHAR,  0},
474
 
                {"function",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
475
 
                {"parameter",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
470
                {"functionid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
471
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
 
472
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "triggers"},
 
473
                {"lastvalue",   ZBX_TYPE_CHAR,  0,      NULL},
 
474
                {"function",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
475
                {"parameter",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
476
476
                {0}
477
477
                }
478
478
        },
479
479
        {"graphs",      "graphid",      ZBX_SYNC,
480
480
                {
481
 
                {"graphid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
482
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
483
 
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
484
 
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
485
 
                {"yaxistype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
486
 
                {"yaxismin",    ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
487
 
                {"yaxismax",    ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
488
 
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
489
 
                {"show_work_period",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
490
 
                {"show_triggers",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
491
 
                {"graphtype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
492
 
                {"show_legend", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
493
 
                {"show_3d",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
494
 
                {"percent_left",        ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
495
 
                {"percent_right",       ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
 
481
                {"graphid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
482
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
483
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
484
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
485
                {"yaxistype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
486
                {"yaxismin",    ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
 
487
                {"yaxismax",    ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
 
488
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "graphs"},
 
489
                {"show_work_period",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
490
                {"show_triggers",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
491
                {"graphtype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
492
                {"show_legend", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
493
                {"show_3d",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
494
                {"percent_left",        ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
 
495
                {"percent_right",       ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
496
496
                {0}
497
497
                }
498
498
        },
499
499
        {"graphs_items",        "gitemid",      ZBX_SYNC,
500
500
                {
501
 
                {"gitemid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
502
 
                {"graphid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
503
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
504
 
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
505
 
                {"sortorder",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
506
 
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
507
 
                {"yaxisside",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
508
 
                {"calc_fnc",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
509
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
510
 
                {"periods_cnt", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
501
                {"gitemid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
502
                {"graphid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "graphs"},
 
503
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
 
504
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
505
                {"sortorder",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
506
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
507
                {"yaxisside",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
508
                {"calc_fnc",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
509
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
510
                {"periods_cnt", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
511
511
                {0}
512
512
                }
513
513
        },
514
514
        {"groups",      "groupid",      ZBX_SYNC,
515
515
                {
516
 
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
517
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
516
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
517
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
518
518
                {0}
519
519
                }
520
520
        },
521
521
        {"help_items",  "itemtype,key_",        0,
522
522
                {
523
 
                {"itemtype",    ZBX_TYPE_INT,   ZBX_NOTNULL},
524
 
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL},
525
 
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL},
 
523
                {"itemtype",    ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
524
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
525
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
526
526
                {0}
527
527
                }
528
528
        },
529
529
        {"hosts",       "hostid",       ZBX_SYNC,
530
530
                {
531
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
532
 
                {"proxy_hostid",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
533
 
                {"host",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
534
 
                {"dns", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
535
 
                {"useip",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
536
 
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
537
 
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
538
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
539
 
                {"disable_until",       ZBX_TYPE_INT,   ZBX_NOTNULL},
540
 
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
541
 
                {"available",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
542
 
                {"errors_from", ZBX_TYPE_INT,   ZBX_NOTNULL},
543
 
                {"lastaccess",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
544
 
                {"inbytes",     ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC},
545
 
                {"outbytes",    ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC},
546
 
                {"useipmi",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
547
 
                {"ipmi_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
548
 
                {"ipmi_authtype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
549
 
                {"ipmi_privilege",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
550
 
                {"ipmi_username",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
551
 
                {"ipmi_password",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
552
 
                {"ipmi_disable_until",  ZBX_TYPE_INT,   ZBX_NOTNULL},
553
 
                {"ipmi_available",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
554
 
                {"snmp_disable_until",  ZBX_TYPE_INT,   ZBX_NOTNULL},
555
 
                {"snmp_available",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
531
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
532
                {"proxy_hostid",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
 
533
                {"host",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
534
                {"dns", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
535
                {"useip",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
536
                {"ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
537
                {"port",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
538
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
539
                {"disable_until",       ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
540
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
541
                {"available",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
542
                {"errors_from", ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
543
                {"lastaccess",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
544
                {"inbytes",     ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
545
                {"outbytes",    ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
546
                {"useipmi",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
547
                {"ipmi_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
548
                {"ipmi_authtype",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
549
                {"ipmi_privilege",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
550
                {"ipmi_username",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
551
                {"ipmi_password",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
552
                {"ipmi_disable_until",  ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
553
                {"ipmi_available",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
554
                {"snmp_disable_until",  ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
555
                {"snmp_available",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
556
556
                {0}
557
557
                }
558
558
        },
559
559
        {"hosts_groups",        "hostgroupid",  ZBX_SYNC,
560
560
                {
561
 
                {"hostgroupid", ZBX_TYPE_ID,    ZBX_NOTNULL},
562
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
563
 
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
561
                {"hostgroupid", ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
562
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
 
563
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "groups"},
564
564
                {0}
565
565
                }
566
566
        },
567
567
        {"hosts_profiles",      "hostid",       ZBX_SYNC,
568
568
                {
569
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
570
 
                {"devicetype",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
571
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
572
 
                {"os",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
573
 
                {"serialno",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
574
 
                {"tag", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
575
 
                {"macaddress",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
576
 
                {"hardware",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
577
 
                {"software",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
578
 
                {"contact",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
579
 
                {"location",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
580
 
                {"notes",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
 
569
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "hosts"},
 
570
                {"devicetype",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
571
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
572
                {"os",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
573
                {"serialno",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
574
                {"tag", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
575
                {"macaddress",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
576
                {"hardware",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
577
                {"software",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
578
                {"contact",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
579
                {"location",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
580
                {"notes",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
581
581
                {0}
582
582
                }
583
583
        },
584
584
        {"hosts_profiles_ext",  "hostid",       ZBX_SYNC,
585
585
                {
586
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
587
 
                {"device_alias",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
588
 
                {"device_type", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
589
 
                {"device_chassis",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
590
 
                {"device_os",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
591
 
                {"device_os_short",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
592
 
                {"device_hw_arch",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
593
 
                {"device_serial",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
594
 
                {"device_model",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
595
 
                {"device_tag",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
596
 
                {"device_vendor",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
597
 
                {"device_contract",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
598
 
                {"device_who",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
599
 
                {"device_status",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
600
 
                {"device_app_01",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
601
 
                {"device_app_02",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
602
 
                {"device_app_03",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
603
 
                {"device_app_04",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
604
 
                {"device_app_05",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
605
 
                {"device_url_1",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
606
 
                {"device_url_2",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
607
 
                {"device_url_3",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
608
 
                {"device_networks",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
609
 
                {"device_notes",        ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
610
 
                {"device_hardware",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
611
 
                {"device_software",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
612
 
                {"ip_subnet_mask",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
613
 
                {"ip_router",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
614
 
                {"ip_macaddress",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
615
 
                {"oob_ip",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
616
 
                {"oob_subnet_mask",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
617
 
                {"oob_router",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
618
 
                {"date_hw_buy", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
619
 
                {"date_hw_install",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
620
 
                {"date_hw_expiry",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
621
 
                {"date_hw_decomm",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
622
 
                {"site_street_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
623
 
                {"site_street_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
624
 
                {"site_street_3",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
625
 
                {"site_city",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
626
 
                {"site_state",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
627
 
                {"site_country",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
628
 
                {"site_zip",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
629
 
                {"site_rack",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
630
 
                {"site_notes",  ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
631
 
                {"poc_1_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
632
 
                {"poc_1_email", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
633
 
                {"poc_1_phone_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
634
 
                {"poc_1_phone_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
635
 
                {"poc_1_cell",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
636
 
                {"poc_1_screen",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
637
 
                {"poc_1_notes", ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
638
 
                {"poc_2_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
639
 
                {"poc_2_email", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
640
 
                {"poc_2_phone_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
641
 
                {"poc_2_phone_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
642
 
                {"poc_2_cell",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
643
 
                {"poc_2_screen",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
644
 
                {"poc_2_notes", ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
 
586
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "hosts"},
 
587
                {"device_alias",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
588
                {"device_type", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
589
                {"device_chassis",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
590
                {"device_os",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
591
                {"device_os_short",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
592
                {"device_hw_arch",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
593
                {"device_serial",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
594
                {"device_model",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
595
                {"device_tag",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
596
                {"device_vendor",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
597
                {"device_contract",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
598
                {"device_who",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
599
                {"device_status",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
600
                {"device_app_01",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
601
                {"device_app_02",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
602
                {"device_app_03",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
603
                {"device_app_04",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
604
                {"device_app_05",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
605
                {"device_url_1",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
606
                {"device_url_2",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
607
                {"device_url_3",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
608
                {"device_networks",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
609
                {"device_notes",        ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
610
                {"device_hardware",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
611
                {"device_software",     ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
612
                {"ip_subnet_mask",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
613
                {"ip_router",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
614
                {"ip_macaddress",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
615
                {"oob_ip",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
616
                {"oob_subnet_mask",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
617
                {"oob_router",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
618
                {"date_hw_buy", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
619
                {"date_hw_install",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
620
                {"date_hw_expiry",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
621
                {"date_hw_decomm",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
622
                {"site_street_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
623
                {"site_street_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
624
                {"site_street_3",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
625
                {"site_city",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
626
                {"site_state",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
627
                {"site_country",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
628
                {"site_zip",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
629
                {"site_rack",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
630
                {"site_notes",  ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
631
                {"poc_1_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
632
                {"poc_1_email", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
633
                {"poc_1_phone_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
634
                {"poc_1_phone_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
635
                {"poc_1_cell",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
636
                {"poc_1_screen",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
637
                {"poc_1_notes", ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
638
                {"poc_2_name",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
639
                {"poc_2_email", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
640
                {"poc_2_phone_1",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
641
                {"poc_2_phone_2",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
642
                {"poc_2_cell",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
643
                {"poc_2_screen",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
644
                {"poc_2_notes", ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
645
645
                {0}
646
646
                }
647
647
        },
648
648
        {"hosts_templates",     "hosttemplateid",       ZBX_SYNC,
649
649
                {
650
 
                {"hosttemplateid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
651
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
652
 
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
650
                {"hosttemplateid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
651
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
 
652
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "hosts"},
653
653
                {0}
654
654
                }
655
655
        },
656
656
        {"housekeeper", "housekeeperid",        0,
657
657
                {
658
 
                {"housekeeperid",       ZBX_TYPE_ID,    ZBX_NOTNULL},
659
 
                {"tablename",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
660
 
                {"field",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
661
 
                {"value",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
658
                {"housekeeperid",       ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
659
                {"tablename",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
660
                {"field",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
661
                {"value",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
662
662
                {0}
663
663
                }
664
664
        },
665
665
        {"images",      "imageid",      ZBX_SYNC,
666
666
                {
667
 
                {"imageid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
668
 
                {"imagetype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
669
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
670
 
                {"image",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
 
667
                {"imageid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
668
                {"imagetype",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
669
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
670
                {"image",       ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
671
671
                {0}
672
672
                }
673
673
        },
674
674
        {"items",       "itemid",       ZBX_SYNC,
675
675
                {
676
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
677
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
678
 
                {"snmp_community",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
679
 
                {"snmp_oid",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
680
 
                {"snmp_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
681
 
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
682
 
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
683
 
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
684
 
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
685
 
                {"history",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
686
 
                {"trends",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
687
 
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL},
688
 
                {"lastvalue",   ZBX_TYPE_CHAR,  0},
689
 
                {"lastclock",   ZBX_TYPE_INT,   0},
690
 
                {"prevvalue",   ZBX_TYPE_CHAR,  0},
691
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
692
 
                {"value_type",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
693
 
                {"trapper_hosts",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
694
 
                {"units",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
695
 
                {"multiplier",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
696
 
                {"delta",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
697
 
                {"prevorgvalue",        ZBX_TYPE_CHAR,  0},
698
 
                {"snmpv3_securityname", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
699
 
                {"snmpv3_securitylevel",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
700
 
                {"snmpv3_authpassphrase",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
701
 
                {"snmpv3_privpassphrase",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
702
 
                {"formula",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
703
 
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
704
 
                {"lastlogsize", ZBX_TYPE_INT,   ZBX_NOTNULL},
705
 
                {"logtimefmt",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
706
 
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
707
 
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
708
 
                {"delay_flex",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
709
 
                {"params",      ZBX_TYPE_TEXT,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
710
 
                {"ipmi_sensor", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY},
 
676
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
677
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
678
                {"snmp_community",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
679
                {"snmp_oid",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
680
                {"snmp_port",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
681
                {"hostid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     "hosts"},
 
682
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
683
                {"key_",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
684
                {"delay",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
685
                {"history",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
686
                {"trends",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
687
                {"nextcheck",   ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
688
                {"lastvalue",   ZBX_TYPE_CHAR,  0,      NULL},
 
689
                {"lastclock",   ZBX_TYPE_INT,   0,      NULL},
 
690
                {"prevvalue",   ZBX_TYPE_CHAR,  0,      NULL},
 
691
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
692
                {"value_type",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
693
                {"trapper_hosts",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
694
                {"units",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
695
                {"multiplier",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
696
                {"delta",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
697
                {"prevorgvalue",        ZBX_TYPE_CHAR,  0,      NULL},
 
698
                {"snmpv3_securityname", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
699
                {"snmpv3_securitylevel",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
700
                {"snmpv3_authpassphrase",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
701
                {"snmpv3_privpassphrase",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
702
                {"formula",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
703
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
704
                {"lastlogsize", ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
705
                {"logtimefmt",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
706
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     "items"},
 
707
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     "valuemaps"},
 
708
                {"delay_flex",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
709
                {"params",      ZBX_TYPE_TEXT,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
 
710
                {"ipmi_sensor", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC | ZBX_PROXY,     NULL},
711
711
                {0}
712
712
                }
713
713
        },
714
714
        {"items_applications",  "itemappid",    ZBX_SYNC,
715
715
                {
716
 
                {"itemappid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
717
 
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
718
 
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
716
                {"itemappid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
717
                {"applicationid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "applications"},
 
718
                {"itemid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "items"},
719
719
                {0}
720
720
                }
721
721
        },
722
722
        {"mappings",    "mappingid",    ZBX_SYNC,
723
723
                {
724
 
                {"mappingid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
725
 
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
726
 
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
727
 
                {"newvalue",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
724
                {"mappingid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
725
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "valuemaps"},
 
726
                {"value",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
727
                {"newvalue",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
728
728
                {0}
729
729
                }
730
730
        },
731
731
        {"media",       "mediaid",      ZBX_SYNC,
732
732
                {
733
 
                {"mediaid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
734
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
735
 
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
736
 
                {"sendto",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
737
 
                {"active",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
738
 
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
739
 
                {"period",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
733
                {"mediaid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
734
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "users"},
 
735
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "media_type"},
 
736
                {"sendto",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
737
                {"active",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
738
                {"severity",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
739
                {"period",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
740
740
                {0}
741
741
                }
742
742
        },
743
743
        {"media_type",  "mediatypeid",  ZBX_SYNC,
744
744
                {
745
 
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL},
746
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
747
 
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
748
 
                {"smtp_server", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
749
 
                {"smtp_helo",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
750
 
                {"smtp_email",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
751
 
                {"exec_path",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
752
 
                {"gsm_modem",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
753
 
                {"username",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
754
 
                {"passwd",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
745
                {"mediatypeid", ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
746
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
747
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
748
                {"smtp_server", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
749
                {"smtp_helo",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
750
                {"smtp_email",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
751
                {"exec_path",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
752
                {"gsm_modem",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
753
                {"username",    ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
754
                {"passwd",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
755
755
                {0}
756
756
                }
757
757
        },
758
758
        {"profiles",    "profileid",    ZBX_SYNC,
759
759
                {
760
 
                {"profileid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
761
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
762
 
                {"idx", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
763
 
                {"idx2",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
764
 
                {"value_id",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
765
 
                {"value_int",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
766
 
                {"value_str",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
767
 
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
768
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
760
                {"profileid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
761
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "users"},
 
762
                {"idx", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
763
                {"idx2",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, NULL},
 
764
                {"value_id",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, NULL},
 
765
                {"value_int",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
766
                {"value_str",   ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
767
                {"source",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
768
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
769
769
                {0}
770
770
                }
771
771
        },
772
772
        {"rights",      "rightid",      ZBX_SYNC,
773
773
                {
774
 
                {"rightid",     ZBX_TYPE_ID,    ZBX_NOTNULL},
775
 
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
776
 
                {"permission",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
777
 
                {"id",  ZBX_TYPE_ID,    ZBX_SYNC},
 
774
                {"rightid",     ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
775
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "usrgrp"},
 
776
                {"permission",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
777
                {"id",  ZBX_TYPE_ID,    ZBX_SYNC,       "groups"},
778
778
                {0}
779
779
                }
780
780
        },
781
781
        {"scripts",     "scriptid",     ZBX_SYNC,
782
782
                {
783
 
                {"scriptid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
784
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
785
 
                {"command",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
786
 
                {"host_access", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
787
 
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
788
 
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
783
                {"scriptid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
784
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
785
                {"command",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
786
                {"host_access", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
787
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "usrgrp"},
 
788
                {"groupid",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "groups"},
789
789
                {0}
790
790
                }
791
791
        },
792
792
        {"screens",     "screenid",     ZBX_SYNC,
793
793
                {
794
 
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
795
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
796
 
                {"hsize",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
797
 
                {"vsize",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
794
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
795
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
796
                {"hsize",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
797
                {"vsize",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
798
798
                {0}
799
799
                }
800
800
        },
801
801
        {"screens_items",       "screenitemid", ZBX_SYNC,
802
802
                {
803
 
                {"screenitemid",        ZBX_TYPE_ID,    ZBX_NOTNULL},
804
 
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
805
 
                {"resourcetype",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
806
 
                {"resourceid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
807
 
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
808
 
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
809
 
                {"x",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
810
 
                {"y",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
811
 
                {"colspan",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
812
 
                {"rowspan",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
813
 
                {"elements",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
814
 
                {"valign",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
815
 
                {"halign",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
816
 
                {"style",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
817
 
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
818
 
                {"dynamic",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
803
                {"screenitemid",        ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
804
                {"screenid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "screens"},
 
805
                {"resourcetype",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
806
                {"resourceid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, NULL},
 
807
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
808
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
809
                {"x",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
810
                {"y",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
811
                {"colspan",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
812
                {"rowspan",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
813
                {"elements",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
814
                {"valign",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
815
                {"halign",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
816
                {"style",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
817
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
818
                {"dynamic",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
819
819
                {0}
820
820
                }
821
821
        },
822
822
        {"services",    "serviceid",    ZBX_SYNC,
823
823
                {
824
 
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
825
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
826
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
827
 
                {"algorithm",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
828
 
                {"triggerid",   ZBX_TYPE_ID,    ZBX_SYNC},
829
 
                {"showsla",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
830
 
                {"goodsla",     ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC},
831
 
                {"sortorder",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
824
                {"serviceid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
825
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
826
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
827
                {"algorithm",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
828
                {"triggerid",   ZBX_TYPE_ID,    ZBX_SYNC,       "triggers"},
 
829
                {"showsla",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
830
                {"goodsla",     ZBX_TYPE_FLOAT, ZBX_NOTNULL | ZBX_SYNC, NULL},
 
831
                {"sortorder",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
832
832
                {0}
833
833
                }
834
834
        },
835
835
        {"services_links",      "linkid",       ZBX_SYNC,
836
836
                {
837
 
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
838
 
                {"serviceupid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
839
 
                {"servicedownid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
840
 
                {"soft",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
837
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
838
                {"serviceupid", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "services"},
 
839
                {"servicedownid",       ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "services"},
 
840
                {"soft",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
841
841
                {0}
842
842
                }
843
843
        },
844
844
        {"sessions",    "sessionid",    0,
845
845
                {
846
 
                {"sessionid",   ZBX_TYPE_CHAR,  ZBX_NOTNULL},
847
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
848
 
                {"lastaccess",  ZBX_TYPE_INT,   ZBX_NOTNULL},
849
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL},
 
846
                {"sessionid",   ZBX_TYPE_CHAR,  ZBX_NOTNULL,    NULL},
 
847
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    "users"},
 
848
                {"lastaccess",  ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
 
849
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL,    NULL},
850
850
                {0}
851
851
                }
852
852
        },
853
853
        {"sysmaps_links",       "linkid",       ZBX_SYNC,
854
854
                {
855
 
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
856
 
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
857
 
                {"selementid1", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
858
 
                {"selementid2", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
859
 
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
860
 
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
855
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
856
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "sysmaps"},
 
857
                {"selementid1", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "sysmaps_elements"},
 
858
                {"selementid2", ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "sysmaps_elements"},
 
859
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
860
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
861
861
                {0}
862
862
                }
863
863
        },
864
864
        {"sysmaps_link_triggers",       "linktriggerid",        ZBX_SYNC,
865
865
                {
866
 
                {"linktriggerid",       ZBX_TYPE_ID,    ZBX_NOTNULL},
867
 
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
868
 
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
869
 
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
870
 
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
866
                {"linktriggerid",       ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
867
                {"linkid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "sysmaps_links"},
 
868
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "triggers"},
 
869
                {"drawtype",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
870
                {"color",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
871
871
                {0}
872
872
                }
873
873
        },
874
874
        {"sysmaps_elements",    "selementid",   ZBX_SYNC,
875
875
                {
876
 
                {"selementid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
877
 
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
878
 
                {"elementid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
879
 
                {"elementtype", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
880
 
                {"iconid_off",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
881
 
                {"iconid_on",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
882
 
                {"iconid_unknown",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
883
 
                {"label",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
884
 
                {"label_location",      ZBX_TYPE_INT,   ZBX_SYNC},
885
 
                {"x",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
886
 
                {"y",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
887
 
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
888
 
                {"iconid_disabled",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
876
                {"selementid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
877
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "sysmaps"},
 
878
                {"elementid",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, NULL},
 
879
                {"elementtype", ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
880
                {"iconid_off",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "images"},
 
881
                {"iconid_on",   ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "images"},
 
882
                {"iconid_unknown",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "images"},
 
883
                {"label",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
884
                {"label_location",      ZBX_TYPE_INT,   ZBX_SYNC,       NULL},
 
885
                {"x",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
886
                {"y",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
887
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
888
                {"iconid_disabled",     ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "images"},
889
889
                {0}
890
890
                }
891
891
        },
892
892
        {"sysmaps",     "sysmapid",     ZBX_SYNC,
893
893
                {
894
 
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
895
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
896
 
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
897
 
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
898
 
                {"backgroundid",        ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC},
899
 
                {"label_type",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
900
 
                {"label_location",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
894
                {"sysmapid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
895
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
896
                {"width",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
897
                {"height",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
898
                {"backgroundid",        ZBX_TYPE_UINT,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
899
                {"label_type",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
900
                {"label_location",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
901
901
                {0}
902
902
                }
903
903
        },
904
904
        {"triggers",    "triggerid",    ZBX_SYNC,
905
905
                {
906
 
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL},
907
 
                {"expression",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
908
 
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
909
 
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
910
 
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
911
 
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
912
 
                {"priority",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
913
 
                {"lastchange",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
914
 
                {"dep_level",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
915
 
                {"comments",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC},
916
 
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
917
 
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
918
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
906
                {"triggerid",   ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
907
                {"expression",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
908
                {"description", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
909
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
910
                {"status",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
911
                {"value",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
912
                {"priority",    ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
913
                {"lastchange",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
914
                {"dep_level",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
915
                {"comments",    ZBX_TYPE_BLOB,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
916
                {"error",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
917
                {"templateid",  ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "triggers"},
 
918
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
919
919
                {0}
920
920
                }
921
921
        },
922
922
        {"trigger_depends",     "triggerdepid", ZBX_SYNC,
923
923
                {
924
 
                {"triggerdepid",        ZBX_TYPE_ID,    ZBX_NOTNULL},
925
 
                {"triggerid_down",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
926
 
                {"triggerid_up",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
924
                {"triggerdepid",        ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
925
                {"triggerid_down",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "triggers"},
 
926
                {"triggerid_up",        ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "triggers"},
927
927
                {0}
928
928
                }
929
929
        },
930
930
        {"users",       "userid",       ZBX_SYNC,
931
931
                {
932
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL},
933
 
                {"alias",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
934
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
935
 
                {"surname",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
936
 
                {"passwd",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
937
 
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
938
 
                {"autologin",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
939
 
                {"autologout",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
940
 
                {"lang",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
941
 
                {"refresh",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
942
 
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
943
 
                {"theme",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
944
 
                {"attempt_failed",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
945
 
                {"attempt_ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
946
 
                {"attempt_clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
932
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
933
                {"alias",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
934
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
935
                {"surname",     ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
936
                {"passwd",      ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
937
                {"url", ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
938
                {"autologin",   ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
939
                {"autologout",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
940
                {"lang",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
941
                {"refresh",     ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
942
                {"type",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
943
                {"theme",       ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
944
                {"attempt_failed",      ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
945
                {"attempt_ip",  ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
946
                {"attempt_clock",       ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
947
947
                {0}
948
948
                }
949
949
        },
950
950
        {"usrgrp",      "usrgrpid",     ZBX_SYNC,
951
951
                {
952
 
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL},
953
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
954
 
                {"gui_access",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
955
 
                {"users_status",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC},
 
952
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
953
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
 
954
                {"gui_access",  ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
 
955
                {"users_status",        ZBX_TYPE_INT,   ZBX_NOTNULL | ZBX_SYNC, NULL},
956
956
                {0}
957
957
                }
958
958
        },
959
959
        {"users_groups",        "id",   ZBX_SYNC,
960
960
                {
961
 
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL},
962
 
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
963
 
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC},
 
961
                {"id",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
962
                {"usrgrpid",    ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "usrgrp"},
 
963
                {"userid",      ZBX_TYPE_ID,    ZBX_NOTNULL | ZBX_SYNC, "users"},
964
964
                {0}
965
965
                }
966
966
        },
967
967
        {"valuemaps",   "valuemapid",   ZBX_SYNC,
968
968
                {
969
 
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL},
970
 
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC},
 
969
                {"valuemapid",  ZBX_TYPE_ID,    ZBX_NOTNULL,    NULL},
 
970
                {"name",        ZBX_TYPE_CHAR,  ZBX_NOTNULL | ZBX_SYNC, NULL},
971
971
                {0}
972
972
                }
973
973
        },
977
977
#ifdef HAVE_MYSQL
978
978
const char *db_schema= {"\
979
979
CREATE TABLE slideshows (\
980
 
        slideshowid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
980
        slideshowid             bigint unsigned         DEFAULT '0'     NOT NULL,\
981
981
        name            varchar(255)            DEFAULT ''      NOT NULL,\
982
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
 
982
        delay           integer         DEFAULT '0'     NOT NULL,\
983
983
        PRIMARY KEY (slideshowid)\
984
 
)  ype=InnoDB;\
 
984
) type=InnoDB;\
985
985
CREATE TABLE slides (\
986
 
        slideid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
987
 
        slideshowid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
988
 
        screenid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
989
 
        s ep            in eger         DEFAULT '0'     NOT NULL,\
990
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
 
986
        slideid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
987
        slideshowid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
988
        screenid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
989
        step            integer         DEFAULT '0'     NOT NULL,\
 
990
        delay           integer         DEFAULT '0'     NOT NULL,\
991
991
        PRIMARY KEY (slideid)\
992
 
)  ype=InnoDB;\
 
992
) type=InnoDB;\
993
993
CREATE INDEX slides_slides_1 on slides (slideshowid);\
994
994
CREATE TABLE drules (\
995
 
        druleid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
996
 
        proxy_hos id            bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
995
        druleid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
996
        proxy_hostid            bigint unsigned         DEFAULT '0'     NOT NULL,\
997
997
        name            varchar(255)            DEFAULT ''      NOT NULL,\
998
998
        iprange         varchar(255)            DEFAULT ''      NOT NULL,\
999
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
1000
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1001
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
 
999
        delay           integer         DEFAULT '0'     NOT NULL,\
 
1000
        nextcheck               integer         DEFAULT '0'     NOT NULL,\
 
1001
        status          integer         DEFAULT '0'     NOT NULL,\
1002
1002
        PRIMARY KEY (druleid)\
1003
 
)  ype=InnoDB;\
 
1003
) type=InnoDB;\
1004
1004
CREATE TABLE dchecks (\
1005
 
        dcheckid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1006
 
        druleid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1007
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
 
1005
        dcheckid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1006
        druleid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1007
        type            integer         DEFAULT '0'     NOT NULL,\
1008
1008
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
1009
 
        snmp_communi y          varchar(255)            DEFAULT '0'     NOT NULL,\
1010
 
        por s           varchar(255)            DEFAULT '0'     NOT NULL,\
 
1009
        snmp_community          varchar(255)            DEFAULT '0'     NOT NULL,\
 
1010
        ports           varchar(255)            DEFAULT '0'     NOT NULL,\
1011
1011
        PRIMARY KEY (dcheckid)\
1012
 
)  ype=InnoDB;\
1013
 
CREATE TABLE dhos s (\
1014
 
        dhos id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1015
 
        druleid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1012
) type=InnoDB;\
 
1013
CREATE TABLE dhosts (\
 
1014
        dhostid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1015
        druleid         bigint unsigned         DEFAULT '0'     NOT NULL,\
1016
1016
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
1017
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1018
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
1019
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
1020
 
        PRIMARY KEY (dhos id)\
1021
 
)  ype=InnoDB;\
 
1017
        status          integer         DEFAULT '0'     NOT NULL,\
 
1018
        lastup          integer         DEFAULT '0'     NOT NULL,\
 
1019
        lastdown                integer         DEFAULT '0'     NOT NULL,\
 
1020
        PRIMARY KEY (dhostid)\
 
1021
) type=InnoDB;\
1022
1022
CREATE TABLE dservices (\
1023
 
        dserviceid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1024
 
        dhos id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1025
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
 
1023
        dserviceid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1024
        dhostid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1025
        type            integer         DEFAULT '0'     NOT NULL,\
1026
1026
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
1027
1027
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
1028
 
        por             in eger         DEFAULT '0'     NOT NULL,\
1029
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1030
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
1031
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
 
1028
        port            integer         DEFAULT '0'     NOT NULL,\
 
1029
        status          integer         DEFAULT '0'     NOT NULL,\
 
1030
        lastup          integer         DEFAULT '0'     NOT NULL,\
 
1031
        lastdown                integer         DEFAULT '0'     NOT NULL,\
1032
1032
        PRIMARY KEY (dserviceid)\
1033
 
)  ype=InnoDB;\
 
1033
) type=InnoDB;\
1034
1034
CREATE TABLE ids (\
1035
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
1036
 
         able_name              varchar(64)             DEFAULT ''      NOT NULL,\
 
1035
        nodeid          integer         DEFAULT '0'     NOT NULL,\
 
1036
        table_name              varchar(64)             DEFAULT ''      NOT NULL,\
1037
1037
        field_name              varchar(64)             DEFAULT ''      NOT NULL,\
1038
 
        nex id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1039
 
        PRIMARY KEY (nodeid, able_name,field_name)\
1040
 
)  ype=InnoDB;\
1041
 
CREATE TABLE h p es  (\
1042
 
        h p es id               bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1038
        nextid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1039
        PRIMARY KEY (nodeid,table_name,field_name)\
 
1040
) type=InnoDB;\
 
1041
CREATE TABLE httptest (\
 
1042
        httptestid              bigint unsigned         DEFAULT '0'     NOT NULL,\
1043
1043
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1044
 
        applica ionid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1045
 
        las check               in eger         DEFAULT '0'     NOT NULL,\
1046
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1047
 
        curs a e                in eger         DEFAULT '0'     NOT NULL,\
1048
 
        curs ep         in eger         DEFAULT '0'     NOT NULL,\
1049
 
        las faileds ep          in eger         DEFAULT '0'     NOT NULL,\
1050
 
        delay           in eger         DEFAULT '60'    NOT NULL,\
1051
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
 
1044
        applicationid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1045
        lastcheck               integer         DEFAULT '0'     NOT NULL,\
 
1046
        nextcheck               integer         DEFAULT '0'     NOT NULL,\
 
1047
        curstate                integer         DEFAULT '0'     NOT NULL,\
 
1048
        curstep         integer         DEFAULT '0'     NOT NULL,\
 
1049
        lastfailedstep          integer         DEFAULT '0'     NOT NULL,\
 
1050
        delay           integer         DEFAULT '60'    NOT NULL,\
 
1051
        status          integer         DEFAULT '0'     NOT NULL,\
1052
1052
        macros          blob                    NOT NULL,\
1053
 
        agen            varchar(255)            DEFAULT ''      NOT NULL,\
1054
 
         ime            double(16,4)            DEFAULT '0'     NOT NULL,\
 
1053
        agent           varchar(255)            DEFAULT ''      NOT NULL,\
 
1054
        time            double(16,4)            DEFAULT '0'     NOT NULL,\
1055
1055
        error           varchar(255)            DEFAULT ''      NOT NULL,\
1056
 
        PRIMARY KEY (h p es id)\
1057
 
)  ype=InnoDB;\
1058
 
CREATE INDEX h p es _h p es _1 on h p es  (applica ionid);\
1059
 
CREATE TABLE h ps ep (\
1060
 
        h ps epid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1061
 
        h p es id               bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1056
        PRIMARY KEY (httptestid)\
 
1057
) type=InnoDB;\
 
1058
CREATE INDEX httptest_httptest_1 on httptest (applicationid);\
 
1059
CREATE TABLE httpstep (\
 
1060
        httpstepid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1061
        httptestid              bigint unsigned         DEFAULT '0'     NOT NULL,\
1062
1062
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1063
 
        no              in eger         DEFAULT '0'     NOT NULL,\
 
1063
        no              integer         DEFAULT '0'     NOT NULL,\
1064
1064
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1065
 
         imeou          in eger         DEFAULT '30'    NOT NULL,\
1066
 
        pos s           blob                    NOT NULL,\
 
1065
        timeout         integer         DEFAULT '30'    NOT NULL,\
 
1066
        posts           blob                    NOT NULL,\
1067
1067
        required                varchar(255)            DEFAULT ''      NOT NULL,\
1068
 
        s a us_codes            varchar(255)            DEFAULT ''      NOT NULL,\
1069
 
        PRIMARY KEY (h ps epid)\
1070
 
)  ype=InnoDB;\
1071
 
CREATE INDEX h ps ep_h ps ep_1 on h ps ep (h p es id);\
1072
 
CREATE TABLE h ps epi em (\
1073
 
        h ps epi emid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1074
 
        h ps epid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1075
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1076
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1077
 
        PRIMARY KEY (h ps epi emid)\
1078
 
)  ype=InnoDB;\
1079
 
CREATE UNIQUE INDEX h ps epi em_h ps epi em_1 on h ps epi em (h ps epid,i emid);\
1080
 
CREATE TABLE h p es i em (\
1081
 
        h p es i emid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1082
 
        h p es id               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1083
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1084
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1085
 
        PRIMARY KEY (h p es i emid)\
1086
 
)  ype=InnoDB;\
1087
 
CREATE UNIQUE INDEX h p es i em_h p es i em_1 on h p es i em (h p es id,i emid);\
 
1068
        status_codes            varchar(255)            DEFAULT ''      NOT NULL,\
 
1069
        PRIMARY KEY (httpstepid)\
 
1070
) type=InnoDB;\
 
1071
CREATE INDEX httpstep_httpstep_1 on httpstep (httptestid);\
 
1072
CREATE TABLE httpstepitem (\
 
1073
        httpstepitemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1074
        httpstepid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1075
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1076
        type            integer         DEFAULT '0'     NOT NULL,\
 
1077
        PRIMARY KEY (httpstepitemid)\
 
1078
) type=InnoDB;\
 
1079
CREATE UNIQUE INDEX httpstepitem_httpstepitem_1 on httpstepitem (httpstepid,itemid);\
 
1080
CREATE TABLE httptestitem (\
 
1081
        httptestitemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1082
        httptestid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1083
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1084
        type            integer         DEFAULT '0'     NOT NULL,\
 
1085
        PRIMARY KEY (httptestitemid)\
 
1086
) type=InnoDB;\
 
1087
CREATE UNIQUE INDEX httptestitem_httptestitem_1 on httptestitem (httptestid,itemid);\
1088
1088
CREATE TABLE nodes (\
1089
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
 
1089
        nodeid          integer         DEFAULT '0'     NOT NULL,\
1090
1090
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
1091
 
         imezone                in eger         DEFAULT '0'     NOT NULL,\
 
1091
        timezone                integer         DEFAULT '0'     NOT NULL,\
1092
1092
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
1093
 
        por             in eger         DEFAULT '10051' NOT NULL,\
1094
 
        slave_his ory           in eger         DEFAULT '30'    NOT NULL,\
1095
 
        slave_ rends            in eger         DEFAULT '365'   NOT NULL,\
1096
 
        node ype                in eger         DEFAULT '0'     NOT NULL,\
1097
 
        mas erid                in eger         DEFAULT '0'     NOT NULL,\
 
1093
        port            integer         DEFAULT '10051' NOT NULL,\
 
1094
        slave_history           integer         DEFAULT '30'    NOT NULL,\
 
1095
        slave_trends            integer         DEFAULT '365'   NOT NULL,\
 
1096
        nodetype                integer         DEFAULT '0'     NOT NULL,\
 
1097
        masterid                integer         DEFAULT '0'     NOT NULL,\
1098
1098
        PRIMARY KEY (nodeid)\
1099
 
)  ype=InnoDB;\
 
1099
) type=InnoDB;\
1100
1100
CREATE TABLE node_cksum (\
1101
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
1102
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
1103
 
        recordid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1104
 
        cksum ype               in eger         DEFAULT '0'     NOT NULL,\
1105
 
        cksum            ex                     NOT NULL,\
 
1101
        nodeid          integer         DEFAULT '0'     NOT NULL,\
 
1102
        tablename               varchar(64)             DEFAULT ''      NOT NULL,\
 
1103
        recordid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1104
        cksumtype               integer         DEFAULT '0'     NOT NULL,\
 
1105
        cksum           text                    NOT NULL,\
1106
1106
        sync            char(128)               DEFAULT ''      NOT NULL\
1107
 
)  ype=InnoDB;\
1108
 
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid, ablename,recordid,cksum ype);\
1109
 
CREATE TABLE services_ imes (\
1110
 
         imeid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1111
 
        serviceid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1112
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1113
 
         s_from         in eger         DEFAULT '0'     NOT NULL,\
1114
 
         s_ o           in eger         DEFAULT '0'     NOT NULL,\
1115
 
        no e            varchar(255)            DEFAULT ''      NOT NULL,\
1116
 
        PRIMARY KEY ( imeid)\
1117
 
)  ype=InnoDB;\
1118
 
CREATE INDEX services_ imes_ imes_1 on services_ imes (serviceid, ype, s_from, s_ o);\
1119
 
CREATE TABLE aler s (\
1120
 
        aler id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1121
 
        ac ionid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1122
 
        even id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1123
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1124
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1125
 
        media ypeid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1126
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
1127
 
        subjec          varchar(255)            DEFAULT ''      NOT NULL,\
 
1107
) type=InnoDB;\
 
1108
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid,tablename,recordid,cksumtype);\
 
1109
CREATE TABLE services_times (\
 
1110
        timeid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1111
        serviceid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1112
        type            integer         DEFAULT '0'     NOT NULL,\
 
1113
        ts_from         integer         DEFAULT '0'     NOT NULL,\
 
1114
        ts_to           integer         DEFAULT '0'     NOT NULL,\
 
1115
        note            varchar(255)            DEFAULT ''      NOT NULL,\
 
1116
        PRIMARY KEY (timeid)\
 
1117
) type=InnoDB;\
 
1118
CREATE INDEX services_times_times_1 on services_times (serviceid,type,ts_from,ts_to);\
 
1119
CREATE TABLE alerts (\
 
1120
        alertid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1121
        actionid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1122
        eventid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1123
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1124
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1125
        mediatypeid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1126
        sendto          varchar(100)            DEFAULT ''      NOT NULL,\
 
1127
        subject         varchar(255)            DEFAULT ''      NOT NULL,\
1128
1128
        message         blob                    NOT NULL,\
1129
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1130
 
        re ries         in eger         DEFAULT '0'     NOT NULL,\
 
1129
        status          integer         DEFAULT '0'     NOT NULL,\
 
1130
        retries         integer         DEFAULT '0'     NOT NULL,\
1131
1131
        error           varchar(128)            DEFAULT ''      NOT NULL,\
1132
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1133
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
1134
 
        aler ype                in eger         DEFAULT '0'     NOT NULL,\
1135
 
        PRIMARY KEY (aler id)\
1136
 
)  ype=InnoDB;\
1137
 
CREATE INDEX aler s_1 on aler s (ac ionid);\
1138
 
CREATE INDEX aler s_2 on aler s (clock);\
1139
 
CREATE INDEX aler s_3 on aler s (even id);\
1140
 
CREATE INDEX aler s_4 on aler s (s a us,re ries);\
1141
 
CREATE INDEX aler s_5 on aler s (media ypeid);\
1142
 
CREATE INDEX aler s_6 on aler s (userid);\
1143
 
CREATE TABLE his ory (\
1144
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1145
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
 
1132
        nextcheck               integer         DEFAULT '0'     NOT NULL,\
 
1133
        esc_step                integer         DEFAULT '0'     NOT NULL,\
 
1134
        alerttype               integer         DEFAULT '0'     NOT NULL,\
 
1135
        PRIMARY KEY (alertid)\
 
1136
) type=InnoDB;\
 
1137
CREATE INDEX alerts_1 on alerts (actionid);\
 
1138
CREATE INDEX alerts_2 on alerts (clock);\
 
1139
CREATE INDEX alerts_3 on alerts (eventid);\
 
1140
CREATE INDEX alerts_4 on alerts (status,retries);\
 
1141
CREATE INDEX alerts_5 on alerts (mediatypeid);\
 
1142
CREATE INDEX alerts_6 on alerts (userid);\
 
1143
CREATE TABLE history (\
 
1144
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1145
        clock           integer         DEFAULT '0'     NOT NULL,\
1146
1146
        value           double(16,4)            DEFAULT '0.0000'        NOT NULL\
1147
 
)  ype=InnoDB;\
1148
 
CREATE INDEX his ory_1 on his ory (i emid,clock);\
1149
 
CREATE TABLE his ory_sync (\
1150
 
        id              bigin  unsigned                 NOT NULL        au o_incremen  unique,\
1151
 
        nodeid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1152
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1153
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
 
1147
) type=InnoDB;\
 
1148
CREATE INDEX history_1 on history (itemid,clock);\
 
1149
CREATE TABLE history_sync (\
 
1150
        id              bigint unsigned                 NOT NULL        auto_increment unique,\
 
1151
        nodeid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1152
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1153
        clock           integer         DEFAULT '0'     NOT NULL,\
1154
1154
        value           double(16,4)            DEFAULT '0.0000'        NOT NULL,\
1155
1155
        PRIMARY KEY (id)\
1156
 
)  ype=InnoDB;\
1157
 
CREATE INDEX his ory_sync_1 on his ory_sync (nodeid,id);\
1158
 
CREATE TABLE his ory_uin  (\
1159
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1160
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1161
 
        value           bigin  unsigned         DEFAULT '0'     NOT NULL\
1162
 
)  ype=InnoDB;\
1163
 
CREATE INDEX his ory_uin _1 on his ory_uin  (i emid,clock);\
1164
 
CREATE TABLE his ory_uin _sync (\
1165
 
        id              bigin  unsigned                 NOT NULL        au o_incremen  unique,\
1166
 
        nodeid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1167
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1168
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1169
 
        value           bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1156
) type=InnoDB;\
 
1157
CREATE INDEX history_sync_1 on history_sync (nodeid,id);\
 
1158
CREATE TABLE history_uint (\
 
1159
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1160
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1161
        value           bigint unsigned         DEFAULT '0'     NOT NULL\
 
1162
) type=InnoDB;\
 
1163
CREATE INDEX history_uint_1 on history_uint (itemid,clock);\
 
1164
CREATE TABLE history_uint_sync (\
 
1165
        id              bigint unsigned                 NOT NULL        auto_increment unique,\
 
1166
        nodeid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1167
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1168
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1169
        value           bigint unsigned         DEFAULT '0'     NOT NULL,\
1170
1170
        PRIMARY KEY (id)\
1171
 
)  ype=InnoDB;\
1172
 
CREATE INDEX his ory_uin _sync_1 on his ory_uin _sync (nodeid,id);\
1173
 
CREATE TABLE his ory_s r (\
1174
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1175
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
 
1171
) type=InnoDB;\
 
1172
CREATE INDEX history_uint_sync_1 on history_uint_sync (nodeid,id);\
 
1173
CREATE TABLE history_str (\
 
1174
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1175
        clock           integer         DEFAULT '0'     NOT NULL,\
1176
1176
        value           varchar(255)            DEFAULT ''      NOT NULL\
1177
 
)  ype=InnoDB;\
1178
 
CREATE INDEX his ory_s r_1 on his ory_s r (i emid,clock);\
1179
 
CREATE TABLE his ory_s r_sync (\
1180
 
        id              bigin  unsigned                 NOT NULL        au o_incremen  unique,\
1181
 
        nodeid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1182
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1183
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
 
1177
) type=InnoDB;\
 
1178
CREATE INDEX history_str_1 on history_str (itemid,clock);\
 
1179
CREATE TABLE history_str_sync (\
 
1180
        id              bigint unsigned                 NOT NULL        auto_increment unique,\
 
1181
        nodeid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1182
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1183
        clock           integer         DEFAULT '0'     NOT NULL,\
1184
1184
        value           varchar(255)            DEFAULT ''      NOT NULL,\
1185
1185
        PRIMARY KEY (id)\
1186
 
)  ype=InnoDB;\
1187
 
CREATE INDEX his ory_s r_sync_1 on his ory_s r_sync (nodeid,id);\
1188
 
CREATE TABLE his ory_log (\
1189
 
        id              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1190
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1191
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1192
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
1193
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
1194
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
1195
 
        value            ex                     NOT NULL,\
1196
 
        PRIMARY KEY (id)\
1197
 
)  ype=InnoDB;\
1198
 
CREATE INDEX his ory_log_1 on his ory_log (i emid,clock);\
1199
 
CREATE TABLE his ory_ ex  (\
1200
 
        id              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1201
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1202
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1203
 
        value            ex                     NOT NULL,\
1204
 
        PRIMARY KEY (id)\
1205
 
)  ype=InnoDB;\
1206
 
CREATE INDEX his ory_ ex _1 on his ory_ ex  (i emid,clock);\
1207
 
CREATE TABLE proxy_his ory (\
1208
 
        id              bigin  unsigned                 NOT NULL        au o_incremen  unique,\
1209
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1210
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1211
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
1212
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
1213
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
1214
 
        value            ex                     NOT NULL,\
1215
 
        PRIMARY KEY (id)\
1216
 
)  ype=InnoDB;\
1217
 
CREATE INDEX proxy_his ory_1 on proxy_his ory (clock);\
1218
 
CREATE TABLE proxy_dhis ory (\
1219
 
        id              bigin  unsigned                 NOT NULL        au o_incremen  unique,\
1220
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1221
 
        druleid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1222
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
 
1186
) type=InnoDB;\
 
1187
CREATE INDEX history_str_sync_1 on history_str_sync (nodeid,id);\
 
1188
CREATE TABLE history_log (\
 
1189
        id              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1190
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1191
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1192
        timestamp               integer         DEFAULT '0'     NOT NULL,\
 
1193
        source          varchar(64)             DEFAULT ''      NOT NULL,\
 
1194
        severity                integer         DEFAULT '0'     NOT NULL,\
 
1195
        value           text                    NOT NULL,\
 
1196
        PRIMARY KEY (id)\
 
1197
) type=InnoDB;\
 
1198
CREATE INDEX history_log_1 on history_log (itemid,clock);\
 
1199
CREATE UNIQUE INDEX history_log_2 on history_log (itemid,id);\
 
1200
CREATE TABLE history_text (\
 
1201
        id              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1202
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1203
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1204
        value           text                    NOT NULL,\
 
1205
        PRIMARY KEY (id)\
 
1206
) type=InnoDB;\
 
1207
CREATE INDEX history_text_1 on history_text (itemid,clock);\
 
1208
CREATE UNIQUE INDEX history_text_2 on history_text (itemid,id);\
 
1209
CREATE TABLE proxy_history (\
 
1210
        id              bigint unsigned                 NOT NULL        auto_increment unique,\
 
1211
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1212
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1213
        timestamp               integer         DEFAULT '0'     NOT NULL,\
 
1214
        source          varchar(64)             DEFAULT ''      NOT NULL,\
 
1215
        severity                integer         DEFAULT '0'     NOT NULL,\
 
1216
        value           text                    NOT NULL,\
 
1217
        PRIMARY KEY (id)\
 
1218
) type=InnoDB;\
 
1219
CREATE INDEX proxy_history_1 on proxy_history (clock);\
 
1220
CREATE TABLE proxy_dhistory (\
 
1221
        id              bigint unsigned                 NOT NULL        auto_increment unique,\
 
1222
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1223
        druleid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1224
        type            integer         DEFAULT '0'     NOT NULL,\
1223
1225
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
1224
 
        por             in eger         DEFAULT '0'     NOT NULL,\
 
1226
        port            integer         DEFAULT '0'     NOT NULL,\
1225
1227
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
1226
1228
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
1227
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
 
1229
        status          integer         DEFAULT '0'     NOT NULL,\
1228
1230
        PRIMARY KEY (id)\
1229
 
)  ype=InnoDB;\
1230
 
CREATE INDEX proxy_dhis ory_1 on proxy_dhis ory (clock);\
1231
 
CREATE TABLE even s (\
1232
 
        even id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1233
 
        source          in eger         DEFAULT '0'     NOT NULL,\
1234
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
1235
 
        objec id                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1236
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1237
 
        value           in eger         DEFAULT '0'     NOT NULL,\
1238
 
        acknowledged            in eger         DEFAULT '0'     NOT NULL,\
1239
 
        PRIMARY KEY (even id)\
1240
 
)  ype=InnoDB;\
1241
 
CREATE INDEX even s_1 on even s (objec ,objec id,even id);\
1242
 
CREATE INDEX even s_2 on even s (clock);\
1243
 
CREATE TABLE  rends (\
1244
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1245
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1246
 
        num             in eger         DEFAULT '0'     NOT NULL,\
 
1231
) type=InnoDB;\
 
1232
CREATE INDEX proxy_dhistory_1 on proxy_dhistory (clock);\
 
1233
CREATE TABLE events (\
 
1234
        eventid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1235
        source          integer         DEFAULT '0'     NOT NULL,\
 
1236
        object          integer         DEFAULT '0'     NOT NULL,\
 
1237
        objectid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1238
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1239
        value           integer         DEFAULT '0'     NOT NULL,\
 
1240
        acknowledged            integer         DEFAULT '0'     NOT NULL,\
 
1241
        PRIMARY KEY (eventid)\
 
1242
) type=InnoDB;\
 
1243
CREATE INDEX events_1 on events (object,objectid,eventid);\
 
1244
CREATE INDEX events_2 on events (clock);\
 
1245
CREATE TABLE trends (\
 
1246
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1247
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1248
        num             integer         DEFAULT '0'     NOT NULL,\
1247
1249
        value_min               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
1248
1250
        value_avg               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
1249
1251
        value_max               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
1250
 
        PRIMARY KEY (i emid,clock)\
1251
 
)  ype=InnoDB;\
1252
 
CREATE TABLE  rends_uin  (\
1253
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1254
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1255
 
        num             in eger         DEFAULT '0'     NOT NULL,\
1256
 
        value_min               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1257
 
        value_avg               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1258
 
        value_max               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1259
 
        PRIMARY KEY (i emid,clock)\
1260
 
)  ype=InnoDB;\
 
1252
        PRIMARY KEY (itemid,clock)\
 
1253
) type=InnoDB;\
 
1254
CREATE TABLE trends_uint (\
 
1255
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1256
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1257
        num             integer         DEFAULT '0'     NOT NULL,\
 
1258
        value_min               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1259
        value_avg               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1260
        value_max               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1261
        PRIMARY KEY (itemid,clock)\
 
1262
) type=InnoDB;\
1261
1263
CREATE TABLE acknowledges (\
1262
 
        acknowledgeid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1263
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1264
 
        even id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1265
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
 
1264
        acknowledgeid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1265
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1266
        eventid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1267
        clock           integer         DEFAULT '0'     NOT NULL,\
1266
1268
        message         varchar(255)            DEFAULT ''      NOT NULL,\
1267
1269
        PRIMARY KEY (acknowledgeid)\
1268
 
)  ype=InnoDB;\
 
1270
) type=InnoDB;\
1269
1271
CREATE INDEX acknowledges_1 on acknowledges (userid);\
1270
 
CREATE INDEX acknowledges_2 on acknowledges (even id);\
 
1272
CREATE INDEX acknowledges_2 on acknowledges (eventid);\
1271
1273
CREATE INDEX acknowledges_3 on acknowledges (clock);\
1272
 
CREATE TABLE audi log (\
1273
 
        audi id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1274
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1275
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1276
 
        ac ion          in eger         DEFAULT '0'     NOT NULL,\
1277
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
1278
 
        de ails         varchar(128)            DEFAULT '0'     NOT NULL,\
1279
 
        PRIMARY KEY (audi id)\
1280
 
)  ype=InnoDB;\
1281
 
CREATE INDEX audi log_1 on audi log (userid,clock);\
1282
 
CREATE INDEX audi log_2 on audi log (clock);\
 
1274
CREATE TABLE auditlog (\
 
1275
        auditid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1276
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1277
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1278
        action          integer         DEFAULT '0'     NOT NULL,\
 
1279
        resourcetype            integer         DEFAULT '0'     NOT NULL,\
 
1280
        details         varchar(128)            DEFAULT '0'     NOT NULL,\
 
1281
        PRIMARY KEY (auditid)\
 
1282
) type=InnoDB;\
 
1283
CREATE INDEX auditlog_1 on auditlog (userid,clock);\
 
1284
CREATE INDEX auditlog_2 on auditlog (clock);\
1283
1285
CREATE TABLE service_alarms (\
1284
 
        servicealarmid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1285
 
        serviceid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1286
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1287
 
        value           in eger         DEFAULT '0'     NOT NULL,\
 
1286
        servicealarmid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1287
        serviceid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1288
        clock           integer         DEFAULT '0'     NOT NULL,\
 
1289
        value           integer         DEFAULT '0'     NOT NULL,\
1288
1290
        PRIMARY KEY (servicealarmid)\
1289
 
)  ype=InnoDB;\
 
1291
) type=InnoDB;\
1290
1292
CREATE INDEX service_alarms_1 on service_alarms (serviceid,clock);\
1291
1293
CREATE INDEX service_alarms_2 on service_alarms (clock);\
1292
 
CREATE TABLE ac ions (\
1293
 
        ac ionid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1294
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
1295
 
        even source             in eger         DEFAULT '0'     NOT NULL,\
1296
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
1297
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1298
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
1299
 
        def_shor da a           varchar(255)            DEFAULT ''      NOT NULL,\
1300
 
        def_longda a            blob                    NOT NULL,\
1301
 
        recovery_msg            in eger         DEFAULT '0'     NOT NULL,\
1302
 
        r_shor da a             varchar(255)            DEFAULT ''      NOT NULL,\
1303
 
        r_longda a              blob                    NOT NULL,\
1304
 
        PRIMARY KEY (ac ionid)\
1305
 
)  ype=InnoDB;\
1306
 
CREATE TABLE opera ions (\
1307
 
        opera ionid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1308
 
        ac ionid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1309
 
        opera ion ype           in eger         DEFAULT '0'     NOT NULL,\
1310
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
1311
 
        objec id                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1312
 
        shor da a               varchar(255)            DEFAULT ''      NOT NULL,\
1313
 
        longda a                blob                    NOT NULL,\
1314
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
1315
 
        esc_s ep_from           in eger         DEFAULT '0'     NOT NULL,\
1316
 
        esc_s ep_ o             in eger         DEFAULT '0'     NOT NULL,\
1317
 
        defaul _msg             in eger         DEFAULT '0'     NOT NULL,\
1318
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
1319
 
        PRIMARY KEY (opera ionid)\
1320
 
)  ype=InnoDB;\
1321
 
CREATE INDEX opera ions_1 on opera ions (ac ionid);\
1322
 
CREATE TABLE opcondi ions (\
1323
 
        opcondi ionid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1324
 
        opera ionid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1325
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
1326
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
1327
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
1328
 
        PRIMARY KEY (opcondi ionid)\
1329
 
)  ype=InnoDB;\
1330
 
CREATE INDEX opcondi ions_1 on opcondi ions (opera ionid);\
1331
 
CREATE TABLE escala ions (\
1332
 
        escala ionid            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1333
 
        ac ionid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1334
 
         riggerid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1335
 
        even id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1336
 
        r_even id               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1337
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1338
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
1339
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1340
 
        PRIMARY KEY (escala ionid)\
1341
 
)  ype=InnoDB;\
1342
 
CREATE INDEX escala ions_1 on escala ions (ac ionid, riggerid);\
1343
 
CREATE TABLE applica ions (\
1344
 
        applica ionid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1345
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1346
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
1347
 
         empla eid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1348
 
        PRIMARY KEY (applica ionid)\
1349
 
)  ype=InnoDB;\
1350
 
CREATE INDEX applica ions_1 on applica ions ( empla eid);\
1351
 
CREATE UNIQUE INDEX applica ions_2 on applica ions (hos id,name);\
1352
 
CREATE TABLE condi ions (\
1353
 
        condi ionid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1354
 
        ac ionid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1355
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
1356
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
1357
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
1358
 
        PRIMARY KEY (condi ionid)\
1359
 
)  ype=InnoDB;\
1360
 
CREATE INDEX condi ions_1 on condi ions (ac ionid);\
 
1294
CREATE TABLE actions (\
 
1295
        actionid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1296
        name            varchar(255)            DEFAULT ''      NOT NULL,\
 
1297
        eventsource             integer         DEFAULT '0'     NOT NULL,\
 
1298
        evaltype                integer         DEFAULT '0'     NOT NULL,\
 
1299
        status          integer         DEFAULT '0'     NOT NULL,\
 
1300
        esc_period              integer         DEFAULT '0'     NOT NULL,\
 
1301
        def_shortdata           varchar(255)            DEFAULT ''      NOT NULL,\
 
1302
        def_longdata            blob                    NOT NULL,\
 
1303
        recovery_msg            integer         DEFAULT '0'     NOT NULL,\
 
1304
        r_shortdata             varchar(255)            DEFAULT ''      NOT NULL,\
 
1305
        r_longdata              blob                    NOT NULL,\
 
1306
        PRIMARY KEY (actionid)\
 
1307
) type=InnoDB;\
 
1308
CREATE TABLE operations (\
 
1309
        operationid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1310
        actionid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1311
        operationtype           integer         DEFAULT '0'     NOT NULL,\
 
1312
        object          integer         DEFAULT '0'     NOT NULL,\
 
1313
        objectid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1314
        shortdata               varchar(255)            DEFAULT ''      NOT NULL,\
 
1315
        longdata                blob                    NOT NULL,\
 
1316
        esc_period              integer         DEFAULT '0'     NOT NULL,\
 
1317
        esc_step_from           integer         DEFAULT '0'     NOT NULL,\
 
1318
        esc_step_to             integer         DEFAULT '0'     NOT NULL,\
 
1319
        default_msg             integer         DEFAULT '0'     NOT NULL,\
 
1320
        evaltype                integer         DEFAULT '0'     NOT NULL,\
 
1321
        PRIMARY KEY (operationid)\
 
1322
) type=InnoDB;\
 
1323
CREATE INDEX operations_1 on operations (actionid);\
 
1324
CREATE TABLE opconditions (\
 
1325
        opconditionid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1326
        operationid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1327
        conditiontype           integer         DEFAULT '0'     NOT NULL,\
 
1328
        operator                integer         DEFAULT '0'     NOT NULL,\
 
1329
        value           varchar(255)            DEFAULT ''      NOT NULL,\
 
1330
        PRIMARY KEY (opconditionid)\
 
1331
) type=InnoDB;\
 
1332
CREATE INDEX opconditions_1 on opconditions (operationid);\
 
1333
CREATE TABLE escalations (\
 
1334
        escalationid            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1335
        actionid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1336
        triggerid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1337
        eventid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1338
        r_eventid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1339
        nextcheck               integer         DEFAULT '0'     NOT NULL,\
 
1340
        esc_step                integer         DEFAULT '0'     NOT NULL,\
 
1341
        status          integer         DEFAULT '0'     NOT NULL,\
 
1342
        PRIMARY KEY (escalationid)\
 
1343
) type=InnoDB;\
 
1344
CREATE INDEX escalations_1 on escalations (actionid,triggerid);\
 
1345
CREATE TABLE applications (\
 
1346
        applicationid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1347
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1348
        name            varchar(255)            DEFAULT ''      NOT NULL,\
 
1349
        templateid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1350
        PRIMARY KEY (applicationid)\
 
1351
) type=InnoDB;\
 
1352
CREATE INDEX applications_1 on applications (templateid);\
 
1353
CREATE UNIQUE INDEX applications_2 on applications (hostid,name);\
 
1354
CREATE TABLE conditions (\
 
1355
        conditionid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1356
        actionid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1357
        conditiontype           integer         DEFAULT '0'     NOT NULL,\
 
1358
        operator                integer         DEFAULT '0'     NOT NULL,\
 
1359
        value           varchar(255)            DEFAULT ''      NOT NULL,\
 
1360
        PRIMARY KEY (conditionid)\
 
1361
) type=InnoDB;\
 
1362
CREATE INDEX conditions_1 on conditions (actionid);\
1361
1363
CREATE TABLE config (\
1362
 
        configid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1363
 
        aler _his ory           in eger         DEFAULT '0'     NOT NULL,\
1364
 
        even _his ory           in eger         DEFAULT '0'     NOT NULL,\
1365
 
        refresh_unsuppor ed             in eger         DEFAULT '0'     NOT NULL,\
 
1364
        configid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1365
        alert_history           integer         DEFAULT '0'     NOT NULL,\
 
1366
        event_history           integer         DEFAULT '0'     NOT NULL,\
 
1367
        refresh_unsupported             integer         DEFAULT '0'     NOT NULL,\
1366
1368
        work_period             varchar(100)            DEFAULT '1-5,00:00-24:00'       NOT NULL,\
1367
 
        aler _usrgrpid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1368
 
        even _ack_enable                in eger         DEFAULT '1'     NOT NULL,\
1369
 
        even _expire            in eger         DEFAULT '7'     NOT NULL,\
1370
 
        even _show_max          in eger         DEFAULT '100'   NOT NULL,\
1371
 
        defaul _ heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
1372
 
        au hen ica ion_ ype             in eger         DEFAULT 0       NOT NULL,\
1373
 
        ldap_hos                varchar(255)            DEFAULT ''      NOT NULL,\
1374
 
        ldap_por                in eger         DEFAULT 389     NOT NULL,\
 
1369
        alert_usrgrpid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1370
        event_ack_enable                integer         DEFAULT '1'     NOT NULL,\
 
1371
        event_expire            integer         DEFAULT '7'     NOT NULL,\
 
1372
        event_show_max          integer         DEFAULT '100'   NOT NULL,\
 
1373
        default_theme           varchar(128)            DEFAULT 'default.css'   NOT NULL,\
 
1374
        authentication_type             integer         DEFAULT 0       NOT NULL,\
 
1375
        ldap_host               varchar(255)            DEFAULT ''      NOT NULL,\
 
1376
        ldap_port               integer         DEFAULT 389     NOT NULL,\
1375
1377
        ldap_base_dn            varchar(255)            DEFAULT ''      NOT NULL,\
1376
1378
        ldap_bind_dn            varchar(255)            DEFAULT ''      NOT NULL,\
1377
1379
        ldap_bind_password              varchar(128)            DEFAULT ''      NOT NULL,\
1378
 
        ldap_search_a ribu e            varchar(128)            DEFAULT ''      NOT NULL,\
 
1380
        ldap_search_attribute           varchar(128)            DEFAULT ''      NOT NULL,\
1379
1381
        PRIMARY KEY (configid)\
1380
 
)  ype=InnoDB;\
1381
 
CREATE TABLE func ions (\
1382
 
        func ionid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1383
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1384
 
         riggerid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1385
 
        las value               varchar(255)                    ,\
1386
 
        func ion                varchar(12)             DEFAULT ''      NOT NULL,\
1387
 
        parame er               varchar(255)            DEFAULT '0'     NOT NULL,\
1388
 
        PRIMARY KEY (func ionid)\
1389
 
)  ype=InnoDB;\
1390
 
CREATE INDEX func ions_1 on func ions ( riggerid);\
1391
 
CREATE INDEX func ions_2 on func ions (i emid,func ion,parame er);\
 
1382
) type=InnoDB;\
 
1383
CREATE TABLE functions (\
 
1384
        functionid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1385
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1386
        triggerid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1387
        lastvalue               varchar(255)                    ,\
 
1388
        function                varchar(12)             DEFAULT ''      NOT NULL,\
 
1389
        parameter               varchar(255)            DEFAULT '0'     NOT NULL,\
 
1390
        PRIMARY KEY (functionid)\
 
1391
) type=InnoDB;\
 
1392
CREATE INDEX functions_1 on functions (triggerid);\
 
1393
CREATE INDEX functions_2 on functions (itemid,function,parameter);\
1392
1394
CREATE TABLE graphs (\
1393
 
        graphid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1395
        graphid         bigint unsigned         DEFAULT '0'     NOT NULL,\
1394
1396
        name            varchar(128)            DEFAULT ''      NOT NULL,\
1395
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
1396
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
1397
 
        yaxis ype               in eger         DEFAULT '0'     NOT NULL,\
 
1397
        width           integer         DEFAULT '0'     NOT NULL,\
 
1398
        height          integer         DEFAULT '0'     NOT NULL,\
 
1399
        yaxistype               integer         DEFAULT '0'     NOT NULL,\
1398
1400
        yaxismin                double(16,4)            DEFAULT '0'     NOT NULL,\
1399
1401
        yaxismax                double(16,4)            DEFAULT '0'     NOT NULL,\
1400
 
         empla eid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1401
 
        show_work_period                in eger         DEFAULT '1'     NOT NULL,\
1402
 
        show_ riggers           in eger         DEFAULT '1'     NOT NULL,\
1403
 
        graph ype               in eger         DEFAULT '0'     NOT NULL,\
1404
 
        show_legend             in eger         DEFAULT '0'     NOT NULL,\
1405
 
        show_3d         in eger         DEFAULT '0'     NOT NULL,\
1406
 
        percen _lef             double(16,4)            DEFAULT '0'     NOT NULL,\
1407
 
        percen _righ            double(16,4)            DEFAULT '0'     NOT NULL,\
 
1402
        templateid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1403
        show_work_period                integer         DEFAULT '1'     NOT NULL,\
 
1404
        show_triggers           integer         DEFAULT '1'     NOT NULL,\
 
1405
        graphtype               integer         DEFAULT '0'     NOT NULL,\
 
1406
        show_legend             integer         DEFAULT '0'     NOT NULL,\
 
1407
        show_3d         integer         DEFAULT '0'     NOT NULL,\
 
1408
        percent_left            double(16,4)            DEFAULT '0'     NOT NULL,\
 
1409
        percent_right           double(16,4)            DEFAULT '0'     NOT NULL,\
1408
1410
        PRIMARY KEY (graphid)\
1409
 
)  ype=InnoDB;\
 
1411
) type=InnoDB;\
1410
1412
CREATE INDEX graphs_graphs_1 on graphs (name);\
1411
 
CREATE TABLE graphs_i ems (\
1412
 
        gi emid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1413
 
        graphid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1414
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1415
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
1416
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
 
1413
CREATE TABLE graphs_items (\
 
1414
        gitemid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1415
        graphid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1416
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1417
        drawtype                integer         DEFAULT '0'     NOT NULL,\
 
1418
        sortorder               integer         DEFAULT '0'     NOT NULL,\
1417
1419
        color           varchar(32)             DEFAULT '009600'        NOT NULL,\
1418
 
        yaxisside               in eger         DEFAULT '1'     NOT NULL,\
1419
 
        calc_fnc                in eger         DEFAULT '2'     NOT NULL,\
1420
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1421
 
        periods_cn              in eger         DEFAULT '5'     NOT NULL,\
1422
 
        PRIMARY KEY (gi emid)\
1423
 
)  ype=InnoDB;\
 
1420
        yaxisside               integer         DEFAULT '1'     NOT NULL,\
 
1421
        calc_fnc                integer         DEFAULT '2'     NOT NULL,\
 
1422
        type            integer         DEFAULT '0'     NOT NULL,\
 
1423
        periods_cnt             integer         DEFAULT '5'     NOT NULL,\
 
1424
        PRIMARY KEY (gitemid)\
 
1425
) type=InnoDB;\
 
1426
CREATE INDEX graphs_items_1 on graphs_items (itemid);\
 
1427
CREATE INDEX graphs_items_2 on graphs_items (graphid);\
1424
1428
CREATE TABLE groups (\
1425
 
        groupid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1429
        groupid         bigint unsigned         DEFAULT '0'     NOT NULL,\
1426
1430
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1427
1431
        PRIMARY KEY (groupid)\
1428
 
)  ype=InnoDB;\
 
1432
) type=InnoDB;\
1429
1433
CREATE INDEX groups_1 on groups (name);\
1430
 
CREATE TABLE help_i ems (\
1431
 
        i em ype                in eger         DEFAULT '0'     NOT NULL,\
 
1434
CREATE TABLE help_items (\
 
1435
        itemtype                integer         DEFAULT '0'     NOT NULL,\
1432
1436
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
1433
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
1434
 
        PRIMARY KEY (i em ype,key_)\
1435
 
)  ype=InnoDB;\
1436
 
CREATE TABLE hos s (\
1437
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1438
 
        proxy_hos id            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1439
 
        hos             varchar(64)             DEFAULT ''      NOT NULL,\
 
1437
        description             varchar(255)            DEFAULT ''      NOT NULL,\
 
1438
        PRIMARY KEY (itemtype,key_)\
 
1439
) type=InnoDB;\
 
1440
CREATE TABLE hosts (\
 
1441
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1442
        proxy_hostid            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1443
        host            varchar(64)             DEFAULT ''      NOT NULL,\
1440
1444
        dns             varchar(64)             DEFAULT ''      NOT NULL,\
1441
 
        useip           in eger         DEFAULT '1'     NOT NULL,\
 
1445
        useip           integer         DEFAULT '1'     NOT NULL,\
1442
1446
        ip              varchar(39)             DEFAULT '127.0.0.1'     NOT NULL,\
1443
 
        por             in eger         DEFAULT '10050' NOT NULL,\
1444
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1445
 
        disable_un il           in eger         DEFAULT '0'     NOT NULL,\
 
1447
        port            integer         DEFAULT '10050' NOT NULL,\
 
1448
        status          integer         DEFAULT '0'     NOT NULL,\
 
1449
        disable_until           integer         DEFAULT '0'     NOT NULL,\
1446
1450
        error           varchar(128)            DEFAULT ''      NOT NULL,\
1447
 
        available               in eger         DEFAULT '0'     NOT NULL,\
1448
 
        errors_from             in eger         DEFAULT '0'     NOT NULL,\
1449
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
1450
 
        inby es         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1451
 
        ou by es                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1452
 
        useipmi         in eger         DEFAULT '0'     NOT NULL,\
1453
 
        ipmi_por                in eger         DEFAULT '623'   NOT NULL,\
1454
 
        ipmi_au h ype           in eger         DEFAULT '0'     NOT NULL,\
1455
 
        ipmi_privilege          in eger         DEFAULT '2'     NOT NULL,\
 
1451
        available               integer         DEFAULT '0'     NOT NULL,\
 
1452
        errors_from             integer         DEFAULT '0'     NOT NULL,\
 
1453
        lastaccess              integer         DEFAULT '0'     NOT NULL,\
 
1454
        inbytes         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1455
        outbytes                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1456
        useipmi         integer         DEFAULT '0'     NOT NULL,\
 
1457
        ipmi_port               integer         DEFAULT '623'   NOT NULL,\
 
1458
        ipmi_authtype           integer         DEFAULT '0'     NOT NULL,\
 
1459
        ipmi_privilege          integer         DEFAULT '2'     NOT NULL,\
1456
1460
        ipmi_username           varchar(16)             DEFAULT ''      NOT NULL,\
1457
1461
        ipmi_password           varchar(20)             DEFAULT ''      NOT NULL,\
1458
 
        ipmi_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
1459
 
        ipmi_available          in eger         DEFAULT '0'     NOT NULL,\
1460
 
        snmp_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
1461
 
        snmp_available          in eger         DEFAULT '0'     NOT NULL,\
1462
 
        PRIMARY KEY (hos id)\
1463
 
)  ype=InnoDB;\
1464
 
CREATE INDEX hos s_1 on hos s (hos );\
1465
 
CREATE INDEX hos s_2 on hos s (s a us);\
1466
 
CREATE INDEX hos s_3 on hos s (proxy_hos id);\
1467
 
CREATE TABLE hos s_groups (\
1468
 
        hos groupid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1469
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1470
 
        groupid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1471
 
        PRIMARY KEY (hos groupid)\
1472
 
)  ype=InnoDB;\
1473
 
CREATE INDEX hos s_groups_groups_1 on hos s_groups (hos id,groupid);\
1474
 
CREATE TABLE hos s_profiles (\
1475
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1476
 
        device ype              varchar(64)             DEFAULT ''      NOT NULL,\
 
1462
        ipmi_disable_until              integer         DEFAULT '0'     NOT NULL,\
 
1463
        ipmi_available          integer         DEFAULT '0'     NOT NULL,\
 
1464
        snmp_disable_until              integer         DEFAULT '0'     NOT NULL,\
 
1465
        snmp_available          integer         DEFAULT '0'     NOT NULL,\
 
1466
        PRIMARY KEY (hostid)\
 
1467
) type=InnoDB;\
 
1468
CREATE INDEX hosts_1 on hosts (host);\
 
1469
CREATE INDEX hosts_2 on hosts (status);\
 
1470
CREATE INDEX hosts_3 on hosts (proxy_hostid);\
 
1471
CREATE TABLE hosts_groups (\
 
1472
        hostgroupid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1473
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1474
        groupid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1475
        PRIMARY KEY (hostgroupid)\
 
1476
) type=InnoDB;\
 
1477
CREATE INDEX hosts_groups_groups_1 on hosts_groups (hostid,groupid);\
 
1478
CREATE TABLE hosts_profiles (\
 
1479
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1480
        devicetype              varchar(64)             DEFAULT ''      NOT NULL,\
1477
1481
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1478
1482
        os              varchar(64)             DEFAULT ''      NOT NULL,\
1479
1483
        serialno                varchar(64)             DEFAULT ''      NOT NULL,\
1480
 
         ag             varchar(64)             DEFAULT ''      NOT NULL,\
 
1484
        tag             varchar(64)             DEFAULT ''      NOT NULL,\
1481
1485
        macaddress              varchar(64)             DEFAULT ''      NOT NULL,\
1482
1486
        hardware                blob                    NOT NULL,\
1483
 
        sof ware                blob                    NOT NULL,\
1484
 
        con ac          blob                    NOT NULL,\
1485
 
        loca ion                blob                    NOT NULL,\
1486
 
        no es           blob                    NOT NULL,\
1487
 
        PRIMARY KEY (hos id)\
1488
 
)  ype=InnoDB;\
1489
 
CREATE TABLE hos s_profiles_ex  (\
1490
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1487
        software                blob                    NOT NULL,\
 
1488
        contact         blob                    NOT NULL,\
 
1489
        location                blob                    NOT NULL,\
 
1490
        notes           blob                    NOT NULL,\
 
1491
        PRIMARY KEY (hostid)\
 
1492
) type=InnoDB;\
 
1493
CREATE TABLE hosts_profiles_ext (\
 
1494
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
1491
1495
        device_alias            varchar(64)             DEFAULT ''      NOT NULL,\
1492
 
        device_ ype             varchar(64)             DEFAULT ''      NOT NULL,\
 
1496
        device_type             varchar(64)             DEFAULT ''      NOT NULL,\
1493
1497
        device_chassis          varchar(64)             DEFAULT ''      NOT NULL,\
1494
1498
        device_os               varchar(64)             DEFAULT ''      NOT NULL,\
1495
 
        device_os_shor          varchar(64)             DEFAULT ''      NOT NULL,\
 
1499
        device_os_short         varchar(64)             DEFAULT ''      NOT NULL,\
1496
1500
        device_hw_arch          varchar(32)             DEFAULT ''      NOT NULL,\
1497
1501
        device_serial           varchar(64)             DEFAULT ''      NOT NULL,\
1498
1502
        device_model            varchar(64)             DEFAULT ''      NOT NULL,\
1499
 
        device_ ag              varchar(64)             DEFAULT ''      NOT NULL,\
 
1503
        device_tag              varchar(64)             DEFAULT ''      NOT NULL,\
1500
1504
        device_vendor           varchar(64)             DEFAULT ''      NOT NULL,\
1501
 
        device_con rac          varchar(64)             DEFAULT ''      NOT NULL,\
 
1505
        device_contract         varchar(64)             DEFAULT ''      NOT NULL,\
1502
1506
        device_who              varchar(64)             DEFAULT ''      NOT NULL,\
1503
 
        device_s a us           varchar(64)             DEFAULT ''      NOT NULL,\
 
1507
        device_status           varchar(64)             DEFAULT ''      NOT NULL,\
1504
1508
        device_app_01           varchar(64)             DEFAULT ''      NOT NULL,\
1505
1509
        device_app_02           varchar(64)             DEFAULT ''      NOT NULL,\
1506
1510
        device_app_03           varchar(64)             DEFAULT ''      NOT NULL,\
1509
1513
        device_url_1            varchar(255)            DEFAULT ''      NOT NULL,\
1510
1514
        device_url_2            varchar(255)            DEFAULT ''      NOT NULL,\
1511
1515
        device_url_3            varchar(255)            DEFAULT ''      NOT NULL,\
1512
 
        device_ne works         blob                    NOT NULL,\
1513
 
        device_no es            blob                    NOT NULL,\
 
1516
        device_networks         blob                    NOT NULL,\
 
1517
        device_notes            blob                    NOT NULL,\
1514
1518
        device_hardware         blob                    NOT NULL,\
1515
 
        device_sof ware         blob                    NOT NULL,\
1516
 
        ip_subne _mask          varchar(39)             DEFAULT ''      NOT NULL,\
1517
 
        ip_rou er               varchar(39)             DEFAULT ''      NOT NULL,\
 
1519
        device_software         blob                    NOT NULL,\
 
1520
        ip_subnet_mask          varchar(39)             DEFAULT ''      NOT NULL,\
 
1521
        ip_router               varchar(39)             DEFAULT ''      NOT NULL,\
1518
1522
        ip_macaddress           varchar(64)             DEFAULT ''      NOT NULL,\
1519
1523
        oob_ip          varchar(39)             DEFAULT ''      NOT NULL,\
1520
 
        oob_subne _mask         varchar(39)             DEFAULT ''      NOT NULL,\
1521
 
        oob_rou er              varchar(39)             DEFAULT ''      NOT NULL,\
1522
 
        da e_hw_buy             varchar(64)             DEFAULT ''      NOT NULL,\
1523
 
        da e_hw_ins all         varchar(64)             DEFAULT ''      NOT NULL,\
1524
 
        da e_hw_expiry          varchar(64)             DEFAULT ''      NOT NULL,\
1525
 
        da e_hw_decomm          varchar(64)             DEFAULT ''      NOT NULL,\
1526
 
        si e_s ree _1           varchar(128)            DEFAULT ''      NOT NULL,\
1527
 
        si e_s ree _2           varchar(128)            DEFAULT ''      NOT NULL,\
1528
 
        si e_s ree _3           varchar(128)            DEFAULT ''      NOT NULL,\
1529
 
        si e_ci y               varchar(128)            DEFAULT ''      NOT NULL,\
1530
 
        si e_s a e              varchar(64)             DEFAULT ''      NOT NULL,\
1531
 
        si e_coun ry            varchar(64)             DEFAULT ''      NOT NULL,\
1532
 
        si e_zip                varchar(64)             DEFAULT ''      NOT NULL,\
1533
 
        si e_rack               varchar(128)            DEFAULT ''      NOT NULL,\
1534
 
        si e_no es              blob                    NOT NULL,\
 
1524
        oob_subnet_mask         varchar(39)             DEFAULT ''      NOT NULL,\
 
1525
        oob_router              varchar(39)             DEFAULT ''      NOT NULL,\
 
1526
        date_hw_buy             varchar(64)             DEFAULT ''      NOT NULL,\
 
1527
        date_hw_install         varchar(64)             DEFAULT ''      NOT NULL,\
 
1528
        date_hw_expiry          varchar(64)             DEFAULT ''      NOT NULL,\
 
1529
        date_hw_decomm          varchar(64)             DEFAULT ''      NOT NULL,\
 
1530
        site_street_1           varchar(128)            DEFAULT ''      NOT NULL,\
 
1531
        site_street_2           varchar(128)            DEFAULT ''      NOT NULL,\
 
1532
        site_street_3           varchar(128)            DEFAULT ''      NOT NULL,\
 
1533
        site_city               varchar(128)            DEFAULT ''      NOT NULL,\
 
1534
        site_state              varchar(64)             DEFAULT ''      NOT NULL,\
 
1535
        site_country            varchar(64)             DEFAULT ''      NOT NULL,\
 
1536
        site_zip                varchar(64)             DEFAULT ''      NOT NULL,\
 
1537
        site_rack               varchar(128)            DEFAULT ''      NOT NULL,\
 
1538
        site_notes              blob                    NOT NULL,\
1535
1539
        poc_1_name              varchar(128)            DEFAULT ''      NOT NULL,\
1536
1540
        poc_1_email             varchar(128)            DEFAULT ''      NOT NULL,\
1537
1541
        poc_1_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
1538
1542
        poc_1_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
1539
1543
        poc_1_cell              varchar(64)             DEFAULT ''      NOT NULL,\
1540
1544
        poc_1_screen            varchar(64)             DEFAULT ''      NOT NULL,\
1541
 
        poc_1_no es             blob                    NOT NULL,\
 
1545
        poc_1_notes             blob                    NOT NULL,\
1542
1546
        poc_2_name              varchar(128)            DEFAULT ''      NOT NULL,\
1543
1547
        poc_2_email             varchar(128)            DEFAULT ''      NOT NULL,\
1544
1548
        poc_2_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
1545
1549
        poc_2_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
1546
1550
        poc_2_cell              varchar(64)             DEFAULT ''      NOT NULL,\
1547
1551
        poc_2_screen            varchar(64)             DEFAULT ''      NOT NULL,\
1548
 
        poc_2_no es             blob                    NOT NULL,\
1549
 
        PRIMARY KEY (hos id)\
1550
 
)  ype=InnoDB;\
1551
 
CREATE TABLE hos s_ empla es (\
1552
 
        hos empla eid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1553
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1554
 
         empla eid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1555
 
        PRIMARY KEY (hos empla eid)\
1556
 
)  ype=InnoDB;\
1557
 
CREATE UNIQUE INDEX hos s_ empla es_1 on hos s_ empla es (hos id, empla eid);\
 
1552
        poc_2_notes             blob                    NOT NULL,\
 
1553
        PRIMARY KEY (hostid)\
 
1554
) type=InnoDB;\
 
1555
CREATE TABLE hosts_templates (\
 
1556
        hosttemplateid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1557
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1558
        templateid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1559
        PRIMARY KEY (hosttemplateid)\
 
1560
) type=InnoDB;\
 
1561
CREATE UNIQUE INDEX hosts_templates_1 on hosts_templates (hostid,templateid);\
1558
1562
CREATE TABLE housekeeper (\
1559
 
        housekeeperid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1560
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
 
1563
        housekeeperid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1564
        tablename               varchar(64)             DEFAULT ''      NOT NULL,\
1561
1565
        field           varchar(64)             DEFAULT ''      NOT NULL,\
1562
 
        value           bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1566
        value           bigint unsigned         DEFAULT '0'     NOT NULL,\
1563
1567
        PRIMARY KEY (housekeeperid)\
1564
 
)  ype=InnoDB;\
 
1568
) type=InnoDB;\
1565
1569
CREATE TABLE images (\
1566
 
        imageid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1567
 
        image ype               in eger         DEFAULT '0'     NOT NULL,\
 
1570
        imageid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1571
        imagetype               integer         DEFAULT '0'     NOT NULL,\
1568
1572
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
1569
1573
        image           longblob                        NOT NULL,\
1570
1574
        PRIMARY KEY (imageid)\
1571
 
)  ype=InnoDB;\
1572
 
CREATE INDEX images_1 on images (image ype,name);\
1573
 
CREATE TABLE i ems (\
1574
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1575
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1576
 
        snmp_communi y          varchar(64)             DEFAULT ''      NOT NULL,\
 
1575
) type=InnoDB;\
 
1576
CREATE INDEX images_1 on images (imagetype,name);\
 
1577
CREATE TABLE items (\
 
1578
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1579
        type            integer         DEFAULT '0'     NOT NULL,\
 
1580
        snmp_community          varchar(64)             DEFAULT ''      NOT NULL,\
1577
1581
        snmp_oid                varchar(255)            DEFAULT ''      NOT NULL,\
1578
 
        snmp_por                in eger         DEFAULT '161'   NOT NULL,\
1579
 
        hos id          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1580
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
 
1582
        snmp_port               integer         DEFAULT '161'   NOT NULL,\
 
1583
        hostid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1584
        description             varchar(255)            DEFAULT ''      NOT NULL,\
1581
1585
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
1582
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
1583
 
        his ory         in eger         DEFAULT '90'    NOT NULL,\
1584
 
         rends          in eger         DEFAULT '365'   NOT NULL,\
1585
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1586
 
        las value               varchar(255)                    NULL,\
1587
 
        las clock               in eger                 NULL,\
 
1586
        delay           integer         DEFAULT '0'     NOT NULL,\
 
1587
        history         integer         DEFAULT '90'    NOT NULL,\
 
1588
        trends          integer         DEFAULT '365'   NOT NULL,\
 
1589
        nextcheck               integer         DEFAULT '0'     NOT NULL,\
 
1590
        lastvalue               varchar(255)                    NULL,\
 
1591
        lastclock               integer                 NULL,\
1588
1592
        prevvalue               varchar(255)                    NULL,\
1589
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1590
 
        value_ ype              in eger         DEFAULT '0'     NOT NULL,\
1591
 
         rapper_hos s           varchar(255)            DEFAULT ''      NOT NULL,\
1592
 
        uni s           varchar(10)             DEFAULT ''      NOT NULL,\
1593
 
        mul iplier              in eger         DEFAULT '0'     NOT NULL,\
1594
 
        del a           in eger         DEFAULT '0'     NOT NULL,\
 
1593
        status          integer         DEFAULT '0'     NOT NULL,\
 
1594
        value_type              integer         DEFAULT '0'     NOT NULL,\
 
1595
        trapper_hosts           varchar(255)            DEFAULT ''      NOT NULL,\
 
1596
        units           varchar(10)             DEFAULT ''      NOT NULL,\
 
1597
        multiplier              integer         DEFAULT '0'     NOT NULL,\
 
1598
        delta           integer         DEFAULT '0'     NOT NULL,\
1595
1599
        prevorgvalue            varchar(255)                    NULL,\
1596
 
        snmpv3_securi yname             varchar(64)             DEFAULT ''      NOT NULL,\
1597
 
        snmpv3_securi ylevel            in eger         DEFAULT '0'     NOT NULL,\
1598
 
        snmpv3_au hpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
 
1600
        snmpv3_securityname             varchar(64)             DEFAULT ''      NOT NULL,\
 
1601
        snmpv3_securitylevel            integer         DEFAULT '0'     NOT NULL,\
 
1602
        snmpv3_authpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
1599
1603
        snmpv3_privpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
1600
1604
        formula         varchar(255)            DEFAULT '1'     NOT NULL,\
1601
1605
        error           varchar(128)            DEFAULT ''      NOT NULL,\
1602
 
        las logsize             in eger         DEFAULT '0'     NOT NULL,\
1603
 
        log imefm               varchar(64)             DEFAULT ''      NOT NULL,\
1604
 
         empla eid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1605
 
        valuemapid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1606
        lastlogsize             integer         DEFAULT '0'     NOT NULL,\
 
1607
        logtimefmt              varchar(64)             DEFAULT ''      NOT NULL,\
 
1608
        templateid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1609
        valuemapid              bigint unsigned         DEFAULT '0'     NOT NULL,\
1606
1610
        delay_flex              varchar(255)            DEFAULT ''      NOT NULL,\
1607
 
        params           ex                     NOT NULL,\
 
1611
        params          text                    NOT NULL,\
1608
1612
        ipmi_sensor             varchar(128)            DEFAULT ''      NOT NULL,\
1609
 
        PRIMARY KEY (i emid)\
1610
 
)  ype=InnoDB;\
1611
 
CREATE UNIQUE INDEX i ems_1 on i ems (hos id,key_);\
1612
 
CREATE INDEX i ems_2 on i ems (nex check);\
1613
 
CREATE INDEX i ems_3 on i ems (s a us);\
1614
 
CREATE INDEX i ems_4 on i ems ( empla eid);\
1615
 
CREATE TABLE i ems_applica ions (\
1616
 
        i emappid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1617
 
        applica ionid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1618
 
        i emid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1619
 
        PRIMARY KEY (i emappid)\
1620
 
)  ype=InnoDB;\
1621
 
CREATE INDEX i ems_applica ions_1 on i ems_applica ions (applica ionid,i emid);\
1622
 
CREATE INDEX i ems_applica ions_2 on i ems_applica ions (i emid);\
 
1613
        PRIMARY KEY (itemid)\
 
1614
) type=InnoDB;\
 
1615
CREATE UNIQUE INDEX items_1 on items (hostid,key_);\
 
1616
CREATE INDEX items_2 on items (nextcheck);\
 
1617
CREATE INDEX items_3 on items (status);\
 
1618
CREATE INDEX items_4 on items (templateid);\
 
1619
CREATE TABLE items_applications (\
 
1620
        itemappid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1621
        applicationid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1622
        itemid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1623
        PRIMARY KEY (itemappid)\
 
1624
) type=InnoDB;\
 
1625
CREATE INDEX items_applications_1 on items_applications (applicationid,itemid);\
 
1626
CREATE INDEX items_applications_2 on items_applications (itemid);\
1623
1627
CREATE TABLE mappings (\
1624
 
        mappingid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1625
 
        valuemapid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1628
        mappingid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1629
        valuemapid              bigint unsigned         DEFAULT '0'     NOT NULL,\
1626
1630
        value           varchar(64)             DEFAULT ''      NOT NULL,\
1627
1631
        newvalue                varchar(64)             DEFAULT ''      NOT NULL,\
1628
1632
        PRIMARY KEY (mappingid)\
1629
 
)  ype=InnoDB;\
 
1633
) type=InnoDB;\
1630
1634
CREATE INDEX mappings_1 on mappings (valuemapid);\
1631
1635
CREATE TABLE media (\
1632
 
        mediaid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1633
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1634
 
        media ypeid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1635
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
1636
 
        ac ive          in eger         DEFAULT '0'     NOT NULL,\
1637
 
        severi y                in eger         DEFAULT '63'    NOT NULL,\
 
1636
        mediaid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1637
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1638
        mediatypeid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1639
        sendto          varchar(100)            DEFAULT ''      NOT NULL,\
 
1640
        active          integer         DEFAULT '0'     NOT NULL,\
 
1641
        severity                integer         DEFAULT '63'    NOT NULL,\
1638
1642
        period          varchar(100)            DEFAULT '1-7,00:00-23:59'       NOT NULL,\
1639
1643
        PRIMARY KEY (mediaid)\
1640
 
)  ype=InnoDB;\
 
1644
) type=InnoDB;\
1641
1645
CREATE INDEX media_1 on media (userid);\
1642
 
CREATE INDEX media_2 on media (media ypeid);\
1643
 
CREATE TABLE media_ ype (\
1644
 
        media ypeid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1645
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1646
 
        descrip ion             varchar(100)            DEFAULT ''      NOT NULL,\
1647
 
        sm p_server             varchar(255)            DEFAULT ''      NOT NULL,\
1648
 
        sm p_helo               varchar(255)            DEFAULT ''      NOT NULL,\
1649
 
        sm p_email              varchar(255)            DEFAULT ''      NOT NULL,\
1650
 
        exec_pa h               varchar(255)            DEFAULT ''      NOT NULL,\
 
1646
CREATE INDEX media_2 on media (mediatypeid);\
 
1647
CREATE TABLE media_type (\
 
1648
        mediatypeid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1649
        type            integer         DEFAULT '0'     NOT NULL,\
 
1650
        description             varchar(100)            DEFAULT ''      NOT NULL,\
 
1651
        smtp_server             varchar(255)            DEFAULT ''      NOT NULL,\
 
1652
        smtp_helo               varchar(255)            DEFAULT ''      NOT NULL,\
 
1653
        smtp_email              varchar(255)            DEFAULT ''      NOT NULL,\
 
1654
        exec_path               varchar(255)            DEFAULT ''      NOT NULL,\
1651
1655
        gsm_modem               varchar(255)            DEFAULT ''      NOT NULL,\
1652
1656
        username                varchar(255)            DEFAULT ''      NOT NULL,\
1653
1657
        passwd          varchar(255)            DEFAULT ''      NOT NULL,\
1654
 
        PRIMARY KEY (media ypeid)\
1655
 
)  ype=InnoDB;\
 
1658
        PRIMARY KEY (mediatypeid)\
 
1659
) type=InnoDB;\
1656
1660
CREATE TABLE profiles (\
1657
 
        profileid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1658
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1661
        profileid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1662
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
1659
1663
        idx             varchar(96)             DEFAULT ''      NOT NULL,\
1660
 
        idx2            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1661
 
        value_id                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1662
 
        value_in                in eger         DEFAULT '0'     NOT NULL,\
1663
 
        value_s r               varchar(255)            DEFAULT ''      NOT NULL,\
 
1664
        idx2            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1665
        value_id                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1666
        value_int               integer         DEFAULT '0'     NOT NULL,\
 
1667
        value_str               varchar(255)            DEFAULT ''      NOT NULL,\
1664
1668
        source          varchar(96)             DEFAULT ''      NOT NULL,\
1665
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
 
1669
        type            integer         DEFAULT '0'     NOT NULL,\
1666
1670
        PRIMARY KEY (profileid)\
1667
 
)  ype=InnoDB;\
 
1671
) type=InnoDB;\
1668
1672
CREATE INDEX profiles_1 on profiles (userid,idx,idx2);\
1669
 
CREATE TABLE righ s (\
1670
 
        righ id         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1671
 
        groupid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1672
 
        permission              in eger         DEFAULT '0'     NOT NULL,\
1673
 
        id              bigin  unsigned                 ,\
1674
 
        PRIMARY KEY (righ id)\
1675
 
)  ype=InnoDB;\
1676
 
CREATE INDEX righ s_1 on righ s (groupid);\
1677
 
CREATE TABLE scrip s (\
1678
 
        scrip id                bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1673
CREATE TABLE rights (\
 
1674
        rightid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1675
        groupid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1676
        permission              integer         DEFAULT '0'     NOT NULL,\
 
1677
        id              bigint unsigned                 ,\
 
1678
        PRIMARY KEY (rightid)\
 
1679
) type=InnoDB;\
 
1680
CREATE INDEX rights_1 on rights (groupid);\
 
1681
CREATE TABLE scripts (\
 
1682
        scriptid                bigint unsigned         DEFAULT '0'     NOT NULL,\
1679
1683
        name            varchar(255)            DEFAULT ''      NOT NULL,\
1680
1684
        command         varchar(255)            DEFAULT ''      NOT NULL,\
1681
 
        hos _access             in eger         DEFAULT '2'     NOT NULL,\
1682
 
        usrgrpid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1683
 
        groupid         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1684
 
        PRIMARY KEY (scrip id)\
1685
 
)  ype=InnoDB;\
 
1685
        host_access             integer         DEFAULT '2'     NOT NULL,\
 
1686
        usrgrpid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1687
        groupid         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1688
        PRIMARY KEY (scriptid)\
 
1689
) type=InnoDB;\
1686
1690
CREATE TABLE screens (\
1687
 
        screenid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1691
        screenid                bigint unsigned         DEFAULT '0'     NOT NULL,\
1688
1692
        name            varchar(255)            DEFAULT 'Screen'        NOT NULL,\
1689
 
        hsize           in eger         DEFAULT '1'     NOT NULL,\
1690
 
        vsize           in eger         DEFAULT '1'     NOT NULL,\
 
1693
        hsize           integer         DEFAULT '1'     NOT NULL,\
 
1694
        vsize           integer         DEFAULT '1'     NOT NULL,\
1691
1695
        PRIMARY KEY (screenid)\
1692
 
)  ype=InnoDB;\
1693
 
CREATE TABLE screens_i ems (\
1694
 
        screeni emid            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1695
 
        screenid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1696
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
1697
 
        resourceid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1698
 
        wid h           in eger         DEFAULT '320'   NOT NULL,\
1699
 
        heigh           in eger         DEFAULT '200'   NOT NULL,\
1700
 
        x               in eger         DEFAULT '0'     NOT NULL,\
1701
 
        y               in eger         DEFAULT '0'     NOT NULL,\
1702
 
        colspan         in eger         DEFAULT '0'     NOT NULL,\
1703
 
        rowspan         in eger         DEFAULT '0'     NOT NULL,\
1704
 
        elemen s                in eger         DEFAULT '25'    NOT NULL,\
1705
 
        valign          in eger         DEFAULT '0'     NOT NULL,\
1706
 
        halign          in eger         DEFAULT '0'     NOT NULL,\
1707
 
        s yle           in eger         DEFAULT '0'     NOT NULL,\
 
1696
) type=InnoDB;\
 
1697
CREATE TABLE screens_items (\
 
1698
        screenitemid            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1699
        screenid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1700
        resourcetype            integer         DEFAULT '0'     NOT NULL,\
 
1701
        resourceid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1702
        width           integer         DEFAULT '320'   NOT NULL,\
 
1703
        height          integer         DEFAULT '200'   NOT NULL,\
 
1704
        x               integer         DEFAULT '0'     NOT NULL,\
 
1705
        y               integer         DEFAULT '0'     NOT NULL,\
 
1706
        colspan         integer         DEFAULT '0'     NOT NULL,\
 
1707
        rowspan         integer         DEFAULT '0'     NOT NULL,\
 
1708
        elements                integer         DEFAULT '25'    NOT NULL,\
 
1709
        valign          integer         DEFAULT '0'     NOT NULL,\
 
1710
        halign          integer         DEFAULT '0'     NOT NULL,\
 
1711
        style           integer         DEFAULT '0'     NOT NULL,\
1708
1712
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1709
 
        dynamic         in eger         DEFAULT '0'     NOT NULL,\
1710
 
        PRIMARY KEY (screeni emid)\
1711
 
)  ype=InnoDB;\
 
1713
        dynamic         integer         DEFAULT '0'     NOT NULL,\
 
1714
        PRIMARY KEY (screenitemid)\
 
1715
) type=InnoDB;\
1712
1716
CREATE TABLE services (\
1713
 
        serviceid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1717
        serviceid               bigint unsigned         DEFAULT '0'     NOT NULL,\
1714
1718
        name            varchar(128)            DEFAULT ''      NOT NULL,\
1715
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1716
 
        algori hm               in eger         DEFAULT '0'     NOT NULL,\
1717
 
         riggerid               bigin  unsigned                 ,\
1718
 
        showsla         in eger         DEFAULT '0'     NOT NULL,\
 
1719
        status          integer         DEFAULT '0'     NOT NULL,\
 
1720
        algorithm               integer         DEFAULT '0'     NOT NULL,\
 
1721
        triggerid               bigint unsigned                 ,\
 
1722
        showsla         integer         DEFAULT '0'     NOT NULL,\
1719
1723
        goodsla         double(16,4)            DEFAULT '99.9'  NOT NULL,\
1720
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
 
1724
        sortorder               integer         DEFAULT '0'     NOT NULL,\
1721
1725
        PRIMARY KEY (serviceid)\
1722
 
)  ype=InnoDB;\
 
1726
) type=InnoDB;\
1723
1727
CREATE TABLE services_links (\
1724
 
        linkid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1725
 
        serviceupid             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1726
 
        servicedownid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1727
 
        sof             in eger         DEFAULT '0'     NOT NULL,\
 
1728
        linkid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1729
        serviceupid             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1730
        servicedownid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1731
        soft            integer         DEFAULT '0'     NOT NULL,\
1728
1732
        PRIMARY KEY (linkid)\
1729
 
)  ype=InnoDB;\
 
1733
) type=InnoDB;\
1730
1734
CREATE INDEX services_links_links_1 on services_links (servicedownid);\
1731
1735
CREATE UNIQUE INDEX services_links_links_2 on services_links (serviceupid,servicedownid);\
1732
1736
CREATE TABLE sessions (\
1733
1737
        sessionid               varchar(32)             DEFAULT ''      NOT NULL,\
1734
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1735
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
1736
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
 
1738
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1739
        lastaccess              integer         DEFAULT '0'     NOT NULL,\
 
1740
        status          integer         DEFAULT '0'     NOT NULL,\
1737
1741
        PRIMARY KEY (sessionid)\
1738
 
)  ype=InnoDB;\
 
1742
) type=InnoDB;\
1739
1743
CREATE TABLE sysmaps_links (\
1740
 
        linkid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1741
 
        sysmapid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1742
 
        selemen id1             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1743
 
        selemen id2             bigin  unsigned         DEFAULT '0'     NOT NULL,\
1744
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
 
1744
        linkid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1745
        sysmapid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1746
        selementid1             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1747
        selementid2             bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1748
        drawtype                integer         DEFAULT '0'     NOT NULL,\
1745
1749
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
1746
1750
        PRIMARY KEY (linkid)\
1747
 
)  ype=InnoDB;\
1748
 
CREATE TABLE sysmaps_link_ riggers (\
1749
 
        link riggerid           bigin  unsigned         DEFAULT '0'     NOT NULL,\
1750
 
        linkid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1751
 
         riggerid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1752
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
 
1751
) type=InnoDB;\
 
1752
CREATE TABLE sysmaps_link_triggers (\
 
1753
        linktriggerid           bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1754
        linkid          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1755
        triggerid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1756
        drawtype                integer         DEFAULT '0'     NOT NULL,\
1753
1757
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
1754
 
        PRIMARY KEY (link riggerid)\
1755
 
)  ype=InnoDB;\
1756
 
CREATE UNIQUE INDEX sysmaps_link_ riggers_1 on sysmaps_link_ riggers (linkid, riggerid);\
1757
 
CREATE TABLE sysmaps_elemen s (\
1758
 
        selemen id              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1759
 
        sysmapid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1760
 
        elemen id               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1761
 
        elemen ype              in eger         DEFAULT '0'     NOT NULL,\
1762
 
        iconid_off              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1763
 
        iconid_on               bigin  unsigned         DEFAULT '0'     NOT NULL,\
1764
 
        iconid_unknown          bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1758
        PRIMARY KEY (linktriggerid)\
 
1759
) type=InnoDB;\
 
1760
CREATE UNIQUE INDEX sysmaps_link_triggers_1 on sysmaps_link_triggers (linkid,triggerid);\
 
1761
CREATE TABLE sysmaps_elements (\
 
1762
        selementid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1763
        sysmapid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1764
        elementid               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1765
        elementtype             integer         DEFAULT '0'     NOT NULL,\
 
1766
        iconid_off              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1767
        iconid_on               bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1768
        iconid_unknown          bigint unsigned         DEFAULT '0'     NOT NULL,\
1765
1769
        label           varchar(128)            DEFAULT ''      NOT NULL,\
1766
 
        label_loca ion          in eger                 NULL,\
1767
 
        x               in eger         DEFAULT '0'     NOT NULL,\
1768
 
        y               in eger         DEFAULT '0'     NOT NULL,\
 
1770
        label_location          integer                 NULL,\
 
1771
        x               integer         DEFAULT '0'     NOT NULL,\
 
1772
        y               integer         DEFAULT '0'     NOT NULL,\
1769
1773
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1770
 
        iconid_disabled         bigin  unsigned         DEFAULT '0'     NOT NULL,\
1771
 
        PRIMARY KEY (selemen id)\
1772
 
)  ype=InnoDB;\
 
1774
        iconid_disabled         bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1775
        PRIMARY KEY (selementid)\
 
1776
) type=InnoDB;\
1773
1777
CREATE TABLE sysmaps (\
1774
 
        sysmapid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1778
        sysmapid                bigint unsigned         DEFAULT '0'     NOT NULL,\
1775
1779
        name            varchar(128)            DEFAULT ''      NOT NULL,\
1776
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
1777
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
1778
 
        backgroundid            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1779
 
        label_ ype              in eger         DEFAULT '0'     NOT NULL,\
1780
 
        label_loca ion          in eger         DEFAULT '0'     NOT NULL,\
 
1780
        width           integer         DEFAULT '0'     NOT NULL,\
 
1781
        height          integer         DEFAULT '0'     NOT NULL,\
 
1782
        backgroundid            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1783
        label_type              integer         DEFAULT '0'     NOT NULL,\
 
1784
        label_location          integer         DEFAULT '0'     NOT NULL,\
1781
1785
        PRIMARY KEY (sysmapid)\
1782
 
)  ype=InnoDB;\
 
1786
) type=InnoDB;\
1783
1787
CREATE INDEX sysmaps_1 on sysmaps (name);\
1784
 
CREATE TABLE  riggers (\
1785
 
         riggerid               bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1788
CREATE TABLE triggers (\
 
1789
        triggerid               bigint unsigned         DEFAULT '0'     NOT NULL,\
1786
1790
        expression              varchar(255)            DEFAULT ''      NOT NULL,\
1787
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
 
1791
        description             varchar(255)            DEFAULT ''      NOT NULL,\
1788
1792
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1789
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1790
 
        value           in eger         DEFAULT '0'     NOT NULL,\
1791
 
        priori y                in eger         DEFAULT '0'     NOT NULL,\
1792
 
        las change              in eger         DEFAULT '0'     NOT NULL,\
1793
 
        dep_level               in eger         DEFAULT '0'     NOT NULL,\
1794
 
        commen s                blob                    NOT NULL,\
 
1793
        status          integer         DEFAULT '0'     NOT NULL,\
 
1794
        value           integer         DEFAULT '0'     NOT NULL,\
 
1795
        priority                integer         DEFAULT '0'     NOT NULL,\
 
1796
        lastchange              integer         DEFAULT '0'     NOT NULL,\
 
1797
        dep_level               integer         DEFAULT '0'     NOT NULL,\
 
1798
        comments                blob                    NOT NULL,\
1795
1799
        error           varchar(128)            DEFAULT ''      NOT NULL,\
1796
 
         empla eid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1797
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1798
 
        PRIMARY KEY ( riggerid)\
1799
 
)  ype=InnoDB;\
1800
 
CREATE INDEX  riggers_1 on  riggers (s a us);\
1801
 
CREATE INDEX  riggers_2 on  riggers (value);\
1802
 
CREATE TABLE  rigger_depends (\
1803
 
         riggerdepid            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1804
 
         riggerid_down          bigin  unsigned         DEFAULT '0'     NOT NULL,\
1805
 
         riggerid_up            bigin  unsigned         DEFAULT '0'     NOT NULL,\
1806
 
        PRIMARY KEY ( riggerdepid)\
1807
 
)  ype=InnoDB;\
1808
 
CREATE INDEX  rigger_depends_1 on  rigger_depends ( riggerid_down, riggerid_up);\
1809
 
CREATE INDEX  rigger_depends_2 on  rigger_depends ( riggerid_up);\
 
1800
        templateid              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1801
        type            integer         DEFAULT '0'     NOT NULL,\
 
1802
        PRIMARY KEY (triggerid)\
 
1803
) type=InnoDB;\
 
1804
CREATE INDEX triggers_1 on triggers (status);\
 
1805
CREATE INDEX triggers_2 on triggers (value);\
 
1806
CREATE TABLE trigger_depends (\
 
1807
        triggerdepid            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1808
        triggerid_down          bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1809
        triggerid_up            bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1810
        PRIMARY KEY (triggerdepid)\
 
1811
) type=InnoDB;\
 
1812
CREATE INDEX trigger_depends_1 on trigger_depends (triggerid_down,triggerid_up);\
 
1813
CREATE INDEX trigger_depends_2 on trigger_depends (triggerid_up);\
1810
1814
CREATE TABLE users (\
1811
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1815
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
1812
1816
        alias           varchar(100)            DEFAULT ''      NOT NULL,\
1813
1817
        name            varchar(100)            DEFAULT ''      NOT NULL,\
1814
1818
        surname         varchar(100)            DEFAULT ''      NOT NULL,\
1815
1819
        passwd          char(32)                DEFAULT ''      NOT NULL,\
1816
1820
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1817
 
        au ologin               in eger         DEFAULT '0'     NOT NULL,\
1818
 
        au ologou               in eger         DEFAULT '900'   NOT NULL,\
 
1821
        autologin               integer         DEFAULT '0'     NOT NULL,\
 
1822
        autologout              integer         DEFAULT '900'   NOT NULL,\
1819
1823
        lang            varchar(5)              DEFAULT 'en_gb' NOT NULL,\
1820
 
        refresh         in eger         DEFAULT '30'    NOT NULL,\
1821
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1822
 
         heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
1823
 
        a emp _failed           in eger         DEFAULT 0       NOT NULL,\
1824
 
        a emp _ip               varchar(39)             DEFAULT ''      NOT NULL,\
1825
 
        a emp _clock            in eger         DEFAULT 0       NOT NULL,\
 
1824
        refresh         integer         DEFAULT '30'    NOT NULL,\
 
1825
        type            integer         DEFAULT '0'     NOT NULL,\
 
1826
        theme           varchar(128)            DEFAULT 'default.css'   NOT NULL,\
 
1827
        attempt_failed          integer         DEFAULT 0       NOT NULL,\
 
1828
        attempt_ip              varchar(39)             DEFAULT ''      NOT NULL,\
 
1829
        attempt_clock           integer         DEFAULT 0       NOT NULL,\
1826
1830
        PRIMARY KEY (userid)\
1827
 
)  ype=InnoDB;\
 
1831
) type=InnoDB;\
1828
1832
CREATE INDEX users_1 on users (alias);\
1829
1833
CREATE TABLE usrgrp (\
1830
 
        usrgrpid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1834
        usrgrpid                bigint unsigned         DEFAULT '0'     NOT NULL,\
1831
1835
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1832
 
        gui_access              in eger         DEFAULT '0'     NOT NULL,\
1833
 
        users_s a us            in eger         DEFAULT '0'     NOT NULL,\
 
1836
        gui_access              integer         DEFAULT '0'     NOT NULL,\
 
1837
        users_status            integer         DEFAULT '0'     NOT NULL,\
1834
1838
        PRIMARY KEY (usrgrpid)\
1835
 
)  ype=InnoDB;\
 
1839
) type=InnoDB;\
1836
1840
CREATE INDEX usrgrp_1 on usrgrp (name);\
1837
1841
CREATE TABLE users_groups (\
1838
 
        id              bigin  unsigned         DEFAULT '0'     NOT NULL,\
1839
 
        usrgrpid                bigin  unsigned         DEFAULT '0'     NOT NULL,\
1840
 
        userid          bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1842
        id              bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1843
        usrgrpid                bigint unsigned         DEFAULT '0'     NOT NULL,\
 
1844
        userid          bigint unsigned         DEFAULT '0'     NOT NULL,\
1841
1845
        PRIMARY KEY (id)\
1842
 
)  ype=InnoDB;\
 
1846
) type=InnoDB;\
1843
1847
CREATE INDEX users_groups_1 on users_groups (usrgrpid,userid);\
1844
1848
CREATE TABLE valuemaps (\
1845
 
        valuemapid              bigin  unsigned         DEFAULT '0'     NOT NULL,\
 
1849
        valuemapid              bigint unsigned         DEFAULT '0'     NOT NULL,\
1846
1850
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1847
1851
        PRIMARY KEY (valuemapid)\
1848
 
)  ype=InnoDB;\
 
1852
) type=InnoDB;\
1849
1853
CREATE INDEX valuemaps_1 on valuemaps (name);\
1850
1854
"};
1851
1855
#elif HAVE_POSTGRESQL
1852
1856
const char *db_schema = {"\
1853
1857
CREATE TABLE slideshows (\
1854
 
        slideshowid             bigin           DEFAULT '0'     NOT NULL,\
1855
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
1856
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
1857
 
        PRIMARY KEY (slideshowid)\
1858
 
) wi h OIDS;\
 
1858
 slideshowid bigint DEFAULT '0' NOT NULL,\
 
1859
 name varchar(255) DEFAULT '' NOT NULL,\
 
1860
 delay integer DEFAULT '0' NOT NULL,\
 
1861
 PRIMARY KEY (slideshowid)\
 
1862
) with OIDS;\
1859
1863
CREATE TABLE slides (\
1860
 
        slideid         bigin           DEFAULT '0'     NOT NULL,\
1861
 
        slideshowid             bigin           DEFAULT '0'     NOT NULL,\
1862
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
1863
 
        s ep            in eger         DEFAULT '0'     NOT NULL,\
1864
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
1865
 
        PRIMARY KEY (slideid)\
1866
 
) wi h OIDS;\
 
1864
 slideid bigint DEFAULT '0' NOT NULL,\
 
1865
 slideshowid bigint DEFAULT '0' NOT NULL,\
 
1866
 screenid bigint DEFAULT '0' NOT NULL,\
 
1867
 step integer DEFAULT '0' NOT NULL,\
 
1868
 delay integer DEFAULT '0' NOT NULL,\
 
1869
 PRIMARY KEY (slideid)\
 
1870
) with OIDS;\
1867
1871
CREATE INDEX slides_slides_1 on slides (slideshowid);\
1868
1872
CREATE TABLE drules (\
1869
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
1870
 
        proxy_hos id            bigin           DEFAULT '0'     NOT NULL,\
1871
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
1872
 
        iprange         varchar(255)            DEFAULT ''      NOT NULL,\
1873
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
1874
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1875
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1876
 
        PRIMARY KEY (druleid)\
1877
 
) wi h OIDS;\
 
1873
 druleid bigint DEFAULT '0' NOT NULL,\
 
1874
 proxy_hostid bigint DEFAULT '0' NOT NULL,\
 
1875
 name varchar(255) DEFAULT '' NOT NULL,\
 
1876
 iprange varchar(255) DEFAULT '' NOT NULL,\
 
1877
 delay integer DEFAULT '0' NOT NULL,\
 
1878
 nextcheck integer DEFAULT '0' NOT NULL,\
 
1879
 status integer DEFAULT '0' NOT NULL,\
 
1880
 PRIMARY KEY (druleid)\
 
1881
) with OIDS;\
1878
1882
CREATE TABLE dchecks (\
1879
 
        dcheckid                bigin           DEFAULT '0'     NOT NULL,\
1880
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
1881
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1882
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
1883
 
        snmp_communi y          varchar(255)            DEFAULT '0'     NOT NULL,\
1884
 
        por s           varchar(255)            DEFAULT '0'     NOT NULL,\
1885
 
        PRIMARY KEY (dcheckid)\
1886
 
) wi h OIDS;\
1887
 
CREATE TABLE dhos s (\
1888
 
        dhos id         bigin           DEFAULT '0'     NOT NULL,\
1889
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
1890
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
1891
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1892
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
1893
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
1894
 
        PRIMARY KEY (dhos id)\
1895
 
) wi h OIDS;\
 
1883
 dcheckid bigint DEFAULT '0' NOT NULL,\
 
1884
 druleid bigint DEFAULT '0' NOT NULL,\
 
1885
 type integer DEFAULT '0' NOT NULL,\
 
1886
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
1887
 snmp_community varchar(255) DEFAULT '0' NOT NULL,\
 
1888
 ports varchar(255) DEFAULT '0' NOT NULL,\
 
1889
 PRIMARY KEY (dcheckid)\
 
1890
) with OIDS;\
 
1891
CREATE TABLE dhosts (\
 
1892
 dhostid bigint DEFAULT '0' NOT NULL,\
 
1893
 druleid bigint DEFAULT '0' NOT NULL,\
 
1894
 ip varchar(39) DEFAULT '' NOT NULL,\
 
1895
 status integer DEFAULT '0' NOT NULL,\
 
1896
 lastup integer DEFAULT '0' NOT NULL,\
 
1897
 lastdown integer DEFAULT '0' NOT NULL,\
 
1898
 PRIMARY KEY (dhostid)\
 
1899
) with OIDS;\
1896
1900
CREATE TABLE dservices (\
1897
 
        dserviceid              bigin           DEFAULT '0'     NOT NULL,\
1898
 
        dhos id         bigin           DEFAULT '0'     NOT NULL,\
1899
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1900
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
1901
 
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
1902
 
        por             in eger         DEFAULT '0'     NOT NULL,\
1903
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1904
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
1905
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
1906
 
        PRIMARY KEY (dserviceid)\
1907
 
) wi h OIDS;\
 
1901
 dserviceid bigint DEFAULT '0' NOT NULL,\
 
1902
 dhostid bigint DEFAULT '0' NOT NULL,\
 
1903
 type integer DEFAULT '0' NOT NULL,\
 
1904
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
1905
 value varchar(255) DEFAULT '0' NOT NULL,\
 
1906
 port integer DEFAULT '0' NOT NULL,\
 
1907
 status integer DEFAULT '0' NOT NULL,\
 
1908
 lastup integer DEFAULT '0' NOT NULL,\
 
1909
 lastdown integer DEFAULT '0' NOT NULL,\
 
1910
 PRIMARY KEY (dserviceid)\
 
1911
) with OIDS;\
1908
1912
CREATE TABLE ids (\
1909
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
1910
 
         able_name              varchar(64)             DEFAULT ''      NOT NULL,\
1911
 
        field_name              varchar(64)             DEFAULT ''      NOT NULL,\
1912
 
        nex id          bigin           DEFAULT '0'     NOT NULL,\
1913
 
        PRIMARY KEY (nodeid, able_name,field_name)\
1914
 
) wi h OIDS;\
1915
 
CREATE TABLE h p es  (\
1916
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
1917
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1918
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
1919
 
        las check               in eger         DEFAULT '0'     NOT NULL,\
1920
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
1921
 
        curs a e                in eger         DEFAULT '0'     NOT NULL,\
1922
 
        curs ep         in eger         DEFAULT '0'     NOT NULL,\
1923
 
        las faileds ep          in eger         DEFAULT '0'     NOT NULL,\
1924
 
        delay           in eger         DEFAULT '60'    NOT NULL,\
1925
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
1926
 
        macros           ex             DEFAULT ''      NOT NULL,\
1927
 
        agen            varchar(255)            DEFAULT ''      NOT NULL,\
1928
 
         ime            numeric(16,4)           DEFAULT '0'     NOT NULL,\
1929
 
        error           varchar(255)            DEFAULT ''      NOT NULL,\
1930
 
        PRIMARY KEY (h p es id)\
1931
 
) wi h OIDS;\
1932
 
CREATE INDEX h p es _h p es _1 on h p es  (applica ionid);\
1933
 
CREATE TABLE h ps ep (\
1934
 
        h ps epid               bigin           DEFAULT '0'     NOT NULL,\
1935
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
1936
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
1937
 
        no              in eger         DEFAULT '0'     NOT NULL,\
1938
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
1939
 
         imeou          in eger         DEFAULT '30'    NOT NULL,\
1940
 
        pos s            ex             DEFAULT ''      NOT NULL,\
1941
 
        required                varchar(255)            DEFAULT ''      NOT NULL,\
1942
 
        s a us_codes            varchar(255)            DEFAULT ''      NOT NULL,\
1943
 
        PRIMARY KEY (h ps epid)\
1944
 
) wi h OIDS;\
1945
 
CREATE INDEX h ps ep_h ps ep_1 on h ps ep (h p es id);\
1946
 
CREATE TABLE h ps epi em (\
1947
 
        h ps epi emid           bigin           DEFAULT '0'     NOT NULL,\
1948
 
        h ps epid               bigin           DEFAULT '0'     NOT NULL,\
1949
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
1950
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1951
 
        PRIMARY KEY (h ps epi emid)\
1952
 
) wi h OIDS;\
1953
 
CREATE UNIQUE INDEX h ps epi em_h ps epi em_1 on h ps epi em (h ps epid,i emid);\
1954
 
CREATE TABLE h p es i em (\
1955
 
        h p es i emid           bigin           DEFAULT '0'     NOT NULL,\
1956
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
1957
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
1958
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1959
 
        PRIMARY KEY (h p es i emid)\
1960
 
) wi h OIDS;\
1961
 
CREATE UNIQUE INDEX h p es i em_h p es i em_1 on h p es i em (h p es id,i emid);\
 
1913
 nodeid integer DEFAULT '0' NOT NULL,\
 
1914
 table_name varchar(64) DEFAULT '' NOT NULL,\
 
1915
 field_name varchar(64) DEFAULT '' NOT NULL,\
 
1916
 nextid bigint DEFAULT '0' NOT NULL,\
 
1917
 PRIMARY KEY (nodeid,table_name,field_name)\
 
1918
) with OIDS;\
 
1919
CREATE TABLE httptest (\
 
1920
 httptestid bigint DEFAULT '0' NOT NULL,\
 
1921
 name varchar(64) DEFAULT '' NOT NULL,\
 
1922
 applicationid bigint DEFAULT '0' NOT NULL,\
 
1923
 lastcheck integer DEFAULT '0' NOT NULL,\
 
1924
 nextcheck integer DEFAULT '0' NOT NULL,\
 
1925
 curstate integer DEFAULT '0' NOT NULL,\
 
1926
 curstep integer DEFAULT '0' NOT NULL,\
 
1927
 lastfailedstep integer DEFAULT '0' NOT NULL,\
 
1928
 delay integer DEFAULT '60' NOT NULL,\
 
1929
 status integer DEFAULT '0' NOT NULL,\
 
1930
 macros text DEFAULT '' NOT NULL,\
 
1931
 agent varchar(255) DEFAULT '' NOT NULL,\
 
1932
 time numeric(16,4) DEFAULT '0' NOT NULL,\
 
1933
 error varchar(255) DEFAULT '' NOT NULL,\
 
1934
 PRIMARY KEY (httptestid)\
 
1935
) with OIDS;\
 
1936
CREATE INDEX httptest_httptest_1 on httptest (applicationid);\
 
1937
CREATE TABLE httpstep (\
 
1938
 httpstepid bigint DEFAULT '0' NOT NULL,\
 
1939
 httptestid bigint DEFAULT '0' NOT NULL,\
 
1940
 name varchar(64) DEFAULT '' NOT NULL,\
 
1941
 no integer DEFAULT '0' NOT NULL,\
 
1942
 url varchar(255) DEFAULT '' NOT NULL,\
 
1943
 timeout integer DEFAULT '30' NOT NULL,\
 
1944
 posts text DEFAULT '' NOT NULL,\
 
1945
 required varchar(255) DEFAULT '' NOT NULL,\
 
1946
 status_codes varchar(255) DEFAULT '' NOT NULL,\
 
1947
 PRIMARY KEY (httpstepid)\
 
1948
) with OIDS;\
 
1949
CREATE INDEX httpstep_httpstep_1 on httpstep (httptestid);\
 
1950
CREATE TABLE httpstepitem (\
 
1951
 httpstepitemid bigint DEFAULT '0' NOT NULL,\
 
1952
 httpstepid bigint DEFAULT '0' NOT NULL,\
 
1953
 itemid bigint DEFAULT '0' NOT NULL,\
 
1954
 type integer DEFAULT '0' NOT NULL,\
 
1955
 PRIMARY KEY (httpstepitemid)\
 
1956
) with OIDS;\
 
1957
CREATE UNIQUE INDEX httpstepitem_httpstepitem_1 on httpstepitem (httpstepid,itemid);\
 
1958
CREATE TABLE httptestitem (\
 
1959
 httptestitemid bigint DEFAULT '0' NOT NULL,\
 
1960
 httptestid bigint DEFAULT '0' NOT NULL,\
 
1961
 itemid bigint DEFAULT '0' NOT NULL,\
 
1962
 type integer DEFAULT '0' NOT NULL,\
 
1963
 PRIMARY KEY (httptestitemid)\
 
1964
) with OIDS;\
 
1965
CREATE UNIQUE INDEX httptestitem_httptestitem_1 on httptestitem (httptestid,itemid);\
1962
1966
CREATE TABLE nodes (\
1963
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
1964
 
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
1965
 
         imezone                in eger         DEFAULT '0'     NOT NULL,\
1966
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
1967
 
        por             in eger         DEFAULT '10051' NOT NULL,\
1968
 
        slave_his ory           in eger         DEFAULT '30'    NOT NULL,\
1969
 
        slave_ rends            in eger         DEFAULT '365'   NOT NULL,\
1970
 
        node ype                in eger         DEFAULT '0'     NOT NULL,\
1971
 
        mas erid                in eger         DEFAULT '0'     NOT NULL,\
1972
 
        PRIMARY KEY (nodeid)\
1973
 
) wi h OIDS;\
 
1967
 nodeid integer DEFAULT '0' NOT NULL,\
 
1968
 name varchar(64) DEFAULT '0' NOT NULL,\
 
1969
 timezone integer DEFAULT '0' NOT NULL,\
 
1970
 ip varchar(39) DEFAULT '' NOT NULL,\
 
1971
 port integer DEFAULT '10051' NOT NULL,\
 
1972
 slave_history integer DEFAULT '30' NOT NULL,\
 
1973
 slave_trends integer DEFAULT '365' NOT NULL,\
 
1974
 nodetype integer DEFAULT '0' NOT NULL,\
 
1975
 masterid integer DEFAULT '0' NOT NULL,\
 
1976
 PRIMARY KEY (nodeid)\
 
1977
) with OIDS;\
1974
1978
CREATE TABLE node_cksum (\
1975
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
1976
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
1977
 
        recordid                bigin           DEFAULT '0'     NOT NULL,\
1978
 
        cksum ype               in eger         DEFAULT '0'     NOT NULL,\
1979
 
        cksum            ex             DEFAULT ''      NOT NULL,\
1980
 
        sync            char(128)               DEFAULT ''      NOT NULL\
1981
 
) wi h OIDS;\
1982
 
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid, ablename,recordid,cksum ype);\
1983
 
CREATE TABLE services_ imes (\
1984
 
         imeid          bigin           DEFAULT '0'     NOT NULL,\
1985
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
1986
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
1987
 
         s_from         in eger         DEFAULT '0'     NOT NULL,\
1988
 
         s_ o           in eger         DEFAULT '0'     NOT NULL,\
1989
 
        no e            varchar(255)            DEFAULT ''      NOT NULL,\
1990
 
        PRIMARY KEY ( imeid)\
1991
 
) wi h OIDS;\
1992
 
CREATE INDEX services_ imes_ imes_1 on services_ imes (serviceid, ype, s_from, s_ o);\
1993
 
CREATE TABLE aler s (\
1994
 
        aler id         bigin           DEFAULT '0'     NOT NULL,\
1995
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
1996
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
1997
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
1998
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
1999
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
2000
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
2001
 
        subjec          varchar(255)            DEFAULT ''      NOT NULL,\
2002
 
        message          ex             DEFAULT ''      NOT NULL,\
2003
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2004
 
        re ries         in eger         DEFAULT '0'     NOT NULL,\
2005
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
2006
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
2007
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
2008
 
        aler ype                in eger         DEFAULT '0'     NOT NULL,\
2009
 
        PRIMARY KEY (aler id)\
2010
 
) wi h OIDS;\
2011
 
CREATE INDEX aler s_1 on aler s (ac ionid);\
2012
 
CREATE INDEX aler s_2 on aler s (clock);\
2013
 
CREATE INDEX aler s_3 on aler s (even id);\
2014
 
CREATE INDEX aler s_4 on aler s (s a us,re ries);\
2015
 
CREATE INDEX aler s_5 on aler s (media ypeid);\
2016
 
CREATE INDEX aler s_6 on aler s (userid);\
2017
 
CREATE TABLE his ory (\
2018
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2019
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2020
 
        value           numeric(16,4)           DEFAULT '0.0000'        NOT NULL\
2021
 
) wi h OIDS;\
2022
 
CREATE INDEX his ory_1 on his ory (i emid,clock);\
2023
 
CREATE TABLE his ory_sync (\
2024
 
        id              serial                  NOT NULL,\
2025
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
2026
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2027
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2028
 
        value           numeric(16,4)           DEFAULT '0.0000'        NOT NULL,\
2029
 
        PRIMARY KEY (id)\
2030
 
) wi h OIDS;\
2031
 
CREATE INDEX his ory_sync_1 on his ory_sync (nodeid,id);\
2032
 
CREATE TABLE his ory_uin  (\
2033
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2034
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2035
 
        value           bigin           DEFAULT '0'     NOT NULL\
2036
 
) wi h OIDS;\
2037
 
CREATE INDEX his ory_uin _1 on his ory_uin  (i emid,clock);\
2038
 
CREATE TABLE his ory_uin _sync (\
2039
 
        id              serial                  NOT NULL,\
2040
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
2041
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2042
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2043
 
        value           bigin           DEFAULT '0'     NOT NULL,\
2044
 
        PRIMARY KEY (id)\
2045
 
) wi h OIDS;\
2046
 
CREATE INDEX his ory_uin _sync_1 on his ory_uin _sync (nodeid,id);\
2047
 
CREATE TABLE his ory_s r (\
2048
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2049
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2050
 
        value           varchar(255)            DEFAULT ''      NOT NULL\
2051
 
) wi h OIDS;\
2052
 
CREATE INDEX his ory_s r_1 on his ory_s r (i emid,clock);\
2053
 
CREATE TABLE his ory_s r_sync (\
2054
 
        id              serial                  NOT NULL,\
2055
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
2056
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2057
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2058
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
2059
 
        PRIMARY KEY (id)\
2060
 
) wi h OIDS;\
2061
 
CREATE INDEX his ory_s r_sync_1 on his ory_s r_sync (nodeid,id);\
2062
 
CREATE TABLE his ory_log (\
2063
 
        id              bigin           DEFAULT '0'     NOT NULL,\
2064
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2065
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2066
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
2067
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
2068
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
2069
 
        value            ex             DEFAULT ''      NOT NULL,\
2070
 
        PRIMARY KEY (id)\
2071
 
) wi h OIDS;\
2072
 
CREATE INDEX his ory_log_1 on his ory_log (i emid,clock);\
2073
 
CREATE TABLE his ory_ ex  (\
2074
 
        id              bigin           DEFAULT '0'     NOT NULL,\
2075
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2076
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2077
 
        value            ex             DEFAULT ''      NOT NULL,\
2078
 
        PRIMARY KEY (id)\
2079
 
) wi h OIDS;\
2080
 
CREATE INDEX his ory_ ex _1 on his ory_ ex  (i emid,clock);\
2081
 
CREATE TABLE proxy_his ory (\
2082
 
        id              serial                  NOT NULL,\
2083
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2084
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2085
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
2086
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
2087
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
2088
 
        value            ex             DEFAULT ''      NOT NULL,\
2089
 
        PRIMARY KEY (id)\
2090
 
) wi h OIDS;\
2091
 
CREATE INDEX proxy_his ory_1 on proxy_his ory (clock);\
2092
 
CREATE TABLE proxy_dhis ory (\
2093
 
        id              serial                  NOT NULL,\
2094
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2095
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
2096
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2097
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
2098
 
        por             in eger         DEFAULT '0'     NOT NULL,\
2099
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
2100
 
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
2101
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2102
 
        PRIMARY KEY (id)\
2103
 
) wi h OIDS;\
2104
 
CREATE INDEX proxy_dhis ory_1 on proxy_dhis ory (clock);\
2105
 
CREATE TABLE even s (\
2106
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
2107
 
        source          in eger         DEFAULT '0'     NOT NULL,\
2108
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
2109
 
        objec id                bigin           DEFAULT '0'     NOT NULL,\
2110
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2111
 
        value           in eger         DEFAULT '0'     NOT NULL,\
2112
 
        acknowledged            in eger         DEFAULT '0'     NOT NULL,\
2113
 
        PRIMARY KEY (even id)\
2114
 
) wi h OIDS;\
2115
 
CREATE INDEX even s_1 on even s (objec ,objec id,even id);\
2116
 
CREATE INDEX even s_2 on even s (clock);\
2117
 
CREATE TABLE  rends (\
2118
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2119
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2120
 
        num             in eger         DEFAULT '0'     NOT NULL,\
2121
 
        value_min               numeric(16,4)           DEFAULT '0.0000'        NOT NULL,\
2122
 
        value_avg               numeric(16,4)           DEFAULT '0.0000'        NOT NULL,\
2123
 
        value_max               numeric(16,4)           DEFAULT '0.0000'        NOT NULL,\
2124
 
        PRIMARY KEY (i emid,clock)\
2125
 
) wi h OIDS;\
2126
 
CREATE TABLE  rends_uin  (\
2127
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2128
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2129
 
        num             in eger         DEFAULT '0'     NOT NULL,\
2130
 
        value_min               bigin           DEFAULT '0'     NOT NULL,\
2131
 
        value_avg               bigin           DEFAULT '0'     NOT NULL,\
2132
 
        value_max               bigin           DEFAULT '0'     NOT NULL,\
2133
 
        PRIMARY KEY (i emid,clock)\
2134
 
) wi h OIDS;\
 
1979
 nodeid integer DEFAULT '0' NOT NULL,\
 
1980
 tablename varchar(64) DEFAULT '' NOT NULL,\
 
1981
 recordid bigint DEFAULT '0' NOT NULL,\
 
1982
 cksumtype integer DEFAULT '0' NOT NULL,\
 
1983
 cksum text DEFAULT '' NOT NULL,\
 
1984
 sync char(128) DEFAULT '' NOT NULL\
 
1985
) with OIDS;\
 
1986
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid,tablename,recordid,cksumtype);\
 
1987
CREATE TABLE services_times (\
 
1988
 timeid bigint DEFAULT '0' NOT NULL,\
 
1989
 serviceid bigint DEFAULT '0' NOT NULL,\
 
1990
 type integer DEFAULT '0' NOT NULL,\
 
1991
 ts_from integer DEFAULT '0' NOT NULL,\
 
1992
 ts_to integer DEFAULT '0' NOT NULL,\
 
1993
 note varchar(255) DEFAULT '' NOT NULL,\
 
1994
 PRIMARY KEY (timeid)\
 
1995
) with OIDS;\
 
1996
CREATE INDEX services_times_times_1 on services_times (serviceid,type,ts_from,ts_to);\
 
1997
CREATE TABLE alerts (\
 
1998
 alertid bigint DEFAULT '0' NOT NULL,\
 
1999
 actionid bigint DEFAULT '0' NOT NULL,\
 
2000
 eventid bigint DEFAULT '0' NOT NULL,\
 
2001
 userid bigint DEFAULT '0' NOT NULL,\
 
2002
 clock integer DEFAULT '0' NOT NULL,\
 
2003
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
2004
 sendto varchar(100) DEFAULT '' NOT NULL,\
 
2005
 subject varchar(255) DEFAULT '' NOT NULL,\
 
2006
 message text DEFAULT '' NOT NULL,\
 
2007
 status integer DEFAULT '0' NOT NULL,\
 
2008
 retries integer DEFAULT '0' NOT NULL,\
 
2009
 error varchar(128) DEFAULT '' NOT NULL,\
 
2010
 nextcheck integer DEFAULT '0' NOT NULL,\
 
2011
 esc_step integer DEFAULT '0' NOT NULL,\
 
2012
 alerttype integer DEFAULT '0' NOT NULL,\
 
2013
 PRIMARY KEY (alertid)\
 
2014
) with OIDS;\
 
2015
CREATE INDEX alerts_1 on alerts (actionid);\
 
2016
CREATE INDEX alerts_2 on alerts (clock);\
 
2017
CREATE INDEX alerts_3 on alerts (eventid);\
 
2018
CREATE INDEX alerts_4 on alerts (status,retries);\
 
2019
CREATE INDEX alerts_5 on alerts (mediatypeid);\
 
2020
CREATE INDEX alerts_6 on alerts (userid);\
 
2021
CREATE TABLE history (\
 
2022
 itemid bigint DEFAULT '0' NOT NULL,\
 
2023
 clock integer DEFAULT '0' NOT NULL,\
 
2024
 value numeric(16,4) DEFAULT '0.0000' NOT NULL\
 
2025
) with OIDS;\
 
2026
CREATE INDEX history_1 on history (itemid,clock);\
 
2027
CREATE TABLE history_sync (\
 
2028
 id serial NOT NULL,\
 
2029
 nodeid bigint DEFAULT '0' NOT NULL,\
 
2030
 itemid bigint DEFAULT '0' NOT NULL,\
 
2031
 clock integer DEFAULT '0' NOT NULL,\
 
2032
 value numeric(16,4) DEFAULT '0.0000' NOT NULL,\
 
2033
 PRIMARY KEY (id)\
 
2034
) with OIDS;\
 
2035
CREATE INDEX history_sync_1 on history_sync (nodeid,id);\
 
2036
CREATE TABLE history_uint (\
 
2037
 itemid bigint DEFAULT '0' NOT NULL,\
 
2038
 clock integer DEFAULT '0' NOT NULL,\
 
2039
 value bigint DEFAULT '0' NOT NULL\
 
2040
) with OIDS;\
 
2041
CREATE INDEX history_uint_1 on history_uint (itemid,clock);\
 
2042
CREATE TABLE history_uint_sync (\
 
2043
 id serial NOT NULL,\
 
2044
 nodeid bigint DEFAULT '0' NOT NULL,\
 
2045
 itemid bigint DEFAULT '0' NOT NULL,\
 
2046
 clock integer DEFAULT '0' NOT NULL,\
 
2047
 value bigint DEFAULT '0' NOT NULL,\
 
2048
 PRIMARY KEY (id)\
 
2049
) with OIDS;\
 
2050
CREATE INDEX history_uint_sync_1 on history_uint_sync (nodeid,id);\
 
2051
CREATE TABLE history_str (\
 
2052
 itemid bigint DEFAULT '0' NOT NULL,\
 
2053
 clock integer DEFAULT '0' NOT NULL,\
 
2054
 value varchar(255) DEFAULT '' NOT NULL\
 
2055
) with OIDS;\
 
2056
CREATE INDEX history_str_1 on history_str (itemid,clock);\
 
2057
CREATE TABLE history_str_sync (\
 
2058
 id serial NOT NULL,\
 
2059
 nodeid bigint DEFAULT '0' NOT NULL,\
 
2060
 itemid bigint DEFAULT '0' NOT NULL,\
 
2061
 clock integer DEFAULT '0' NOT NULL,\
 
2062
 value varchar(255) DEFAULT '' NOT NULL,\
 
2063
 PRIMARY KEY (id)\
 
2064
) with OIDS;\
 
2065
CREATE INDEX history_str_sync_1 on history_str_sync (nodeid,id);\
 
2066
CREATE TABLE history_log (\
 
2067
 id bigint DEFAULT '0' NOT NULL,\
 
2068
 itemid bigint DEFAULT '0' NOT NULL,\
 
2069
 clock integer DEFAULT '0' NOT NULL,\
 
2070
 timestamp integer DEFAULT '0' NOT NULL,\
 
2071
 source varchar(64) DEFAULT '' NOT NULL,\
 
2072
 severity integer DEFAULT '0' NOT NULL,\
 
2073
 value text DEFAULT '' NOT NULL,\
 
2074
 PRIMARY KEY (id)\
 
2075
) with OIDS;\
 
2076
CREATE INDEX history_log_1 on history_log (itemid,clock);\
 
2077
CREATE UNIQUE INDEX history_log_2 on history_log (itemid,id);\
 
2078
CREATE TABLE history_text (\
 
2079
 id bigint DEFAULT '0' NOT NULL,\
 
2080
 itemid bigint DEFAULT '0' NOT NULL,\
 
2081
 clock integer DEFAULT '0' NOT NULL,\
 
2082
 value text DEFAULT '' NOT NULL,\
 
2083
 PRIMARY KEY (id)\
 
2084
) with OIDS;\
 
2085
CREATE INDEX history_text_1 on history_text (itemid,clock);\
 
2086
CREATE UNIQUE INDEX history_text_2 on history_text (itemid,id);\
 
2087
CREATE TABLE proxy_history (\
 
2088
 id serial NOT NULL,\
 
2089
 itemid bigint DEFAULT '0' NOT NULL,\
 
2090
 clock integer DEFAULT '0' NOT NULL,\
 
2091
 timestamp integer DEFAULT '0' NOT NULL,\
 
2092
 source varchar(64) DEFAULT '' NOT NULL,\
 
2093
 severity integer DEFAULT '0' NOT NULL,\
 
2094
 value text DEFAULT '' NOT NULL,\
 
2095
 PRIMARY KEY (id)\
 
2096
) with OIDS;\
 
2097
CREATE INDEX proxy_history_1 on proxy_history (clock);\
 
2098
CREATE TABLE proxy_dhistory (\
 
2099
 id serial NOT NULL,\
 
2100
 clock integer DEFAULT '0' NOT NULL,\
 
2101
 druleid bigint DEFAULT '0' NOT NULL,\
 
2102
 type integer DEFAULT '0' NOT NULL,\
 
2103
 ip varchar(39) DEFAULT '' NOT NULL,\
 
2104
 port integer DEFAULT '0' NOT NULL,\
 
2105
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
2106
 value varchar(255) DEFAULT '0' NOT NULL,\
 
2107
 status integer DEFAULT '0' NOT NULL,\
 
2108
 PRIMARY KEY (id)\
 
2109
) with OIDS;\
 
2110
CREATE INDEX proxy_dhistory_1 on proxy_dhistory (clock);\
 
2111
CREATE TABLE events (\
 
2112
 eventid bigint DEFAULT '0' NOT NULL,\
 
2113
 source integer DEFAULT '0' NOT NULL,\
 
2114
 object integer DEFAULT '0' NOT NULL,\
 
2115
 objectid bigint DEFAULT '0' NOT NULL,\
 
2116
 clock integer DEFAULT '0' NOT NULL,\
 
2117
 value integer DEFAULT '0' NOT NULL,\
 
2118
 acknowledged integer DEFAULT '0' NOT NULL,\
 
2119
 PRIMARY KEY (eventid)\
 
2120
) with OIDS;\
 
2121
CREATE INDEX events_1 on events (object,objectid,eventid);\
 
2122
CREATE INDEX events_2 on events (clock);\
 
2123
CREATE TABLE trends (\
 
2124
 itemid bigint DEFAULT '0' NOT NULL,\
 
2125
 clock integer DEFAULT '0' NOT NULL,\
 
2126
 num integer DEFAULT '0' NOT NULL,\
 
2127
 value_min numeric(16,4) DEFAULT '0.0000' NOT NULL,\
 
2128
 value_avg numeric(16,4) DEFAULT '0.0000' NOT NULL,\
 
2129
 value_max numeric(16,4) DEFAULT '0.0000' NOT NULL,\
 
2130
 PRIMARY KEY (itemid,clock)\
 
2131
) with OIDS;\
 
2132
CREATE TABLE trends_uint (\
 
2133
 itemid bigint DEFAULT '0' NOT NULL,\
 
2134
 clock integer DEFAULT '0' NOT NULL,\
 
2135
 num integer DEFAULT '0' NOT NULL,\
 
2136
 value_min bigint DEFAULT '0' NOT NULL,\
 
2137
 value_avg bigint DEFAULT '0' NOT NULL,\
 
2138
 value_max bigint DEFAULT '0' NOT NULL,\
 
2139
 PRIMARY KEY (itemid,clock)\
 
2140
) with OIDS;\
2135
2141
CREATE TABLE acknowledges (\
2136
 
        acknowledgeid           bigin           DEFAULT '0'     NOT NULL,\
2137
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2138
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
2139
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2140
 
        message         varchar(255)            DEFAULT ''      NOT NULL,\
2141
 
        PRIMARY KEY (acknowledgeid)\
2142
 
) wi h OIDS;\
 
2142
 acknowledgeid bigint DEFAULT '0' NOT NULL,\
 
2143
 userid bigint DEFAULT '0' NOT NULL,\
 
2144
 eventid bigint DEFAULT '0' NOT NULL,\
 
2145
 clock integer DEFAULT '0' NOT NULL,\
 
2146
 message varchar(255) DEFAULT '' NOT NULL,\
 
2147
 PRIMARY KEY (acknowledgeid)\
 
2148
) with OIDS;\
2143
2149
CREATE INDEX acknowledges_1 on acknowledges (userid);\
2144
 
CREATE INDEX acknowledges_2 on acknowledges (even id);\
 
2150
CREATE INDEX acknowledges_2 on acknowledges (eventid);\
2145
2151
CREATE INDEX acknowledges_3 on acknowledges (clock);\
2146
 
CREATE TABLE audi log (\
2147
 
        audi id         bigin           DEFAULT '0'     NOT NULL,\
2148
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2149
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2150
 
        ac ion          in eger         DEFAULT '0'     NOT NULL,\
2151
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
2152
 
        de ails         varchar(128)            DEFAULT '0'     NOT NULL,\
2153
 
        PRIMARY KEY (audi id)\
2154
 
) wi h OIDS;\
2155
 
CREATE INDEX audi log_1 on audi log (userid,clock);\
2156
 
CREATE INDEX audi log_2 on audi log (clock);\
 
2152
CREATE TABLE auditlog (\
 
2153
 auditid bigint DEFAULT '0' NOT NULL,\
 
2154
 userid bigint DEFAULT '0' NOT NULL,\
 
2155
 clock integer DEFAULT '0' NOT NULL,\
 
2156
 action integer DEFAULT '0' NOT NULL,\
 
2157
 resourcetype integer DEFAULT '0' NOT NULL,\
 
2158
 details varchar(128) DEFAULT '0' NOT NULL,\
 
2159
 PRIMARY KEY (auditid)\
 
2160
) with OIDS;\
 
2161
CREATE INDEX auditlog_1 on auditlog (userid,clock);\
 
2162
CREATE INDEX auditlog_2 on auditlog (clock);\
2157
2163
CREATE TABLE service_alarms (\
2158
 
        servicealarmid          bigin           DEFAULT '0'     NOT NULL,\
2159
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
2160
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
2161
 
        value           in eger         DEFAULT '0'     NOT NULL,\
2162
 
        PRIMARY KEY (servicealarmid)\
2163
 
) wi h OIDS;\
 
2164
 servicealarmid bigint DEFAULT '0' NOT NULL,\
 
2165
 serviceid bigint DEFAULT '0' NOT NULL,\
 
2166
 clock integer DEFAULT '0' NOT NULL,\
 
2167
 value integer DEFAULT '0' NOT NULL,\
 
2168
 PRIMARY KEY (servicealarmid)\
 
2169
) with OIDS;\
2164
2170
CREATE INDEX service_alarms_1 on service_alarms (serviceid,clock);\
2165
2171
CREATE INDEX service_alarms_2 on service_alarms (clock);\
2166
 
CREATE TABLE ac ions (\
2167
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
2168
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
2169
 
        even source             in eger         DEFAULT '0'     NOT NULL,\
2170
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
2171
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2172
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
2173
 
        def_shor da a           varchar(255)            DEFAULT ''      NOT NULL,\
2174
 
        def_longda a             ex             DEFAULT ''      NOT NULL,\
2175
 
        recovery_msg            in eger         DEFAULT '0'     NOT NULL,\
2176
 
        r_shor da a             varchar(255)            DEFAULT ''      NOT NULL,\
2177
 
        r_longda a               ex             DEFAULT ''      NOT NULL,\
2178
 
        PRIMARY KEY (ac ionid)\
2179
 
) wi h OIDS;\
2180
 
CREATE TABLE opera ions (\
2181
 
        opera ionid             bigin           DEFAULT '0'     NOT NULL,\
2182
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
2183
 
        opera ion ype           in eger         DEFAULT '0'     NOT NULL,\
2184
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
2185
 
        objec id                bigin           DEFAULT '0'     NOT NULL,\
2186
 
        shor da a               varchar(255)            DEFAULT ''      NOT NULL,\
2187
 
        longda a                 ex             DEFAULT ''      NOT NULL,\
2188
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
2189
 
        esc_s ep_from           in eger         DEFAULT '0'     NOT NULL,\
2190
 
        esc_s ep_ o             in eger         DEFAULT '0'     NOT NULL,\
2191
 
        defaul _msg             in eger         DEFAULT '0'     NOT NULL,\
2192
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
2193
 
        PRIMARY KEY (opera ionid)\
2194
 
) wi h OIDS;\
2195
 
CREATE INDEX opera ions_1 on opera ions (ac ionid);\
2196
 
CREATE TABLE opcondi ions (\
2197
 
        opcondi ionid           bigin           DEFAULT '0'     NOT NULL,\
2198
 
        opera ionid             bigin           DEFAULT '0'     NOT NULL,\
2199
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
2200
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
2201
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
2202
 
        PRIMARY KEY (opcondi ionid)\
2203
 
) wi h OIDS;\
2204
 
CREATE INDEX opcondi ions_1 on opcondi ions (opera ionid);\
2205
 
CREATE TABLE escala ions (\
2206
 
        escala ionid            bigin           DEFAULT '0'     NOT NULL,\
2207
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
2208
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
2209
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
2210
 
        r_even id               bigin           DEFAULT '0'     NOT NULL,\
2211
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
2212
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
2213
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2214
 
        PRIMARY KEY (escala ionid)\
2215
 
) wi h OIDS;\
2216
 
CREATE INDEX escala ions_1 on escala ions (ac ionid, riggerid);\
2217
 
CREATE TABLE applica ions (\
2218
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
2219
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2220
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
2221
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
2222
 
        PRIMARY KEY (applica ionid)\
2223
 
) wi h OIDS;\
2224
 
CREATE INDEX applica ions_1 on applica ions ( empla eid);\
2225
 
CREATE UNIQUE INDEX applica ions_2 on applica ions (hos id,name);\
2226
 
CREATE TABLE condi ions (\
2227
 
        condi ionid             bigin           DEFAULT '0'     NOT NULL,\
2228
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
2229
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
2230
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
2231
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
2232
 
        PRIMARY KEY (condi ionid)\
2233
 
) wi h OIDS;\
2234
 
CREATE INDEX condi ions_1 on condi ions (ac ionid);\
 
2172
CREATE TABLE actions (\
 
2173
 actionid bigint DEFAULT '0' NOT NULL,\
 
2174
 name varchar(255) DEFAULT '' NOT NULL,\
 
2175
 eventsource integer DEFAULT '0' NOT NULL,\
 
2176
 evaltype integer DEFAULT '0' NOT NULL,\
 
2177
 status integer DEFAULT '0' NOT NULL,\
 
2178
 esc_period integer DEFAULT '0' NOT NULL,\
 
2179
 def_shortdata varchar(255) DEFAULT '' NOT NULL,\
 
2180
 def_longdata text DEFAULT '' NOT NULL,\
 
2181
 recovery_msg integer DEFAULT '0' NOT NULL,\
 
2182
 r_shortdata varchar(255) DEFAULT '' NOT NULL,\
 
2183
 r_longdata text DEFAULT '' NOT NULL,\
 
2184
 PRIMARY KEY (actionid)\
 
2185
) with OIDS;\
 
2186
CREATE TABLE operations (\
 
2187
 operationid bigint DEFAULT '0' NOT NULL,\
 
2188
 actionid bigint DEFAULT '0' NOT NULL,\
 
2189
 operationtype integer DEFAULT '0' NOT NULL,\
 
2190
 object integer DEFAULT '0' NOT NULL,\
 
2191
 objectid bigint DEFAULT '0' NOT NULL,\
 
2192
 shortdata varchar(255) DEFAULT '' NOT NULL,\
 
2193
 longdata text DEFAULT '' NOT NULL,\
 
2194
 esc_period integer DEFAULT '0' NOT NULL,\
 
2195
 esc_step_from integer DEFAULT '0' NOT NULL,\
 
2196
 esc_step_to integer DEFAULT '0' NOT NULL,\
 
2197
 default_msg integer DEFAULT '0' NOT NULL,\
 
2198
 evaltype integer DEFAULT '0' NOT NULL,\
 
2199
 PRIMARY KEY (operationid)\
 
2200
) with OIDS;\
 
2201
CREATE INDEX operations_1 on operations (actionid);\
 
2202
CREATE TABLE opconditions (\
 
2203
 opconditionid bigint DEFAULT '0' NOT NULL,\
 
2204
 operationid bigint DEFAULT '0' NOT NULL,\
 
2205
 conditiontype integer DEFAULT '0' NOT NULL,\
 
2206
 operator integer DEFAULT '0' NOT NULL,\
 
2207
 value varchar(255) DEFAULT '' NOT NULL,\
 
2208
 PRIMARY KEY (opconditionid)\
 
2209
) with OIDS;\
 
2210
CREATE INDEX opconditions_1 on opconditions (operationid);\
 
2211
CREATE TABLE escalations (\
 
2212
 escalationid bigint DEFAULT '0' NOT NULL,\
 
2213
 actionid bigint DEFAULT '0' NOT NULL,\
 
2214
 triggerid bigint DEFAULT '0' NOT NULL,\
 
2215
 eventid bigint DEFAULT '0' NOT NULL,\
 
2216
 r_eventid bigint DEFAULT '0' NOT NULL,\
 
2217
 nextcheck integer DEFAULT '0' NOT NULL,\
 
2218
 esc_step integer DEFAULT '0' NOT NULL,\
 
2219
 status integer DEFAULT '0' NOT NULL,\
 
2220
 PRIMARY KEY (escalationid)\
 
2221
) with OIDS;\
 
2222
CREATE INDEX escalations_1 on escalations (actionid,triggerid);\
 
2223
CREATE TABLE applications (\
 
2224
 applicationid bigint DEFAULT '0' NOT NULL,\
 
2225
 hostid bigint DEFAULT '0' NOT NULL,\
 
2226
 name varchar(255) DEFAULT '' NOT NULL,\
 
2227
 templateid bigint DEFAULT '0' NOT NULL,\
 
2228
 PRIMARY KEY (applicationid)\
 
2229
) with OIDS;\
 
2230
CREATE INDEX applications_1 on applications (templateid);\
 
2231
CREATE UNIQUE INDEX applications_2 on applications (hostid,name);\
 
2232
CREATE TABLE conditions (\
 
2233
 conditionid bigint DEFAULT '0' NOT NULL,\
 
2234
 actionid bigint DEFAULT '0' NOT NULL,\
 
2235
 conditiontype integer DEFAULT '0' NOT NULL,\
 
2236
 operator integer DEFAULT '0' NOT NULL,\
 
2237
 value varchar(255) DEFAULT '' NOT NULL,\
 
2238
 PRIMARY KEY (conditionid)\
 
2239
) with OIDS;\
 
2240
CREATE INDEX conditions_1 on conditions (actionid);\
2235
2241
CREATE TABLE config (\
2236
 
        configid                bigin           DEFAULT '0'     NOT NULL,\
2237
 
        aler _his ory           in eger         DEFAULT '0'     NOT NULL,\
2238
 
        even _his ory           in eger         DEFAULT '0'     NOT NULL,\
2239
 
        refresh_unsuppor ed             in eger         DEFAULT '0'     NOT NULL,\
2240
 
        work_period             varchar(100)            DEFAULT '1-5,00:00-24:00'       NOT NULL,\
2241
 
        aler _usrgrpid          bigin           DEFAULT '0'     NOT NULL,\
2242
 
        even _ack_enable                in eger         DEFAULT '1'     NOT NULL,\
2243
 
        even _expire            in eger         DEFAULT '7'     NOT NULL,\
2244
 
        even _show_max          in eger         DEFAULT '100'   NOT NULL,\
2245
 
        defaul _ heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
2246
 
        au hen ica ion_ ype             in eger         DEFAULT 0       NOT NULL,\
2247
 
        ldap_hos                varchar(255)            DEFAULT ''      NOT NULL,\
2248
 
        ldap_por                in eger         DEFAULT 389     NOT NULL,\
2249
 
        ldap_base_dn            varchar(255)            DEFAULT ''      NOT NULL,\
2250
 
        ldap_bind_dn            varchar(255)            DEFAULT ''      NOT NULL,\
2251
 
        ldap_bind_password              varchar(128)            DEFAULT ''      NOT NULL,\
2252
 
        ldap_search_a ribu e            varchar(128)            DEFAULT ''      NOT NULL,\
2253
 
        PRIMARY KEY (configid)\
2254
 
) wi h OIDS;\
2255
 
CREATE TABLE func ions (\
2256
 
        func ionid              bigin           DEFAULT '0'     NOT NULL,\
2257
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2258
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
2259
 
        las value               varchar(255)                    ,\
2260
 
        func ion                varchar(12)             DEFAULT ''      NOT NULL,\
2261
 
        parame er               varchar(255)            DEFAULT '0'     NOT NULL,\
2262
 
        PRIMARY KEY (func ionid)\
2263
 
) wi h OIDS;\
2264
 
CREATE INDEX func ions_1 on func ions ( riggerid);\
2265
 
CREATE INDEX func ions_2 on func ions (i emid,func ion,parame er);\
 
2242
 configid bigint DEFAULT '0' NOT NULL,\
 
2243
 alert_history integer DEFAULT '0' NOT NULL,\
 
2244
 event_history integer DEFAULT '0' NOT NULL,\
 
2245
 refresh_unsupported integer DEFAULT '0' NOT NULL,\
 
2246
 work_period varchar(100) DEFAULT '1-5,00:00-24:00' NOT NULL,\
 
2247
 alert_usrgrpid bigint DEFAULT '0' NOT NULL,\
 
2248
 event_ack_enable integer DEFAULT '1' NOT NULL,\
 
2249
 event_expire integer DEFAULT '7' NOT NULL,\
 
2250
 event_show_max integer DEFAULT '100' NOT NULL,\
 
2251
 default_theme varchar(128) DEFAULT 'default.css' NOT NULL,\
 
2252
 authentication_type integer DEFAULT 0 NOT NULL,\
 
2253
 ldap_host varchar(255) DEFAULT '' NOT NULL,\
 
2254
 ldap_port integer DEFAULT 389 NOT NULL,\
 
2255
 ldap_base_dn varchar(255) DEFAULT '' NOT NULL,\
 
2256
 ldap_bind_dn varchar(255) DEFAULT '' NOT NULL,\
 
2257
 ldap_bind_password varchar(128) DEFAULT '' NOT NULL,\
 
2258
 ldap_search_attribute varchar(128) DEFAULT '' NOT NULL,\
 
2259
 PRIMARY KEY (configid)\
 
2260
) with OIDS;\
 
2261
CREATE TABLE functions (\
 
2262
 functionid bigint DEFAULT '0' NOT NULL,\
 
2263
 itemid bigint DEFAULT '0' NOT NULL,\
 
2264
 triggerid bigint DEFAULT '0' NOT NULL,\
 
2265
 lastvalue varchar(255) ,\
 
2266
 function varchar(12) DEFAULT '' NOT NULL,\
 
2267
 parameter varchar(255) DEFAULT '0' NOT NULL,\
 
2268
 PRIMARY KEY (functionid)\
 
2269
) with OIDS;\
 
2270
CREATE INDEX functions_1 on functions (triggerid);\
 
2271
CREATE INDEX functions_2 on functions (itemid,function,parameter);\
2266
2272
CREATE TABLE graphs (\
2267
 
        graphid         bigin           DEFAULT '0'     NOT NULL,\
2268
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
2269
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
2270
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
2271
 
        yaxis ype               in eger         DEFAULT '0'     NOT NULL,\
2272
 
        yaxismin                numeric(16,4)           DEFAULT '0'     NOT NULL,\
2273
 
        yaxismax                numeric(16,4)           DEFAULT '0'     NOT NULL,\
2274
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
2275
 
        show_work_period                in eger         DEFAULT '1'     NOT NULL,\
2276
 
        show_ riggers           in eger         DEFAULT '1'     NOT NULL,\
2277
 
        graph ype               in eger         DEFAULT '0'     NOT NULL,\
2278
 
        show_legend             in eger         DEFAULT '0'     NOT NULL,\
2279
 
        show_3d         in eger         DEFAULT '0'     NOT NULL,\
2280
 
        percen _lef             numeric(16,4)           DEFAULT '0'     NOT NULL,\
2281
 
        percen _righ            numeric(16,4)           DEFAULT '0'     NOT NULL,\
2282
 
        PRIMARY KEY (graphid)\
2283
 
) wi h OIDS;\
 
2273
 graphid bigint DEFAULT '0' NOT NULL,\
 
2274
 name varchar(128) DEFAULT '' NOT NULL,\
 
2275
 width integer DEFAULT '0' NOT NULL,\
 
2276
 height integer DEFAULT '0' NOT NULL,\
 
2277
 yaxistype integer DEFAULT '0' NOT NULL,\
 
2278
 yaxismin numeric(16,4) DEFAULT '0' NOT NULL,\
 
2279
 yaxismax numeric(16,4) DEFAULT '0' NOT NULL,\
 
2280
 templateid bigint DEFAULT '0' NOT NULL,\
 
2281
 show_work_period integer DEFAULT '1' NOT NULL,\
 
2282
 show_triggers integer DEFAULT '1' NOT NULL,\
 
2283
 graphtype integer DEFAULT '0' NOT NULL,\
 
2284
 show_legend integer DEFAULT '0' NOT NULL,\
 
2285
 show_3d integer DEFAULT '0' NOT NULL,\
 
2286
 percent_left numeric(16,4) DEFAULT '0' NOT NULL,\
 
2287
 percent_right numeric(16,4) DEFAULT '0' NOT NULL,\
 
2288
 PRIMARY KEY (graphid)\
 
2289
) with OIDS;\
2284
2290
CREATE INDEX graphs_graphs_1 on graphs (name);\
2285
 
CREATE TABLE graphs_i ems (\
2286
 
        gi emid         bigin           DEFAULT '0'     NOT NULL,\
2287
 
        graphid         bigin           DEFAULT '0'     NOT NULL,\
2288
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2289
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
2290
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
2291
 
        color           varchar(32)             DEFAULT '009600'        NOT NULL,\
2292
 
        yaxisside               in eger         DEFAULT '1'     NOT NULL,\
2293
 
        calc_fnc                in eger         DEFAULT '2'     NOT NULL,\
2294
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2295
 
        periods_cn              in eger         DEFAULT '5'     NOT NULL,\
2296
 
        PRIMARY KEY (gi emid)\
2297
 
) wi h OIDS;\
 
2291
CREATE TABLE graphs_items (\
 
2292
 gitemid bigint DEFAULT '0' NOT NULL,\
 
2293
 graphid bigint DEFAULT '0' NOT NULL,\
 
2294
 itemid bigint DEFAULT '0' NOT NULL,\
 
2295
 drawtype integer DEFAULT '0' NOT NULL,\
 
2296
 sortorder integer DEFAULT '0' NOT NULL,\
 
2297
 color varchar(32) DEFAULT '009600' NOT NULL,\
 
2298
 yaxisside integer DEFAULT '1' NOT NULL,\
 
2299
 calc_fnc integer DEFAULT '2' NOT NULL,\
 
2300
 type integer DEFAULT '0' NOT NULL,\
 
2301
 periods_cnt integer DEFAULT '5' NOT NULL,\
 
2302
 PRIMARY KEY (gitemid)\
 
2303
) with OIDS;\
 
2304
CREATE INDEX graphs_items_1 on graphs_items (itemid);\
 
2305
CREATE INDEX graphs_items_2 on graphs_items (graphid);\
2298
2306
CREATE TABLE groups (\
2299
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
2300
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
2301
 
        PRIMARY KEY (groupid)\
2302
 
) wi h OIDS;\
 
2307
 groupid bigint DEFAULT '0' NOT NULL,\
 
2308
 name varchar(64) DEFAULT '' NOT NULL,\
 
2309
 PRIMARY KEY (groupid)\
 
2310
) with OIDS;\
2303
2311
CREATE INDEX groups_1 on groups (name);\
2304
 
CREATE TABLE help_i ems (\
2305
 
        i em ype                in eger         DEFAULT '0'     NOT NULL,\
2306
 
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
2307
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
2308
 
        PRIMARY KEY (i em ype,key_)\
2309
 
) wi h OIDS;\
2310
 
CREATE TABLE hos s (\
2311
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2312
 
        proxy_hos id            bigin           DEFAULT '0'     NOT NULL,\
2313
 
        hos             varchar(64)             DEFAULT ''      NOT NULL,\
2314
 
        dns             varchar(64)             DEFAULT ''      NOT NULL,\
2315
 
        useip           in eger         DEFAULT '1'     NOT NULL,\
2316
 
        ip              varchar(39)             DEFAULT '127.0.0.1'     NOT NULL,\
2317
 
        por             in eger         DEFAULT '10050' NOT NULL,\
2318
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2319
 
        disable_un il           in eger         DEFAULT '0'     NOT NULL,\
2320
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
2321
 
        available               in eger         DEFAULT '0'     NOT NULL,\
2322
 
        errors_from             in eger         DEFAULT '0'     NOT NULL,\
2323
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
2324
 
        inby es         bigin           DEFAULT '0'     NOT NULL,\
2325
 
        ou by es                bigin           DEFAULT '0'     NOT NULL,\
2326
 
        useipmi         in eger         DEFAULT '0'     NOT NULL,\
2327
 
        ipmi_por                in eger         DEFAULT '623'   NOT NULL,\
2328
 
        ipmi_au h ype           in eger         DEFAULT '0'     NOT NULL,\
2329
 
        ipmi_privilege          in eger         DEFAULT '2'     NOT NULL,\
2330
 
        ipmi_username           varchar(16)             DEFAULT ''      NOT NULL,\
2331
 
        ipmi_password           varchar(20)             DEFAULT ''      NOT NULL,\
2332
 
        ipmi_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
2333
 
        ipmi_available          in eger         DEFAULT '0'     NOT NULL,\
2334
 
        snmp_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
2335
 
        snmp_available          in eger         DEFAULT '0'     NOT NULL,\
2336
 
        PRIMARY KEY (hos id)\
2337
 
) wi h OIDS;\
2338
 
CREATE INDEX hos s_1 on hos s (hos );\
2339
 
CREATE INDEX hos s_2 on hos s (s a us);\
2340
 
CREATE INDEX hos s_3 on hos s (proxy_hos id);\
2341
 
CREATE TABLE hos s_groups (\
2342
 
        hos groupid             bigin           DEFAULT '0'     NOT NULL,\
2343
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2344
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
2345
 
        PRIMARY KEY (hos groupid)\
2346
 
) wi h OIDS;\
2347
 
CREATE INDEX hos s_groups_groups_1 on hos s_groups (hos id,groupid);\
2348
 
CREATE TABLE hos s_profiles (\
2349
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2350
 
        device ype              varchar(64)             DEFAULT ''      NOT NULL,\
2351
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
2352
 
        os              varchar(64)             DEFAULT ''      NOT NULL,\
2353
 
        serialno                varchar(64)             DEFAULT ''      NOT NULL,\
2354
 
         ag             varchar(64)             DEFAULT ''      NOT NULL,\
2355
 
        macaddress              varchar(64)             DEFAULT ''      NOT NULL,\
2356
 
        hardware                 ex             DEFAULT ''      NOT NULL,\
2357
 
        sof ware                 ex             DEFAULT ''      NOT NULL,\
2358
 
        con ac           ex             DEFAULT ''      NOT NULL,\
2359
 
        loca ion                 ex             DEFAULT ''      NOT NULL,\
2360
 
        no es            ex             DEFAULT ''      NOT NULL,\
2361
 
        PRIMARY KEY (hos id)\
2362
 
) wi h OIDS;\
2363
 
CREATE TABLE hos s_profiles_ex  (\
2364
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2365
 
        device_alias            varchar(64)             DEFAULT ''      NOT NULL,\
2366
 
        device_ ype             varchar(64)             DEFAULT ''      NOT NULL,\
2367
 
        device_chassis          varchar(64)             DEFAULT ''      NOT NULL,\
2368
 
        device_os               varchar(64)             DEFAULT ''      NOT NULL,\
2369
 
        device_os_shor          varchar(64)             DEFAULT ''      NOT NULL,\
2370
 
        device_hw_arch          varchar(32)             DEFAULT ''      NOT NULL,\
2371
 
        device_serial           varchar(64)             DEFAULT ''      NOT NULL,\
2372
 
        device_model            varchar(64)             DEFAULT ''      NOT NULL,\
2373
 
        device_ ag              varchar(64)             DEFAULT ''      NOT NULL,\
2374
 
        device_vendor           varchar(64)             DEFAULT ''      NOT NULL,\
2375
 
        device_con rac          varchar(64)             DEFAULT ''      NOT NULL,\
2376
 
        device_who              varchar(64)             DEFAULT ''      NOT NULL,\
2377
 
        device_s a us           varchar(64)             DEFAULT ''      NOT NULL,\
2378
 
        device_app_01           varchar(64)             DEFAULT ''      NOT NULL,\
2379
 
        device_app_02           varchar(64)             DEFAULT ''      NOT NULL,\
2380
 
        device_app_03           varchar(64)             DEFAULT ''      NOT NULL,\
2381
 
        device_app_04           varchar(64)             DEFAULT ''      NOT NULL,\
2382
 
        device_app_05           varchar(64)             DEFAULT ''      NOT NULL,\
2383
 
        device_url_1            varchar(255)            DEFAULT ''      NOT NULL,\
2384
 
        device_url_2            varchar(255)            DEFAULT ''      NOT NULL,\
2385
 
        device_url_3            varchar(255)            DEFAULT ''      NOT NULL,\
2386
 
        device_ne works          ex             DEFAULT ''      NOT NULL,\
2387
 
        device_no es             ex             DEFAULT ''      NOT NULL,\
2388
 
        device_hardware          ex             DEFAULT ''      NOT NULL,\
2389
 
        device_sof ware          ex             DEFAULT ''      NOT NULL,\
2390
 
        ip_subne _mask          varchar(39)             DEFAULT ''      NOT NULL,\
2391
 
        ip_rou er               varchar(39)             DEFAULT ''      NOT NULL,\
2392
 
        ip_macaddress           varchar(64)             DEFAULT ''      NOT NULL,\
2393
 
        oob_ip          varchar(39)             DEFAULT ''      NOT NULL,\
2394
 
        oob_subne _mask         varchar(39)             DEFAULT ''      NOT NULL,\
2395
 
        oob_rou er              varchar(39)             DEFAULT ''      NOT NULL,\
2396
 
        da e_hw_buy             varchar(64)             DEFAULT ''      NOT NULL,\
2397
 
        da e_hw_ins all         varchar(64)             DEFAULT ''      NOT NULL,\
2398
 
        da e_hw_expiry          varchar(64)             DEFAULT ''      NOT NULL,\
2399
 
        da e_hw_decomm          varchar(64)             DEFAULT ''      NOT NULL,\
2400
 
        si e_s ree _1           varchar(128)            DEFAULT ''      NOT NULL,\
2401
 
        si e_s ree _2           varchar(128)            DEFAULT ''      NOT NULL,\
2402
 
        si e_s ree _3           varchar(128)            DEFAULT ''      NOT NULL,\
2403
 
        si e_ci y               varchar(128)            DEFAULT ''      NOT NULL,\
2404
 
        si e_s a e              varchar(64)             DEFAULT ''      NOT NULL,\
2405
 
        si e_coun ry            varchar(64)             DEFAULT ''      NOT NULL,\
2406
 
        si e_zip                varchar(64)             DEFAULT ''      NOT NULL,\
2407
 
        si e_rack               varchar(128)            DEFAULT ''      NOT NULL,\
2408
 
        si e_no es               ex             DEFAULT ''      NOT NULL,\
2409
 
        poc_1_name              varchar(128)            DEFAULT ''      NOT NULL,\
2410
 
        poc_1_email             varchar(128)            DEFAULT ''      NOT NULL,\
2411
 
        poc_1_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
2412
 
        poc_1_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
2413
 
        poc_1_cell              varchar(64)             DEFAULT ''      NOT NULL,\
2414
 
        poc_1_screen            varchar(64)             DEFAULT ''      NOT NULL,\
2415
 
        poc_1_no es              ex             DEFAULT ''      NOT NULL,\
2416
 
        poc_2_name              varchar(128)            DEFAULT ''      NOT NULL,\
2417
 
        poc_2_email             varchar(128)            DEFAULT ''      NOT NULL,\
2418
 
        poc_2_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
2419
 
        poc_2_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
2420
 
        poc_2_cell              varchar(64)             DEFAULT ''      NOT NULL,\
2421
 
        poc_2_screen            varchar(64)             DEFAULT ''      NOT NULL,\
2422
 
        poc_2_no es              ex             DEFAULT ''      NOT NULL,\
2423
 
        PRIMARY KEY (hos id)\
2424
 
) wi h OIDS;\
2425
 
CREATE TABLE hos s_ empla es (\
2426
 
        hos empla eid           bigin           DEFAULT '0'     NOT NULL,\
2427
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2428
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
2429
 
        PRIMARY KEY (hos empla eid)\
2430
 
) wi h OIDS;\
2431
 
CREATE UNIQUE INDEX hos s_ empla es_1 on hos s_ empla es (hos id, empla eid);\
 
2312
CREATE TABLE help_items (\
 
2313
 itemtype integer DEFAULT '0' NOT NULL,\
 
2314
 key_ varchar(255) DEFAULT '' NOT NULL,\
 
2315
 description varchar(255) DEFAULT '' NOT NULL,\
 
2316
 PRIMARY KEY (itemtype,key_)\
 
2317
) with OIDS;\
 
2318
CREATE TABLE hosts (\
 
2319
 hostid bigint DEFAULT '0' NOT NULL,\
 
2320
 proxy_hostid bigint DEFAULT '0' NOT NULL,\
 
2321
 host varchar(64) DEFAULT '' NOT NULL,\
 
2322
 dns varchar(64) DEFAULT '' NOT NULL,\
 
2323
 useip integer DEFAULT '1' NOT NULL,\
 
2324
 ip varchar(39) DEFAULT '127.0.0.1' NOT NULL,\
 
2325
 port integer DEFAULT '10050' NOT NULL,\
 
2326
 status integer DEFAULT '0' NOT NULL,\
 
2327
 disable_until integer DEFAULT '0' NOT NULL,\
 
2328
 error varchar(128) DEFAULT '' NOT NULL,\
 
2329
 available integer DEFAULT '0' NOT NULL,\
 
2330
 errors_from integer DEFAULT '0' NOT NULL,\
 
2331
 lastaccess integer DEFAULT '0' NOT NULL,\
 
2332
 inbytes bigint DEFAULT '0' NOT NULL,\
 
2333
 outbytes bigint DEFAULT '0' NOT NULL,\
 
2334
 useipmi integer DEFAULT '0' NOT NULL,\
 
2335
 ipmi_port integer DEFAULT '623' NOT NULL,\
 
2336
 ipmi_authtype integer DEFAULT '0' NOT NULL,\
 
2337
 ipmi_privilege integer DEFAULT '2' NOT NULL,\
 
2338
 ipmi_username varchar(16) DEFAULT '' NOT NULL,\
 
2339
 ipmi_password varchar(20) DEFAULT '' NOT NULL,\
 
2340
 ipmi_disable_until integer DEFAULT '0' NOT NULL,\
 
2341
 ipmi_available integer DEFAULT '0' NOT NULL,\
 
2342
 snmp_disable_until integer DEFAULT '0' NOT NULL,\
 
2343
 snmp_available integer DEFAULT '0' NOT NULL,\
 
2344
 PRIMARY KEY (hostid)\
 
2345
) with OIDS;\
 
2346
CREATE INDEX hosts_1 on hosts (host);\
 
2347
CREATE INDEX hosts_2 on hosts (status);\
 
2348
CREATE INDEX hosts_3 on hosts (proxy_hostid);\
 
2349
CREATE TABLE hosts_groups (\
 
2350
 hostgroupid bigint DEFAULT '0' NOT NULL,\
 
2351
 hostid bigint DEFAULT '0' NOT NULL,\
 
2352
 groupid bigint DEFAULT '0' NOT NULL,\
 
2353
 PRIMARY KEY (hostgroupid)\
 
2354
) with OIDS;\
 
2355
CREATE INDEX hosts_groups_groups_1 on hosts_groups (hostid,groupid);\
 
2356
CREATE TABLE hosts_profiles (\
 
2357
 hostid bigint DEFAULT '0' NOT NULL,\
 
2358
 devicetype varchar(64) DEFAULT '' NOT NULL,\
 
2359
 name varchar(64) DEFAULT '' NOT NULL,\
 
2360
 os varchar(64) DEFAULT '' NOT NULL,\
 
2361
 serialno varchar(64) DEFAULT '' NOT NULL,\
 
2362
 tag varchar(64) DEFAULT '' NOT NULL,\
 
2363
 macaddress varchar(64) DEFAULT '' NOT NULL,\
 
2364
 hardware text DEFAULT '' NOT NULL,\
 
2365
 software text DEFAULT '' NOT NULL,\
 
2366
 contact text DEFAULT '' NOT NULL,\
 
2367
 location text DEFAULT '' NOT NULL,\
 
2368
 notes text DEFAULT '' NOT NULL,\
 
2369
 PRIMARY KEY (hostid)\
 
2370
) with OIDS;\
 
2371
CREATE TABLE hosts_profiles_ext (\
 
2372
 hostid bigint DEFAULT '0' NOT NULL,\
 
2373
 device_alias varchar(64) DEFAULT '' NOT NULL,\
 
2374
 device_type varchar(64) DEFAULT '' NOT NULL,\
 
2375
 device_chassis varchar(64) DEFAULT '' NOT NULL,\
 
2376
 device_os varchar(64) DEFAULT '' NOT NULL,\
 
2377
 device_os_short varchar(64) DEFAULT '' NOT NULL,\
 
2378
 device_hw_arch varchar(32) DEFAULT '' NOT NULL,\
 
2379
 device_serial varchar(64) DEFAULT '' NOT NULL,\
 
2380
 device_model varchar(64) DEFAULT '' NOT NULL,\
 
2381
 device_tag varchar(64) DEFAULT '' NOT NULL,\
 
2382
 device_vendor varchar(64) DEFAULT '' NOT NULL,\
 
2383
 device_contract varchar(64) DEFAULT '' NOT NULL,\
 
2384
 device_who varchar(64) DEFAULT '' NOT NULL,\
 
2385
 device_status varchar(64) DEFAULT '' NOT NULL,\
 
2386
 device_app_01 varchar(64) DEFAULT '' NOT NULL,\
 
2387
 device_app_02 varchar(64) DEFAULT '' NOT NULL,\
 
2388
 device_app_03 varchar(64) DEFAULT '' NOT NULL,\
 
2389
 device_app_04 varchar(64) DEFAULT '' NOT NULL,\
 
2390
 device_app_05 varchar(64) DEFAULT '' NOT NULL,\
 
2391
 device_url_1 varchar(255) DEFAULT '' NOT NULL,\
 
2392
 device_url_2 varchar(255) DEFAULT '' NOT NULL,\
 
2393
 device_url_3 varchar(255) DEFAULT '' NOT NULL,\
 
2394
 device_networks text DEFAULT '' NOT NULL,\
 
2395
 device_notes text DEFAULT '' NOT NULL,\
 
2396
 device_hardware text DEFAULT '' NOT NULL,\
 
2397
 device_software text DEFAULT '' NOT NULL,\
 
2398
 ip_subnet_mask varchar(39) DEFAULT '' NOT NULL,\
 
2399
 ip_router varchar(39) DEFAULT '' NOT NULL,\
 
2400
 ip_macaddress varchar(64) DEFAULT '' NOT NULL,\
 
2401
 oob_ip varchar(39) DEFAULT '' NOT NULL,\
 
2402
 oob_subnet_mask varchar(39) DEFAULT '' NOT NULL,\
 
2403
 oob_router varchar(39) DEFAULT '' NOT NULL,\
 
2404
 date_hw_buy varchar(64) DEFAULT '' NOT NULL,\
 
2405
 date_hw_install varchar(64) DEFAULT '' NOT NULL,\
 
2406
 date_hw_expiry varchar(64) DEFAULT '' NOT NULL,\
 
2407
 date_hw_decomm varchar(64) DEFAULT '' NOT NULL,\
 
2408
 site_street_1 varchar(128) DEFAULT '' NOT NULL,\
 
2409
 site_street_2 varchar(128) DEFAULT '' NOT NULL,\
 
2410
 site_street_3 varchar(128) DEFAULT '' NOT NULL,\
 
2411
 site_city varchar(128) DEFAULT '' NOT NULL,\
 
2412
 site_state varchar(64) DEFAULT '' NOT NULL,\
 
2413
 site_country varchar(64) DEFAULT '' NOT NULL,\
 
2414
 site_zip varchar(64) DEFAULT '' NOT NULL,\
 
2415
 site_rack varchar(128) DEFAULT '' NOT NULL,\
 
2416
 site_notes text DEFAULT '' NOT NULL,\
 
2417
 poc_1_name varchar(128) DEFAULT '' NOT NULL,\
 
2418
 poc_1_email varchar(128) DEFAULT '' NOT NULL,\
 
2419
 poc_1_phone_1 varchar(64) DEFAULT '' NOT NULL,\
 
2420
 poc_1_phone_2 varchar(64) DEFAULT '' NOT NULL,\
 
2421
 poc_1_cell varchar(64) DEFAULT '' NOT NULL,\
 
2422
 poc_1_screen varchar(64) DEFAULT '' NOT NULL,\
 
2423
 poc_1_notes text DEFAULT '' NOT NULL,\
 
2424
 poc_2_name varchar(128) DEFAULT '' NOT NULL,\
 
2425
 poc_2_email varchar(128) DEFAULT '' NOT NULL,\
 
2426
 poc_2_phone_1 varchar(64) DEFAULT '' NOT NULL,\
 
2427
 poc_2_phone_2 varchar(64) DEFAULT '' NOT NULL,\
 
2428
 poc_2_cell varchar(64) DEFAULT '' NOT NULL,\
 
2429
 poc_2_screen varchar(64) DEFAULT '' NOT NULL,\
 
2430
 poc_2_notes text DEFAULT '' NOT NULL,\
 
2431
 PRIMARY KEY (hostid)\
 
2432
) with OIDS;\
 
2433
CREATE TABLE hosts_templates (\
 
2434
 hosttemplateid bigint DEFAULT '0' NOT NULL,\
 
2435
 hostid bigint DEFAULT '0' NOT NULL,\
 
2436
 templateid bigint DEFAULT '0' NOT NULL,\
 
2437
 PRIMARY KEY (hosttemplateid)\
 
2438
) with OIDS;\
 
2439
CREATE UNIQUE INDEX hosts_templates_1 on hosts_templates (hostid,templateid);\
2432
2440
CREATE TABLE housekeeper (\
2433
 
        housekeeperid           bigin           DEFAULT '0'     NOT NULL,\
2434
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
2435
 
        field           varchar(64)             DEFAULT ''      NOT NULL,\
2436
 
        value           bigin           DEFAULT '0'     NOT NULL,\
2437
 
        PRIMARY KEY (housekeeperid)\
2438
 
) wi h OIDS;\
 
2441
 housekeeperid bigint DEFAULT '0' NOT NULL,\
 
2442
 tablename varchar(64) DEFAULT '' NOT NULL,\
 
2443
 field varchar(64) DEFAULT '' NOT NULL,\
 
2444
 value bigint DEFAULT '0' NOT NULL,\
 
2445
 PRIMARY KEY (housekeeperid)\
 
2446
) with OIDS;\
2439
2447
CREATE TABLE images (\
2440
 
        imageid         bigin           DEFAULT '0'     NOT NULL,\
2441
 
        image ype               in eger         DEFAULT '0'     NOT NULL,\
2442
 
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
2443
 
        image           by ea           DEFAULT ''      NOT NULL,\
2444
 
        PRIMARY KEY (imageid)\
2445
 
) wi h OIDS;\
2446
 
CREATE INDEX images_1 on images (image ype,name);\
2447
 
CREATE TABLE i ems (\
2448
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2449
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2450
 
        snmp_communi y          varchar(64)             DEFAULT ''      NOT NULL,\
2451
 
        snmp_oid                varchar(255)            DEFAULT ''      NOT NULL,\
2452
 
        snmp_por                in eger         DEFAULT '161'   NOT NULL,\
2453
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
2454
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
2455
 
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
2456
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
2457
 
        his ory         in eger         DEFAULT '90'    NOT NULL,\
2458
 
         rends          in eger         DEFAULT '365'   NOT NULL,\
2459
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
2460
 
        las value               varchar(255)                    NULL,\
2461
 
        las clock               in eger                 NULL,\
2462
 
        prevvalue               varchar(255)                    NULL,\
2463
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2464
 
        value_ ype              in eger         DEFAULT '0'     NOT NULL,\
2465
 
         rapper_hos s           varchar(255)            DEFAULT ''      NOT NULL,\
2466
 
        uni s           varchar(10)             DEFAULT ''      NOT NULL,\
2467
 
        mul iplier              in eger         DEFAULT '0'     NOT NULL,\
2468
 
        del a           in eger         DEFAULT '0'     NOT NULL,\
2469
 
        prevorgvalue            varchar(255)                    NULL,\
2470
 
        snmpv3_securi yname             varchar(64)             DEFAULT ''      NOT NULL,\
2471
 
        snmpv3_securi ylevel            in eger         DEFAULT '0'     NOT NULL,\
2472
 
        snmpv3_au hpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
2473
 
        snmpv3_privpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
2474
 
        formula         varchar(255)            DEFAULT '1'     NOT NULL,\
2475
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
2476
 
        las logsize             in eger         DEFAULT '0'     NOT NULL,\
2477
 
        log imefm               varchar(64)             DEFAULT ''      NOT NULL,\
2478
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
2479
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
2480
 
        delay_flex              varchar(255)            DEFAULT ''      NOT NULL,\
2481
 
        params           ex             DEFAULT ''      NOT NULL,\
2482
 
        ipmi_sensor             varchar(128)            DEFAULT ''      NOT NULL,\
2483
 
        PRIMARY KEY (i emid)\
2484
 
) wi h OIDS;\
2485
 
CREATE UNIQUE INDEX i ems_1 on i ems (hos id,key_);\
2486
 
CREATE INDEX i ems_2 on i ems (nex check);\
2487
 
CREATE INDEX i ems_3 on i ems (s a us);\
2488
 
CREATE INDEX i ems_4 on i ems ( empla eid);\
2489
 
CREATE TABLE i ems_applica ions (\
2490
 
        i emappid               bigin           DEFAULT '0'     NOT NULL,\
2491
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
2492
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
2493
 
        PRIMARY KEY (i emappid)\
2494
 
) wi h OIDS;\
2495
 
CREATE INDEX i ems_applica ions_1 on i ems_applica ions (applica ionid,i emid);\
2496
 
CREATE INDEX i ems_applica ions_2 on i ems_applica ions (i emid);\
 
2448
 imageid bigint DEFAULT '0' NOT NULL,\
 
2449
 imagetype integer DEFAULT '0' NOT NULL,\
 
2450
 name varchar(64) DEFAULT '0' NOT NULL,\
 
2451
 image bytea DEFAULT '' NOT NULL,\
 
2452
 PRIMARY KEY (imageid)\
 
2453
) with OIDS;\
 
2454
CREATE INDEX images_1 on images (imagetype,name);\
 
2455
CREATE TABLE items (\
 
2456
 itemid bigint DEFAULT '0' NOT NULL,\
 
2457
 type integer DEFAULT '0' NOT NULL,\
 
2458
 snmp_community varchar(64) DEFAULT '' NOT NULL,\
 
2459
 snmp_oid varchar(255) DEFAULT '' NOT NULL,\
 
2460
 snmp_port integer DEFAULT '161' NOT NULL,\
 
2461
 hostid bigint DEFAULT '0' NOT NULL,\
 
2462
 description varchar(255) DEFAULT '' NOT NULL,\
 
2463
 key_ varchar(255) DEFAULT '' NOT NULL,\
 
2464
 delay integer DEFAULT '0' NOT NULL,\
 
2465
 history integer DEFAULT '90' NOT NULL,\
 
2466
 trends integer DEFAULT '365' NOT NULL,\
 
2467
 nextcheck integer DEFAULT '0' NOT NULL,\
 
2468
 lastvalue varchar(255) NULL,\
 
2469
 lastclock integer NULL,\
 
2470
 prevvalue varchar(255) NULL,\
 
2471
 status integer DEFAULT '0' NOT NULL,\
 
2472
 value_type integer DEFAULT '0' NOT NULL,\
 
2473
 trapper_hosts varchar(255) DEFAULT '' NOT NULL,\
 
2474
 units varchar(10) DEFAULT '' NOT NULL,\
 
2475
 multiplier integer DEFAULT '0' NOT NULL,\
 
2476
 delta integer DEFAULT '0' NOT NULL,\
 
2477
 prevorgvalue varchar(255) NULL,\
 
2478
 snmpv3_securityname varchar(64) DEFAULT '' NOT NULL,\
 
2479
 snmpv3_securitylevel integer DEFAULT '0' NOT NULL,\
 
2480
 snmpv3_authpassphrase varchar(64) DEFAULT '' NOT NULL,\
 
2481
 snmpv3_privpassphrase varchar(64) DEFAULT '' NOT NULL,\
 
2482
 formula varchar(255) DEFAULT '1' NOT NULL,\
 
2483
 error varchar(128) DEFAULT '' NOT NULL,\
 
2484
 lastlogsize integer DEFAULT '0' NOT NULL,\
 
2485
 logtimefmt varchar(64) DEFAULT '' NOT NULL,\
 
2486
 templateid bigint DEFAULT '0' NOT NULL,\
 
2487
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
2488
 delay_flex varchar(255) DEFAULT '' NOT NULL,\
 
2489
 params text DEFAULT '' NOT NULL,\
 
2490
 ipmi_sensor varchar(128) DEFAULT '' NOT NULL,\
 
2491
 PRIMARY KEY (itemid)\
 
2492
) with OIDS;\
 
2493
CREATE UNIQUE INDEX items_1 on items (hostid,key_);\
 
2494
CREATE INDEX items_2 on items (nextcheck);\
 
2495
CREATE INDEX items_3 on items (status);\
 
2496
CREATE INDEX items_4 on items (templateid);\
 
2497
CREATE TABLE items_applications (\
 
2498
 itemappid bigint DEFAULT '0' NOT NULL,\
 
2499
 applicationid bigint DEFAULT '0' NOT NULL,\
 
2500
 itemid bigint DEFAULT '0' NOT NULL,\
 
2501
 PRIMARY KEY (itemappid)\
 
2502
) with OIDS;\
 
2503
CREATE INDEX items_applications_1 on items_applications (applicationid,itemid);\
 
2504
CREATE INDEX items_applications_2 on items_applications (itemid);\
2497
2505
CREATE TABLE mappings (\
2498
 
        mappingid               bigin           DEFAULT '0'     NOT NULL,\
2499
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
2500
 
        value           varchar(64)             DEFAULT ''      NOT NULL,\
2501
 
        newvalue                varchar(64)             DEFAULT ''      NOT NULL,\
2502
 
        PRIMARY KEY (mappingid)\
2503
 
) wi h OIDS;\
 
2506
 mappingid bigint DEFAULT '0' NOT NULL,\
 
2507
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
2508
 value varchar(64) DEFAULT '' NOT NULL,\
 
2509
 newvalue varchar(64) DEFAULT '' NOT NULL,\
 
2510
 PRIMARY KEY (mappingid)\
 
2511
) with OIDS;\
2504
2512
CREATE INDEX mappings_1 on mappings (valuemapid);\
2505
2513
CREATE TABLE media (\
2506
 
        mediaid         bigin           DEFAULT '0'     NOT NULL,\
2507
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2508
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
2509
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
2510
 
        ac ive          in eger         DEFAULT '0'     NOT NULL,\
2511
 
        severi y                in eger         DEFAULT '63'    NOT NULL,\
2512
 
        period          varchar(100)            DEFAULT '1-7,00:00-23:59'       NOT NULL,\
2513
 
        PRIMARY KEY (mediaid)\
2514
 
) wi h OIDS;\
 
2514
 mediaid bigint DEFAULT '0' NOT NULL,\
 
2515
 userid bigint DEFAULT '0' NOT NULL,\
 
2516
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
2517
 sendto varchar(100) DEFAULT '' NOT NULL,\
 
2518
 active integer DEFAULT '0' NOT NULL,\
 
2519
 severity integer DEFAULT '63' NOT NULL,\
 
2520
 period varchar(100) DEFAULT '1-7,00:00-23:59' NOT NULL,\
 
2521
 PRIMARY KEY (mediaid)\
 
2522
) with OIDS;\
2515
2523
CREATE INDEX media_1 on media (userid);\
2516
 
CREATE INDEX media_2 on media (media ypeid);\
2517
 
CREATE TABLE media_ ype (\
2518
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
2519
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2520
 
        descrip ion             varchar(100)            DEFAULT ''      NOT NULL,\
2521
 
        sm p_server             varchar(255)            DEFAULT ''      NOT NULL,\
2522
 
        sm p_helo               varchar(255)            DEFAULT ''      NOT NULL,\
2523
 
        sm p_email              varchar(255)            DEFAULT ''      NOT NULL,\
2524
 
        exec_pa h               varchar(255)            DEFAULT ''      NOT NULL,\
2525
 
        gsm_modem               varchar(255)            DEFAULT ''      NOT NULL,\
2526
 
        username                varchar(255)            DEFAULT ''      NOT NULL,\
2527
 
        passwd          varchar(255)            DEFAULT ''      NOT NULL,\
2528
 
        PRIMARY KEY (media ypeid)\
2529
 
) wi h OIDS;\
 
2524
CREATE INDEX media_2 on media (mediatypeid);\
 
2525
CREATE TABLE media_type (\
 
2526
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
2527
 type integer DEFAULT '0' NOT NULL,\
 
2528
 description varchar(100) DEFAULT '' NOT NULL,\
 
2529
 smtp_server varchar(255) DEFAULT '' NOT NULL,\
 
2530
 smtp_helo varchar(255) DEFAULT '' NOT NULL,\
 
2531
 smtp_email varchar(255) DEFAULT '' NOT NULL,\
 
2532
 exec_path varchar(255) DEFAULT '' NOT NULL,\
 
2533
 gsm_modem varchar(255) DEFAULT '' NOT NULL,\
 
2534
 username varchar(255) DEFAULT '' NOT NULL,\
 
2535
 passwd varchar(255) DEFAULT '' NOT NULL,\
 
2536
 PRIMARY KEY (mediatypeid)\
 
2537
) with OIDS;\
2530
2538
CREATE TABLE profiles (\
2531
 
        profileid               bigin           DEFAULT '0'     NOT NULL,\
2532
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2533
 
        idx             varchar(96)             DEFAULT ''      NOT NULL,\
2534
 
        idx2            bigin           DEFAULT '0'     NOT NULL,\
2535
 
        value_id                bigin           DEFAULT '0'     NOT NULL,\
2536
 
        value_in                in eger         DEFAULT '0'     NOT NULL,\
2537
 
        value_s r               varchar(255)            DEFAULT ''      NOT NULL,\
2538
 
        source          varchar(96)             DEFAULT ''      NOT NULL,\
2539
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2540
 
        PRIMARY KEY (profileid)\
2541
 
) wi h OIDS;\
 
2539
 profileid bigint DEFAULT '0' NOT NULL,\
 
2540
 userid bigint DEFAULT '0' NOT NULL,\
 
2541
 idx varchar(96) DEFAULT '' NOT NULL,\
 
2542
 idx2 bigint DEFAULT '0' NOT NULL,\
 
2543
 value_id bigint DEFAULT '0' NOT NULL,\
 
2544
 value_int integer DEFAULT '0' NOT NULL,\
 
2545
 value_str varchar(255) DEFAULT '' NOT NULL,\
 
2546
 source varchar(96) DEFAULT '' NOT NULL,\
 
2547
 type integer DEFAULT '0' NOT NULL,\
 
2548
 PRIMARY KEY (profileid)\
 
2549
) with OIDS;\
2542
2550
CREATE INDEX profiles_1 on profiles (userid,idx,idx2);\
2543
 
CREATE TABLE righ s (\
2544
 
        righ id         bigin           DEFAULT '0'     NOT NULL,\
2545
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
2546
 
        permission              in eger         DEFAULT '0'     NOT NULL,\
2547
 
        id              bigin                   ,\
2548
 
        PRIMARY KEY (righ id)\
2549
 
) wi h OIDS;\
2550
 
CREATE INDEX righ s_1 on righ s (groupid);\
2551
 
CREATE TABLE scrip s (\
2552
 
        scrip id                bigin           DEFAULT '0'     NOT NULL,\
2553
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
2554
 
        command         varchar(255)            DEFAULT ''      NOT NULL,\
2555
 
        hos _access             in eger         DEFAULT '2'     NOT NULL,\
2556
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
2557
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
2558
 
        PRIMARY KEY (scrip id)\
2559
 
) wi h OIDS;\
 
2551
CREATE TABLE rights (\
 
2552
 rightid bigint DEFAULT '0' NOT NULL,\
 
2553
 groupid bigint DEFAULT '0' NOT NULL,\
 
2554
 permission integer DEFAULT '0' NOT NULL,\
 
2555
 id bigint ,\
 
2556
 PRIMARY KEY (rightid)\
 
2557
) with OIDS;\
 
2558
CREATE INDEX rights_1 on rights (groupid);\
 
2559
CREATE TABLE scripts (\
 
2560
 scriptid bigint DEFAULT '0' NOT NULL,\
 
2561
 name varchar(255) DEFAULT '' NOT NULL,\
 
2562
 command varchar(255) DEFAULT '' NOT NULL,\
 
2563
 host_access integer DEFAULT '2' NOT NULL,\
 
2564
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
2565
 groupid bigint DEFAULT '0' NOT NULL,\
 
2566
 PRIMARY KEY (scriptid)\
 
2567
) with OIDS;\
2560
2568
CREATE TABLE screens (\
2561
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
2562
 
        name            varchar(255)            DEFAULT 'Screen'        NOT NULL,\
2563
 
        hsize           in eger         DEFAULT '1'     NOT NULL,\
2564
 
        vsize           in eger         DEFAULT '1'     NOT NULL,\
2565
 
        PRIMARY KEY (screenid)\
2566
 
) wi h OIDS;\
2567
 
CREATE TABLE screens_i ems (\
2568
 
        screeni emid            bigin           DEFAULT '0'     NOT NULL,\
2569
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
2570
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
2571
 
        resourceid              bigin           DEFAULT '0'     NOT NULL,\
2572
 
        wid h           in eger         DEFAULT '320'   NOT NULL,\
2573
 
        heigh           in eger         DEFAULT '200'   NOT NULL,\
2574
 
        x               in eger         DEFAULT '0'     NOT NULL,\
2575
 
        y               in eger         DEFAULT '0'     NOT NULL,\
2576
 
        colspan         in eger         DEFAULT '0'     NOT NULL,\
2577
 
        rowspan         in eger         DEFAULT '0'     NOT NULL,\
2578
 
        elemen s                in eger         DEFAULT '25'    NOT NULL,\
2579
 
        valign          in eger         DEFAULT '0'     NOT NULL,\
2580
 
        halign          in eger         DEFAULT '0'     NOT NULL,\
2581
 
        s yle           in eger         DEFAULT '0'     NOT NULL,\
2582
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
2583
 
        dynamic         in eger         DEFAULT '0'     NOT NULL,\
2584
 
        PRIMARY KEY (screeni emid)\
2585
 
) wi h OIDS;\
 
2569
 screenid bigint DEFAULT '0' NOT NULL,\
 
2570
 name varchar(255) DEFAULT 'Screen' NOT NULL,\
 
2571
 hsize integer DEFAULT '1' NOT NULL,\
 
2572
 vsize integer DEFAULT '1' NOT NULL,\
 
2573
 PRIMARY KEY (screenid)\
 
2574
) with OIDS;\
 
2575
CREATE TABLE screens_items (\
 
2576
 screenitemid bigint DEFAULT '0' NOT NULL,\
 
2577
 screenid bigint DEFAULT '0' NOT NULL,\
 
2578
 resourcetype integer DEFAULT '0' NOT NULL,\
 
2579
 resourceid bigint DEFAULT '0' NOT NULL,\
 
2580
 width integer DEFAULT '320' NOT NULL,\
 
2581
 height integer DEFAULT '200' NOT NULL,\
 
2582
 x integer DEFAULT '0' NOT NULL,\
 
2583
 y integer DEFAULT '0' NOT NULL,\
 
2584
 colspan integer DEFAULT '0' NOT NULL,\
 
2585
 rowspan integer DEFAULT '0' NOT NULL,\
 
2586
 elements integer DEFAULT '25' NOT NULL,\
 
2587
 valign integer DEFAULT '0' NOT NULL,\
 
2588
 halign integer DEFAULT '0' NOT NULL,\
 
2589
 style integer DEFAULT '0' NOT NULL,\
 
2590
 url varchar(255) DEFAULT '' NOT NULL,\
 
2591
 dynamic integer DEFAULT '0' NOT NULL,\
 
2592
 PRIMARY KEY (screenitemid)\
 
2593
) with OIDS;\
2586
2594
CREATE TABLE services (\
2587
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
2588
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
2589
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2590
 
        algori hm               in eger         DEFAULT '0'     NOT NULL,\
2591
 
         riggerid               bigin                   ,\
2592
 
        showsla         in eger         DEFAULT '0'     NOT NULL,\
2593
 
        goodsla         numeric(16,4)           DEFAULT '99.9'  NOT NULL,\
2594
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
2595
 
        PRIMARY KEY (serviceid)\
2596
 
) wi h OIDS;\
 
2595
 serviceid bigint DEFAULT '0' NOT NULL,\
 
2596
 name varchar(128) DEFAULT '' NOT NULL,\
 
2597
 status integer DEFAULT '0' NOT NULL,\
 
2598
 algorithm integer DEFAULT '0' NOT NULL,\
 
2599
 triggerid bigint ,\
 
2600
 showsla integer DEFAULT '0' NOT NULL,\
 
2601
 goodsla numeric(16,4) DEFAULT '99.9' NOT NULL,\
 
2602
 sortorder integer DEFAULT '0' NOT NULL,\
 
2603
 PRIMARY KEY (serviceid)\
 
2604
) with OIDS;\
2597
2605
CREATE TABLE services_links (\
2598
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
2599
 
        serviceupid             bigin           DEFAULT '0'     NOT NULL,\
2600
 
        servicedownid           bigin           DEFAULT '0'     NOT NULL,\
2601
 
        sof             in eger         DEFAULT '0'     NOT NULL,\
2602
 
        PRIMARY KEY (linkid)\
2603
 
) wi h OIDS;\
 
2606
 linkid bigint DEFAULT '0' NOT NULL,\
 
2607
 serviceupid bigint DEFAULT '0' NOT NULL,\
 
2608
 servicedownid bigint DEFAULT '0' NOT NULL,\
 
2609
 soft integer DEFAULT '0' NOT NULL,\
 
2610
 PRIMARY KEY (linkid)\
 
2611
) with OIDS;\
2604
2612
CREATE INDEX services_links_links_1 on services_links (servicedownid);\
2605
2613
CREATE UNIQUE INDEX services_links_links_2 on services_links (serviceupid,servicedownid);\
2606
2614
CREATE TABLE sessions (\
2607
 
        sessionid               varchar(32)             DEFAULT ''      NOT NULL,\
2608
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2609
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
2610
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2611
 
        PRIMARY KEY (sessionid)\
2612
 
) wi h OIDS;\
 
2615
 sessionid varchar(32) DEFAULT '' NOT NULL,\
 
2616
 userid bigint DEFAULT '0' NOT NULL,\
 
2617
 lastaccess integer DEFAULT '0' NOT NULL,\
 
2618
 status integer DEFAULT '0' NOT NULL,\
 
2619
 PRIMARY KEY (sessionid)\
 
2620
) with OIDS;\
2613
2621
CREATE TABLE sysmaps_links (\
2614
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
2615
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
2616
 
        selemen id1             bigin           DEFAULT '0'     NOT NULL,\
2617
 
        selemen id2             bigin           DEFAULT '0'     NOT NULL,\
2618
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
2619
 
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
2620
 
        PRIMARY KEY (linkid)\
2621
 
) wi h OIDS;\
2622
 
CREATE TABLE sysmaps_link_ riggers (\
2623
 
        link riggerid           bigin           DEFAULT '0'     NOT NULL,\
2624
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
2625
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
2626
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
2627
 
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
2628
 
        PRIMARY KEY (link riggerid)\
2629
 
) wi h OIDS;\
2630
 
CREATE UNIQUE INDEX sysmaps_link_ riggers_1 on sysmaps_link_ riggers (linkid, riggerid);\
2631
 
CREATE TABLE sysmaps_elemen s (\
2632
 
        selemen id              bigin           DEFAULT '0'     NOT NULL,\
2633
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
2634
 
        elemen id               bigin           DEFAULT '0'     NOT NULL,\
2635
 
        elemen ype              in eger         DEFAULT '0'     NOT NULL,\
2636
 
        iconid_off              bigin           DEFAULT '0'     NOT NULL,\
2637
 
        iconid_on               bigin           DEFAULT '0'     NOT NULL,\
2638
 
        iconid_unknown          bigin           DEFAULT '0'     NOT NULL,\
2639
 
        label           varchar(128)            DEFAULT ''      NOT NULL,\
2640
 
        label_loca ion          in eger                 NULL,\
2641
 
        x               in eger         DEFAULT '0'     NOT NULL,\
2642
 
        y               in eger         DEFAULT '0'     NOT NULL,\
2643
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
2644
 
        iconid_disabled         bigin           DEFAULT '0'     NOT NULL,\
2645
 
        PRIMARY KEY (selemen id)\
2646
 
) wi h OIDS;\
 
2622
 linkid bigint DEFAULT '0' NOT NULL,\
 
2623
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
2624
 selementid1 bigint DEFAULT '0' NOT NULL,\
 
2625
 selementid2 bigint DEFAULT '0' NOT NULL,\
 
2626
 drawtype integer DEFAULT '0' NOT NULL,\
 
2627
 color varchar(6) DEFAULT '000000' NOT NULL,\
 
2628
 PRIMARY KEY (linkid)\
 
2629
) with OIDS;\
 
2630
CREATE TABLE sysmaps_link_triggers (\
 
2631
 linktriggerid bigint DEFAULT '0' NOT NULL,\
 
2632
 linkid bigint DEFAULT '0' NOT NULL,\
 
2633
 triggerid bigint DEFAULT '0' NOT NULL,\
 
2634
 drawtype integer DEFAULT '0' NOT NULL,\
 
2635
 color varchar(6) DEFAULT '000000' NOT NULL,\
 
2636
 PRIMARY KEY (linktriggerid)\
 
2637
) with OIDS;\
 
2638
CREATE UNIQUE INDEX sysmaps_link_triggers_1 on sysmaps_link_triggers (linkid,triggerid);\
 
2639
CREATE TABLE sysmaps_elements (\
 
2640
 selementid bigint DEFAULT '0' NOT NULL,\
 
2641
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
2642
 elementid bigint DEFAULT '0' NOT NULL,\
 
2643
 elementtype integer DEFAULT '0' NOT NULL,\
 
2644
 iconid_off bigint DEFAULT '0' NOT NULL,\
 
2645
 iconid_on bigint DEFAULT '0' NOT NULL,\
 
2646
 iconid_unknown bigint DEFAULT '0' NOT NULL,\
 
2647
 label varchar(128) DEFAULT '' NOT NULL,\
 
2648
 label_location integer NULL,\
 
2649
 x integer DEFAULT '0' NOT NULL,\
 
2650
 y integer DEFAULT '0' NOT NULL,\
 
2651
 url varchar(255) DEFAULT '' NOT NULL,\
 
2652
 iconid_disabled bigint DEFAULT '0' NOT NULL,\
 
2653
 PRIMARY KEY (selementid)\
 
2654
) with OIDS;\
2647
2655
CREATE TABLE sysmaps (\
2648
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
2649
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
2650
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
2651
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
2652
 
        backgroundid            bigin           DEFAULT '0'     NOT NULL,\
2653
 
        label_ ype              in eger         DEFAULT '0'     NOT NULL,\
2654
 
        label_loca ion          in eger         DEFAULT '0'     NOT NULL,\
2655
 
        PRIMARY KEY (sysmapid)\
2656
 
) wi h OIDS;\
 
2656
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
2657
 name varchar(128) DEFAULT '' NOT NULL,\
 
2658
 width integer DEFAULT '0' NOT NULL,\
 
2659
 height integer DEFAULT '0' NOT NULL,\
 
2660
 backgroundid bigint DEFAULT '0' NOT NULL,\
 
2661
 label_type integer DEFAULT '0' NOT NULL,\
 
2662
 label_location integer DEFAULT '0' NOT NULL,\
 
2663
 PRIMARY KEY (sysmapid)\
 
2664
) with OIDS;\
2657
2665
CREATE INDEX sysmaps_1 on sysmaps (name);\
2658
 
CREATE TABLE  riggers (\
2659
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
2660
 
        expression              varchar(255)            DEFAULT ''      NOT NULL,\
2661
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
2662
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
2663
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
2664
 
        value           in eger         DEFAULT '0'     NOT NULL,\
2665
 
        priori y                in eger         DEFAULT '0'     NOT NULL,\
2666
 
        las change              in eger         DEFAULT '0'     NOT NULL,\
2667
 
        dep_level               in eger         DEFAULT '0'     NOT NULL,\
2668
 
        commen s                 ex             DEFAULT ''      NOT NULL,\
2669
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
2670
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
2671
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2672
 
        PRIMARY KEY ( riggerid)\
2673
 
) wi h OIDS;\
2674
 
CREATE INDEX  riggers_1 on  riggers (s a us);\
2675
 
CREATE INDEX  riggers_2 on  riggers (value);\
2676
 
CREATE TABLE  rigger_depends (\
2677
 
         riggerdepid            bigin           DEFAULT '0'     NOT NULL,\
2678
 
         riggerid_down          bigin           DEFAULT '0'     NOT NULL,\
2679
 
         riggerid_up            bigin           DEFAULT '0'     NOT NULL,\
2680
 
        PRIMARY KEY ( riggerdepid)\
2681
 
) wi h OIDS;\
2682
 
CREATE INDEX  rigger_depends_1 on  rigger_depends ( riggerid_down, riggerid_up);\
2683
 
CREATE INDEX  rigger_depends_2 on  rigger_depends ( riggerid_up);\
 
2666
CREATE TABLE triggers (\
 
2667
 triggerid bigint DEFAULT '0' NOT NULL,\
 
2668
 expression varchar(255) DEFAULT '' NOT NULL,\
 
2669
 description varchar(255) DEFAULT '' NOT NULL,\
 
2670
 url varchar(255) DEFAULT '' NOT NULL,\
 
2671
 status integer DEFAULT '0' NOT NULL,\
 
2672
 value integer DEFAULT '0' NOT NULL,\
 
2673
 priority integer DEFAULT '0' NOT NULL,\
 
2674
 lastchange integer DEFAULT '0' NOT NULL,\
 
2675
 dep_level integer DEFAULT '0' NOT NULL,\
 
2676
 comments text DEFAULT '' NOT NULL,\
 
2677
 error varchar(128) DEFAULT '' NOT NULL,\
 
2678
 templateid bigint DEFAULT '0' NOT NULL,\
 
2679
 type integer DEFAULT '0' NOT NULL,\
 
2680
 PRIMARY KEY (triggerid)\
 
2681
) with OIDS;\
 
2682
CREATE INDEX triggers_1 on triggers (status);\
 
2683
CREATE INDEX triggers_2 on triggers (value);\
 
2684
CREATE TABLE trigger_depends (\
 
2685
 triggerdepid bigint DEFAULT '0' NOT NULL,\
 
2686
 triggerid_down bigint DEFAULT '0' NOT NULL,\
 
2687
 triggerid_up bigint DEFAULT '0' NOT NULL,\
 
2688
 PRIMARY KEY (triggerdepid)\
 
2689
) with OIDS;\
 
2690
CREATE INDEX trigger_depends_1 on trigger_depends (triggerid_down,triggerid_up);\
 
2691
CREATE INDEX trigger_depends_2 on trigger_depends (triggerid_up);\
2684
2692
CREATE TABLE users (\
2685
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2686
 
        alias           varchar(100)            DEFAULT ''      NOT NULL,\
2687
 
        name            varchar(100)            DEFAULT ''      NOT NULL,\
2688
 
        surname         varchar(100)            DEFAULT ''      NOT NULL,\
2689
 
        passwd          char(32)                DEFAULT ''      NOT NULL,\
2690
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
2691
 
        au ologin               in eger         DEFAULT '0'     NOT NULL,\
2692
 
        au ologou               in eger         DEFAULT '900'   NOT NULL,\
2693
 
        lang            varchar(5)              DEFAULT 'en_gb' NOT NULL,\
2694
 
        refresh         in eger         DEFAULT '30'    NOT NULL,\
2695
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
2696
 
         heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
2697
 
        a emp _failed           in eger         DEFAULT 0       NOT NULL,\
2698
 
        a emp _ip               varchar(39)             DEFAULT ''      NOT NULL,\
2699
 
        a emp _clock            in eger         DEFAULT 0       NOT NULL,\
2700
 
        PRIMARY KEY (userid)\
2701
 
) wi h OIDS;\
 
2693
 userid bigint DEFAULT '0' NOT NULL,\
 
2694
 alias varchar(100) DEFAULT '' NOT NULL,\
 
2695
 name varchar(100) DEFAULT '' NOT NULL,\
 
2696
 surname varchar(100) DEFAULT '' NOT NULL,\
 
2697
 passwd char(32) DEFAULT '' NOT NULL,\
 
2698
 url varchar(255) DEFAULT '' NOT NULL,\
 
2699
 autologin integer DEFAULT '0' NOT NULL,\
 
2700
 autologout integer DEFAULT '900' NOT NULL,\
 
2701
 lang varchar(5) DEFAULT 'en_gb' NOT NULL,\
 
2702
 refresh integer DEFAULT '30' NOT NULL,\
 
2703
 type integer DEFAULT '0' NOT NULL,\
 
2704
 theme varchar(128) DEFAULT 'default.css' NOT NULL,\
 
2705
 attempt_failed integer DEFAULT 0 NOT NULL,\
 
2706
 attempt_ip varchar(39) DEFAULT '' NOT NULL,\
 
2707
 attempt_clock integer DEFAULT 0 NOT NULL,\
 
2708
 PRIMARY KEY (userid)\
 
2709
) with OIDS;\
2702
2710
CREATE INDEX users_1 on users (alias);\
2703
2711
CREATE TABLE usrgrp (\
2704
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
2705
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
2706
 
        gui_access              in eger         DEFAULT '0'     NOT NULL,\
2707
 
        users_s a us            in eger         DEFAULT '0'     NOT NULL,\
2708
 
        PRIMARY KEY (usrgrpid)\
2709
 
) wi h OIDS;\
 
2712
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
2713
 name varchar(64) DEFAULT '' NOT NULL,\
 
2714
 gui_access integer DEFAULT '0' NOT NULL,\
 
2715
 users_status integer DEFAULT '0' NOT NULL,\
 
2716
 PRIMARY KEY (usrgrpid)\
 
2717
) with OIDS;\
2710
2718
CREATE INDEX usrgrp_1 on usrgrp (name);\
2711
2719
CREATE TABLE users_groups (\
2712
 
        id              bigin           DEFAULT '0'     NOT NULL,\
2713
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
2714
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
2715
 
        PRIMARY KEY (id)\
2716
 
) wi h OIDS;\
 
2720
 id bigint DEFAULT '0' NOT NULL,\
 
2721
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
2722
 userid bigint DEFAULT '0' NOT NULL,\
 
2723
 PRIMARY KEY (id)\
 
2724
) with OIDS;\
2717
2725
CREATE INDEX users_groups_1 on users_groups (usrgrpid,userid);\
2718
2726
CREATE TABLE valuemaps (\
2719
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
2720
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
2721
 
        PRIMARY KEY (valuemapid)\
2722
 
) wi h OIDS;\
 
2727
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
2728
 name varchar(64) DEFAULT '' NOT NULL,\
 
2729
 PRIMARY KEY (valuemapid)\
 
2730
) with OIDS;\
2723
2731
CREATE INDEX valuemaps_1 on valuemaps (name);\
2724
2732
"};
2725
2733
#elif HAVE_ORACLE
2726
2734
const char *db_schema = {"\
2727
2735
CREATE TABLE slideshows (\
2728
 
        slideshowid             number(20)              DEFAULT '0'     NOT NULL,\
2729
 
        name            varchar2(255)           DEFAULT ''      ,\
2730
 
        delay           number(10)              DEFAULT '0'     NOT NULL,\
2731
 
        PRIMARY KEY (slideshowid)\
 
2736
 slideshowid number(20) DEFAULT '0' NOT NULL,\
 
2737
 name varchar2(255) DEFAULT '' ,\
 
2738
 delay number(10) DEFAULT '0' NOT NULL,\
 
2739
 PRIMARY KEY (slideshowid)\
2732
2740
);\
2733
2741
CREATE TABLE slides (\
2734
 
        slideid         number(20)              DEFAULT '0'     NOT NULL,\
2735
 
        slideshowid             number(20)              DEFAULT '0'     NOT NULL,\
2736
 
        screenid                number(20)              DEFAULT '0'     NOT NULL,\
2737
 
        s ep            number(10)              DEFAULT '0'     NOT NULL,\
2738
 
        delay           number(10)              DEFAULT '0'     NOT NULL,\
2739
 
        PRIMARY KEY (slideid)\
 
2742
 slideid number(20) DEFAULT '0' NOT NULL,\
 
2743
 slideshowid number(20) DEFAULT '0' NOT NULL,\
 
2744
 screenid number(20) DEFAULT '0' NOT NULL,\
 
2745
 step number(10) DEFAULT '0' NOT NULL,\
 
2746
 delay number(10) DEFAULT '0' NOT NULL,\
 
2747
 PRIMARY KEY (slideid)\
2740
2748
);\
2741
2749
CREATE INDEX slides_slides_1 on slides (slideshowid);\
2742
2750
CREATE TABLE drules (\
2743
 
        druleid         number(20)              DEFAULT '0'     NOT NULL,\
2744
 
        proxy_hos id            number(20)              DEFAULT '0'     NOT NULL,\
2745
 
        name            varchar2(255)           DEFAULT ''      ,\
2746
 
        iprange         varchar2(255)           DEFAULT ''      ,\
2747
 
        delay           number(10)              DEFAULT '0'     NOT NULL,\
2748
 
        nex check               number(10)              DEFAULT '0'     NOT NULL,\
2749
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2750
 
        PRIMARY KEY (druleid)\
 
2751
 druleid number(20) DEFAULT '0' NOT NULL,\
 
2752
 proxy_hostid number(20) DEFAULT '0' NOT NULL,\
 
2753
 name varchar2(255) DEFAULT '' ,\
 
2754
 iprange varchar2(255) DEFAULT '' ,\
 
2755
 delay number(10) DEFAULT '0' NOT NULL,\
 
2756
 nextcheck number(10) DEFAULT '0' NOT NULL,\
 
2757
 status number(10) DEFAULT '0' NOT NULL,\
 
2758
 PRIMARY KEY (druleid)\
2751
2759
);\
2752
2760
CREATE TABLE dchecks (\
2753
 
        dcheckid                number(20)              DEFAULT '0'     NOT NULL,\
2754
 
        druleid         number(20)              DEFAULT '0'     NOT NULL,\
2755
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2756
 
        key_            varchar2(255)           DEFAULT '0'     ,\
2757
 
        snmp_communi y          varchar2(255)           DEFAULT '0'     ,\
2758
 
        por s           varchar2(255)           DEFAULT '0'     ,\
2759
 
        PRIMARY KEY (dcheckid)\
 
2761
 dcheckid number(20) DEFAULT '0' NOT NULL,\
 
2762
 druleid number(20) DEFAULT '0' NOT NULL,\
 
2763
 type number(10) DEFAULT '0' NOT NULL,\
 
2764
 key_ varchar2(255) DEFAULT '0' ,\
 
2765
 snmp_community varchar2(255) DEFAULT '0' ,\
 
2766
 ports varchar2(255) DEFAULT '0' ,\
 
2767
 PRIMARY KEY (dcheckid)\
2760
2768
);\
2761
 
CREATE TABLE dhos s (\
2762
 
        dhos id         number(20)              DEFAULT '0'     NOT NULL,\
2763
 
        druleid         number(20)              DEFAULT '0'     NOT NULL,\
2764
 
        ip              varchar2(39)            DEFAULT ''      ,\
2765
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2766
 
        las up          number(10)              DEFAULT '0'     NOT NULL,\
2767
 
        las down                number(10)              DEFAULT '0'     NOT NULL,\
2768
 
        PRIMARY KEY (dhos id)\
 
2769
CREATE TABLE dhosts (\
 
2770
 dhostid number(20) DEFAULT '0' NOT NULL,\
 
2771
 druleid number(20) DEFAULT '0' NOT NULL,\
 
2772
 ip varchar2(39) DEFAULT '' ,\
 
2773
 status number(10) DEFAULT '0' NOT NULL,\
 
2774
 lastup number(10) DEFAULT '0' NOT NULL,\
 
2775
 lastdown number(10) DEFAULT '0' NOT NULL,\
 
2776
 PRIMARY KEY (dhostid)\
2769
2777
);\
2770
2778
CREATE TABLE dservices (\
2771
 
        dserviceid              number(20)              DEFAULT '0'     NOT NULL,\
2772
 
        dhos id         number(20)              DEFAULT '0'     NOT NULL,\
2773
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2774
 
        key_            varchar2(255)           DEFAULT '0'     ,\
2775
 
        value           varchar2(255)           DEFAULT '0'     ,\
2776
 
        por             number(10)              DEFAULT '0'     NOT NULL,\
2777
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2778
 
        las up          number(10)              DEFAULT '0'     NOT NULL,\
2779
 
        las down                number(10)              DEFAULT '0'     NOT NULL,\
2780
 
        PRIMARY KEY (dserviceid)\
 
2779
 dserviceid number(20) DEFAULT '0' NOT NULL,\
 
2780
 dhostid number(20) DEFAULT '0' NOT NULL,\
 
2781
 type number(10) DEFAULT '0' NOT NULL,\
 
2782
 key_ varchar2(255) DEFAULT '0' ,\
 
2783
 value varchar2(255) DEFAULT '0' ,\
 
2784
 port number(10) DEFAULT '0' NOT NULL,\
 
2785
 status number(10) DEFAULT '0' NOT NULL,\
 
2786
 lastup number(10) DEFAULT '0' NOT NULL,\
 
2787
 lastdown number(10) DEFAULT '0' NOT NULL,\
 
2788
 PRIMARY KEY (dserviceid)\
2781
2789
);\
2782
2790
CREATE TABLE ids (\
2783
 
        nodeid          number(10)              DEFAULT '0'     NOT NULL,\
2784
 
         able_name              varchar2(64)            DEFAULT ''      ,\
2785
 
        field_name              varchar2(64)            DEFAULT ''      ,\
2786
 
        nex id          number(20)              DEFAULT '0'     NOT NULL,\
2787
 
        PRIMARY KEY (nodeid, able_name,field_name)\
2788
 
);\
2789
 
CREATE TABLE h p es  (\
2790
 
        h p es id               number(20)              DEFAULT '0'     NOT NULL,\
2791
 
        name            varchar2(64)            DEFAULT ''      ,\
2792
 
        applica ionid           number(20)              DEFAULT '0'     NOT NULL,\
2793
 
        las check               number(10)              DEFAULT '0'     NOT NULL,\
2794
 
        nex check               number(10)              DEFAULT '0'     NOT NULL,\
2795
 
        curs a e                number(10)              DEFAULT '0'     NOT NULL,\
2796
 
        curs ep         number(10)              DEFAULT '0'     NOT NULL,\
2797
 
        las faileds ep          number(10)              DEFAULT '0'     NOT NULL,\
2798
 
        delay           number(10)              DEFAULT '60'    NOT NULL,\
2799
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2800
 
        macros          varchar2(2048)          DEFAULT ''      ,\
2801
 
        agen            varchar2(255)           DEFAULT ''      ,\
2802
 
         ime            number(20,4)            DEFAULT '0'     NOT NULL,\
2803
 
        error           varchar2(255)           DEFAULT ''      ,\
2804
 
        PRIMARY KEY (h p es id)\
2805
 
);\
2806
 
CREATE INDEX h p es _h p es _1 on h p es  (applica ionid);\
2807
 
CREATE TABLE h ps ep (\
2808
 
        h ps epid               number(20)              DEFAULT '0'     NOT NULL,\
2809
 
        h p es id               number(20)              DEFAULT '0'     NOT NULL,\
2810
 
        name            varchar2(64)            DEFAULT ''      ,\
2811
 
        no              number(10)              DEFAULT '0'     NOT NULL,\
2812
 
        url             varchar2(255)           DEFAULT ''      ,\
2813
 
         imeou          number(10)              DEFAULT '30'    NOT NULL,\
2814
 
        pos s           varchar2(2048)          DEFAULT ''      ,\
2815
 
        required                varchar2(255)           DEFAULT ''      ,\
2816
 
        s a us_codes            varchar2(255)           DEFAULT ''      ,\
2817
 
        PRIMARY KEY (h ps epid)\
2818
 
);\
2819
 
CREATE INDEX h ps ep_h ps ep_1 on h ps ep (h p es id);\
2820
 
CREATE TABLE h ps epi em (\
2821
 
        h ps epi emid           number(20)              DEFAULT '0'     NOT NULL,\
2822
 
        h ps epid               number(20)              DEFAULT '0'     NOT NULL,\
2823
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2824
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2825
 
        PRIMARY KEY (h ps epi emid)\
2826
 
);\
2827
 
CREATE UNIQUE INDEX h ps epi em_h ps epi em_1 on h ps epi em (h ps epid,i emid);\
2828
 
CREATE TABLE h p es i em (\
2829
 
        h p es i emid           number(20)              DEFAULT '0'     NOT NULL,\
2830
 
        h p es id               number(20)              DEFAULT '0'     NOT NULL,\
2831
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2832
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2833
 
        PRIMARY KEY (h p es i emid)\
2834
 
);\
2835
 
CREATE UNIQUE INDEX h p es i em_h p es i em_1 on h p es i em (h p es id,i emid);\
 
2791
 nodeid number(10) DEFAULT '0' NOT NULL,\
 
2792
 table_name varchar2(64) DEFAULT '' ,\
 
2793
 field_name varchar2(64) DEFAULT '' ,\
 
2794
 nextid number(20) DEFAULT '0' NOT NULL,\
 
2795
 PRIMARY KEY (nodeid,table_name,field_name)\
 
2796
);\
 
2797
CREATE TABLE httptest (\
 
2798
 httptestid number(20) DEFAULT '0' NOT NULL,\
 
2799
 name varchar2(64) DEFAULT '' ,\
 
2800
 applicationid number(20) DEFAULT '0' NOT NULL,\
 
2801
 lastcheck number(10) DEFAULT '0' NOT NULL,\
 
2802
 nextcheck number(10) DEFAULT '0' NOT NULL,\
 
2803
 curstate number(10) DEFAULT '0' NOT NULL,\
 
2804
 curstep number(10) DEFAULT '0' NOT NULL,\
 
2805
 lastfailedstep number(10) DEFAULT '0' NOT NULL,\
 
2806
 delay number(10) DEFAULT '60' NOT NULL,\
 
2807
 status number(10) DEFAULT '0' NOT NULL,\
 
2808
 macros varchar2(2048) DEFAULT '' ,\
 
2809
 agent varchar2(255) DEFAULT '' ,\
 
2810
 time number(20,4) DEFAULT '0' NOT NULL,\
 
2811
 error varchar2(255) DEFAULT '' ,\
 
2812
 PRIMARY KEY (httptestid)\
 
2813
);\
 
2814
CREATE INDEX httptest_httptest_1 on httptest (applicationid);\
 
2815
CREATE TABLE httpstep (\
 
2816
 httpstepid number(20) DEFAULT '0' NOT NULL,\
 
2817
 httptestid number(20) DEFAULT '0' NOT NULL,\
 
2818
 name varchar2(64) DEFAULT '' ,\
 
2819
 no number(10) DEFAULT '0' NOT NULL,\
 
2820
 url varchar2(255) DEFAULT '' ,\
 
2821
 timeout number(10) DEFAULT '30' NOT NULL,\
 
2822
 posts varchar2(2048) DEFAULT '' ,\
 
2823
 required varchar2(255) DEFAULT '' ,\
 
2824
 status_codes varchar2(255) DEFAULT '' ,\
 
2825
 PRIMARY KEY (httpstepid)\
 
2826
);\
 
2827
CREATE INDEX httpstep_httpstep_1 on httpstep (httptestid);\
 
2828
CREATE TABLE httpstepitem (\
 
2829
 httpstepitemid number(20) DEFAULT '0' NOT NULL,\
 
2830
 httpstepid number(20) DEFAULT '0' NOT NULL,\
 
2831
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2832
 type number(10) DEFAULT '0' NOT NULL,\
 
2833
 PRIMARY KEY (httpstepitemid)\
 
2834
);\
 
2835
CREATE UNIQUE INDEX httpstepitem_httpstepitem_1 on httpstepitem (httpstepid,itemid);\
 
2836
CREATE TABLE httptestitem (\
 
2837
 httptestitemid number(20) DEFAULT '0' NOT NULL,\
 
2838
 httptestid number(20) DEFAULT '0' NOT NULL,\
 
2839
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2840
 type number(10) DEFAULT '0' NOT NULL,\
 
2841
 PRIMARY KEY (httptestitemid)\
 
2842
);\
 
2843
CREATE UNIQUE INDEX httptestitem_httptestitem_1 on httptestitem (httptestid,itemid);\
2836
2844
CREATE TABLE nodes (\
2837
 
        nodeid          number(10)              DEFAULT '0'     NOT NULL,\
2838
 
        name            varchar2(64)            DEFAULT '0'     ,\
2839
 
         imezone                number(10)              DEFAULT '0'     NOT NULL,\
2840
 
        ip              varchar2(39)            DEFAULT ''      ,\
2841
 
        por             number(10)              DEFAULT '10051' NOT NULL,\
2842
 
        slave_his ory           number(10)              DEFAULT '30'    NOT NULL,\
2843
 
        slave_ rends            number(10)              DEFAULT '365'   NOT NULL,\
2844
 
        node ype                number(10)              DEFAULT '0'     NOT NULL,\
2845
 
        mas erid                number(10)              DEFAULT '0'     NOT NULL,\
2846
 
        PRIMARY KEY (nodeid)\
 
2845
 nodeid number(10) DEFAULT '0' NOT NULL,\
 
2846
 name varchar2(64) DEFAULT '0' ,\
 
2847
 timezone number(10) DEFAULT '0' NOT NULL,\
 
2848
 ip varchar2(39) DEFAULT '' ,\
 
2849
 port number(10) DEFAULT '10051' NOT NULL,\
 
2850
 slave_history number(10) DEFAULT '30' NOT NULL,\
 
2851
 slave_trends number(10) DEFAULT '365' NOT NULL,\
 
2852
 nodetype number(10) DEFAULT '0' NOT NULL,\
 
2853
 masterid number(10) DEFAULT '0' NOT NULL,\
 
2854
 PRIMARY KEY (nodeid)\
2847
2855
);\
2848
2856
CREATE TABLE node_cksum (\
2849
 
        nodeid          number(10)              DEFAULT '0'     NOT NULL,\
2850
 
         ablename               varchar2(64)            DEFAULT ''      ,\
2851
 
        recordid                number(20)              DEFAULT '0'     NOT NULL,\
2852
 
        cksum ype               number(10)              DEFAULT '0'     NOT NULL,\
2853
 
        cksum           clob            DEFAULT ''      NOT NULL,\
2854
 
        sync            varchar2(128)           DEFAULT ''      \
2855
 
);\
2856
 
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid, ablename,recordid,cksum ype);\
2857
 
CREATE TABLE services_ imes (\
2858
 
         imeid          number(20)              DEFAULT '0'     NOT NULL,\
2859
 
        serviceid               number(20)              DEFAULT '0'     NOT NULL,\
2860
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2861
 
         s_from         number(10)              DEFAULT '0'     NOT NULL,\
2862
 
         s_ o           number(10)              DEFAULT '0'     NOT NULL,\
2863
 
        no e            varchar2(255)           DEFAULT ''      ,\
2864
 
        PRIMARY KEY ( imeid)\
2865
 
);\
2866
 
CREATE INDEX services_ imes_ imes_1 on services_ imes (serviceid, ype, s_from, s_ o);\
2867
 
CREATE TABLE aler s (\
2868
 
        aler id         number(20)              DEFAULT '0'     NOT NULL,\
2869
 
        ac ionid                number(20)              DEFAULT '0'     NOT NULL,\
2870
 
        even id         number(20)              DEFAULT '0'     NOT NULL,\
2871
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
2872
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2873
 
        media ypeid             number(20)              DEFAULT '0'     NOT NULL,\
2874
 
        send o          varchar2(100)           DEFAULT ''      ,\
2875
 
        subjec          varchar2(255)           DEFAULT ''      ,\
2876
 
        message         varchar2(2048)          DEFAULT ''      ,\
2877
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2878
 
        re ries         number(10)              DEFAULT '0'     NOT NULL,\
2879
 
        error           varchar2(128)           DEFAULT ''      ,\
2880
 
        nex check               number(10)              DEFAULT '0'     NOT NULL,\
2881
 
        esc_s ep                number(10)              DEFAULT '0'     NOT NULL,\
2882
 
        aler ype                number(10)              DEFAULT '0'     NOT NULL,\
2883
 
        PRIMARY KEY (aler id)\
2884
 
);\
2885
 
CREATE INDEX aler s_1 on aler s (ac ionid);\
2886
 
CREATE INDEX aler s_2 on aler s (clock);\
2887
 
CREATE INDEX aler s_3 on aler s (even id);\
2888
 
CREATE INDEX aler s_4 on aler s (s a us,re ries);\
2889
 
CREATE INDEX aler s_5 on aler s (media ypeid);\
2890
 
CREATE INDEX aler s_6 on aler s (userid);\
2891
 
CREATE TABLE his ory (\
2892
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2893
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2894
 
        value           number(20,4)            DEFAULT '0.0000'        NOT NULL\
2895
 
);\
2896
 
CREATE INDEX his ory_1 on his ory (i emid,clock);\
2897
 
CREATE TABLE his ory_sync (\
2898
 
        id              number(20)                      NOT NULL,\
2899
 
        nodeid          number(20)              DEFAULT '0'     NOT NULL,\
2900
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2901
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2902
 
        value           number(20,4)            DEFAULT '0.0000'        NOT NULL,\
2903
 
        PRIMARY KEY (id)\
2904
 
);\
2905
 
CREATE INDEX his ory_sync_1 on his ory_sync (nodeid,id);\
2906
 
CREATE TABLE his ory_uin  (\
2907
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2908
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2909
 
        value           number(20)              DEFAULT '0'     NOT NULL\
2910
 
);\
2911
 
CREATE INDEX his ory_uin _1 on his ory_uin  (i emid,clock);\
2912
 
CREATE TABLE his ory_uin _sync (\
2913
 
        id              number(20)                      NOT NULL,\
2914
 
        nodeid          number(20)              DEFAULT '0'     NOT NULL,\
2915
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2916
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2917
 
        value           number(20)              DEFAULT '0'     NOT NULL,\
2918
 
        PRIMARY KEY (id)\
2919
 
);\
2920
 
CREATE INDEX his ory_uin _sync_1 on his ory_uin _sync (nodeid,id);\
2921
 
CREATE TABLE his ory_s r (\
2922
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2923
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2924
 
        value           varchar2(255)           DEFAULT ''      \
2925
 
);\
2926
 
CREATE INDEX his ory_s r_1 on his ory_s r (i emid,clock);\
2927
 
CREATE TABLE his ory_s r_sync (\
2928
 
        id              number(20)                      NOT NULL,\
2929
 
        nodeid          number(20)              DEFAULT '0'     NOT NULL,\
2930
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2931
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2932
 
        value           varchar2(255)           DEFAULT ''      ,\
2933
 
        PRIMARY KEY (id)\
2934
 
);\
2935
 
CREATE INDEX his ory_s r_sync_1 on his ory_s r_sync (nodeid,id);\
2936
 
CREATE TABLE his ory_log (\
2937
 
        id              number(20)              DEFAULT '0'     NOT NULL,\
2938
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2939
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2940
 
         imes amp               number(10)              DEFAULT '0'     NOT NULL,\
2941
 
        source          varchar2(64)            DEFAULT ''      ,\
2942
 
        severi y                number(10)              DEFAULT '0'     NOT NULL,\
2943
 
        value           varchar2(2048)          DEFAULT ''      ,\
2944
 
        PRIMARY KEY (id)\
2945
 
);\
2946
 
CREATE INDEX his ory_log_1 on his ory_log (i emid,clock);\
2947
 
CREATE TABLE his ory_ ex  (\
2948
 
        id              number(20)              DEFAULT '0'     NOT NULL,\
2949
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2950
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2951
 
        value           clob            DEFAULT ''      NOT NULL,\
2952
 
        PRIMARY KEY (id)\
2953
 
);\
2954
 
CREATE INDEX his ory_ ex _1 on his ory_ ex  (i emid,clock);\
2955
 
CREATE TABLE proxy_his ory (\
2956
 
        id              number(20)                      NOT NULL,\
2957
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2958
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2959
 
         imes amp               number(10)              DEFAULT '0'     NOT NULL,\
2960
 
        source          varchar2(64)            DEFAULT ''      ,\
2961
 
        severi y                number(10)              DEFAULT '0'     NOT NULL,\
2962
 
        value           varchar2(2048)          DEFAULT ''      ,\
2963
 
        PRIMARY KEY (id)\
2964
 
);\
2965
 
CREATE INDEX proxy_his ory_1 on proxy_his ory (clock);\
2966
 
CREATE TABLE proxy_dhis ory (\
2967
 
        id              number(20)                      NOT NULL,\
2968
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2969
 
        druleid         number(20)              DEFAULT '0'     NOT NULL,\
2970
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
2971
 
        ip              varchar2(39)            DEFAULT ''      ,\
2972
 
        por             number(10)              DEFAULT '0'     NOT NULL,\
2973
 
        key_            varchar2(255)           DEFAULT '0'     ,\
2974
 
        value           varchar2(255)           DEFAULT '0'     ,\
2975
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
2976
 
        PRIMARY KEY (id)\
2977
 
);\
2978
 
CREATE INDEX proxy_dhis ory_1 on proxy_dhis ory (clock);\
2979
 
CREATE TABLE even s (\
2980
 
        even id         number(20)              DEFAULT '0'     NOT NULL,\
2981
 
        source          number(10)              DEFAULT '0'     NOT NULL,\
2982
 
        objec           number(10)              DEFAULT '0'     NOT NULL,\
2983
 
        objec id                number(20)              DEFAULT '0'     NOT NULL,\
2984
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2985
 
        value           number(10)              DEFAULT '0'     NOT NULL,\
2986
 
        acknowledged            number(10)              DEFAULT '0'     NOT NULL,\
2987
 
        PRIMARY KEY (even id)\
2988
 
);\
2989
 
CREATE INDEX even s_1 on even s (objec ,objec id,even id);\
2990
 
CREATE INDEX even s_2 on even s (clock);\
2991
 
CREATE TABLE  rends (\
2992
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
2993
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
2994
 
        num             number(10)              DEFAULT '0'     NOT NULL,\
2995
 
        value_min               number(20,4)            DEFAULT '0.0000'        NOT NULL,\
2996
 
        value_avg               number(20,4)            DEFAULT '0.0000'        NOT NULL,\
2997
 
        value_max               number(20,4)            DEFAULT '0.0000'        NOT NULL,\
2998
 
        PRIMARY KEY (i emid,clock)\
2999
 
);\
3000
 
CREATE TABLE  rends_uin  (\
3001
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
3002
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
3003
 
        num             number(10)              DEFAULT '0'     NOT NULL,\
3004
 
        value_min               number(20)              DEFAULT '0'     NOT NULL,\
3005
 
        value_avg               number(20)              DEFAULT '0'     NOT NULL,\
3006
 
        value_max               number(20)              DEFAULT '0'     NOT NULL,\
3007
 
        PRIMARY KEY (i emid,clock)\
 
2857
 nodeid number(10) DEFAULT '0' NOT NULL,\
 
2858
 tablename varchar2(64) DEFAULT '' ,\
 
2859
 recordid number(20) DEFAULT '0' NOT NULL,\
 
2860
 cksumtype number(10) DEFAULT '0' NOT NULL,\
 
2861
 cksum clob DEFAULT '' NOT NULL,\
 
2862
 sync varchar2(128) DEFAULT '' \
 
2863
);\
 
2864
CREATE INDEX node_cksum_cksum_1 on node_cksum (nodeid,tablename,recordid,cksumtype);\
 
2865
CREATE TABLE services_times (\
 
2866
 timeid number(20) DEFAULT '0' NOT NULL,\
 
2867
 serviceid number(20) DEFAULT '0' NOT NULL,\
 
2868
 type number(10) DEFAULT '0' NOT NULL,\
 
2869
 ts_from number(10) DEFAULT '0' NOT NULL,\
 
2870
 ts_to number(10) DEFAULT '0' NOT NULL,\
 
2871
 note varchar2(255) DEFAULT '' ,\
 
2872
 PRIMARY KEY (timeid)\
 
2873
);\
 
2874
CREATE INDEX services_times_times_1 on services_times (serviceid,type,ts_from,ts_to);\
 
2875
CREATE TABLE alerts (\
 
2876
 alertid number(20) DEFAULT '0' NOT NULL,\
 
2877
 actionid number(20) DEFAULT '0' NOT NULL,\
 
2878
 eventid number(20) DEFAULT '0' NOT NULL,\
 
2879
 userid number(20) DEFAULT '0' NOT NULL,\
 
2880
 clock number(10) DEFAULT '0' NOT NULL,\
 
2881
 mediatypeid number(20) DEFAULT '0' NOT NULL,\
 
2882
 sendto varchar2(100) DEFAULT '' ,\
 
2883
 subject varchar2(255) DEFAULT '' ,\
 
2884
 message varchar2(2048) DEFAULT '' ,\
 
2885
 status number(10) DEFAULT '0' NOT NULL,\
 
2886
 retries number(10) DEFAULT '0' NOT NULL,\
 
2887
 error varchar2(128) DEFAULT '' ,\
 
2888
 nextcheck number(10) DEFAULT '0' NOT NULL,\
 
2889
 esc_step number(10) DEFAULT '0' NOT NULL,\
 
2890
 alerttype number(10) DEFAULT '0' NOT NULL,\
 
2891
 PRIMARY KEY (alertid)\
 
2892
);\
 
2893
CREATE INDEX alerts_1 on alerts (actionid);\
 
2894
CREATE INDEX alerts_2 on alerts (clock);\
 
2895
CREATE INDEX alerts_3 on alerts (eventid);\
 
2896
CREATE INDEX alerts_4 on alerts (status,retries);\
 
2897
CREATE INDEX alerts_5 on alerts (mediatypeid);\
 
2898
CREATE INDEX alerts_6 on alerts (userid);\
 
2899
CREATE TABLE history (\
 
2900
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2901
 clock number(10) DEFAULT '0' NOT NULL,\
 
2902
 value number(20,4) DEFAULT '0.0000' NOT NULL\
 
2903
);\
 
2904
CREATE INDEX history_1 on history (itemid,clock);\
 
2905
CREATE TABLE history_sync (\
 
2906
 id number(20) NOT NULL,\
 
2907
 nodeid number(20) DEFAULT '0' NOT NULL,\
 
2908
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2909
 clock number(10) DEFAULT '0' NOT NULL,\
 
2910
 value number(20,4) DEFAULT '0.0000' NOT NULL,\
 
2911
 PRIMARY KEY (id)\
 
2912
);\
 
2913
CREATE INDEX history_sync_1 on history_sync (nodeid,id);\
 
2914
CREATE TABLE history_uint (\
 
2915
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2916
 clock number(10) DEFAULT '0' NOT NULL,\
 
2917
 value number(20) DEFAULT '0' NOT NULL\
 
2918
);\
 
2919
CREATE INDEX history_uint_1 on history_uint (itemid,clock);\
 
2920
CREATE TABLE history_uint_sync (\
 
2921
 id number(20) NOT NULL,\
 
2922
 nodeid number(20) DEFAULT '0' NOT NULL,\
 
2923
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2924
 clock number(10) DEFAULT '0' NOT NULL,\
 
2925
 value number(20) DEFAULT '0' NOT NULL,\
 
2926
 PRIMARY KEY (id)\
 
2927
);\
 
2928
CREATE INDEX history_uint_sync_1 on history_uint_sync (nodeid,id);\
 
2929
CREATE TABLE history_str (\
 
2930
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2931
 clock number(10) DEFAULT '0' NOT NULL,\
 
2932
 value varchar2(255) DEFAULT '' \
 
2933
);\
 
2934
CREATE INDEX history_str_1 on history_str (itemid,clock);\
 
2935
CREATE TABLE history_str_sync (\
 
2936
 id number(20) NOT NULL,\
 
2937
 nodeid number(20) DEFAULT '0' NOT NULL,\
 
2938
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2939
 clock number(10) DEFAULT '0' NOT NULL,\
 
2940
 value varchar2(255) DEFAULT '' ,\
 
2941
 PRIMARY KEY (id)\
 
2942
);\
 
2943
CREATE INDEX history_str_sync_1 on history_str_sync (nodeid,id);\
 
2944
CREATE TABLE history_log (\
 
2945
 id number(20) DEFAULT '0' NOT NULL,\
 
2946
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2947
 clock number(10) DEFAULT '0' NOT NULL,\
 
2948
 timestamp number(10) DEFAULT '0' NOT NULL,\
 
2949
 source varchar2(64) DEFAULT '' ,\
 
2950
 severity number(10) DEFAULT '0' NOT NULL,\
 
2951
 value varchar2(2048) DEFAULT '' ,\
 
2952
 PRIMARY KEY (id)\
 
2953
);\
 
2954
CREATE INDEX history_log_1 on history_log (itemid,clock);\
 
2955
CREATE UNIQUE INDEX history_log_2 on history_log (itemid,id);\
 
2956
CREATE TABLE history_text (\
 
2957
 id number(20) DEFAULT '0' NOT NULL,\
 
2958
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2959
 clock number(10) DEFAULT '0' NOT NULL,\
 
2960
 value clob DEFAULT '' NOT NULL,\
 
2961
 PRIMARY KEY (id)\
 
2962
);\
 
2963
CREATE INDEX history_text_1 on history_text (itemid,clock);\
 
2964
CREATE UNIQUE INDEX history_text_2 on history_text (itemid,id);\
 
2965
CREATE TABLE proxy_history (\
 
2966
 id number(20) NOT NULL,\
 
2967
 itemid number(20) DEFAULT '0' NOT NULL,\
 
2968
 clock number(10) DEFAULT '0' NOT NULL,\
 
2969
 timestamp number(10) DEFAULT '0' NOT NULL,\
 
2970
 source varchar2(64) DEFAULT '' ,\
 
2971
 severity number(10) DEFAULT '0' NOT NULL,\
 
2972
 value varchar2(2048) DEFAULT '' ,\
 
2973
 PRIMARY KEY (id)\
 
2974
);\
 
2975
CREATE INDEX proxy_history_1 on proxy_history (clock);\
 
2976
CREATE TABLE proxy_dhistory (\
 
2977
 id number(20) NOT NULL,\
 
2978
 clock number(10) DEFAULT '0' NOT NULL,\
 
2979
 druleid number(20) DEFAULT '0' NOT NULL,\
 
2980
 type number(10) DEFAULT '0' NOT NULL,\
 
2981
 ip varchar2(39) DEFAULT '' ,\
 
2982
 port number(10) DEFAULT '0' NOT NULL,\
 
2983
 key_ varchar2(255) DEFAULT '0' ,\
 
2984
 value varchar2(255) DEFAULT '0' ,\
 
2985
 status number(10) DEFAULT '0' NOT NULL,\
 
2986
 PRIMARY KEY (id)\
 
2987
);\
 
2988
CREATE INDEX proxy_dhistory_1 on proxy_dhistory (clock);\
 
2989
CREATE TABLE events (\
 
2990
 eventid number(20) DEFAULT '0' NOT NULL,\
 
2991
 source number(10) DEFAULT '0' NOT NULL,\
 
2992
 object number(10) DEFAULT '0' NOT NULL,\
 
2993
 objectid number(20) DEFAULT '0' NOT NULL,\
 
2994
 clock number(10) DEFAULT '0' NOT NULL,\
 
2995
 value number(10) DEFAULT '0' NOT NULL,\
 
2996
 acknowledged number(10) DEFAULT '0' NOT NULL,\
 
2997
 PRIMARY KEY (eventid)\
 
2998
);\
 
2999
CREATE INDEX events_1 on events (object,objectid,eventid);\
 
3000
CREATE INDEX events_2 on events (clock);\
 
3001
CREATE TABLE trends (\
 
3002
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3003
 clock number(10) DEFAULT '0' NOT NULL,\
 
3004
 num number(10) DEFAULT '0' NOT NULL,\
 
3005
 value_min number(20,4) DEFAULT '0.0000' NOT NULL,\
 
3006
 value_avg number(20,4) DEFAULT '0.0000' NOT NULL,\
 
3007
 value_max number(20,4) DEFAULT '0.0000' NOT NULL,\
 
3008
 PRIMARY KEY (itemid,clock)\
 
3009
);\
 
3010
CREATE TABLE trends_uint (\
 
3011
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3012
 clock number(10) DEFAULT '0' NOT NULL,\
 
3013
 num number(10) DEFAULT '0' NOT NULL,\
 
3014
 value_min number(20) DEFAULT '0' NOT NULL,\
 
3015
 value_avg number(20) DEFAULT '0' NOT NULL,\
 
3016
 value_max number(20) DEFAULT '0' NOT NULL,\
 
3017
 PRIMARY KEY (itemid,clock)\
3008
3018
);\
3009
3019
CREATE TABLE acknowledges (\
3010
 
        acknowledgeid           number(20)              DEFAULT '0'     NOT NULL,\
3011
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3012
 
        even id         number(20)              DEFAULT '0'     NOT NULL,\
3013
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
3014
 
        message         varchar2(255)           DEFAULT ''      ,\
3015
 
        PRIMARY KEY (acknowledgeid)\
 
3020
 acknowledgeid number(20) DEFAULT '0' NOT NULL,\
 
3021
 userid number(20) DEFAULT '0' NOT NULL,\
 
3022
 eventid number(20) DEFAULT '0' NOT NULL,\
 
3023
 clock number(10) DEFAULT '0' NOT NULL,\
 
3024
 message varchar2(255) DEFAULT '' ,\
 
3025
 PRIMARY KEY (acknowledgeid)\
3016
3026
);\
3017
3027
CREATE INDEX acknowledges_1 on acknowledges (userid);\
3018
 
CREATE INDEX acknowledges_2 on acknowledges (even id);\
 
3028
CREATE INDEX acknowledges_2 on acknowledges (eventid);\
3019
3029
CREATE INDEX acknowledges_3 on acknowledges (clock);\
3020
 
CREATE TABLE audi log (\
3021
 
        audi id         number(20)              DEFAULT '0'     NOT NULL,\
3022
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3023
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
3024
 
        ac ion          number(10)              DEFAULT '0'     NOT NULL,\
3025
 
        resource ype            number(10)              DEFAULT '0'     NOT NULL,\
3026
 
        de ails         varchar2(128)           DEFAULT '0'     ,\
3027
 
        PRIMARY KEY (audi id)\
 
3030
CREATE TABLE auditlog (\
 
3031
 auditid number(20) DEFAULT '0' NOT NULL,\
 
3032
 userid number(20) DEFAULT '0' NOT NULL,\
 
3033
 clock number(10) DEFAULT '0' NOT NULL,\
 
3034
 action number(10) DEFAULT '0' NOT NULL,\
 
3035
 resourcetype number(10) DEFAULT '0' NOT NULL,\
 
3036
 details varchar2(128) DEFAULT '0' ,\
 
3037
 PRIMARY KEY (auditid)\
3028
3038
);\
3029
 
CREATE INDEX audi log_1 on audi log (userid,clock);\
3030
 
CREATE INDEX audi log_2 on audi log (clock);\
 
3039
CREATE INDEX auditlog_1 on auditlog (userid,clock);\
 
3040
CREATE INDEX auditlog_2 on auditlog (clock);\
3031
3041
CREATE TABLE service_alarms (\
3032
 
        servicealarmid          number(20)              DEFAULT '0'     NOT NULL,\
3033
 
        serviceid               number(20)              DEFAULT '0'     NOT NULL,\
3034
 
        clock           number(10)              DEFAULT '0'     NOT NULL,\
3035
 
        value           number(10)              DEFAULT '0'     NOT NULL,\
3036
 
        PRIMARY KEY (servicealarmid)\
 
3042
 servicealarmid number(20) DEFAULT '0' NOT NULL,\
 
3043
 serviceid number(20) DEFAULT '0' NOT NULL,\
 
3044
 clock number(10) DEFAULT '0' NOT NULL,\
 
3045
 value number(10) DEFAULT '0' NOT NULL,\
 
3046
 PRIMARY KEY (servicealarmid)\
3037
3047
);\
3038
3048
CREATE INDEX service_alarms_1 on service_alarms (serviceid,clock);\
3039
3049
CREATE INDEX service_alarms_2 on service_alarms (clock);\
3040
 
CREATE TABLE ac ions (\
3041
 
        ac ionid                number(20)              DEFAULT '0'     NOT NULL,\
3042
 
        name            varchar2(255)           DEFAULT ''      ,\
3043
 
        even source             number(10)              DEFAULT '0'     NOT NULL,\
3044
 
        eval ype                number(10)              DEFAULT '0'     NOT NULL,\
3045
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3046
 
        esc_period              number(10)              DEFAULT '0'     NOT NULL,\
3047
 
        def_shor da a           varchar2(255)           DEFAULT ''      ,\
3048
 
        def_longda a            varchar2(2048)          DEFAULT ''      ,\
3049
 
        recovery_msg            number(10)              DEFAULT '0'     NOT NULL,\
3050
 
        r_shor da a             varchar2(255)           DEFAULT ''      ,\
3051
 
        r_longda a              varchar2(2048)          DEFAULT ''      ,\
3052
 
        PRIMARY KEY (ac ionid)\
3053
 
);\
3054
 
CREATE TABLE opera ions (\
3055
 
        opera ionid             number(20)              DEFAULT '0'     NOT NULL,\
3056
 
        ac ionid                number(20)              DEFAULT '0'     NOT NULL,\
3057
 
        opera ion ype           number(10)              DEFAULT '0'     NOT NULL,\
3058
 
        objec           number(10)              DEFAULT '0'     NOT NULL,\
3059
 
        objec id                number(20)              DEFAULT '0'     NOT NULL,\
3060
 
        shor da a               varchar2(255)           DEFAULT ''      ,\
3061
 
        longda a                varchar2(2048)          DEFAULT ''      ,\
3062
 
        esc_period              number(10)              DEFAULT '0'     NOT NULL,\
3063
 
        esc_s ep_from           number(10)              DEFAULT '0'     NOT NULL,\
3064
 
        esc_s ep_ o             number(10)              DEFAULT '0'     NOT NULL,\
3065
 
        defaul _msg             number(10)              DEFAULT '0'     NOT NULL,\
3066
 
        eval ype                number(10)              DEFAULT '0'     NOT NULL,\
3067
 
        PRIMARY KEY (opera ionid)\
3068
 
);\
3069
 
CREATE INDEX opera ions_1 on opera ions (ac ionid);\
3070
 
CREATE TABLE opcondi ions (\
3071
 
        opcondi ionid           number(20)              DEFAULT '0'     NOT NULL,\
3072
 
        opera ionid             number(20)              DEFAULT '0'     NOT NULL,\
3073
 
        condi ion ype           number(10)              DEFAULT '0'     NOT NULL,\
3074
 
        opera or                number(10)              DEFAULT '0'     NOT NULL,\
3075
 
        value           varchar2(255)           DEFAULT ''      ,\
3076
 
        PRIMARY KEY (opcondi ionid)\
3077
 
);\
3078
 
CREATE INDEX opcondi ions_1 on opcondi ions (opera ionid);\
3079
 
CREATE TABLE escala ions (\
3080
 
        escala ionid            number(20)              DEFAULT '0'     NOT NULL,\
3081
 
        ac ionid                number(20)              DEFAULT '0'     NOT NULL,\
3082
 
         riggerid               number(20)              DEFAULT '0'     NOT NULL,\
3083
 
        even id         number(20)              DEFAULT '0'     NOT NULL,\
3084
 
        r_even id               number(20)              DEFAULT '0'     NOT NULL,\
3085
 
        nex check               number(10)              DEFAULT '0'     NOT NULL,\
3086
 
        esc_s ep                number(10)              DEFAULT '0'     NOT NULL,\
3087
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3088
 
        PRIMARY KEY (escala ionid)\
3089
 
);\
3090
 
CREATE INDEX escala ions_1 on escala ions (ac ionid, riggerid);\
3091
 
CREATE TABLE applica ions (\
3092
 
        applica ionid           number(20)              DEFAULT '0'     NOT NULL,\
3093
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3094
 
        name            varchar2(255)           DEFAULT ''      ,\
3095
 
         empla eid              number(20)              DEFAULT '0'     NOT NULL,\
3096
 
        PRIMARY KEY (applica ionid)\
3097
 
);\
3098
 
CREATE INDEX applica ions_1 on applica ions ( empla eid);\
3099
 
CREATE UNIQUE INDEX applica ions_2 on applica ions (hos id,name);\
3100
 
CREATE TABLE condi ions (\
3101
 
        condi ionid             number(20)              DEFAULT '0'     NOT NULL,\
3102
 
        ac ionid                number(20)              DEFAULT '0'     NOT NULL,\
3103
 
        condi ion ype           number(10)              DEFAULT '0'     NOT NULL,\
3104
 
        opera or                number(10)              DEFAULT '0'     NOT NULL,\
3105
 
        value           varchar2(255)           DEFAULT ''      ,\
3106
 
        PRIMARY KEY (condi ionid)\
3107
 
);\
3108
 
CREATE INDEX condi ions_1 on condi ions (ac ionid);\
 
3050
CREATE TABLE actions (\
 
3051
 actionid number(20) DEFAULT '0' NOT NULL,\
 
3052
 name varchar2(255) DEFAULT '' ,\
 
3053
 eventsource number(10) DEFAULT '0' NOT NULL,\
 
3054
 evaltype number(10) DEFAULT '0' NOT NULL,\
 
3055
 status number(10) DEFAULT '0' NOT NULL,\
 
3056
 esc_period number(10) DEFAULT '0' NOT NULL,\
 
3057
 def_shortdata varchar2(255) DEFAULT '' ,\
 
3058
 def_longdata varchar2(2048) DEFAULT '' ,\
 
3059
 recovery_msg number(10) DEFAULT '0' NOT NULL,\
 
3060
 r_shortdata varchar2(255) DEFAULT '' ,\
 
3061
 r_longdata varchar2(2048) DEFAULT '' ,\
 
3062
 PRIMARY KEY (actionid)\
 
3063
);\
 
3064
CREATE TABLE operations (\
 
3065
 operationid number(20) DEFAULT '0' NOT NULL,\
 
3066
 actionid number(20) DEFAULT '0' NOT NULL,\
 
3067
 operationtype number(10) DEFAULT '0' NOT NULL,\
 
3068
 object number(10) DEFAULT '0' NOT NULL,\
 
3069
 objectid number(20) DEFAULT '0' NOT NULL,\
 
3070
 shortdata varchar2(255) DEFAULT '' ,\
 
3071
 longdata varchar2(2048) DEFAULT '' ,\
 
3072
 esc_period number(10) DEFAULT '0' NOT NULL,\
 
3073
 esc_step_from number(10) DEFAULT '0' NOT NULL,\
 
3074
 esc_step_to number(10) DEFAULT '0' NOT NULL,\
 
3075
 default_msg number(10) DEFAULT '0' NOT NULL,\
 
3076
 evaltype number(10) DEFAULT '0' NOT NULL,\
 
3077
 PRIMARY KEY (operationid)\
 
3078
);\
 
3079
CREATE INDEX operations_1 on operations (actionid);\
 
3080
CREATE TABLE opconditions (\
 
3081
 opconditionid number(20) DEFAULT '0' NOT NULL,\
 
3082
 operationid number(20) DEFAULT '0' NOT NULL,\
 
3083
 conditiontype number(10) DEFAULT '0' NOT NULL,\
 
3084
 operator number(10) DEFAULT '0' NOT NULL,\
 
3085
 value varchar2(255) DEFAULT '' ,\
 
3086
 PRIMARY KEY (opconditionid)\
 
3087
);\
 
3088
CREATE INDEX opconditions_1 on opconditions (operationid);\
 
3089
CREATE TABLE escalations (\
 
3090
 escalationid number(20) DEFAULT '0' NOT NULL,\
 
3091
 actionid number(20) DEFAULT '0' NOT NULL,\
 
3092
 triggerid number(20) DEFAULT '0' NOT NULL,\
 
3093
 eventid number(20) DEFAULT '0' NOT NULL,\
 
3094
 r_eventid number(20) DEFAULT '0' NOT NULL,\
 
3095
 nextcheck number(10) DEFAULT '0' NOT NULL,\
 
3096
 esc_step number(10) DEFAULT '0' NOT NULL,\
 
3097
 status number(10) DEFAULT '0' NOT NULL,\
 
3098
 PRIMARY KEY (escalationid)\
 
3099
);\
 
3100
CREATE INDEX escalations_1 on escalations (actionid,triggerid);\
 
3101
CREATE TABLE applications (\
 
3102
 applicationid number(20) DEFAULT '0' NOT NULL,\
 
3103
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3104
 name varchar2(255) DEFAULT '' ,\
 
3105
 templateid number(20) DEFAULT '0' NOT NULL,\
 
3106
 PRIMARY KEY (applicationid)\
 
3107
);\
 
3108
CREATE INDEX applications_1 on applications (templateid);\
 
3109
CREATE UNIQUE INDEX applications_2 on applications (hostid,name);\
 
3110
CREATE TABLE conditions (\
 
3111
 conditionid number(20) DEFAULT '0' NOT NULL,\
 
3112
 actionid number(20) DEFAULT '0' NOT NULL,\
 
3113
 conditiontype number(10) DEFAULT '0' NOT NULL,\
 
3114
 operator number(10) DEFAULT '0' NOT NULL,\
 
3115
 value varchar2(255) DEFAULT '' ,\
 
3116
 PRIMARY KEY (conditionid)\
 
3117
);\
 
3118
CREATE INDEX conditions_1 on conditions (actionid);\
3109
3119
CREATE TABLE config (\
3110
 
        configid                number(20)              DEFAULT '0'     NOT NULL,\
3111
 
        aler _his ory           number(10)              DEFAULT '0'     NOT NULL,\
3112
 
        even _his ory           number(10)              DEFAULT '0'     NOT NULL,\
3113
 
        refresh_unsuppor ed             number(10)              DEFAULT '0'     NOT NULL,\
3114
 
        work_period             varchar2(100)           DEFAULT '1-5,00:00-24:00'       ,\
3115
 
        aler _usrgrpid          number(20)              DEFAULT '0'     NOT NULL,\
3116
 
        even _ack_enable                number(10)              DEFAULT '1'     NOT NULL,\
3117
 
        even _expire            number(10)              DEFAULT '7'     NOT NULL,\
3118
 
        even _show_max          number(10)              DEFAULT '100'   NOT NULL,\
3119
 
        defaul _ heme           varchar2(128)           DEFAULT 'defaul .css'   ,\
3120
 
        au hen ica ion_ ype             number(10)              DEFAULT 0       NOT NULL,\
3121
 
        ldap_hos                varchar2(255)           DEFAULT ''      ,\
3122
 
        ldap_por                number(10)              DEFAULT 389     NOT NULL,\
3123
 
        ldap_base_dn            varchar2(255)           DEFAULT ''      ,\
3124
 
        ldap_bind_dn            varchar2(255)           DEFAULT ''      ,\
3125
 
        ldap_bind_password              varchar2(128)           DEFAULT ''      ,\
3126
 
        ldap_search_a ribu e            varchar2(128)           DEFAULT ''      ,\
3127
 
        PRIMARY KEY (configid)\
3128
 
);\
3129
 
CREATE TABLE func ions (\
3130
 
        func ionid              number(20)              DEFAULT '0'     NOT NULL,\
3131
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
3132
 
         riggerid               number(20)              DEFAULT '0'     NOT NULL,\
3133
 
        las value               varchar2(255)                   ,\
3134
 
        func ion                varchar2(12)            DEFAULT ''      ,\
3135
 
        parame er               varchar2(255)           DEFAULT '0'     ,\
3136
 
        PRIMARY KEY (func ionid)\
3137
 
);\
3138
 
CREATE INDEX func ions_1 on func ions ( riggerid);\
3139
 
CREATE INDEX func ions_2 on func ions (i emid,func ion,parame er);\
 
3120
 configid number(20) DEFAULT '0' NOT NULL,\
 
3121
 alert_history number(10) DEFAULT '0' NOT NULL,\
 
3122
 event_history number(10) DEFAULT '0' NOT NULL,\
 
3123
 refresh_unsupported number(10) DEFAULT '0' NOT NULL,\
 
3124
 work_period varchar2(100) DEFAULT '1-5,00:00-24:00' ,\
 
3125
 alert_usrgrpid number(20) DEFAULT '0' NOT NULL,\
 
3126
 event_ack_enable number(10) DEFAULT '1' NOT NULL,\
 
3127
 event_expire number(10) DEFAULT '7' NOT NULL,\
 
3128
 event_show_max number(10) DEFAULT '100' NOT NULL,\
 
3129
 default_theme varchar2(128) DEFAULT 'default.css' ,\
 
3130
 authentication_type number(10) DEFAULT 0 NOT NULL,\
 
3131
 ldap_host varchar2(255) DEFAULT '' ,\
 
3132
 ldap_port number(10) DEFAULT 389 NOT NULL,\
 
3133
 ldap_base_dn varchar2(255) DEFAULT '' ,\
 
3134
 ldap_bind_dn varchar2(255) DEFAULT '' ,\
 
3135
 ldap_bind_password varchar2(128) DEFAULT '' ,\
 
3136
 ldap_search_attribute varchar2(128) DEFAULT '' ,\
 
3137
 PRIMARY KEY (configid)\
 
3138
);\
 
3139
CREATE TABLE functions (\
 
3140
 functionid number(20) DEFAULT '0' NOT NULL,\
 
3141
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3142
 triggerid number(20) DEFAULT '0' NOT NULL,\
 
3143
 lastvalue varchar2(255) ,\
 
3144
 function varchar2(12) DEFAULT '' ,\
 
3145
 parameter varchar2(255) DEFAULT '0' ,\
 
3146
 PRIMARY KEY (functionid)\
 
3147
);\
 
3148
CREATE INDEX functions_1 on functions (triggerid);\
 
3149
CREATE INDEX functions_2 on functions (itemid,function,parameter);\
3140
3150
CREATE TABLE graphs (\
3141
 
        graphid         number(20)              DEFAULT '0'     NOT NULL,\
3142
 
        name            varchar2(128)           DEFAULT ''      ,\
3143
 
        wid h           number(10)              DEFAULT '0'     NOT NULL,\
3144
 
        heigh           number(10)              DEFAULT '0'     NOT NULL,\
3145
 
        yaxis ype               number(10)              DEFAULT '0'     NOT NULL,\
3146
 
        yaxismin                number(20,4)            DEFAULT '0'     NOT NULL,\
3147
 
        yaxismax                number(20,4)            DEFAULT '0'     NOT NULL,\
3148
 
         empla eid              number(20)              DEFAULT '0'     NOT NULL,\
3149
 
        show_work_period                number(10)              DEFAULT '1'     NOT NULL,\
3150
 
        show_ riggers           number(10)              DEFAULT '1'     NOT NULL,\
3151
 
        graph ype               number(10)              DEFAULT '0'     NOT NULL,\
3152
 
        show_legend             number(10)              DEFAULT '0'     NOT NULL,\
3153
 
        show_3d         number(10)              DEFAULT '0'     NOT NULL,\
3154
 
        percen _lef             number(20,4)            DEFAULT '0'     NOT NULL,\
3155
 
        percen _righ            number(20,4)            DEFAULT '0'     NOT NULL,\
3156
 
        PRIMARY KEY (graphid)\
 
3151
 graphid number(20) DEFAULT '0' NOT NULL,\
 
3152
 name varchar2(128) DEFAULT '' ,\
 
3153
 width number(10) DEFAULT '0' NOT NULL,\
 
3154
 height number(10) DEFAULT '0' NOT NULL,\
 
3155
 yaxistype number(10) DEFAULT '0' NOT NULL,\
 
3156
 yaxismin number(20,4) DEFAULT '0' NOT NULL,\
 
3157
 yaxismax number(20,4) DEFAULT '0' NOT NULL,\
 
3158
 templateid number(20) DEFAULT '0' NOT NULL,\
 
3159
 show_work_period number(10) DEFAULT '1' NOT NULL,\
 
3160
 show_triggers number(10) DEFAULT '1' NOT NULL,\
 
3161
 graphtype number(10) DEFAULT '0' NOT NULL,\
 
3162
 show_legend number(10) DEFAULT '0' NOT NULL,\
 
3163
 show_3d number(10) DEFAULT '0' NOT NULL,\
 
3164
 percent_left number(20,4) DEFAULT '0' NOT NULL,\
 
3165
 percent_right number(20,4) DEFAULT '0' NOT NULL,\
 
3166
 PRIMARY KEY (graphid)\
3157
3167
);\
3158
3168
CREATE INDEX graphs_graphs_1 on graphs (name);\
3159
 
CREATE TABLE graphs_i ems (\
3160
 
        gi emid         number(20)              DEFAULT '0'     NOT NULL,\
3161
 
        graphid         number(20)              DEFAULT '0'     NOT NULL,\
3162
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
3163
 
        draw ype                number(10)              DEFAULT '0'     NOT NULL,\
3164
 
        sor order               number(10)              DEFAULT '0'     NOT NULL,\
3165
 
        color           varchar2(32)            DEFAULT '009600'        ,\
3166
 
        yaxisside               number(10)              DEFAULT '1'     NOT NULL,\
3167
 
        calc_fnc                number(10)              DEFAULT '2'     NOT NULL,\
3168
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3169
 
        periods_cn              number(10)              DEFAULT '5'     NOT NULL,\
3170
 
        PRIMARY KEY (gi emid)\
 
3169
CREATE TABLE graphs_items (\
 
3170
 gitemid number(20) DEFAULT '0' NOT NULL,\
 
3171
 graphid number(20) DEFAULT '0' NOT NULL,\
 
3172
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3173
 drawtype number(10) DEFAULT '0' NOT NULL,\
 
3174
 sortorder number(10) DEFAULT '0' NOT NULL,\
 
3175
 color varchar2(32) DEFAULT '009600' ,\
 
3176
 yaxisside number(10) DEFAULT '1' NOT NULL,\
 
3177
 calc_fnc number(10) DEFAULT '2' NOT NULL,\
 
3178
 type number(10) DEFAULT '0' NOT NULL,\
 
3179
 periods_cnt number(10) DEFAULT '5' NOT NULL,\
 
3180
 PRIMARY KEY (gitemid)\
3171
3181
);\
 
3182
CREATE INDEX graphs_items_1 on graphs_items (itemid);\
 
3183
CREATE INDEX graphs_items_2 on graphs_items (graphid);\
3172
3184
CREATE TABLE groups (\
3173
 
        groupid         number(20)              DEFAULT '0'     NOT NULL,\
3174
 
        name            varchar2(64)            DEFAULT ''      ,\
3175
 
        PRIMARY KEY (groupid)\
 
3185
 groupid number(20) DEFAULT '0' NOT NULL,\
 
3186
 name varchar2(64) DEFAULT '' ,\
 
3187
 PRIMARY KEY (groupid)\
3176
3188
);\
3177
3189
CREATE INDEX groups_1 on groups (name);\
3178
 
CREATE TABLE help_i ems (\
3179
 
        i em ype                number(10)              DEFAULT '0'     NOT NULL,\
3180
 
        key_            varchar2(255)           DEFAULT ''      ,\
3181
 
        descrip ion             varchar2(255)           DEFAULT ''      ,\
3182
 
        PRIMARY KEY (i em ype,key_)\
3183
 
);\
3184
 
CREATE TABLE hos s (\
3185
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3186
 
        proxy_hos id            number(20)              DEFAULT '0'     NOT NULL,\
3187
 
        hos             varchar2(64)            DEFAULT ''      ,\
3188
 
        dns             varchar2(64)            DEFAULT ''      ,\
3189
 
        useip           number(10)              DEFAULT '1'     NOT NULL,\
3190
 
        ip              varchar2(39)            DEFAULT '127.0.0.1'     ,\
3191
 
        por             number(10)              DEFAULT '10050' NOT NULL,\
3192
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3193
 
        disable_un il           number(10)              DEFAULT '0'     NOT NULL,\
3194
 
        error           varchar2(128)           DEFAULT ''      ,\
3195
 
        available               number(10)              DEFAULT '0'     NOT NULL,\
3196
 
        errors_from             number(10)              DEFAULT '0'     NOT NULL,\
3197
 
        las access              number(10)              DEFAULT '0'     NOT NULL,\
3198
 
        inby es         number(20)              DEFAULT '0'     NOT NULL,\
3199
 
        ou by es                number(20)              DEFAULT '0'     NOT NULL,\
3200
 
        useipmi         number(10)              DEFAULT '0'     NOT NULL,\
3201
 
        ipmi_por                number(10)              DEFAULT '623'   NOT NULL,\
3202
 
        ipmi_au h ype           number(10)              DEFAULT '0'     NOT NULL,\
3203
 
        ipmi_privilege          number(10)              DEFAULT '2'     NOT NULL,\
3204
 
        ipmi_username           varchar2(16)            DEFAULT ''      ,\
3205
 
        ipmi_password           varchar2(20)            DEFAULT ''      ,\
3206
 
        ipmi_disable_un il              number(10)              DEFAULT '0'     NOT NULL,\
3207
 
        ipmi_available          number(10)              DEFAULT '0'     NOT NULL,\
3208
 
        snmp_disable_un il              number(10)              DEFAULT '0'     NOT NULL,\
3209
 
        snmp_available          number(10)              DEFAULT '0'     NOT NULL,\
3210
 
        PRIMARY KEY (hos id)\
3211
 
);\
3212
 
CREATE INDEX hos s_1 on hos s (hos );\
3213
 
CREATE INDEX hos s_2 on hos s (s a us);\
3214
 
CREATE INDEX hos s_3 on hos s (proxy_hos id);\
3215
 
CREATE TABLE hos s_groups (\
3216
 
        hos groupid             number(20)              DEFAULT '0'     NOT NULL,\
3217
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3218
 
        groupid         number(20)              DEFAULT '0'     NOT NULL,\
3219
 
        PRIMARY KEY (hos groupid)\
3220
 
);\
3221
 
CREATE INDEX hos s_groups_groups_1 on hos s_groups (hos id,groupid);\
3222
 
CREATE TABLE hos s_profiles (\
3223
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3224
 
        device ype              varchar2(64)            DEFAULT ''      ,\
3225
 
        name            varchar2(64)            DEFAULT ''      ,\
3226
 
        os              varchar2(64)            DEFAULT ''      ,\
3227
 
        serialno                varchar2(64)            DEFAULT ''      ,\
3228
 
         ag             varchar2(64)            DEFAULT ''      ,\
3229
 
        macaddress              varchar2(64)            DEFAULT ''      ,\
3230
 
        hardware                varchar2(2048)          DEFAULT ''      ,\
3231
 
        sof ware                varchar2(2048)          DEFAULT ''      ,\
3232
 
        con ac          varchar2(2048)          DEFAULT ''      ,\
3233
 
        loca ion                varchar2(2048)          DEFAULT ''      ,\
3234
 
        no es           varchar2(2048)          DEFAULT ''      ,\
3235
 
        PRIMARY KEY (hos id)\
3236
 
);\
3237
 
CREATE TABLE hos s_profiles_ex  (\
3238
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3239
 
        device_alias            varchar2(64)            DEFAULT ''      ,\
3240
 
        device_ ype             varchar2(64)            DEFAULT ''      ,\
3241
 
        device_chassis          varchar2(64)            DEFAULT ''      ,\
3242
 
        device_os               varchar2(64)            DEFAULT ''      ,\
3243
 
        device_os_shor          varchar2(64)            DEFAULT ''      ,\
3244
 
        device_hw_arch          varchar2(32)            DEFAULT ''      ,\
3245
 
        device_serial           varchar2(64)            DEFAULT ''      ,\
3246
 
        device_model            varchar2(64)            DEFAULT ''      ,\
3247
 
        device_ ag              varchar2(64)            DEFAULT ''      ,\
3248
 
        device_vendor           varchar2(64)            DEFAULT ''      ,\
3249
 
        device_con rac          varchar2(64)            DEFAULT ''      ,\
3250
 
        device_who              varchar2(64)            DEFAULT ''      ,\
3251
 
        device_s a us           varchar2(64)            DEFAULT ''      ,\
3252
 
        device_app_01           varchar2(64)            DEFAULT ''      ,\
3253
 
        device_app_02           varchar2(64)            DEFAULT ''      ,\
3254
 
        device_app_03           varchar2(64)            DEFAULT ''      ,\
3255
 
        device_app_04           varchar2(64)            DEFAULT ''      ,\
3256
 
        device_app_05           varchar2(64)            DEFAULT ''      ,\
3257
 
        device_url_1            varchar2(255)           DEFAULT ''      ,\
3258
 
        device_url_2            varchar2(255)           DEFAULT ''      ,\
3259
 
        device_url_3            varchar2(255)           DEFAULT ''      ,\
3260
 
        device_ne works         varchar2(2048)          DEFAULT ''      ,\
3261
 
        device_no es            varchar2(2048)          DEFAULT ''      ,\
3262
 
        device_hardware         varchar2(2048)          DEFAULT ''      ,\
3263
 
        device_sof ware         varchar2(2048)          DEFAULT ''      ,\
3264
 
        ip_subne _mask          varchar2(39)            DEFAULT ''      ,\
3265
 
        ip_rou er               varchar2(39)            DEFAULT ''      ,\
3266
 
        ip_macaddress           varchar2(64)            DEFAULT ''      ,\
3267
 
        oob_ip          varchar2(39)            DEFAULT ''      ,\
3268
 
        oob_subne _mask         varchar2(39)            DEFAULT ''      ,\
3269
 
        oob_rou er              varchar2(39)            DEFAULT ''      ,\
3270
 
        da e_hw_buy             varchar2(64)            DEFAULT ''      ,\
3271
 
        da e_hw_ins all         varchar2(64)            DEFAULT ''      ,\
3272
 
        da e_hw_expiry          varchar2(64)            DEFAULT ''      ,\
3273
 
        da e_hw_decomm          varchar2(64)            DEFAULT ''      ,\
3274
 
        si e_s ree _1           varchar2(128)           DEFAULT ''      ,\
3275
 
        si e_s ree _2           varchar2(128)           DEFAULT ''      ,\
3276
 
        si e_s ree _3           varchar2(128)           DEFAULT ''      ,\
3277
 
        si e_ci y               varchar2(128)           DEFAULT ''      ,\
3278
 
        si e_s a e              varchar2(64)            DEFAULT ''      ,\
3279
 
        si e_coun ry            varchar2(64)            DEFAULT ''      ,\
3280
 
        si e_zip                varchar2(64)            DEFAULT ''      ,\
3281
 
        si e_rack               varchar2(128)           DEFAULT ''      ,\
3282
 
        si e_no es              varchar2(2048)          DEFAULT ''      ,\
3283
 
        poc_1_name              varchar2(128)           DEFAULT ''      ,\
3284
 
        poc_1_email             varchar2(128)           DEFAULT ''      ,\
3285
 
        poc_1_phone_1           varchar2(64)            DEFAULT ''      ,\
3286
 
        poc_1_phone_2           varchar2(64)            DEFAULT ''      ,\
3287
 
        poc_1_cell              varchar2(64)            DEFAULT ''      ,\
3288
 
        poc_1_screen            varchar2(64)            DEFAULT ''      ,\
3289
 
        poc_1_no es             varchar2(2048)          DEFAULT ''      ,\
3290
 
        poc_2_name              varchar2(128)           DEFAULT ''      ,\
3291
 
        poc_2_email             varchar2(128)           DEFAULT ''      ,\
3292
 
        poc_2_phone_1           varchar2(64)            DEFAULT ''      ,\
3293
 
        poc_2_phone_2           varchar2(64)            DEFAULT ''      ,\
3294
 
        poc_2_cell              varchar2(64)            DEFAULT ''      ,\
3295
 
        poc_2_screen            varchar2(64)            DEFAULT ''      ,\
3296
 
        poc_2_no es             varchar2(2048)          DEFAULT ''      ,\
3297
 
        PRIMARY KEY (hos id)\
3298
 
);\
3299
 
CREATE TABLE hos s_ empla es (\
3300
 
        hos empla eid           number(20)              DEFAULT '0'     NOT NULL,\
3301
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3302
 
         empla eid              number(20)              DEFAULT '0'     NOT NULL,\
3303
 
        PRIMARY KEY (hos empla eid)\
3304
 
);\
3305
 
CREATE UNIQUE INDEX hos s_ empla es_1 on hos s_ empla es (hos id, empla eid);\
 
3190
CREATE TABLE help_items (\
 
3191
 itemtype number(10) DEFAULT '0' NOT NULL,\
 
3192
 key_ varchar2(255) DEFAULT '' ,\
 
3193
 description varchar2(255) DEFAULT '' ,\
 
3194
 PRIMARY KEY (itemtype,key_)\
 
3195
);\
 
3196
CREATE TABLE hosts (\
 
3197
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3198
 proxy_hostid number(20) DEFAULT '0' NOT NULL,\
 
3199
 host varchar2(64) DEFAULT '' ,\
 
3200
 dns varchar2(64) DEFAULT '' ,\
 
3201
 useip number(10) DEFAULT '1' NOT NULL,\
 
3202
 ip varchar2(39) DEFAULT '127.0.0.1' ,\
 
3203
 port number(10) DEFAULT '10050' NOT NULL,\
 
3204
 status number(10) DEFAULT '0' NOT NULL,\
 
3205
 disable_until number(10) DEFAULT '0' NOT NULL,\
 
3206
 error varchar2(128) DEFAULT '' ,\
 
3207
 available number(10) DEFAULT '0' NOT NULL,\
 
3208
 errors_from number(10) DEFAULT '0' NOT NULL,\
 
3209
 lastaccess number(10) DEFAULT '0' NOT NULL,\
 
3210
 inbytes number(20) DEFAULT '0' NOT NULL,\
 
3211
 outbytes number(20) DEFAULT '0' NOT NULL,\
 
3212
 useipmi number(10) DEFAULT '0' NOT NULL,\
 
3213
 ipmi_port number(10) DEFAULT '623' NOT NULL,\
 
3214
 ipmi_authtype number(10) DEFAULT '0' NOT NULL,\
 
3215
 ipmi_privilege number(10) DEFAULT '2' NOT NULL,\
 
3216
 ipmi_username varchar2(16) DEFAULT '' ,\
 
3217
 ipmi_password varchar2(20) DEFAULT '' ,\
 
3218
 ipmi_disable_until number(10) DEFAULT '0' NOT NULL,\
 
3219
 ipmi_available number(10) DEFAULT '0' NOT NULL,\
 
3220
 snmp_disable_until number(10) DEFAULT '0' NOT NULL,\
 
3221
 snmp_available number(10) DEFAULT '0' NOT NULL,\
 
3222
 PRIMARY KEY (hostid)\
 
3223
);\
 
3224
CREATE INDEX hosts_1 on hosts (host);\
 
3225
CREATE INDEX hosts_2 on hosts (status);\
 
3226
CREATE INDEX hosts_3 on hosts (proxy_hostid);\
 
3227
CREATE TABLE hosts_groups (\
 
3228
 hostgroupid number(20) DEFAULT '0' NOT NULL,\
 
3229
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3230
 groupid number(20) DEFAULT '0' NOT NULL,\
 
3231
 PRIMARY KEY (hostgroupid)\
 
3232
);\
 
3233
CREATE INDEX hosts_groups_groups_1 on hosts_groups (hostid,groupid);\
 
3234
CREATE TABLE hosts_profiles (\
 
3235
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3236
 devicetype varchar2(64) DEFAULT '' ,\
 
3237
 name varchar2(64) DEFAULT '' ,\
 
3238
 os varchar2(64) DEFAULT '' ,\
 
3239
 serialno varchar2(64) DEFAULT '' ,\
 
3240
 tag varchar2(64) DEFAULT '' ,\
 
3241
 macaddress varchar2(64) DEFAULT '' ,\
 
3242
 hardware varchar2(2048) DEFAULT '' ,\
 
3243
 software varchar2(2048) DEFAULT '' ,\
 
3244
 contact varchar2(2048) DEFAULT '' ,\
 
3245
 location varchar2(2048) DEFAULT '' ,\
 
3246
 notes varchar2(2048) DEFAULT '' ,\
 
3247
 PRIMARY KEY (hostid)\
 
3248
);\
 
3249
CREATE TABLE hosts_profiles_ext (\
 
3250
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3251
 device_alias varchar2(64) DEFAULT '' ,\
 
3252
 device_type varchar2(64) DEFAULT '' ,\
 
3253
 device_chassis varchar2(64) DEFAULT '' ,\
 
3254
 device_os varchar2(64) DEFAULT '' ,\
 
3255
 device_os_short varchar2(64) DEFAULT '' ,\
 
3256
 device_hw_arch varchar2(32) DEFAULT '' ,\
 
3257
 device_serial varchar2(64) DEFAULT '' ,\
 
3258
 device_model varchar2(64) DEFAULT '' ,\
 
3259
 device_tag varchar2(64) DEFAULT '' ,\
 
3260
 device_vendor varchar2(64) DEFAULT '' ,\
 
3261
 device_contract varchar2(64) DEFAULT '' ,\
 
3262
 device_who varchar2(64) DEFAULT '' ,\
 
3263
 device_status varchar2(64) DEFAULT '' ,\
 
3264
 device_app_01 varchar2(64) DEFAULT '' ,\
 
3265
 device_app_02 varchar2(64) DEFAULT '' ,\
 
3266
 device_app_03 varchar2(64) DEFAULT '' ,\
 
3267
 device_app_04 varchar2(64) DEFAULT '' ,\
 
3268
 device_app_05 varchar2(64) DEFAULT '' ,\
 
3269
 device_url_1 varchar2(255) DEFAULT '' ,\
 
3270
 device_url_2 varchar2(255) DEFAULT '' ,\
 
3271
 device_url_3 varchar2(255) DEFAULT '' ,\
 
3272
 device_networks varchar2(2048) DEFAULT '' ,\
 
3273
 device_notes varchar2(2048) DEFAULT '' ,\
 
3274
 device_hardware varchar2(2048) DEFAULT '' ,\
 
3275
 device_software varchar2(2048) DEFAULT '' ,\
 
3276
 ip_subnet_mask varchar2(39) DEFAULT '' ,\
 
3277
 ip_router varchar2(39) DEFAULT '' ,\
 
3278
 ip_macaddress varchar2(64) DEFAULT '' ,\
 
3279
 oob_ip varchar2(39) DEFAULT '' ,\
 
3280
 oob_subnet_mask varchar2(39) DEFAULT '' ,\
 
3281
 oob_router varchar2(39) DEFAULT '' ,\
 
3282
 date_hw_buy varchar2(64) DEFAULT '' ,\
 
3283
 date_hw_install varchar2(64) DEFAULT '' ,\
 
3284
 date_hw_expiry varchar2(64) DEFAULT '' ,\
 
3285
 date_hw_decomm varchar2(64) DEFAULT '' ,\
 
3286
 site_street_1 varchar2(128) DEFAULT '' ,\
 
3287
 site_street_2 varchar2(128) DEFAULT '' ,\
 
3288
 site_street_3 varchar2(128) DEFAULT '' ,\
 
3289
 site_city varchar2(128) DEFAULT '' ,\
 
3290
 site_state varchar2(64) DEFAULT '' ,\
 
3291
 site_country varchar2(64) DEFAULT '' ,\
 
3292
 site_zip varchar2(64) DEFAULT '' ,\
 
3293
 site_rack varchar2(128) DEFAULT '' ,\
 
3294
 site_notes varchar2(2048) DEFAULT '' ,\
 
3295
 poc_1_name varchar2(128) DEFAULT '' ,\
 
3296
 poc_1_email varchar2(128) DEFAULT '' ,\
 
3297
 poc_1_phone_1 varchar2(64) DEFAULT '' ,\
 
3298
 poc_1_phone_2 varchar2(64) DEFAULT '' ,\
 
3299
 poc_1_cell varchar2(64) DEFAULT '' ,\
 
3300
 poc_1_screen varchar2(64) DEFAULT '' ,\
 
3301
 poc_1_notes varchar2(2048) DEFAULT '' ,\
 
3302
 poc_2_name varchar2(128) DEFAULT '' ,\
 
3303
 poc_2_email varchar2(128) DEFAULT '' ,\
 
3304
 poc_2_phone_1 varchar2(64) DEFAULT '' ,\
 
3305
 poc_2_phone_2 varchar2(64) DEFAULT '' ,\
 
3306
 poc_2_cell varchar2(64) DEFAULT '' ,\
 
3307
 poc_2_screen varchar2(64) DEFAULT '' ,\
 
3308
 poc_2_notes varchar2(2048) DEFAULT '' ,\
 
3309
 PRIMARY KEY (hostid)\
 
3310
);\
 
3311
CREATE TABLE hosts_templates (\
 
3312
 hosttemplateid number(20) DEFAULT '0' NOT NULL,\
 
3313
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3314
 templateid number(20) DEFAULT '0' NOT NULL,\
 
3315
 PRIMARY KEY (hosttemplateid)\
 
3316
);\
 
3317
CREATE UNIQUE INDEX hosts_templates_1 on hosts_templates (hostid,templateid);\
3306
3318
CREATE TABLE housekeeper (\
3307
 
        housekeeperid           number(20)              DEFAULT '0'     NOT NULL,\
3308
 
         ablename               varchar2(64)            DEFAULT ''      ,\
3309
 
        field           varchar2(64)            DEFAULT ''      ,\
3310
 
        value           number(20)              DEFAULT '0'     NOT NULL,\
3311
 
        PRIMARY KEY (housekeeperid)\
 
3319
 housekeeperid number(20) DEFAULT '0' NOT NULL,\
 
3320
 tablename varchar2(64) DEFAULT '' ,\
 
3321
 field varchar2(64) DEFAULT '' ,\
 
3322
 value number(20) DEFAULT '0' NOT NULL,\
 
3323
 PRIMARY KEY (housekeeperid)\
3312
3324
);\
3313
3325
CREATE TABLE images (\
3314
 
        imageid         number(20)              DEFAULT '0'     NOT NULL,\
3315
 
        image ype               number(10)              DEFAULT '0'     NOT NULL,\
3316
 
        name            varchar2(64)            DEFAULT '0'     ,\
3317
 
        image           blob            DEFAULT ''      NOT NULL,\
3318
 
        PRIMARY KEY (imageid)\
3319
 
);\
3320
 
CREATE INDEX images_1 on images (image ype,name);\
3321
 
CREATE TABLE i ems (\
3322
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
3323
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3324
 
        snmp_communi y          varchar2(64)            DEFAULT ''      ,\
3325
 
        snmp_oid                varchar2(255)           DEFAULT ''      ,\
3326
 
        snmp_por                number(10)              DEFAULT '161'   NOT NULL,\
3327
 
        hos id          number(20)              DEFAULT '0'     NOT NULL,\
3328
 
        descrip ion             varchar2(255)           DEFAULT ''      ,\
3329
 
        key_            varchar2(255)           DEFAULT ''      ,\
3330
 
        delay           number(10)              DEFAULT '0'     NOT NULL,\
3331
 
        his ory         number(10)              DEFAULT '90'    NOT NULL,\
3332
 
         rends          number(10)              DEFAULT '365'   NOT NULL,\
3333
 
        nex check               number(10)              DEFAULT '0'     NOT NULL,\
3334
 
        las value               varchar2(255)                   ,\
3335
 
        las clock               number(10)                      NULL,\
3336
 
        prevvalue               varchar2(255)                   ,\
3337
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3338
 
        value_ ype              number(10)              DEFAULT '0'     NOT NULL,\
3339
 
         rapper_hos s           varchar2(255)           DEFAULT ''      ,\
3340
 
        uni s           varchar2(10)            DEFAULT ''      ,\
3341
 
        mul iplier              number(10)              DEFAULT '0'     NOT NULL,\
3342
 
        del a           number(10)              DEFAULT '0'     NOT NULL,\
3343
 
        prevorgvalue            varchar2(255)                   ,\
3344
 
        snmpv3_securi yname             varchar2(64)            DEFAULT ''      ,\
3345
 
        snmpv3_securi ylevel            number(10)              DEFAULT '0'     NOT NULL,\
3346
 
        snmpv3_au hpassphrase           varchar2(64)            DEFAULT ''      ,\
3347
 
        snmpv3_privpassphrase           varchar2(64)            DEFAULT ''      ,\
3348
 
        formula         varchar2(255)           DEFAULT '1'     ,\
3349
 
        error           varchar2(128)           DEFAULT ''      ,\
3350
 
        las logsize             number(10)              DEFAULT '0'     NOT NULL,\
3351
 
        log imefm               varchar2(64)            DEFAULT ''      ,\
3352
 
         empla eid              number(20)              DEFAULT '0'     NOT NULL,\
3353
 
        valuemapid              number(20)              DEFAULT '0'     NOT NULL,\
3354
 
        delay_flex              varchar2(255)           DEFAULT ''      ,\
3355
 
        params          varchar2(2048)          DEFAULT ''      ,\
3356
 
        ipmi_sensor             varchar2(128)           DEFAULT ''      ,\
3357
 
        PRIMARY KEY (i emid)\
3358
 
);\
3359
 
CREATE UNIQUE INDEX i ems_1 on i ems (hos id,key_);\
3360
 
CREATE INDEX i ems_2 on i ems (nex check);\
3361
 
CREATE INDEX i ems_3 on i ems (s a us);\
3362
 
CREATE INDEX i ems_4 on i ems ( empla eid);\
3363
 
CREATE TABLE i ems_applica ions (\
3364
 
        i emappid               number(20)              DEFAULT '0'     NOT NULL,\
3365
 
        applica ionid           number(20)              DEFAULT '0'     NOT NULL,\
3366
 
        i emid          number(20)              DEFAULT '0'     NOT NULL,\
3367
 
        PRIMARY KEY (i emappid)\
3368
 
);\
3369
 
CREATE INDEX i ems_applica ions_1 on i ems_applica ions (applica ionid,i emid);\
3370
 
CREATE INDEX i ems_applica ions_2 on i ems_applica ions (i emid);\
 
3326
 imageid number(20) DEFAULT '0' NOT NULL,\
 
3327
 imagetype number(10) DEFAULT '0' NOT NULL,\
 
3328
 name varchar2(64) DEFAULT '0' ,\
 
3329
 image blob DEFAULT '' NOT NULL,\
 
3330
 PRIMARY KEY (imageid)\
 
3331
);\
 
3332
CREATE INDEX images_1 on images (imagetype,name);\
 
3333
CREATE TABLE items (\
 
3334
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3335
 type number(10) DEFAULT '0' NOT NULL,\
 
3336
 snmp_community varchar2(64) DEFAULT '' ,\
 
3337
 snmp_oid varchar2(255) DEFAULT '' ,\
 
3338
 snmp_port number(10) DEFAULT '161' NOT NULL,\
 
3339
 hostid number(20) DEFAULT '0' NOT NULL,\
 
3340
 description varchar2(255) DEFAULT '' ,\
 
3341
 key_ varchar2(255) DEFAULT '' ,\
 
3342
 delay number(10) DEFAULT '0' NOT NULL,\
 
3343
 history number(10) DEFAULT '90' NOT NULL,\
 
3344
 trends number(10) DEFAULT '365' NOT NULL,\
 
3345
 nextcheck number(10) DEFAULT '0' NOT NULL,\
 
3346
 lastvalue varchar2(255) ,\
 
3347
 lastclock number(10) NULL,\
 
3348
 prevvalue varchar2(255) ,\
 
3349
 status number(10) DEFAULT '0' NOT NULL,\
 
3350
 value_type number(10) DEFAULT '0' NOT NULL,\
 
3351
 trapper_hosts varchar2(255) DEFAULT '' ,\
 
3352
 units varchar2(10) DEFAULT '' ,\
 
3353
 multiplier number(10) DEFAULT '0' NOT NULL,\
 
3354
 delta number(10) DEFAULT '0' NOT NULL,\
 
3355
 prevorgvalue varchar2(255) ,\
 
3356
 snmpv3_securityname varchar2(64) DEFAULT '' ,\
 
3357
 snmpv3_securitylevel number(10) DEFAULT '0' NOT NULL,\
 
3358
 snmpv3_authpassphrase varchar2(64) DEFAULT '' ,\
 
3359
 snmpv3_privpassphrase varchar2(64) DEFAULT '' ,\
 
3360
 formula varchar2(255) DEFAULT '1' ,\
 
3361
 error varchar2(128) DEFAULT '' ,\
 
3362
 lastlogsize number(10) DEFAULT '0' NOT NULL,\
 
3363
 logtimefmt varchar2(64) DEFAULT '' ,\
 
3364
 templateid number(20) DEFAULT '0' NOT NULL,\
 
3365
 valuemapid number(20) DEFAULT '0' NOT NULL,\
 
3366
 delay_flex varchar2(255) DEFAULT '' ,\
 
3367
 params varchar2(2048) DEFAULT '' ,\
 
3368
 ipmi_sensor varchar2(128) DEFAULT '' ,\
 
3369
 PRIMARY KEY (itemid)\
 
3370
);\
 
3371
CREATE UNIQUE INDEX items_1 on items (hostid,key_);\
 
3372
CREATE INDEX items_2 on items (nextcheck);\
 
3373
CREATE INDEX items_3 on items (status);\
 
3374
CREATE INDEX items_4 on items (templateid);\
 
3375
CREATE TABLE items_applications (\
 
3376
 itemappid number(20) DEFAULT '0' NOT NULL,\
 
3377
 applicationid number(20) DEFAULT '0' NOT NULL,\
 
3378
 itemid number(20) DEFAULT '0' NOT NULL,\
 
3379
 PRIMARY KEY (itemappid)\
 
3380
);\
 
3381
CREATE INDEX items_applications_1 on items_applications (applicationid,itemid);\
 
3382
CREATE INDEX items_applications_2 on items_applications (itemid);\
3371
3383
CREATE TABLE mappings (\
3372
 
        mappingid               number(20)              DEFAULT '0'     NOT NULL,\
3373
 
        valuemapid              number(20)              DEFAULT '0'     NOT NULL,\
3374
 
        value           varchar2(64)            DEFAULT ''      ,\
3375
 
        newvalue                varchar2(64)            DEFAULT ''      ,\
3376
 
        PRIMARY KEY (mappingid)\
 
3384
 mappingid number(20) DEFAULT '0' NOT NULL,\
 
3385
 valuemapid number(20) DEFAULT '0' NOT NULL,\
 
3386
 value varchar2(64) DEFAULT '' ,\
 
3387
 newvalue varchar2(64) DEFAULT '' ,\
 
3388
 PRIMARY KEY (mappingid)\
3377
3389
);\
3378
3390
CREATE INDEX mappings_1 on mappings (valuemapid);\
3379
3391
CREATE TABLE media (\
3380
 
        mediaid         number(20)              DEFAULT '0'     NOT NULL,\
3381
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3382
 
        media ypeid             number(20)              DEFAULT '0'     NOT NULL,\
3383
 
        send o          varchar2(100)           DEFAULT ''      ,\
3384
 
        ac ive          number(10)              DEFAULT '0'     NOT NULL,\
3385
 
        severi y                number(10)              DEFAULT '63'    NOT NULL,\
3386
 
        period          varchar2(100)           DEFAULT '1-7,00:00-23:59'       ,\
3387
 
        PRIMARY KEY (mediaid)\
 
3392
 mediaid number(20) DEFAULT '0' NOT NULL,\
 
3393
 userid number(20) DEFAULT '0' NOT NULL,\
 
3394
 mediatypeid number(20) DEFAULT '0' NOT NULL,\
 
3395
 sendto varchar2(100) DEFAULT '' ,\
 
3396
 active number(10) DEFAULT '0' NOT NULL,\
 
3397
 severity number(10) DEFAULT '63' NOT NULL,\
 
3398
 period varchar2(100) DEFAULT '1-7,00:00-23:59' ,\
 
3399
 PRIMARY KEY (mediaid)\
3388
3400
);\
3389
3401
CREATE INDEX media_1 on media (userid);\
3390
 
CREATE INDEX media_2 on media (media ypeid);\
3391
 
CREATE TABLE media_ ype (\
3392
 
        media ypeid             number(20)              DEFAULT '0'     NOT NULL,\
3393
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3394
 
        descrip ion             varchar2(100)           DEFAULT ''      ,\
3395
 
        sm p_server             varchar2(255)           DEFAULT ''      ,\
3396
 
        sm p_helo               varchar2(255)           DEFAULT ''      ,\
3397
 
        sm p_email              varchar2(255)           DEFAULT ''      ,\
3398
 
        exec_pa h               varchar2(255)           DEFAULT ''      ,\
3399
 
        gsm_modem               varchar2(255)           DEFAULT ''      ,\
3400
 
        username                varchar2(255)           DEFAULT ''      ,\
3401
 
        passwd          varchar2(255)           DEFAULT ''      ,\
3402
 
        PRIMARY KEY (media ypeid)\
 
3402
CREATE INDEX media_2 on media (mediatypeid);\
 
3403
CREATE TABLE media_type (\
 
3404
 mediatypeid number(20) DEFAULT '0' NOT NULL,\
 
3405
 type number(10) DEFAULT '0' NOT NULL,\
 
3406
 description varchar2(100) DEFAULT '' ,\
 
3407
 smtp_server varchar2(255) DEFAULT '' ,\
 
3408
 smtp_helo varchar2(255) DEFAULT '' ,\
 
3409
 smtp_email varchar2(255) DEFAULT '' ,\
 
3410
 exec_path varchar2(255) DEFAULT '' ,\
 
3411
 gsm_modem varchar2(255) DEFAULT '' ,\
 
3412
 username varchar2(255) DEFAULT '' ,\
 
3413
 passwd varchar2(255) DEFAULT '' ,\
 
3414
 PRIMARY KEY (mediatypeid)\
3403
3415
);\
3404
3416
CREATE TABLE profiles (\
3405
 
        profileid               number(20)              DEFAULT '0'     NOT NULL,\
3406
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3407
 
        idx             varchar2(96)            DEFAULT ''      ,\
3408
 
        idx2            number(20)              DEFAULT '0'     NOT NULL,\
3409
 
        value_id                number(20)              DEFAULT '0'     NOT NULL,\
3410
 
        value_in                number(10)              DEFAULT '0'     NOT NULL,\
3411
 
        value_s r               varchar2(255)           DEFAULT ''      ,\
3412
 
        source          varchar2(96)            DEFAULT ''      ,\
3413
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3414
 
        PRIMARY KEY (profileid)\
 
3417
 profileid number(20) DEFAULT '0' NOT NULL,\
 
3418
 userid number(20) DEFAULT '0' NOT NULL,\
 
3419
 idx varchar2(96) DEFAULT '' ,\
 
3420
 idx2 number(20) DEFAULT '0' NOT NULL,\
 
3421
 value_id number(20) DEFAULT '0' NOT NULL,\
 
3422
 value_int number(10) DEFAULT '0' NOT NULL,\
 
3423
 value_str varchar2(255) DEFAULT '' ,\
 
3424
 source varchar2(96) DEFAULT '' ,\
 
3425
 type number(10) DEFAULT '0' NOT NULL,\
 
3426
 PRIMARY KEY (profileid)\
3415
3427
);\
3416
3428
CREATE INDEX profiles_1 on profiles (userid,idx,idx2);\
3417
 
CREATE TABLE righ s (\
3418
 
        righ id         number(20)              DEFAULT '0'     NOT NULL,\
3419
 
        groupid         number(20)              DEFAULT '0'     NOT NULL,\
3420
 
        permission              number(10)              DEFAULT '0'     NOT NULL,\
3421
 
        id              number(20)                      ,\
3422
 
        PRIMARY KEY (righ id)\
 
3429
CREATE TABLE rights (\
 
3430
 rightid number(20) DEFAULT '0' NOT NULL,\
 
3431
 groupid number(20) DEFAULT '0' NOT NULL,\
 
3432
 permission number(10) DEFAULT '0' NOT NULL,\
 
3433
 id number(20) ,\
 
3434
 PRIMARY KEY (rightid)\
3423
3435
);\
3424
 
CREATE INDEX righ s_1 on righ s (groupid);\
3425
 
CREATE TABLE scrip s (\
3426
 
        scrip id                number(20)              DEFAULT '0'     NOT NULL,\
3427
 
        name            varchar2(255)           DEFAULT ''      ,\
3428
 
        command         varchar2(255)           DEFAULT ''      ,\
3429
 
        hos _access             number(10)              DEFAULT '2'     NOT NULL,\
3430
 
        usrgrpid                number(20)              DEFAULT '0'     NOT NULL,\
3431
 
        groupid         number(20)              DEFAULT '0'     NOT NULL,\
3432
 
        PRIMARY KEY (scrip id)\
 
3436
CREATE INDEX rights_1 on rights (groupid);\
 
3437
CREATE TABLE scripts (\
 
3438
 scriptid number(20) DEFAULT '0' NOT NULL,\
 
3439
 name varchar2(255) DEFAULT '' ,\
 
3440
 command varchar2(255) DEFAULT '' ,\
 
3441
 host_access number(10) DEFAULT '2' NOT NULL,\
 
3442
 usrgrpid number(20) DEFAULT '0' NOT NULL,\
 
3443
 groupid number(20) DEFAULT '0' NOT NULL,\
 
3444
 PRIMARY KEY (scriptid)\
3433
3445
);\
3434
3446
CREATE TABLE screens (\
3435
 
        screenid                number(20)              DEFAULT '0'     NOT NULL,\
3436
 
        name            varchar2(255)           DEFAULT 'Screen'        ,\
3437
 
        hsize           number(10)              DEFAULT '1'     NOT NULL,\
3438
 
        vsize           number(10)              DEFAULT '1'     NOT NULL,\
3439
 
        PRIMARY KEY (screenid)\
 
3447
 screenid number(20) DEFAULT '0' NOT NULL,\
 
3448
 name varchar2(255) DEFAULT 'Screen' ,\
 
3449
 hsize number(10) DEFAULT '1' NOT NULL,\
 
3450
 vsize number(10) DEFAULT '1' NOT NULL,\
 
3451
 PRIMARY KEY (screenid)\
3440
3452
);\
3441
 
CREATE TABLE screens_i ems (\
3442
 
        screeni emid            number(20)              DEFAULT '0'     NOT NULL,\
3443
 
        screenid                number(20)              DEFAULT '0'     NOT NULL,\
3444
 
        resource ype            number(10)              DEFAULT '0'     NOT NULL,\
3445
 
        resourceid              number(20)              DEFAULT '0'     NOT NULL,\
3446
 
        wid h           number(10)              DEFAULT '320'   NOT NULL,\
3447
 
        heigh           number(10)              DEFAULT '200'   NOT NULL,\
3448
 
        x               number(10)              DEFAULT '0'     NOT NULL,\
3449
 
        y               number(10)              DEFAULT '0'     NOT NULL,\
3450
 
        colspan         number(10)              DEFAULT '0'     NOT NULL,\
3451
 
        rowspan         number(10)              DEFAULT '0'     NOT NULL,\
3452
 
        elemen s                number(10)              DEFAULT '25'    NOT NULL,\
3453
 
        valign          number(10)              DEFAULT '0'     NOT NULL,\
3454
 
        halign          number(10)              DEFAULT '0'     NOT NULL,\
3455
 
        s yle           number(10)              DEFAULT '0'     NOT NULL,\
3456
 
        url             varchar2(255)           DEFAULT ''      ,\
3457
 
        dynamic         number(10)              DEFAULT '0'     NOT NULL,\
3458
 
        PRIMARY KEY (screeni emid)\
 
3453
CREATE TABLE screens_items (\
 
3454
 screenitemid number(20) DEFAULT '0' NOT NULL,\
 
3455
 screenid number(20) DEFAULT '0' NOT NULL,\
 
3456
 resourcetype number(10) DEFAULT '0' NOT NULL,\
 
3457
 resourceid number(20) DEFAULT '0' NOT NULL,\
 
3458
 width number(10) DEFAULT '320' NOT NULL,\
 
3459
 height number(10) DEFAULT '200' NOT NULL,\
 
3460
 x number(10) DEFAULT '0' NOT NULL,\
 
3461
 y number(10) DEFAULT '0' NOT NULL,\
 
3462
 colspan number(10) DEFAULT '0' NOT NULL,\
 
3463
 rowspan number(10) DEFAULT '0' NOT NULL,\
 
3464
 elements number(10) DEFAULT '25' NOT NULL,\
 
3465
 valign number(10) DEFAULT '0' NOT NULL,\
 
3466
 halign number(10) DEFAULT '0' NOT NULL,\
 
3467
 style number(10) DEFAULT '0' NOT NULL,\
 
3468
 url varchar2(255) DEFAULT '' ,\
 
3469
 dynamic number(10) DEFAULT '0' NOT NULL,\
 
3470
 PRIMARY KEY (screenitemid)\
3459
3471
);\
3460
3472
CREATE TABLE services (\
3461
 
        serviceid               number(20)              DEFAULT '0'     NOT NULL,\
3462
 
        name            varchar2(128)           DEFAULT ''      ,\
3463
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3464
 
        algori hm               number(10)              DEFAULT '0'     NOT NULL,\
3465
 
         riggerid               number(20)                      ,\
3466
 
        showsla         number(10)              DEFAULT '0'     NOT NULL,\
3467
 
        goodsla         number(20,4)            DEFAULT '99.9'  NOT NULL,\
3468
 
        sor order               number(10)              DEFAULT '0'     NOT NULL,\
3469
 
        PRIMARY KEY (serviceid)\
 
3473
 serviceid number(20) DEFAULT '0' NOT NULL,\
 
3474
 name varchar2(128) DEFAULT '' ,\
 
3475
 status number(10) DEFAULT '0' NOT NULL,\
 
3476
 algorithm number(10) DEFAULT '0' NOT NULL,\
 
3477
 triggerid number(20) ,\
 
3478
 showsla number(10) DEFAULT '0' NOT NULL,\
 
3479
 goodsla number(20,4) DEFAULT '99.9' NOT NULL,\
 
3480
 sortorder number(10) DEFAULT '0' NOT NULL,\
 
3481
 PRIMARY KEY (serviceid)\
3470
3482
);\
3471
3483
CREATE TABLE services_links (\
3472
 
        linkid          number(20)              DEFAULT '0'     NOT NULL,\
3473
 
        serviceupid             number(20)              DEFAULT '0'     NOT NULL,\
3474
 
        servicedownid           number(20)              DEFAULT '0'     NOT NULL,\
3475
 
        sof             number(10)              DEFAULT '0'     NOT NULL,\
3476
 
        PRIMARY KEY (linkid)\
 
3484
 linkid number(20) DEFAULT '0' NOT NULL,\
 
3485
 serviceupid number(20) DEFAULT '0' NOT NULL,\
 
3486
 servicedownid number(20) DEFAULT '0' NOT NULL,\
 
3487
 soft number(10) DEFAULT '0' NOT NULL,\
 
3488
 PRIMARY KEY (linkid)\
3477
3489
);\
3478
3490
CREATE INDEX services_links_links_1 on services_links (servicedownid);\
3479
3491
CREATE UNIQUE INDEX services_links_links_2 on services_links (serviceupid,servicedownid);\
3480
3492
CREATE TABLE sessions (\
3481
 
        sessionid               varchar2(32)            DEFAULT ''      ,\
3482
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3483
 
        las access              number(10)              DEFAULT '0'     NOT NULL,\
3484
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3485
 
        PRIMARY KEY (sessionid)\
 
3493
 sessionid varchar2(32) DEFAULT '' ,\
 
3494
 userid number(20) DEFAULT '0' NOT NULL,\
 
3495
 lastaccess number(10) DEFAULT '0' NOT NULL,\
 
3496
 status number(10) DEFAULT '0' NOT NULL,\
 
3497
 PRIMARY KEY (sessionid)\
3486
3498
);\
3487
3499
CREATE TABLE sysmaps_links (\
3488
 
        linkid          number(20)              DEFAULT '0'     NOT NULL,\
3489
 
        sysmapid                number(20)              DEFAULT '0'     NOT NULL,\
3490
 
        selemen id1             number(20)              DEFAULT '0'     NOT NULL,\
3491
 
        selemen id2             number(20)              DEFAULT '0'     NOT NULL,\
3492
 
        draw ype                number(10)              DEFAULT '0'     NOT NULL,\
3493
 
        color           varchar2(6)             DEFAULT '000000'        ,\
3494
 
        PRIMARY KEY (linkid)\
3495
 
);\
3496
 
CREATE TABLE sysmaps_link_ riggers (\
3497
 
        link riggerid           number(20)              DEFAULT '0'     NOT NULL,\
3498
 
        linkid          number(20)              DEFAULT '0'     NOT NULL,\
3499
 
         riggerid               number(20)              DEFAULT '0'     NOT NULL,\
3500
 
        draw ype                number(10)              DEFAULT '0'     NOT NULL,\
3501
 
        color           varchar2(6)             DEFAULT '000000'        ,\
3502
 
        PRIMARY KEY (link riggerid)\
3503
 
);\
3504
 
CREATE UNIQUE INDEX sysmaps_link_ riggers_1 on sysmaps_link_ riggers (linkid, riggerid);\
3505
 
CREATE TABLE sysmaps_elemen s (\
3506
 
        selemen id              number(20)              DEFAULT '0'     NOT NULL,\
3507
 
        sysmapid                number(20)              DEFAULT '0'     NOT NULL,\
3508
 
        elemen id               number(20)              DEFAULT '0'     NOT NULL,\
3509
 
        elemen ype              number(10)              DEFAULT '0'     NOT NULL,\
3510
 
        iconid_off              number(20)              DEFAULT '0'     NOT NULL,\
3511
 
        iconid_on               number(20)              DEFAULT '0'     NOT NULL,\
3512
 
        iconid_unknown          number(20)              DEFAULT '0'     NOT NULL,\
3513
 
        label           varchar2(128)           DEFAULT ''      ,\
3514
 
        label_loca ion          number(10)                      NULL,\
3515
 
        x               number(10)              DEFAULT '0'     NOT NULL,\
3516
 
        y               number(10)              DEFAULT '0'     NOT NULL,\
3517
 
        url             varchar2(255)           DEFAULT ''      ,\
3518
 
        iconid_disabled         number(20)              DEFAULT '0'     NOT NULL,\
3519
 
        PRIMARY KEY (selemen id)\
 
3500
 linkid number(20) DEFAULT '0' NOT NULL,\
 
3501
 sysmapid number(20) DEFAULT '0' NOT NULL,\
 
3502
 selementid1 number(20) DEFAULT '0' NOT NULL,\
 
3503
 selementid2 number(20) DEFAULT '0' NOT NULL,\
 
3504
 drawtype number(10) DEFAULT '0' NOT NULL,\
 
3505
 color varchar2(6) DEFAULT '000000' ,\
 
3506
 PRIMARY KEY (linkid)\
 
3507
);\
 
3508
CREATE TABLE sysmaps_link_triggers (\
 
3509
 linktriggerid number(20) DEFAULT '0' NOT NULL,\
 
3510
 linkid number(20) DEFAULT '0' NOT NULL,\
 
3511
 triggerid number(20) DEFAULT '0' NOT NULL,\
 
3512
 drawtype number(10) DEFAULT '0' NOT NULL,\
 
3513
 color varchar2(6) DEFAULT '000000' ,\
 
3514
 PRIMARY KEY (linktriggerid)\
 
3515
);\
 
3516
CREATE UNIQUE INDEX sysmaps_link_triggers_1 on sysmaps_link_triggers (linkid,triggerid);\
 
3517
CREATE TABLE sysmaps_elements (\
 
3518
 selementid number(20) DEFAULT '0' NOT NULL,\
 
3519
 sysmapid number(20) DEFAULT '0' NOT NULL,\
 
3520
 elementid number(20) DEFAULT '0' NOT NULL,\
 
3521
 elementtype number(10) DEFAULT '0' NOT NULL,\
 
3522
 iconid_off number(20) DEFAULT '0' NOT NULL,\
 
3523
 iconid_on number(20) DEFAULT '0' NOT NULL,\
 
3524
 iconid_unknown number(20) DEFAULT '0' NOT NULL,\
 
3525
 label varchar2(128) DEFAULT '' ,\
 
3526
 label_location number(10) NULL,\
 
3527
 x number(10) DEFAULT '0' NOT NULL,\
 
3528
 y number(10) DEFAULT '0' NOT NULL,\
 
3529
 url varchar2(255) DEFAULT '' ,\
 
3530
 iconid_disabled number(20) DEFAULT '0' NOT NULL,\
 
3531
 PRIMARY KEY (selementid)\
3520
3532
);\
3521
3533
CREATE TABLE sysmaps (\
3522
 
        sysmapid                number(20)              DEFAULT '0'     NOT NULL,\
3523
 
        name            varchar2(128)           DEFAULT ''      ,\
3524
 
        wid h           number(10)              DEFAULT '0'     NOT NULL,\
3525
 
        heigh           number(10)              DEFAULT '0'     NOT NULL,\
3526
 
        backgroundid            number(20)              DEFAULT '0'     NOT NULL,\
3527
 
        label_ ype              number(10)              DEFAULT '0'     NOT NULL,\
3528
 
        label_loca ion          number(10)              DEFAULT '0'     NOT NULL,\
3529
 
        PRIMARY KEY (sysmapid)\
 
3534
 sysmapid number(20) DEFAULT '0' NOT NULL,\
 
3535
 name varchar2(128) DEFAULT '' ,\
 
3536
 width number(10) DEFAULT '0' NOT NULL,\
 
3537
 height number(10) DEFAULT '0' NOT NULL,\
 
3538
 backgroundid number(20) DEFAULT '0' NOT NULL,\
 
3539
 label_type number(10) DEFAULT '0' NOT NULL,\
 
3540
 label_location number(10) DEFAULT '0' NOT NULL,\
 
3541
 PRIMARY KEY (sysmapid)\
3530
3542
);\
3531
3543
CREATE INDEX sysmaps_1 on sysmaps (name);\
3532
 
CREATE TABLE  riggers (\
3533
 
         riggerid               number(20)              DEFAULT '0'     NOT NULL,\
3534
 
        expression              varchar2(255)           DEFAULT ''      ,\
3535
 
        descrip ion             varchar2(255)           DEFAULT ''      ,\
3536
 
        url             varchar2(255)           DEFAULT ''      ,\
3537
 
        s a us          number(10)              DEFAULT '0'     NOT NULL,\
3538
 
        value           number(10)              DEFAULT '0'     NOT NULL,\
3539
 
        priori y                number(10)              DEFAULT '0'     NOT NULL,\
3540
 
        las change              number(10)              DEFAULT '0'     NOT NULL,\
3541
 
        dep_level               number(10)              DEFAULT '0'     NOT NULL,\
3542
 
        commen s                varchar2(2048)          DEFAULT ''      ,\
3543
 
        error           varchar2(128)           DEFAULT ''      ,\
3544
 
         empla eid              number(20)              DEFAULT '0'     NOT NULL,\
3545
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3546
 
        PRIMARY KEY ( riggerid)\
3547
 
);\
3548
 
CREATE INDEX  riggers_1 on  riggers (s a us);\
3549
 
CREATE INDEX  riggers_2 on  riggers (value);\
3550
 
CREATE TABLE  rigger_depends (\
3551
 
         riggerdepid            number(20)              DEFAULT '0'     NOT NULL,\
3552
 
         riggerid_down          number(20)              DEFAULT '0'     NOT NULL,\
3553
 
         riggerid_up            number(20)              DEFAULT '0'     NOT NULL,\
3554
 
        PRIMARY KEY ( riggerdepid)\
3555
 
);\
3556
 
CREATE INDEX  rigger_depends_1 on  rigger_depends ( riggerid_down, riggerid_up);\
3557
 
CREATE INDEX  rigger_depends_2 on  rigger_depends ( riggerid_up);\
 
3544
CREATE TABLE triggers (\
 
3545
 triggerid number(20) DEFAULT '0' NOT NULL,\
 
3546
 expression varchar2(255) DEFAULT '' ,\
 
3547
 description varchar2(255) DEFAULT '' ,\
 
3548
 url varchar2(255) DEFAULT '' ,\
 
3549
 status number(10) DEFAULT '0' NOT NULL,\
 
3550
 value number(10) DEFAULT '0' NOT NULL,\
 
3551
 priority number(10) DEFAULT '0' NOT NULL,\
 
3552
 lastchange number(10) DEFAULT '0' NOT NULL,\
 
3553
 dep_level number(10) DEFAULT '0' NOT NULL,\
 
3554
 comments varchar2(2048) DEFAULT '' ,\
 
3555
 error varchar2(128) DEFAULT '' ,\
 
3556
 templateid number(20) DEFAULT '0' NOT NULL,\
 
3557
 type number(10) DEFAULT '0' NOT NULL,\
 
3558
 PRIMARY KEY (triggerid)\
 
3559
);\
 
3560
CREATE INDEX triggers_1 on triggers (status);\
 
3561
CREATE INDEX triggers_2 on triggers (value);\
 
3562
CREATE TABLE trigger_depends (\
 
3563
 triggerdepid number(20) DEFAULT '0' NOT NULL,\
 
3564
 triggerid_down number(20) DEFAULT '0' NOT NULL,\
 
3565
 triggerid_up number(20) DEFAULT '0' NOT NULL,\
 
3566
 PRIMARY KEY (triggerdepid)\
 
3567
);\
 
3568
CREATE INDEX trigger_depends_1 on trigger_depends (triggerid_down,triggerid_up);\
 
3569
CREATE INDEX trigger_depends_2 on trigger_depends (triggerid_up);\
3558
3570
CREATE TABLE users (\
3559
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3560
 
        alias           varchar2(100)           DEFAULT ''      ,\
3561
 
        name            varchar2(100)           DEFAULT ''      ,\
3562
 
        surname         varchar2(100)           DEFAULT ''      ,\
3563
 
        passwd          varchar2(32)            DEFAULT ''      ,\
3564
 
        url             varchar2(255)           DEFAULT ''      ,\
3565
 
        au ologin               number(10)              DEFAULT '0'     NOT NULL,\
3566
 
        au ologou               number(10)              DEFAULT '900'   NOT NULL,\
3567
 
        lang            varchar2(5)             DEFAULT 'en_gb' ,\
3568
 
        refresh         number(10)              DEFAULT '30'    NOT NULL,\
3569
 
         ype            number(10)              DEFAULT '0'     NOT NULL,\
3570
 
         heme           varchar2(128)           DEFAULT 'defaul .css'   ,\
3571
 
        a emp _failed           number(10)              DEFAULT 0       NOT NULL,\
3572
 
        a emp _ip               varchar2(39)            DEFAULT ''      ,\
3573
 
        a emp _clock            number(10)              DEFAULT 0       NOT NULL,\
3574
 
        PRIMARY KEY (userid)\
 
3571
 userid number(20) DEFAULT '0' NOT NULL,\
 
3572
 alias varchar2(100) DEFAULT '' ,\
 
3573
 name varchar2(100) DEFAULT '' ,\
 
3574
 surname varchar2(100) DEFAULT '' ,\
 
3575
 passwd varchar2(32) DEFAULT '' ,\
 
3576
 url varchar2(255) DEFAULT '' ,\
 
3577
 autologin number(10) DEFAULT '0' NOT NULL,\
 
3578
 autologout number(10) DEFAULT '900' NOT NULL,\
 
3579
 lang varchar2(5) DEFAULT 'en_gb' ,\
 
3580
 refresh number(10) DEFAULT '30' NOT NULL,\
 
3581
 type number(10) DEFAULT '0' NOT NULL,\
 
3582
 theme varchar2(128) DEFAULT 'default.css' ,\
 
3583
 attempt_failed number(10) DEFAULT 0 NOT NULL,\
 
3584
 attempt_ip varchar2(39) DEFAULT '' ,\
 
3585
 attempt_clock number(10) DEFAULT 0 NOT NULL,\
 
3586
 PRIMARY KEY (userid)\
3575
3587
);\
3576
3588
CREATE INDEX users_1 on users (alias);\
3577
3589
CREATE TABLE usrgrp (\
3578
 
        usrgrpid                number(20)              DEFAULT '0'     NOT NULL,\
3579
 
        name            varchar2(64)            DEFAULT ''      ,\
3580
 
        gui_access              number(10)              DEFAULT '0'     NOT NULL,\
3581
 
        users_s a us            number(10)              DEFAULT '0'     NOT NULL,\
3582
 
        PRIMARY KEY (usrgrpid)\
 
3590
 usrgrpid number(20) DEFAULT '0' NOT NULL,\
 
3591
 name varchar2(64) DEFAULT '' ,\
 
3592
 gui_access number(10) DEFAULT '0' NOT NULL,\
 
3593
 users_status number(10) DEFAULT '0' NOT NULL,\
 
3594
 PRIMARY KEY (usrgrpid)\
3583
3595
);\
3584
3596
CREATE INDEX usrgrp_1 on usrgrp (name);\
3585
3597
CREATE TABLE users_groups (\
3586
 
        id              number(20)              DEFAULT '0'     NOT NULL,\
3587
 
        usrgrpid                number(20)              DEFAULT '0'     NOT NULL,\
3588
 
        userid          number(20)              DEFAULT '0'     NOT NULL,\
3589
 
        PRIMARY KEY (id)\
 
3598
 id number(20) DEFAULT '0' NOT NULL,\
 
3599
 usrgrpid number(20) DEFAULT '0' NOT NULL,\
 
3600
 userid number(20) DEFAULT '0' NOT NULL,\
 
3601
 PRIMARY KEY (id)\
3590
3602
);\
3591
3603
CREATE INDEX users_groups_1 on users_groups (usrgrpid,userid);\
3592
3604
CREATE TABLE valuemaps (\
3593
 
        valuemapid              number(20)              DEFAULT '0'     NOT NULL,\
3594
 
        name            varchar2(64)            DEFAULT ''      ,\
3595
 
        PRIMARY KEY (valuemapid)\
 
3605
 valuemapid number(20) DEFAULT '0' NOT NULL,\
 
3606
 name varchar2(64) DEFAULT '' ,\
 
3607
 PRIMARY KEY (valuemapid)\
3596
3608
);\
3597
3609
CREATE INDEX valuemaps_1 on valuemaps (name);\
3598
3610
"};
3600
3612
const char *db_schema = {"\
3601
3613
BEGIN TRANSACTION;\
3602
3614
CREATE TABLE IF NOT EXISTS slideshows (\
3603
 
        slideshowid             bigin           DEFAULT '0'     NOT NULL,\
3604
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
3605
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
3606
 
        PRIMARY KEY (slideshowid)\
 
3615
 slideshowid bigint DEFAULT '0' NOT NULL,\
 
3616
 name varchar(255) DEFAULT '' NOT NULL,\
 
3617
 delay integer DEFAULT '0' NOT NULL,\
 
3618
 PRIMARY KEY (slideshowid)\
3607
3619
);\
3608
3620
CREATE TABLE IF NOT EXISTS slides (\
3609
 
        slideid         bigin           DEFAULT '0'     NOT NULL,\
3610
 
        slideshowid             bigin           DEFAULT '0'     NOT NULL,\
3611
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
3612
 
        s ep            in eger         DEFAULT '0'     NOT NULL,\
3613
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
3614
 
        PRIMARY KEY (slideid)\
 
3621
 slideid bigint DEFAULT '0' NOT NULL,\
 
3622
 slideshowid bigint DEFAULT '0' NOT NULL,\
 
3623
 screenid bigint DEFAULT '0' NOT NULL,\
 
3624
 step integer DEFAULT '0' NOT NULL,\
 
3625
 delay integer DEFAULT '0' NOT NULL,\
 
3626
 PRIMARY KEY (slideid)\
3615
3627
);\
3616
3628
CREATE INDEX IF NOT EXISTS slides_slides_1 on slides (slideshowid);\
3617
3629
CREATE TABLE IF NOT EXISTS drules (\
3618
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
3619
 
        proxy_hos id            bigin           DEFAULT '0'     NOT NULL,\
3620
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
3621
 
        iprange         varchar(255)            DEFAULT ''      NOT NULL,\
3622
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
3623
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
3624
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3625
 
        PRIMARY KEY (druleid)\
 
3630
 druleid bigint DEFAULT '0' NOT NULL,\
 
3631
 proxy_hostid bigint DEFAULT '0' NOT NULL,\
 
3632
 name varchar(255) DEFAULT '' NOT NULL,\
 
3633
 iprange varchar(255) DEFAULT '' NOT NULL,\
 
3634
 delay integer DEFAULT '0' NOT NULL,\
 
3635
 nextcheck integer DEFAULT '0' NOT NULL,\
 
3636
 status integer DEFAULT '0' NOT NULL,\
 
3637
 PRIMARY KEY (druleid)\
3626
3638
);\
3627
3639
CREATE TABLE IF NOT EXISTS dchecks (\
3628
 
        dcheckid                bigin           DEFAULT '0'     NOT NULL,\
3629
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
3630
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3631
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
3632
 
        snmp_communi y          varchar(255)            DEFAULT '0'     NOT NULL,\
3633
 
        por s           varchar(255)            DEFAULT '0'     NOT NULL,\
3634
 
        PRIMARY KEY (dcheckid)\
 
3640
 dcheckid bigint DEFAULT '0' NOT NULL,\
 
3641
 druleid bigint DEFAULT '0' NOT NULL,\
 
3642
 type integer DEFAULT '0' NOT NULL,\
 
3643
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
3644
 snmp_community varchar(255) DEFAULT '0' NOT NULL,\
 
3645
 ports varchar(255) DEFAULT '0' NOT NULL,\
 
3646
 PRIMARY KEY (dcheckid)\
3635
3647
);\
3636
 
CREATE TABLE IF NOT EXISTS dhos s (\
3637
 
        dhos id         bigin           DEFAULT '0'     NOT NULL,\
3638
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
3639
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
3640
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3641
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
3642
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
3643
 
        PRIMARY KEY (dhos id)\
 
3648
CREATE TABLE IF NOT EXISTS dhosts (\
 
3649
 dhostid bigint DEFAULT '0' NOT NULL,\
 
3650
 druleid bigint DEFAULT '0' NOT NULL,\
 
3651
 ip varchar(39) DEFAULT '' NOT NULL,\
 
3652
 status integer DEFAULT '0' NOT NULL,\
 
3653
 lastup integer DEFAULT '0' NOT NULL,\
 
3654
 lastdown integer DEFAULT '0' NOT NULL,\
 
3655
 PRIMARY KEY (dhostid)\
3644
3656
);\
3645
3657
CREATE TABLE IF NOT EXISTS dservices (\
3646
 
        dserviceid              bigin           DEFAULT '0'     NOT NULL,\
3647
 
        dhos id         bigin           DEFAULT '0'     NOT NULL,\
3648
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3649
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
3650
 
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
3651
 
        por             in eger         DEFAULT '0'     NOT NULL,\
3652
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3653
 
        las up          in eger         DEFAULT '0'     NOT NULL,\
3654
 
        las down                in eger         DEFAULT '0'     NOT NULL,\
3655
 
        PRIMARY KEY (dserviceid)\
 
3658
 dserviceid bigint DEFAULT '0' NOT NULL,\
 
3659
 dhostid bigint DEFAULT '0' NOT NULL,\
 
3660
 type integer DEFAULT '0' NOT NULL,\
 
3661
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
3662
 value varchar(255) DEFAULT '0' NOT NULL,\
 
3663
 port integer DEFAULT '0' NOT NULL,\
 
3664
 status integer DEFAULT '0' NOT NULL,\
 
3665
 lastup integer DEFAULT '0' NOT NULL,\
 
3666
 lastdown integer DEFAULT '0' NOT NULL,\
 
3667
 PRIMARY KEY (dserviceid)\
3656
3668
);\
3657
3669
CREATE TABLE IF NOT EXISTS ids (\
3658
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
3659
 
         able_name              varchar(64)             DEFAULT ''      NOT NULL,\
3660
 
        field_name              varchar(64)             DEFAULT ''      NOT NULL,\
3661
 
        nex id          bigin           DEFAULT '0'     NOT NULL,\
3662
 
        PRIMARY KEY (nodeid, able_name,field_name)\
3663
 
);\
3664
 
CREATE TABLE IF NOT EXISTS h p es  (\
3665
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
3666
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
3667
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
3668
 
        las check               in eger         DEFAULT '0'     NOT NULL,\
3669
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
3670
 
        curs a e                in eger         DEFAULT '0'     NOT NULL,\
3671
 
        curs ep         in eger         DEFAULT '0'     NOT NULL,\
3672
 
        las faileds ep          in eger         DEFAULT '0'     NOT NULL,\
3673
 
        delay           in eger         DEFAULT '60'    NOT NULL,\
3674
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3675
 
        macros          blob            DEFAULT ''      NOT NULL,\
3676
 
        agen            varchar(255)            DEFAULT ''      NOT NULL,\
3677
 
         ime            double(16,4)            DEFAULT '0'     NOT NULL,\
3678
 
        error           varchar(255)            DEFAULT ''      NOT NULL,\
3679
 
        PRIMARY KEY (h p es id)\
3680
 
);\
3681
 
CREATE INDEX IF NOT EXISTS h p es _h p es _1 on h p es  (applica ionid);\
3682
 
CREATE TABLE IF NOT EXISTS h ps ep (\
3683
 
        h ps epid               bigin           DEFAULT '0'     NOT NULL,\
3684
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
3685
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
3686
 
        no              in eger         DEFAULT '0'     NOT NULL,\
3687
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
3688
 
         imeou          in eger         DEFAULT '30'    NOT NULL,\
3689
 
        pos s           blob            DEFAULT ''      NOT NULL,\
3690
 
        required                varchar(255)            DEFAULT ''      NOT NULL,\
3691
 
        s a us_codes            varchar(255)            DEFAULT ''      NOT NULL,\
3692
 
        PRIMARY KEY (h ps epid)\
3693
 
);\
3694
 
CREATE INDEX IF NOT EXISTS h ps ep_h ps ep_1 on h ps ep (h p es id);\
3695
 
CREATE TABLE IF NOT EXISTS h ps epi em (\
3696
 
        h ps epi emid           bigin           DEFAULT '0'     NOT NULL,\
3697
 
        h ps epid               bigin           DEFAULT '0'     NOT NULL,\
3698
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3699
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3700
 
        PRIMARY KEY (h ps epi emid)\
3701
 
);\
3702
 
CREATE UNIQUE INDEX IF NOT EXISTS h ps epi em_h ps epi em_1 on h ps epi em (h ps epid,i emid);\
3703
 
CREATE TABLE IF NOT EXISTS h p es i em (\
3704
 
        h p es i emid           bigin           DEFAULT '0'     NOT NULL,\
3705
 
        h p es id               bigin           DEFAULT '0'     NOT NULL,\
3706
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3707
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3708
 
        PRIMARY KEY (h p es i emid)\
3709
 
);\
3710
 
CREATE UNIQUE INDEX IF NOT EXISTS h p es i em_h p es i em_1 on h p es i em (h p es id,i emid);\
 
3670
 nodeid integer DEFAULT '0' NOT NULL,\
 
3671
 table_name varchar(64) DEFAULT '' NOT NULL,\
 
3672
 field_name varchar(64) DEFAULT '' NOT NULL,\
 
3673
 nextid bigint DEFAULT '0' NOT NULL,\
 
3674
 PRIMARY KEY (nodeid,table_name,field_name)\
 
3675
);\
 
3676
CREATE TABLE IF NOT EXISTS httptest (\
 
3677
 httptestid bigint DEFAULT '0' NOT NULL,\
 
3678
 name varchar(64) DEFAULT '' NOT NULL,\
 
3679
 applicationid bigint DEFAULT '0' NOT NULL,\
 
3680
 lastcheck integer DEFAULT '0' NOT NULL,\
 
3681
 nextcheck integer DEFAULT '0' NOT NULL,\
 
3682
 curstate integer DEFAULT '0' NOT NULL,\
 
3683
 curstep integer DEFAULT '0' NOT NULL,\
 
3684
 lastfailedstep integer DEFAULT '0' NOT NULL,\
 
3685
 delay integer DEFAULT '60' NOT NULL,\
 
3686
 status integer DEFAULT '0' NOT NULL,\
 
3687
 macros blob DEFAULT '' NOT NULL,\
 
3688
 agent varchar(255) DEFAULT '' NOT NULL,\
 
3689
 time double(16,4) DEFAULT '0' NOT NULL,\
 
3690
 error varchar(255) DEFAULT '' NOT NULL,\
 
3691
 PRIMARY KEY (httptestid)\
 
3692
);\
 
3693
CREATE INDEX IF NOT EXISTS httptest_httptest_1 on httptest (applicationid);\
 
3694
CREATE TABLE IF NOT EXISTS httpstep (\
 
3695
 httpstepid bigint DEFAULT '0' NOT NULL,\
 
3696
 httptestid bigint DEFAULT '0' NOT NULL,\
 
3697
 name varchar(64) DEFAULT '' NOT NULL,\
 
3698
 no integer DEFAULT '0' NOT NULL,\
 
3699
 url varchar(255) DEFAULT '' NOT NULL,\
 
3700
 timeout integer DEFAULT '30' NOT NULL,\
 
3701
 posts blob DEFAULT '' NOT NULL,\
 
3702
 required varchar(255) DEFAULT '' NOT NULL,\
 
3703
 status_codes varchar(255) DEFAULT '' NOT NULL,\
 
3704
 PRIMARY KEY (httpstepid)\
 
3705
);\
 
3706
CREATE INDEX IF NOT EXISTS httpstep_httpstep_1 on httpstep (httptestid);\
 
3707
CREATE TABLE IF NOT EXISTS httpstepitem (\
 
3708
 httpstepitemid bigint DEFAULT '0' NOT NULL,\
 
3709
 httpstepid bigint DEFAULT '0' NOT NULL,\
 
3710
 itemid bigint DEFAULT '0' NOT NULL,\
 
3711
 type integer DEFAULT '0' NOT NULL,\
 
3712
 PRIMARY KEY (httpstepitemid)\
 
3713
);\
 
3714
CREATE UNIQUE INDEX IF NOT EXISTS httpstepitem_httpstepitem_1 on httpstepitem (httpstepid,itemid);\
 
3715
CREATE TABLE IF NOT EXISTS httptestitem (\
 
3716
 httptestitemid bigint DEFAULT '0' NOT NULL,\
 
3717
 httptestid bigint DEFAULT '0' NOT NULL,\
 
3718
 itemid bigint DEFAULT '0' NOT NULL,\
 
3719
 type integer DEFAULT '0' NOT NULL,\
 
3720
 PRIMARY KEY (httptestitemid)\
 
3721
);\
 
3722
CREATE UNIQUE INDEX IF NOT EXISTS httptestitem_httptestitem_1 on httptestitem (httptestid,itemid);\
3711
3723
CREATE TABLE IF NOT EXISTS nodes (\
3712
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
3713
 
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
3714
 
         imezone                in eger         DEFAULT '0'     NOT NULL,\
3715
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
3716
 
        por             in eger         DEFAULT '10051' NOT NULL,\
3717
 
        slave_his ory           in eger         DEFAULT '30'    NOT NULL,\
3718
 
        slave_ rends            in eger         DEFAULT '365'   NOT NULL,\
3719
 
        node ype                in eger         DEFAULT '0'     NOT NULL,\
3720
 
        mas erid                in eger         DEFAULT '0'     NOT NULL,\
3721
 
        PRIMARY KEY (nodeid)\
 
3724
 nodeid integer DEFAULT '0' NOT NULL,\
 
3725
 name varchar(64) DEFAULT '0' NOT NULL,\
 
3726
 timezone integer DEFAULT '0' NOT NULL,\
 
3727
 ip varchar(39) DEFAULT '' NOT NULL,\
 
3728
 port integer DEFAULT '10051' NOT NULL,\
 
3729
 slave_history integer DEFAULT '30' NOT NULL,\
 
3730
 slave_trends integer DEFAULT '365' NOT NULL,\
 
3731
 nodetype integer DEFAULT '0' NOT NULL,\
 
3732
 masterid integer DEFAULT '0' NOT NULL,\
 
3733
 PRIMARY KEY (nodeid)\
3722
3734
);\
3723
3735
CREATE TABLE IF NOT EXISTS node_cksum (\
3724
 
        nodeid          in eger         DEFAULT '0'     NOT NULL,\
3725
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
3726
 
        recordid                bigin           DEFAULT '0'     NOT NULL,\
3727
 
        cksum ype               in eger         DEFAULT '0'     NOT NULL,\
3728
 
        cksum            ex             DEFAULT ''      NOT NULL,\
3729
 
        sync            char(128)               DEFAULT ''      NOT NULL\
3730
 
);\
3731
 
CREATE INDEX IF NOT EXISTS node_cksum_cksum_1 on node_cksum (nodeid, ablename,recordid,cksum ype);\
3732
 
CREATE TABLE IF NOT EXISTS services_ imes (\
3733
 
         imeid          bigin           DEFAULT '0'     NOT NULL,\
3734
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
3735
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3736
 
         s_from         in eger         DEFAULT '0'     NOT NULL,\
3737
 
         s_ o           in eger         DEFAULT '0'     NOT NULL,\
3738
 
        no e            varchar(255)            DEFAULT ''      NOT NULL,\
3739
 
        PRIMARY KEY ( imeid)\
3740
 
);\
3741
 
CREATE INDEX IF NOT EXISTS services_ imes_ imes_1 on services_ imes (serviceid, ype, s_from, s_ o);\
3742
 
CREATE TABLE IF NOT EXISTS aler s (\
3743
 
        aler id         bigin           DEFAULT '0'     NOT NULL,\
3744
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
3745
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
3746
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
3747
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3748
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
3749
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
3750
 
        subjec          varchar(255)            DEFAULT ''      NOT NULL,\
3751
 
        message         blob            DEFAULT ''      NOT NULL,\
3752
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3753
 
        re ries         in eger         DEFAULT '0'     NOT NULL,\
3754
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
3755
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
3756
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
3757
 
        aler ype                in eger         DEFAULT '0'     NOT NULL,\
3758
 
        PRIMARY KEY (aler id)\
3759
 
);\
3760
 
CREATE INDEX IF NOT EXISTS aler s_1 on aler s (ac ionid);\
3761
 
CREATE INDEX IF NOT EXISTS aler s_2 on aler s (clock);\
3762
 
CREATE INDEX IF NOT EXISTS aler s_3 on aler s (even id);\
3763
 
CREATE INDEX IF NOT EXISTS aler s_4 on aler s (s a us,re ries);\
3764
 
CREATE INDEX IF NOT EXISTS aler s_5 on aler s (media ypeid);\
3765
 
CREATE INDEX IF NOT EXISTS aler s_6 on aler s (userid);\
3766
 
CREATE TABLE IF NOT EXISTS his ory (\
3767
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3768
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3769
 
        value           double(16,4)            DEFAULT '0.0000'        NOT NULL\
3770
 
);\
3771
 
CREATE INDEX IF NOT EXISTS his ory_1 on his ory (i emid,clock);\
3772
 
CREATE TABLE IF NOT EXISTS his ory_sync (\
3773
 
        id              in eger                 NOT NULL        PRIMARY KEY AUTOINCREMENT,\
3774
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
3775
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3776
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3777
 
        value           double(16,4)            DEFAULT '0.0000'        NOT NULL\
3778
 
);\
3779
 
CREATE INDEX IF NOT EXISTS his ory_sync_1 on his ory_sync (nodeid,id);\
3780
 
CREATE TABLE IF NOT EXISTS his ory_uin  (\
3781
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3782
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3783
 
        value           bigin           DEFAULT '0'     NOT NULL\
3784
 
);\
3785
 
CREATE INDEX IF NOT EXISTS his ory_uin _1 on his ory_uin  (i emid,clock);\
3786
 
CREATE TABLE IF NOT EXISTS his ory_uin _sync (\
3787
 
        id              in eger                 NOT NULL        PRIMARY KEY AUTOINCREMENT,\
3788
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
3789
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3790
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3791
 
        value           bigin           DEFAULT '0'     NOT NULL\
3792
 
);\
3793
 
CREATE INDEX IF NOT EXISTS his ory_uin _sync_1 on his ory_uin _sync (nodeid,id);\
3794
 
CREATE TABLE IF NOT EXISTS his ory_s r (\
3795
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3796
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3797
 
        value           varchar(255)            DEFAULT ''      NOT NULL\
3798
 
);\
3799
 
CREATE INDEX IF NOT EXISTS his ory_s r_1 on his ory_s r (i emid,clock);\
3800
 
CREATE TABLE IF NOT EXISTS his ory_s r_sync (\
3801
 
        id              in eger                 NOT NULL        PRIMARY KEY AUTOINCREMENT,\
3802
 
        nodeid          bigin           DEFAULT '0'     NOT NULL,\
3803
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3804
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3805
 
        value           varchar(255)            DEFAULT ''      NOT NULL\
3806
 
);\
3807
 
CREATE INDEX IF NOT EXISTS his ory_s r_sync_1 on his ory_s r_sync (nodeid,id);\
3808
 
CREATE TABLE IF NOT EXISTS his ory_log (\
3809
 
        id              bigin           DEFAULT '0'     NOT NULL,\
3810
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3811
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3812
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
3813
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
3814
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
3815
 
        value            ex             DEFAULT ''      NOT NULL,\
3816
 
        PRIMARY KEY (id)\
3817
 
);\
3818
 
CREATE INDEX IF NOT EXISTS his ory_log_1 on his ory_log (i emid,clock);\
3819
 
CREATE TABLE IF NOT EXISTS his ory_ ex  (\
3820
 
        id              bigin           DEFAULT '0'     NOT NULL,\
3821
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3822
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3823
 
        value            ex             DEFAULT ''      NOT NULL,\
3824
 
        PRIMARY KEY (id)\
3825
 
);\
3826
 
CREATE INDEX IF NOT EXISTS his ory_ ex _1 on his ory_ ex  (i emid,clock);\
3827
 
CREATE TABLE IF NOT EXISTS proxy_his ory (\
3828
 
        id              in eger                 NOT NULL        PRIMARY KEY AUTOINCREMENT,\
3829
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3830
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3831
 
         imes amp               in eger         DEFAULT '0'     NOT NULL,\
3832
 
        source          varchar(64)             DEFAULT ''      NOT NULL,\
3833
 
        severi y                in eger         DEFAULT '0'     NOT NULL,\
3834
 
        value            ex             DEFAULT ''      NOT NULL\
3835
 
);\
3836
 
CREATE INDEX IF NOT EXISTS proxy_his ory_1 on proxy_his ory (clock);\
3837
 
CREATE TABLE IF NOT EXISTS proxy_dhis ory (\
3838
 
        id              in eger                 NOT NULL        PRIMARY KEY AUTOINCREMENT,\
3839
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3840
 
        druleid         bigin           DEFAULT '0'     NOT NULL,\
3841
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
3842
 
        ip              varchar(39)             DEFAULT ''      NOT NULL,\
3843
 
        por             in eger         DEFAULT '0'     NOT NULL,\
3844
 
        key_            varchar(255)            DEFAULT '0'     NOT NULL,\
3845
 
        value           varchar(255)            DEFAULT '0'     NOT NULL,\
3846
 
        s a us          in eger         DEFAULT '0'     NOT NULL\
3847
 
);\
3848
 
CREATE INDEX IF NOT EXISTS proxy_dhis ory_1 on proxy_dhis ory (clock);\
3849
 
CREATE TABLE IF NOT EXISTS even s (\
3850
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
3851
 
        source          in eger         DEFAULT '0'     NOT NULL,\
3852
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
3853
 
        objec id                bigin           DEFAULT '0'     NOT NULL,\
3854
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3855
 
        value           in eger         DEFAULT '0'     NOT NULL,\
3856
 
        acknowledged            in eger         DEFAULT '0'     NOT NULL,\
3857
 
        PRIMARY KEY (even id)\
3858
 
);\
3859
 
CREATE INDEX IF NOT EXISTS even s_1 on even s (objec ,objec id,even id);\
3860
 
CREATE INDEX IF NOT EXISTS even s_2 on even s (clock);\
3861
 
CREATE TABLE IF NOT EXISTS  rends (\
3862
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3863
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3864
 
        num             in eger         DEFAULT '0'     NOT NULL,\
3865
 
        value_min               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
3866
 
        value_avg               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
3867
 
        value_max               double(16,4)            DEFAULT '0.0000'        NOT NULL,\
3868
 
        PRIMARY KEY (i emid,clock)\
3869
 
);\
3870
 
CREATE TABLE IF NOT EXISTS  rends_uin  (\
3871
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
3872
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3873
 
        num             in eger         DEFAULT '0'     NOT NULL,\
3874
 
        value_min               bigin           DEFAULT '0'     NOT NULL,\
3875
 
        value_avg               bigin           DEFAULT '0'     NOT NULL,\
3876
 
        value_max               bigin           DEFAULT '0'     NOT NULL,\
3877
 
        PRIMARY KEY (i emid,clock)\
 
3736
 nodeid integer DEFAULT '0' NOT NULL,\
 
3737
 tablename varchar(64) DEFAULT '' NOT NULL,\
 
3738
 recordid bigint DEFAULT '0' NOT NULL,\
 
3739
 cksumtype integer DEFAULT '0' NOT NULL,\
 
3740
 cksum text DEFAULT '' NOT NULL,\
 
3741
 sync char(128) DEFAULT '' NOT NULL\
 
3742
);\
 
3743
CREATE INDEX IF NOT EXISTS node_cksum_cksum_1 on node_cksum (nodeid,tablename,recordid,cksumtype);\
 
3744
CREATE TABLE IF NOT EXISTS services_times (\
 
3745
 timeid bigint DEFAULT '0' NOT NULL,\
 
3746
 serviceid bigint DEFAULT '0' NOT NULL,\
 
3747
 type integer DEFAULT '0' NOT NULL,\
 
3748
 ts_from integer DEFAULT '0' NOT NULL,\
 
3749
 ts_to integer DEFAULT '0' NOT NULL,\
 
3750
 note varchar(255) DEFAULT '' NOT NULL,\
 
3751
 PRIMARY KEY (timeid)\
 
3752
);\
 
3753
CREATE INDEX IF NOT EXISTS services_times_times_1 on services_times (serviceid,type,ts_from,ts_to);\
 
3754
CREATE TABLE IF NOT EXISTS alerts (\
 
3755
 alertid bigint DEFAULT '0' NOT NULL,\
 
3756
 actionid bigint DEFAULT '0' NOT NULL,\
 
3757
 eventid bigint DEFAULT '0' NOT NULL,\
 
3758
 userid bigint DEFAULT '0' NOT NULL,\
 
3759
 clock integer DEFAULT '0' NOT NULL,\
 
3760
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
3761
 sendto varchar(100) DEFAULT '' NOT NULL,\
 
3762
 subject varchar(255) DEFAULT '' NOT NULL,\
 
3763
 message blob DEFAULT '' NOT NULL,\
 
3764
 status integer DEFAULT '0' NOT NULL,\
 
3765
 retries integer DEFAULT '0' NOT NULL,\
 
3766
 error varchar(128) DEFAULT '' NOT NULL,\
 
3767
 nextcheck integer DEFAULT '0' NOT NULL,\
 
3768
 esc_step integer DEFAULT '0' NOT NULL,\
 
3769
 alerttype integer DEFAULT '0' NOT NULL,\
 
3770
 PRIMARY KEY (alertid)\
 
3771
);\
 
3772
CREATE INDEX IF NOT EXISTS alerts_1 on alerts (actionid);\
 
3773
CREATE INDEX IF NOT EXISTS alerts_2 on alerts (clock);\
 
3774
CREATE INDEX IF NOT EXISTS alerts_3 on alerts (eventid);\
 
3775
CREATE INDEX IF NOT EXISTS alerts_4 on alerts (status,retries);\
 
3776
CREATE INDEX IF NOT EXISTS alerts_5 on alerts (mediatypeid);\
 
3777
CREATE INDEX IF NOT EXISTS alerts_6 on alerts (userid);\
 
3778
CREATE TABLE IF NOT EXISTS history (\
 
3779
 itemid bigint DEFAULT '0' NOT NULL,\
 
3780
 clock integer DEFAULT '0' NOT NULL,\
 
3781
 value double(16,4) DEFAULT '0.0000' NOT NULL\
 
3782
);\
 
3783
CREATE INDEX IF NOT EXISTS history_1 on history (itemid,clock);\
 
3784
CREATE TABLE IF NOT EXISTS history_sync (\
 
3785
 id integer NOT NULL PRIMARY KEY AUTOINCREMENT,\
 
3786
 nodeid bigint DEFAULT '0' NOT NULL,\
 
3787
 itemid bigint DEFAULT '0' NOT NULL,\
 
3788
 clock integer DEFAULT '0' NOT NULL,\
 
3789
 value double(16,4) DEFAULT '0.0000' NOT NULL\
 
3790
);\
 
3791
CREATE INDEX IF NOT EXISTS history_sync_1 on history_sync (nodeid,id);\
 
3792
CREATE TABLE IF NOT EXISTS history_uint (\
 
3793
 itemid bigint DEFAULT '0' NOT NULL,\
 
3794
 clock integer DEFAULT '0' NOT NULL,\
 
3795
 value bigint DEFAULT '0' NOT NULL\
 
3796
);\
 
3797
CREATE INDEX IF NOT EXISTS history_uint_1 on history_uint (itemid,clock);\
 
3798
CREATE TABLE IF NOT EXISTS history_uint_sync (\
 
3799
 id integer NOT NULL PRIMARY KEY AUTOINCREMENT,\
 
3800
 nodeid bigint DEFAULT '0' NOT NULL,\
 
3801
 itemid bigint DEFAULT '0' NOT NULL,\
 
3802
 clock integer DEFAULT '0' NOT NULL,\
 
3803
 value bigint DEFAULT '0' NOT NULL\
 
3804
);\
 
3805
CREATE INDEX IF NOT EXISTS history_uint_sync_1 on history_uint_sync (nodeid,id);\
 
3806
CREATE TABLE IF NOT EXISTS history_str (\
 
3807
 itemid bigint DEFAULT '0' NOT NULL,\
 
3808
 clock integer DEFAULT '0' NOT NULL,\
 
3809
 value varchar(255) DEFAULT '' NOT NULL\
 
3810
);\
 
3811
CREATE INDEX IF NOT EXISTS history_str_1 on history_str (itemid,clock);\
 
3812
CREATE TABLE IF NOT EXISTS history_str_sync (\
 
3813
 id integer NOT NULL PRIMARY KEY AUTOINCREMENT,\
 
3814
 nodeid bigint DEFAULT '0' NOT NULL,\
 
3815
 itemid bigint DEFAULT '0' NOT NULL,\
 
3816
 clock integer DEFAULT '0' NOT NULL,\
 
3817
 value varchar(255) DEFAULT '' NOT NULL\
 
3818
);\
 
3819
CREATE INDEX IF NOT EXISTS history_str_sync_1 on history_str_sync (nodeid,id);\
 
3820
CREATE TABLE IF NOT EXISTS history_log (\
 
3821
 id bigint DEFAULT '0' NOT NULL,\
 
3822
 itemid bigint DEFAULT '0' NOT NULL,\
 
3823
 clock integer DEFAULT '0' NOT NULL,\
 
3824
 timestamp integer DEFAULT '0' NOT NULL,\
 
3825
 source varchar(64) DEFAULT '' NOT NULL,\
 
3826
 severity integer DEFAULT '0' NOT NULL,\
 
3827
 value text DEFAULT '' NOT NULL,\
 
3828
 PRIMARY KEY (id)\
 
3829
);\
 
3830
CREATE INDEX IF NOT EXISTS history_log_1 on history_log (itemid,clock);\
 
3831
CREATE UNIQUE INDEX IF NOT EXISTS history_log_2 on history_log (itemid,id);\
 
3832
CREATE TABLE IF NOT EXISTS history_text (\
 
3833
 id bigint DEFAULT '0' NOT NULL,\
 
3834
 itemid bigint DEFAULT '0' NOT NULL,\
 
3835
 clock integer DEFAULT '0' NOT NULL,\
 
3836
 value text DEFAULT '' NOT NULL,\
 
3837
 PRIMARY KEY (id)\
 
3838
);\
 
3839
CREATE INDEX IF NOT EXISTS history_text_1 on history_text (itemid,clock);\
 
3840
CREATE UNIQUE INDEX IF NOT EXISTS history_text_2 on history_text (itemid,id);\
 
3841
CREATE TABLE IF NOT EXISTS proxy_history (\
 
3842
 id integer NOT NULL PRIMARY KEY AUTOINCREMENT,\
 
3843
 itemid bigint DEFAULT '0' NOT NULL,\
 
3844
 clock integer DEFAULT '0' NOT NULL,\
 
3845
 timestamp integer DEFAULT '0' NOT NULL,\
 
3846
 source varchar(64) DEFAULT '' NOT NULL,\
 
3847
 severity integer DEFAULT '0' NOT NULL,\
 
3848
 value text DEFAULT '' NOT NULL\
 
3849
);\
 
3850
CREATE INDEX IF NOT EXISTS proxy_history_1 on proxy_history (clock);\
 
3851
CREATE TABLE IF NOT EXISTS proxy_dhistory (\
 
3852
 id integer NOT NULL PRIMARY KEY AUTOINCREMENT,\
 
3853
 clock integer DEFAULT '0' NOT NULL,\
 
3854
 druleid bigint DEFAULT '0' NOT NULL,\
 
3855
 type integer DEFAULT '0' NOT NULL,\
 
3856
 ip varchar(39) DEFAULT '' NOT NULL,\
 
3857
 port integer DEFAULT '0' NOT NULL,\
 
3858
 key_ varchar(255) DEFAULT '0' NOT NULL,\
 
3859
 value varchar(255) DEFAULT '0' NOT NULL,\
 
3860
 status integer DEFAULT '0' NOT NULL\
 
3861
);\
 
3862
CREATE INDEX IF NOT EXISTS proxy_dhistory_1 on proxy_dhistory (clock);\
 
3863
CREATE TABLE IF NOT EXISTS events (\
 
3864
 eventid bigint DEFAULT '0' NOT NULL,\
 
3865
 source integer DEFAULT '0' NOT NULL,\
 
3866
 object integer DEFAULT '0' NOT NULL,\
 
3867
 objectid bigint DEFAULT '0' NOT NULL,\
 
3868
 clock integer DEFAULT '0' NOT NULL,\
 
3869
 value integer DEFAULT '0' NOT NULL,\
 
3870
 acknowledged integer DEFAULT '0' NOT NULL,\
 
3871
 PRIMARY KEY (eventid)\
 
3872
);\
 
3873
CREATE INDEX IF NOT EXISTS events_1 on events (object,objectid,eventid);\
 
3874
CREATE INDEX IF NOT EXISTS events_2 on events (clock);\
 
3875
CREATE TABLE IF NOT EXISTS trends (\
 
3876
 itemid bigint DEFAULT '0' NOT NULL,\
 
3877
 clock integer DEFAULT '0' NOT NULL,\
 
3878
 num integer DEFAULT '0' NOT NULL,\
 
3879
 value_min double(16,4) DEFAULT '0.0000' NOT NULL,\
 
3880
 value_avg double(16,4) DEFAULT '0.0000' NOT NULL,\
 
3881
 value_max double(16,4) DEFAULT '0.0000' NOT NULL,\
 
3882
 PRIMARY KEY (itemid,clock)\
 
3883
);\
 
3884
CREATE TABLE IF NOT EXISTS trends_uint (\
 
3885
 itemid bigint DEFAULT '0' NOT NULL,\
 
3886
 clock integer DEFAULT '0' NOT NULL,\
 
3887
 num integer DEFAULT '0' NOT NULL,\
 
3888
 value_min bigint DEFAULT '0' NOT NULL,\
 
3889
 value_avg bigint DEFAULT '0' NOT NULL,\
 
3890
 value_max bigint DEFAULT '0' NOT NULL,\
 
3891
 PRIMARY KEY (itemid,clock)\
3878
3892
);\
3879
3893
CREATE TABLE IF NOT EXISTS acknowledges (\
3880
 
        acknowledgeid           bigin           DEFAULT '0'     NOT NULL,\
3881
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
3882
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
3883
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3884
 
        message         varchar(255)            DEFAULT ''      NOT NULL,\
3885
 
        PRIMARY KEY (acknowledgeid)\
 
3894
 acknowledgeid bigint DEFAULT '0' NOT NULL,\
 
3895
 userid bigint DEFAULT '0' NOT NULL,\
 
3896
 eventid bigint DEFAULT '0' NOT NULL,\
 
3897
 clock integer DEFAULT '0' NOT NULL,\
 
3898
 message varchar(255) DEFAULT '' NOT NULL,\
 
3899
 PRIMARY KEY (acknowledgeid)\
3886
3900
);\
3887
3901
CREATE INDEX IF NOT EXISTS acknowledges_1 on acknowledges (userid);\
3888
 
CREATE INDEX IF NOT EXISTS acknowledges_2 on acknowledges (even id);\
 
3902
CREATE INDEX IF NOT EXISTS acknowledges_2 on acknowledges (eventid);\
3889
3903
CREATE INDEX IF NOT EXISTS acknowledges_3 on acknowledges (clock);\
3890
 
CREATE TABLE IF NOT EXISTS audi log (\
3891
 
        audi id         bigin           DEFAULT '0'     NOT NULL,\
3892
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
3893
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3894
 
        ac ion          in eger         DEFAULT '0'     NOT NULL,\
3895
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
3896
 
        de ails         varchar(128)            DEFAULT '0'     NOT NULL,\
3897
 
        PRIMARY KEY (audi id)\
 
3904
CREATE TABLE IF NOT EXISTS auditlog (\
 
3905
 auditid bigint DEFAULT '0' NOT NULL,\
 
3906
 userid bigint DEFAULT '0' NOT NULL,\
 
3907
 clock integer DEFAULT '0' NOT NULL,\
 
3908
 action integer DEFAULT '0' NOT NULL,\
 
3909
 resourcetype integer DEFAULT '0' NOT NULL,\
 
3910
 details varchar(128) DEFAULT '0' NOT NULL,\
 
3911
 PRIMARY KEY (auditid)\
3898
3912
);\
3899
 
CREATE INDEX IF NOT EXISTS audi log_1 on audi log (userid,clock);\
3900
 
CREATE INDEX IF NOT EXISTS audi log_2 on audi log (clock);\
 
3913
CREATE INDEX IF NOT EXISTS auditlog_1 on auditlog (userid,clock);\
 
3914
CREATE INDEX IF NOT EXISTS auditlog_2 on auditlog (clock);\
3901
3915
CREATE TABLE IF NOT EXISTS service_alarms (\
3902
 
        servicealarmid          bigin           DEFAULT '0'     NOT NULL,\
3903
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
3904
 
        clock           in eger         DEFAULT '0'     NOT NULL,\
3905
 
        value           in eger         DEFAULT '0'     NOT NULL,\
3906
 
        PRIMARY KEY (servicealarmid)\
 
3916
 servicealarmid bigint DEFAULT '0' NOT NULL,\
 
3917
 serviceid bigint DEFAULT '0' NOT NULL,\
 
3918
 clock integer DEFAULT '0' NOT NULL,\
 
3919
 value integer DEFAULT '0' NOT NULL,\
 
3920
 PRIMARY KEY (servicealarmid)\
3907
3921
);\
3908
3922
CREATE INDEX IF NOT EXISTS service_alarms_1 on service_alarms (serviceid,clock);\
3909
3923
CREATE INDEX IF NOT EXISTS service_alarms_2 on service_alarms (clock);\
3910
 
CREATE TABLE IF NOT EXISTS ac ions (\
3911
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
3912
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
3913
 
        even source             in eger         DEFAULT '0'     NOT NULL,\
3914
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
3915
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3916
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
3917
 
        def_shor da a           varchar(255)            DEFAULT ''      NOT NULL,\
3918
 
        def_longda a            blob            DEFAULT ''      NOT NULL,\
3919
 
        recovery_msg            in eger         DEFAULT '0'     NOT NULL,\
3920
 
        r_shor da a             varchar(255)            DEFAULT ''      NOT NULL,\
3921
 
        r_longda a              blob            DEFAULT ''      NOT NULL,\
3922
 
        PRIMARY KEY (ac ionid)\
3923
 
);\
3924
 
CREATE TABLE IF NOT EXISTS opera ions (\
3925
 
        opera ionid             bigin           DEFAULT '0'     NOT NULL,\
3926
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
3927
 
        opera ion ype           in eger         DEFAULT '0'     NOT NULL,\
3928
 
        objec           in eger         DEFAULT '0'     NOT NULL,\
3929
 
        objec id                bigin           DEFAULT '0'     NOT NULL,\
3930
 
        shor da a               varchar(255)            DEFAULT ''      NOT NULL,\
3931
 
        longda a                blob            DEFAULT ''      NOT NULL,\
3932
 
        esc_period              in eger         DEFAULT '0'     NOT NULL,\
3933
 
        esc_s ep_from           in eger         DEFAULT '0'     NOT NULL,\
3934
 
        esc_s ep_ o             in eger         DEFAULT '0'     NOT NULL,\
3935
 
        defaul _msg             in eger         DEFAULT '0'     NOT NULL,\
3936
 
        eval ype                in eger         DEFAULT '0'     NOT NULL,\
3937
 
        PRIMARY KEY (opera ionid)\
3938
 
);\
3939
 
CREATE INDEX IF NOT EXISTS opera ions_1 on opera ions (ac ionid);\
3940
 
CREATE TABLE IF NOT EXISTS opcondi ions (\
3941
 
        opcondi ionid           bigin           DEFAULT '0'     NOT NULL,\
3942
 
        opera ionid             bigin           DEFAULT '0'     NOT NULL,\
3943
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
3944
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
3945
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
3946
 
        PRIMARY KEY (opcondi ionid)\
3947
 
);\
3948
 
CREATE INDEX IF NOT EXISTS opcondi ions_1 on opcondi ions (opera ionid);\
3949
 
CREATE TABLE IF NOT EXISTS escala ions (\
3950
 
        escala ionid            bigin           DEFAULT '0'     NOT NULL,\
3951
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
3952
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
3953
 
        even id         bigin           DEFAULT '0'     NOT NULL,\
3954
 
        r_even id               bigin           DEFAULT '0'     NOT NULL,\
3955
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
3956
 
        esc_s ep                in eger         DEFAULT '0'     NOT NULL,\
3957
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
3958
 
        PRIMARY KEY (escala ionid)\
3959
 
);\
3960
 
CREATE INDEX IF NOT EXISTS escala ions_1 on escala ions (ac ionid, riggerid);\
3961
 
CREATE TABLE IF NOT EXISTS applica ions (\
3962
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
3963
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
3964
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
3965
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
3966
 
        PRIMARY KEY (applica ionid)\
3967
 
);\
3968
 
CREATE INDEX IF NOT EXISTS applica ions_1 on applica ions ( empla eid);\
3969
 
CREATE UNIQUE INDEX IF NOT EXISTS applica ions_2 on applica ions (hos id,name);\
3970
 
CREATE TABLE IF NOT EXISTS condi ions (\
3971
 
        condi ionid             bigin           DEFAULT '0'     NOT NULL,\
3972
 
        ac ionid                bigin           DEFAULT '0'     NOT NULL,\
3973
 
        condi ion ype           in eger         DEFAULT '0'     NOT NULL,\
3974
 
        opera or                in eger         DEFAULT '0'     NOT NULL,\
3975
 
        value           varchar(255)            DEFAULT ''      NOT NULL,\
3976
 
        PRIMARY KEY (condi ionid)\
3977
 
);\
3978
 
CREATE INDEX IF NOT EXISTS condi ions_1 on condi ions (ac ionid);\
 
3924
CREATE TABLE IF NOT EXISTS actions (\
 
3925
 actionid bigint DEFAULT '0' NOT NULL,\
 
3926
 name varchar(255) DEFAULT '' NOT NULL,\
 
3927
 eventsource integer DEFAULT '0' NOT NULL,\
 
3928
 evaltype integer DEFAULT '0' NOT NULL,\
 
3929
 status integer DEFAULT '0' NOT NULL,\
 
3930
 esc_period integer DEFAULT '0' NOT NULL,\
 
3931
 def_shortdata varchar(255) DEFAULT '' NOT NULL,\
 
3932
 def_longdata blob DEFAULT '' NOT NULL,\
 
3933
 recovery_msg integer DEFAULT '0' NOT NULL,\
 
3934
 r_shortdata varchar(255) DEFAULT '' NOT NULL,\
 
3935
 r_longdata blob DEFAULT '' NOT NULL,\
 
3936
 PRIMARY KEY (actionid)\
 
3937
);\
 
3938
CREATE TABLE IF NOT EXISTS operations (\
 
3939
 operationid bigint DEFAULT '0' NOT NULL,\
 
3940
 actionid bigint DEFAULT '0' NOT NULL,\
 
3941
 operationtype integer DEFAULT '0' NOT NULL,\
 
3942
 object integer DEFAULT '0' NOT NULL,\
 
3943
 objectid bigint DEFAULT '0' NOT NULL,\
 
3944
 shortdata varchar(255) DEFAULT '' NOT NULL,\
 
3945
 longdata blob DEFAULT '' NOT NULL,\
 
3946
 esc_period integer DEFAULT '0' NOT NULL,\
 
3947
 esc_step_from integer DEFAULT '0' NOT NULL,\
 
3948
 esc_step_to integer DEFAULT '0' NOT NULL,\
 
3949
 default_msg integer DEFAULT '0' NOT NULL,\
 
3950
 evaltype integer DEFAULT '0' NOT NULL,\
 
3951
 PRIMARY KEY (operationid)\
 
3952
);\
 
3953
CREATE INDEX IF NOT EXISTS operations_1 on operations (actionid);\
 
3954
CREATE TABLE IF NOT EXISTS opconditions (\
 
3955
 opconditionid bigint DEFAULT '0' NOT NULL,\
 
3956
 operationid bigint DEFAULT '0' NOT NULL,\
 
3957
 conditiontype integer DEFAULT '0' NOT NULL,\
 
3958
 operator integer DEFAULT '0' NOT NULL,\
 
3959
 value varchar(255) DEFAULT '' NOT NULL,\
 
3960
 PRIMARY KEY (opconditionid)\
 
3961
);\
 
3962
CREATE INDEX IF NOT EXISTS opconditions_1 on opconditions (operationid);\
 
3963
CREATE TABLE IF NOT EXISTS escalations (\
 
3964
 escalationid bigint DEFAULT '0' NOT NULL,\
 
3965
 actionid bigint DEFAULT '0' NOT NULL,\
 
3966
 triggerid bigint DEFAULT '0' NOT NULL,\
 
3967
 eventid bigint DEFAULT '0' NOT NULL,\
 
3968
 r_eventid bigint DEFAULT '0' NOT NULL,\
 
3969
 nextcheck integer DEFAULT '0' NOT NULL,\
 
3970
 esc_step integer DEFAULT '0' NOT NULL,\
 
3971
 status integer DEFAULT '0' NOT NULL,\
 
3972
 PRIMARY KEY (escalationid)\
 
3973
);\
 
3974
CREATE INDEX IF NOT EXISTS escalations_1 on escalations (actionid,triggerid);\
 
3975
CREATE TABLE IF NOT EXISTS applications (\
 
3976
 applicationid bigint DEFAULT '0' NOT NULL,\
 
3977
 hostid bigint DEFAULT '0' NOT NULL,\
 
3978
 name varchar(255) DEFAULT '' NOT NULL,\
 
3979
 templateid bigint DEFAULT '0' NOT NULL,\
 
3980
 PRIMARY KEY (applicationid)\
 
3981
);\
 
3982
CREATE INDEX IF NOT EXISTS applications_1 on applications (templateid);\
 
3983
CREATE UNIQUE INDEX IF NOT EXISTS applications_2 on applications (hostid,name);\
 
3984
CREATE TABLE IF NOT EXISTS conditions (\
 
3985
 conditionid bigint DEFAULT '0' NOT NULL,\
 
3986
 actionid bigint DEFAULT '0' NOT NULL,\
 
3987
 conditiontype integer DEFAULT '0' NOT NULL,\
 
3988
 operator integer DEFAULT '0' NOT NULL,\
 
3989
 value varchar(255) DEFAULT '' NOT NULL,\
 
3990
 PRIMARY KEY (conditionid)\
 
3991
);\
 
3992
CREATE INDEX IF NOT EXISTS conditions_1 on conditions (actionid);\
3979
3993
CREATE TABLE IF NOT EXISTS config (\
3980
 
        configid                bigin           DEFAULT '0'     NOT NULL,\
3981
 
        aler _his ory           in eger         DEFAULT '0'     NOT NULL,\
3982
 
        even _his ory           in eger         DEFAULT '0'     NOT NULL,\
3983
 
        refresh_unsuppor ed             in eger         DEFAULT '0'     NOT NULL,\
3984
 
        work_period             varchar(100)            DEFAULT '1-5,00:00-24:00'       NOT NULL,\
3985
 
        aler _usrgrpid          bigin           DEFAULT '0'     NOT NULL,\
3986
 
        even _ack_enable                in eger         DEFAULT '1'     NOT NULL,\
3987
 
        even _expire            in eger         DEFAULT '7'     NOT NULL,\
3988
 
        even _show_max          in eger         DEFAULT '100'   NOT NULL,\
3989
 
        defaul _ heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
3990
 
        au hen ica ion_ ype             in eger         DEFAULT 0       NOT NULL,\
3991
 
        ldap_hos                varchar(255)            DEFAULT ''      NOT NULL,\
3992
 
        ldap_por                in eger         DEFAULT 389     NOT NULL,\
3993
 
        ldap_base_dn            varchar(255)            DEFAULT ''      NOT NULL,\
3994
 
        ldap_bind_dn            varchar(255)            DEFAULT ''      NOT NULL,\
3995
 
        ldap_bind_password              varchar(128)            DEFAULT ''      NOT NULL,\
3996
 
        ldap_search_a ribu e            varchar(128)            DEFAULT ''      NOT NULL,\
3997
 
        PRIMARY KEY (configid)\
3998
 
);\
3999
 
CREATE TABLE IF NOT EXISTS func ions (\
4000
 
        func ionid              bigin           DEFAULT '0'     NOT NULL,\
4001
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
4002
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
4003
 
        las value               varchar(255)                    ,\
4004
 
        func ion                varchar(12)             DEFAULT ''      NOT NULL,\
4005
 
        parame er               varchar(255)            DEFAULT '0'     NOT NULL,\
4006
 
        PRIMARY KEY (func ionid)\
4007
 
);\
4008
 
CREATE INDEX IF NOT EXISTS func ions_1 on func ions ( riggerid);\
4009
 
CREATE INDEX IF NOT EXISTS func ions_2 on func ions (i emid,func ion,parame er);\
 
3994
 configid bigint DEFAULT '0' NOT NULL,\
 
3995
 alert_history integer DEFAULT '0' NOT NULL,\
 
3996
 event_history integer DEFAULT '0' NOT NULL,\
 
3997
 refresh_unsupported integer DEFAULT '0' NOT NULL,\
 
3998
 work_period varchar(100) DEFAULT '1-5,00:00-24:00' NOT NULL,\
 
3999
 alert_usrgrpid bigint DEFAULT '0' NOT NULL,\
 
4000
 event_ack_enable integer DEFAULT '1' NOT NULL,\
 
4001
 event_expire integer DEFAULT '7' NOT NULL,\
 
4002
 event_show_max integer DEFAULT '100' NOT NULL,\
 
4003
 default_theme varchar(128) DEFAULT 'default.css' NOT NULL,\
 
4004
 authentication_type integer DEFAULT 0 NOT NULL,\
 
4005
 ldap_host varchar(255) DEFAULT '' NOT NULL,\
 
4006
 ldap_port integer DEFAULT 389 NOT NULL,\
 
4007
 ldap_base_dn varchar(255) DEFAULT '' NOT NULL,\
 
4008
 ldap_bind_dn varchar(255) DEFAULT '' NOT NULL,\
 
4009
 ldap_bind_password varchar(128) DEFAULT '' NOT NULL,\
 
4010
 ldap_search_attribute varchar(128) DEFAULT '' NOT NULL,\
 
4011
 PRIMARY KEY (configid)\
 
4012
);\
 
4013
CREATE TABLE IF NOT EXISTS functions (\
 
4014
 functionid bigint DEFAULT '0' NOT NULL,\
 
4015
 itemid bigint DEFAULT '0' NOT NULL,\
 
4016
 triggerid bigint DEFAULT '0' NOT NULL,\
 
4017
 lastvalue varchar(255) ,\
 
4018
 function varchar(12) DEFAULT '' NOT NULL,\
 
4019
 parameter varchar(255) DEFAULT '0' NOT NULL,\
 
4020
 PRIMARY KEY (functionid)\
 
4021
);\
 
4022
CREATE INDEX IF NOT EXISTS functions_1 on functions (triggerid);\
 
4023
CREATE INDEX IF NOT EXISTS functions_2 on functions (itemid,function,parameter);\
4010
4024
CREATE TABLE IF NOT EXISTS graphs (\
4011
 
        graphid         bigin           DEFAULT '0'     NOT NULL,\
4012
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
4013
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
4014
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
4015
 
        yaxis ype               in eger         DEFAULT '0'     NOT NULL,\
4016
 
        yaxismin                double(16,4)            DEFAULT '0'     NOT NULL,\
4017
 
        yaxismax                double(16,4)            DEFAULT '0'     NOT NULL,\
4018
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
4019
 
        show_work_period                in eger         DEFAULT '1'     NOT NULL,\
4020
 
        show_ riggers           in eger         DEFAULT '1'     NOT NULL,\
4021
 
        graph ype               in eger         DEFAULT '0'     NOT NULL,\
4022
 
        show_legend             in eger         DEFAULT '0'     NOT NULL,\
4023
 
        show_3d         in eger         DEFAULT '0'     NOT NULL,\
4024
 
        percen _lef             double(16,4)            DEFAULT '0'     NOT NULL,\
4025
 
        percen _righ            double(16,4)            DEFAULT '0'     NOT NULL,\
4026
 
        PRIMARY KEY (graphid)\
 
4025
 graphid bigint DEFAULT '0' NOT NULL,\
 
4026
 name varchar(128) DEFAULT '' NOT NULL,\
 
4027
 width integer DEFAULT '0' NOT NULL,\
 
4028
 height integer DEFAULT '0' NOT NULL,\
 
4029
 yaxistype integer DEFAULT '0' NOT NULL,\
 
4030
 yaxismin double(16,4) DEFAULT '0' NOT NULL,\
 
4031
 yaxismax double(16,4) DEFAULT '0' NOT NULL,\
 
4032
 templateid bigint DEFAULT '0' NOT NULL,\
 
4033
 show_work_period integer DEFAULT '1' NOT NULL,\
 
4034
 show_triggers integer DEFAULT '1' NOT NULL,\
 
4035
 graphtype integer DEFAULT '0' NOT NULL,\
 
4036
 show_legend integer DEFAULT '0' NOT NULL,\
 
4037
 show_3d integer DEFAULT '0' NOT NULL,\
 
4038
 percent_left double(16,4) DEFAULT '0' NOT NULL,\
 
4039
 percent_right double(16,4) DEFAULT '0' NOT NULL,\
 
4040
 PRIMARY KEY (graphid)\
4027
4041
);\
4028
4042
CREATE INDEX IF NOT EXISTS graphs_graphs_1 on graphs (name);\
4029
 
CREATE TABLE IF NOT EXISTS graphs_i ems (\
4030
 
        gi emid         bigin           DEFAULT '0'     NOT NULL,\
4031
 
        graphid         bigin           DEFAULT '0'     NOT NULL,\
4032
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
4033
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
4034
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
4035
 
        color           varchar(32)             DEFAULT '009600'        NOT NULL,\
4036
 
        yaxisside               in eger         DEFAULT '1'     NOT NULL,\
4037
 
        calc_fnc                in eger         DEFAULT '2'     NOT NULL,\
4038
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4039
 
        periods_cn              in eger         DEFAULT '5'     NOT NULL,\
4040
 
        PRIMARY KEY (gi emid)\
 
4043
CREATE TABLE IF NOT EXISTS graphs_items (\
 
4044
 gitemid bigint DEFAULT '0' NOT NULL,\
 
4045
 graphid bigint DEFAULT '0' NOT NULL,\
 
4046
 itemid bigint DEFAULT '0' NOT NULL,\
 
4047
 drawtype integer DEFAULT '0' NOT NULL,\
 
4048
 sortorder integer DEFAULT '0' NOT NULL,\
 
4049
 color varchar(32) DEFAULT '009600' NOT NULL,\
 
4050
 yaxisside integer DEFAULT '1' NOT NULL,\
 
4051
 calc_fnc integer DEFAULT '2' NOT NULL,\
 
4052
 type integer DEFAULT '0' NOT NULL,\
 
4053
 periods_cnt integer DEFAULT '5' NOT NULL,\
 
4054
 PRIMARY KEY (gitemid)\
4041
4055
);\
 
4056
CREATE INDEX IF NOT EXISTS graphs_items_1 on graphs_items (itemid);\
 
4057
CREATE INDEX IF NOT EXISTS graphs_items_2 on graphs_items (graphid);\
4042
4058
CREATE TABLE IF NOT EXISTS groups (\
4043
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
4044
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
4045
 
        PRIMARY KEY (groupid)\
 
4059
 groupid bigint DEFAULT '0' NOT NULL,\
 
4060
 name varchar(64) DEFAULT '' NOT NULL,\
 
4061
 PRIMARY KEY (groupid)\
4046
4062
);\
4047
4063
CREATE INDEX IF NOT EXISTS groups_1 on groups (name);\
4048
 
CREATE TABLE IF NOT EXISTS help_i ems (\
4049
 
        i em ype                in eger         DEFAULT '0'     NOT NULL,\
4050
 
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
4051
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
4052
 
        PRIMARY KEY (i em ype,key_)\
4053
 
);\
4054
 
CREATE TABLE IF NOT EXISTS hos s (\
4055
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4056
 
        proxy_hos id            bigin           DEFAULT '0'     NOT NULL,\
4057
 
        hos             varchar(64)             DEFAULT ''      NOT NULL,\
4058
 
        dns             varchar(64)             DEFAULT ''      NOT NULL,\
4059
 
        useip           in eger         DEFAULT '1'     NOT NULL,\
4060
 
        ip              varchar(39)             DEFAULT '127.0.0.1'     NOT NULL,\
4061
 
        por             in eger         DEFAULT '10050' NOT NULL,\
4062
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
4063
 
        disable_un il           in eger         DEFAULT '0'     NOT NULL,\
4064
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
4065
 
        available               in eger         DEFAULT '0'     NOT NULL,\
4066
 
        errors_from             in eger         DEFAULT '0'     NOT NULL,\
4067
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
4068
 
        inby es         bigin           DEFAULT '0'     NOT NULL,\
4069
 
        ou by es                bigin           DEFAULT '0'     NOT NULL,\
4070
 
        useipmi         in eger         DEFAULT '0'     NOT NULL,\
4071
 
        ipmi_por                in eger         DEFAULT '623'   NOT NULL,\
4072
 
        ipmi_au h ype           in eger         DEFAULT '0'     NOT NULL,\
4073
 
        ipmi_privilege          in eger         DEFAULT '2'     NOT NULL,\
4074
 
        ipmi_username           varchar(16)             DEFAULT ''      NOT NULL,\
4075
 
        ipmi_password           varchar(20)             DEFAULT ''      NOT NULL,\
4076
 
        ipmi_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
4077
 
        ipmi_available          in eger         DEFAULT '0'     NOT NULL,\
4078
 
        snmp_disable_un il              in eger         DEFAULT '0'     NOT NULL,\
4079
 
        snmp_available          in eger         DEFAULT '0'     NOT NULL,\
4080
 
        PRIMARY KEY (hos id)\
4081
 
);\
4082
 
CREATE INDEX IF NOT EXISTS hos s_1 on hos s (hos );\
4083
 
CREATE INDEX IF NOT EXISTS hos s_2 on hos s (s a us);\
4084
 
CREATE INDEX IF NOT EXISTS hos s_3 on hos s (proxy_hos id);\
4085
 
CREATE TABLE IF NOT EXISTS hos s_groups (\
4086
 
        hos groupid             bigin           DEFAULT '0'     NOT NULL,\
4087
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4088
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
4089
 
        PRIMARY KEY (hos groupid)\
4090
 
);\
4091
 
CREATE INDEX IF NOT EXISTS hos s_groups_groups_1 on hos s_groups (hos id,groupid);\
4092
 
CREATE TABLE IF NOT EXISTS hos s_profiles (\
4093
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4094
 
        device ype              varchar(64)             DEFAULT ''      NOT NULL,\
4095
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
4096
 
        os              varchar(64)             DEFAULT ''      NOT NULL,\
4097
 
        serialno                varchar(64)             DEFAULT ''      NOT NULL,\
4098
 
         ag             varchar(64)             DEFAULT ''      NOT NULL,\
4099
 
        macaddress              varchar(64)             DEFAULT ''      NOT NULL,\
4100
 
        hardware                blob            DEFAULT ''      NOT NULL,\
4101
 
        sof ware                blob            DEFAULT ''      NOT NULL,\
4102
 
        con ac          blob            DEFAULT ''      NOT NULL,\
4103
 
        loca ion                blob            DEFAULT ''      NOT NULL,\
4104
 
        no es           blob            DEFAULT ''      NOT NULL,\
4105
 
        PRIMARY KEY (hos id)\
4106
 
);\
4107
 
CREATE TABLE IF NOT EXISTS hos s_profiles_ex  (\
4108
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4109
 
        device_alias            varchar(64)             DEFAULT ''      NOT NULL,\
4110
 
        device_ ype             varchar(64)             DEFAULT ''      NOT NULL,\
4111
 
        device_chassis          varchar(64)             DEFAULT ''      NOT NULL,\
4112
 
        device_os               varchar(64)             DEFAULT ''      NOT NULL,\
4113
 
        device_os_shor          varchar(64)             DEFAULT ''      NOT NULL,\
4114
 
        device_hw_arch          varchar(32)             DEFAULT ''      NOT NULL,\
4115
 
        device_serial           varchar(64)             DEFAULT ''      NOT NULL,\
4116
 
        device_model            varchar(64)             DEFAULT ''      NOT NULL,\
4117
 
        device_ ag              varchar(64)             DEFAULT ''      NOT NULL,\
4118
 
        device_vendor           varchar(64)             DEFAULT ''      NOT NULL,\
4119
 
        device_con rac          varchar(64)             DEFAULT ''      NOT NULL,\
4120
 
        device_who              varchar(64)             DEFAULT ''      NOT NULL,\
4121
 
        device_s a us           varchar(64)             DEFAULT ''      NOT NULL,\
4122
 
        device_app_01           varchar(64)             DEFAULT ''      NOT NULL,\
4123
 
        device_app_02           varchar(64)             DEFAULT ''      NOT NULL,\
4124
 
        device_app_03           varchar(64)             DEFAULT ''      NOT NULL,\
4125
 
        device_app_04           varchar(64)             DEFAULT ''      NOT NULL,\
4126
 
        device_app_05           varchar(64)             DEFAULT ''      NOT NULL,\
4127
 
        device_url_1            varchar(255)            DEFAULT ''      NOT NULL,\
4128
 
        device_url_2            varchar(255)            DEFAULT ''      NOT NULL,\
4129
 
        device_url_3            varchar(255)            DEFAULT ''      NOT NULL,\
4130
 
        device_ne works         blob            DEFAULT ''      NOT NULL,\
4131
 
        device_no es            blob            DEFAULT ''      NOT NULL,\
4132
 
        device_hardware         blob            DEFAULT ''      NOT NULL,\
4133
 
        device_sof ware         blob            DEFAULT ''      NOT NULL,\
4134
 
        ip_subne _mask          varchar(39)             DEFAULT ''      NOT NULL,\
4135
 
        ip_rou er               varchar(39)             DEFAULT ''      NOT NULL,\
4136
 
        ip_macaddress           varchar(64)             DEFAULT ''      NOT NULL,\
4137
 
        oob_ip          varchar(39)             DEFAULT ''      NOT NULL,\
4138
 
        oob_subne _mask         varchar(39)             DEFAULT ''      NOT NULL,\
4139
 
        oob_rou er              varchar(39)             DEFAULT ''      NOT NULL,\
4140
 
        da e_hw_buy             varchar(64)             DEFAULT ''      NOT NULL,\
4141
 
        da e_hw_ins all         varchar(64)             DEFAULT ''      NOT NULL,\
4142
 
        da e_hw_expiry          varchar(64)             DEFAULT ''      NOT NULL,\
4143
 
        da e_hw_decomm          varchar(64)             DEFAULT ''      NOT NULL,\
4144
 
        si e_s ree _1           varchar(128)            DEFAULT ''      NOT NULL,\
4145
 
        si e_s ree _2           varchar(128)            DEFAULT ''      NOT NULL,\
4146
 
        si e_s ree _3           varchar(128)            DEFAULT ''      NOT NULL,\
4147
 
        si e_ci y               varchar(128)            DEFAULT ''      NOT NULL,\
4148
 
        si e_s a e              varchar(64)             DEFAULT ''      NOT NULL,\
4149
 
        si e_coun ry            varchar(64)             DEFAULT ''      NOT NULL,\
4150
 
        si e_zip                varchar(64)             DEFAULT ''      NOT NULL,\
4151
 
        si e_rack               varchar(128)            DEFAULT ''      NOT NULL,\
4152
 
        si e_no es              blob            DEFAULT ''      NOT NULL,\
4153
 
        poc_1_name              varchar(128)            DEFAULT ''      NOT NULL,\
4154
 
        poc_1_email             varchar(128)            DEFAULT ''      NOT NULL,\
4155
 
        poc_1_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
4156
 
        poc_1_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
4157
 
        poc_1_cell              varchar(64)             DEFAULT ''      NOT NULL,\
4158
 
        poc_1_screen            varchar(64)             DEFAULT ''      NOT NULL,\
4159
 
        poc_1_no es             blob            DEFAULT ''      NOT NULL,\
4160
 
        poc_2_name              varchar(128)            DEFAULT ''      NOT NULL,\
4161
 
        poc_2_email             varchar(128)            DEFAULT ''      NOT NULL,\
4162
 
        poc_2_phone_1           varchar(64)             DEFAULT ''      NOT NULL,\
4163
 
        poc_2_phone_2           varchar(64)             DEFAULT ''      NOT NULL,\
4164
 
        poc_2_cell              varchar(64)             DEFAULT ''      NOT NULL,\
4165
 
        poc_2_screen            varchar(64)             DEFAULT ''      NOT NULL,\
4166
 
        poc_2_no es             blob            DEFAULT ''      NOT NULL,\
4167
 
        PRIMARY KEY (hos id)\
4168
 
);\
4169
 
CREATE TABLE IF NOT EXISTS hos s_ empla es (\
4170
 
        hos empla eid           bigin           DEFAULT '0'     NOT NULL,\
4171
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4172
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
4173
 
        PRIMARY KEY (hos empla eid)\
4174
 
);\
4175
 
CREATE UNIQUE INDEX IF NOT EXISTS hos s_ empla es_1 on hos s_ empla es (hos id, empla eid);\
 
4064
CREATE TABLE IF NOT EXISTS help_items (\
 
4065
 itemtype integer DEFAULT '0' NOT NULL,\
 
4066
 key_ varchar(255) DEFAULT '' NOT NULL,\
 
4067
 description varchar(255) DEFAULT '' NOT NULL,\
 
4068
 PRIMARY KEY (itemtype,key_)\
 
4069
);\
 
4070
CREATE TABLE IF NOT EXISTS hosts (\
 
4071
 hostid bigint DEFAULT '0' NOT NULL,\
 
4072
 proxy_hostid bigint DEFAULT '0' NOT NULL,\
 
4073
 host varchar(64) DEFAULT '' NOT NULL,\
 
4074
 dns varchar(64) DEFAULT '' NOT NULL,\
 
4075
 useip integer DEFAULT '1' NOT NULL,\
 
4076
 ip varchar(39) DEFAULT '127.0.0.1' NOT NULL,\
 
4077
 port integer DEFAULT '10050' NOT NULL,\
 
4078
 status integer DEFAULT '0' NOT NULL,\
 
4079
 disable_until integer DEFAULT '0' NOT NULL,\
 
4080
 error varchar(128) DEFAULT '' NOT NULL,\
 
4081
 available integer DEFAULT '0' NOT NULL,\
 
4082
 errors_from integer DEFAULT '0' NOT NULL,\
 
4083
 lastaccess integer DEFAULT '0' NOT NULL,\
 
4084
 inbytes bigint DEFAULT '0' NOT NULL,\
 
4085
 outbytes bigint DEFAULT '0' NOT NULL,\
 
4086
 useipmi integer DEFAULT '0' NOT NULL,\
 
4087
 ipmi_port integer DEFAULT '623' NOT NULL,\
 
4088
 ipmi_authtype integer DEFAULT '0' NOT NULL,\
 
4089
 ipmi_privilege integer DEFAULT '2' NOT NULL,\
 
4090
 ipmi_username varchar(16) DEFAULT '' NOT NULL,\
 
4091
 ipmi_password varchar(20) DEFAULT '' NOT NULL,\
 
4092
 ipmi_disable_until integer DEFAULT '0' NOT NULL,\
 
4093
 ipmi_available integer DEFAULT '0' NOT NULL,\
 
4094
 snmp_disable_until integer DEFAULT '0' NOT NULL,\
 
4095
 snmp_available integer DEFAULT '0' NOT NULL,\
 
4096
 PRIMARY KEY (hostid)\
 
4097
);\
 
4098
CREATE INDEX IF NOT EXISTS hosts_1 on hosts (host);\
 
4099
CREATE INDEX IF NOT EXISTS hosts_2 on hosts (status);\
 
4100
CREATE INDEX IF NOT EXISTS hosts_3 on hosts (proxy_hostid);\
 
4101
CREATE TABLE IF NOT EXISTS hosts_groups (\
 
4102
 hostgroupid bigint DEFAULT '0' NOT NULL,\
 
4103
 hostid bigint DEFAULT '0' NOT NULL,\
 
4104
 groupid bigint DEFAULT '0' NOT NULL,\
 
4105
 PRIMARY KEY (hostgroupid)\
 
4106
);\
 
4107
CREATE INDEX IF NOT EXISTS hosts_groups_groups_1 on hosts_groups (hostid,groupid);\
 
4108
CREATE TABLE IF NOT EXISTS hosts_profiles (\
 
4109
 hostid bigint DEFAULT '0' NOT NULL,\
 
4110
 devicetype varchar(64) DEFAULT '' NOT NULL,\
 
4111
 name varchar(64) DEFAULT '' NOT NULL,\
 
4112
 os varchar(64) DEFAULT '' NOT NULL,\
 
4113
 serialno varchar(64) DEFAULT '' NOT NULL,\
 
4114
 tag varchar(64) DEFAULT '' NOT NULL,\
 
4115
 macaddress varchar(64) DEFAULT '' NOT NULL,\
 
4116
 hardware blob DEFAULT '' NOT NULL,\
 
4117
 software blob DEFAULT '' NOT NULL,\
 
4118
 contact blob DEFAULT '' NOT NULL,\
 
4119
 location blob DEFAULT '' NOT NULL,\
 
4120
 notes blob DEFAULT '' NOT NULL,\
 
4121
 PRIMARY KEY (hostid)\
 
4122
);\
 
4123
CREATE TABLE IF NOT EXISTS hosts_profiles_ext (\
 
4124
 hostid bigint DEFAULT '0' NOT NULL,\
 
4125
 device_alias varchar(64) DEFAULT '' NOT NULL,\
 
4126
 device_type varchar(64) DEFAULT '' NOT NULL,\
 
4127
 device_chassis varchar(64) DEFAULT '' NOT NULL,\
 
4128
 device_os varchar(64) DEFAULT '' NOT NULL,\
 
4129
 device_os_short varchar(64) DEFAULT '' NOT NULL,\
 
4130
 device_hw_arch varchar(32) DEFAULT '' NOT NULL,\
 
4131
 device_serial varchar(64) DEFAULT '' NOT NULL,\
 
4132
 device_model varchar(64) DEFAULT '' NOT NULL,\
 
4133
 device_tag varchar(64) DEFAULT '' NOT NULL,\
 
4134
 device_vendor varchar(64) DEFAULT '' NOT NULL,\
 
4135
 device_contract varchar(64) DEFAULT '' NOT NULL,\
 
4136
 device_who varchar(64) DEFAULT '' NOT NULL,\
 
4137
 device_status varchar(64) DEFAULT '' NOT NULL,\
 
4138
 device_app_01 varchar(64) DEFAULT '' NOT NULL,\
 
4139
 device_app_02 varchar(64) DEFAULT '' NOT NULL,\
 
4140
 device_app_03 varchar(64) DEFAULT '' NOT NULL,\
 
4141
 device_app_04 varchar(64) DEFAULT '' NOT NULL,\
 
4142
 device_app_05 varchar(64) DEFAULT '' NOT NULL,\
 
4143
 device_url_1 varchar(255) DEFAULT '' NOT NULL,\
 
4144
 device_url_2 varchar(255) DEFAULT '' NOT NULL,\
 
4145
 device_url_3 varchar(255) DEFAULT '' NOT NULL,\
 
4146
 device_networks blob DEFAULT '' NOT NULL,\
 
4147
 device_notes blob DEFAULT '' NOT NULL,\
 
4148
 device_hardware blob DEFAULT '' NOT NULL,\
 
4149
 device_software blob DEFAULT '' NOT NULL,\
 
4150
 ip_subnet_mask varchar(39) DEFAULT '' NOT NULL,\
 
4151
 ip_router varchar(39) DEFAULT '' NOT NULL,\
 
4152
 ip_macaddress varchar(64) DEFAULT '' NOT NULL,\
 
4153
 oob_ip varchar(39) DEFAULT '' NOT NULL,\
 
4154
 oob_subnet_mask varchar(39) DEFAULT '' NOT NULL,\
 
4155
 oob_router varchar(39) DEFAULT '' NOT NULL,\
 
4156
 date_hw_buy varchar(64) DEFAULT '' NOT NULL,\
 
4157
 date_hw_install varchar(64) DEFAULT '' NOT NULL,\
 
4158
 date_hw_expiry varchar(64) DEFAULT '' NOT NULL,\
 
4159
 date_hw_decomm varchar(64) DEFAULT '' NOT NULL,\
 
4160
 site_street_1 varchar(128) DEFAULT '' NOT NULL,\
 
4161
 site_street_2 varchar(128) DEFAULT '' NOT NULL,\
 
4162
 site_street_3 varchar(128) DEFAULT '' NOT NULL,\
 
4163
 site_city varchar(128) DEFAULT '' NOT NULL,\
 
4164
 site_state varchar(64) DEFAULT '' NOT NULL,\
 
4165
 site_country varchar(64) DEFAULT '' NOT NULL,\
 
4166
 site_zip varchar(64) DEFAULT '' NOT NULL,\
 
4167
 site_rack varchar(128) DEFAULT '' NOT NULL,\
 
4168
 site_notes blob DEFAULT '' NOT NULL,\
 
4169
 poc_1_name varchar(128) DEFAULT '' NOT NULL,\
 
4170
 poc_1_email varchar(128) DEFAULT '' NOT NULL,\
 
4171
 poc_1_phone_1 varchar(64) DEFAULT '' NOT NULL,\
 
4172
 poc_1_phone_2 varchar(64) DEFAULT '' NOT NULL,\
 
4173
 poc_1_cell varchar(64) DEFAULT '' NOT NULL,\
 
4174
 poc_1_screen varchar(64) DEFAULT '' NOT NULL,\
 
4175
 poc_1_notes blob DEFAULT '' NOT NULL,\
 
4176
 poc_2_name varchar(128) DEFAULT '' NOT NULL,\
 
4177
 poc_2_email varchar(128) DEFAULT '' NOT NULL,\
 
4178
 poc_2_phone_1 varchar(64) DEFAULT '' NOT NULL,\
 
4179
 poc_2_phone_2 varchar(64) DEFAULT '' NOT NULL,\
 
4180
 poc_2_cell varchar(64) DEFAULT '' NOT NULL,\
 
4181
 poc_2_screen varchar(64) DEFAULT '' NOT NULL,\
 
4182
 poc_2_notes blob DEFAULT '' NOT NULL,\
 
4183
 PRIMARY KEY (hostid)\
 
4184
);\
 
4185
CREATE TABLE IF NOT EXISTS hosts_templates (\
 
4186
 hosttemplateid bigint DEFAULT '0' NOT NULL,\
 
4187
 hostid bigint DEFAULT '0' NOT NULL,\
 
4188
 templateid bigint DEFAULT '0' NOT NULL,\
 
4189
 PRIMARY KEY (hosttemplateid)\
 
4190
);\
 
4191
CREATE UNIQUE INDEX IF NOT EXISTS hosts_templates_1 on hosts_templates (hostid,templateid);\
4176
4192
CREATE TABLE IF NOT EXISTS housekeeper (\
4177
 
        housekeeperid           bigin           DEFAULT '0'     NOT NULL,\
4178
 
         ablename               varchar(64)             DEFAULT ''      NOT NULL,\
4179
 
        field           varchar(64)             DEFAULT ''      NOT NULL,\
4180
 
        value           bigin           DEFAULT '0'     NOT NULL,\
4181
 
        PRIMARY KEY (housekeeperid)\
 
4193
 housekeeperid bigint DEFAULT '0' NOT NULL,\
 
4194
 tablename varchar(64) DEFAULT '' NOT NULL,\
 
4195
 field varchar(64) DEFAULT '' NOT NULL,\
 
4196
 value bigint DEFAULT '0' NOT NULL,\
 
4197
 PRIMARY KEY (housekeeperid)\
4182
4198
);\
4183
4199
CREATE TABLE IF NOT EXISTS images (\
4184
 
        imageid         bigin           DEFAULT '0'     NOT NULL,\
4185
 
        image ype               in eger         DEFAULT '0'     NOT NULL,\
4186
 
        name            varchar(64)             DEFAULT '0'     NOT NULL,\
4187
 
        image           longblob                DEFAULT ''      NOT NULL,\
4188
 
        PRIMARY KEY (imageid)\
4189
 
);\
4190
 
CREATE INDEX IF NOT EXISTS images_1 on images (image ype,name);\
4191
 
CREATE TABLE IF NOT EXISTS i ems (\
4192
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
4193
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4194
 
        snmp_communi y          varchar(64)             DEFAULT ''      NOT NULL,\
4195
 
        snmp_oid                varchar(255)            DEFAULT ''      NOT NULL,\
4196
 
        snmp_por                in eger         DEFAULT '161'   NOT NULL,\
4197
 
        hos id          bigin           DEFAULT '0'     NOT NULL,\
4198
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
4199
 
        key_            varchar(255)            DEFAULT ''      NOT NULL,\
4200
 
        delay           in eger         DEFAULT '0'     NOT NULL,\
4201
 
        his ory         in eger         DEFAULT '90'    NOT NULL,\
4202
 
         rends          in eger         DEFAULT '365'   NOT NULL,\
4203
 
        nex check               in eger         DEFAULT '0'     NOT NULL,\
4204
 
        las value               varchar(255)                    NULL,\
4205
 
        las clock               in eger                 NULL,\
4206
 
        prevvalue               varchar(255)                    NULL,\
4207
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
4208
 
        value_ ype              in eger         DEFAULT '0'     NOT NULL,\
4209
 
         rapper_hos s           varchar(255)            DEFAULT ''      NOT NULL,\
4210
 
        uni s           varchar(10)             DEFAULT ''      NOT NULL,\
4211
 
        mul iplier              in eger         DEFAULT '0'     NOT NULL,\
4212
 
        del a           in eger         DEFAULT '0'     NOT NULL,\
4213
 
        prevorgvalue            varchar(255)                    NULL,\
4214
 
        snmpv3_securi yname             varchar(64)             DEFAULT ''      NOT NULL,\
4215
 
        snmpv3_securi ylevel            in eger         DEFAULT '0'     NOT NULL,\
4216
 
        snmpv3_au hpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
4217
 
        snmpv3_privpassphrase           varchar(64)             DEFAULT ''      NOT NULL,\
4218
 
        formula         varchar(255)            DEFAULT '1'     NOT NULL,\
4219
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
4220
 
        las logsize             in eger         DEFAULT '0'     NOT NULL,\
4221
 
        log imefm               varchar(64)             DEFAULT ''      NOT NULL,\
4222
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
4223
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
4224
 
        delay_flex              varchar(255)            DEFAULT ''      NOT NULL,\
4225
 
        params           ex             DEFAULT ''      NOT NULL,\
4226
 
        ipmi_sensor             varchar(128)            DEFAULT ''      NOT NULL,\
4227
 
        PRIMARY KEY (i emid)\
4228
 
);\
4229
 
CREATE UNIQUE INDEX IF NOT EXISTS i ems_1 on i ems (hos id,key_);\
4230
 
CREATE INDEX IF NOT EXISTS i ems_2 on i ems (nex check);\
4231
 
CREATE INDEX IF NOT EXISTS i ems_3 on i ems (s a us);\
4232
 
CREATE INDEX IF NOT EXISTS i ems_4 on i ems ( empla eid);\
4233
 
CREATE TABLE IF NOT EXISTS i ems_applica ions (\
4234
 
        i emappid               bigin           DEFAULT '0'     NOT NULL,\
4235
 
        applica ionid           bigin           DEFAULT '0'     NOT NULL,\
4236
 
        i emid          bigin           DEFAULT '0'     NOT NULL,\
4237
 
        PRIMARY KEY (i emappid)\
4238
 
);\
4239
 
CREATE INDEX IF NOT EXISTS i ems_applica ions_1 on i ems_applica ions (applica ionid,i emid);\
4240
 
CREATE INDEX IF NOT EXISTS i ems_applica ions_2 on i ems_applica ions (i emid);\
 
4200
 imageid bigint DEFAULT '0' NOT NULL,\
 
4201
 imagetype integer DEFAULT '0' NOT NULL,\
 
4202
 name varchar(64) DEFAULT '0' NOT NULL,\
 
4203
 image longblob DEFAULT '' NOT NULL,\
 
4204
 PRIMARY KEY (imageid)\
 
4205
);\
 
4206
CREATE INDEX IF NOT EXISTS images_1 on images (imagetype,name);\
 
4207
CREATE TABLE IF NOT EXISTS items (\
 
4208
 itemid bigint DEFAULT '0' NOT NULL,\
 
4209
 type integer DEFAULT '0' NOT NULL,\
 
4210
 snmp_community varchar(64) DEFAULT '' NOT NULL,\
 
4211
 snmp_oid varchar(255) DEFAULT '' NOT NULL,\
 
4212
 snmp_port integer DEFAULT '161' NOT NULL,\
 
4213
 hostid bigint DEFAULT '0' NOT NULL,\
 
4214
 description varchar(255) DEFAULT '' NOT NULL,\
 
4215
 key_ varchar(255) DEFAULT '' NOT NULL,\
 
4216
 delay integer DEFAULT '0' NOT NULL,\
 
4217
 history integer DEFAULT '90' NOT NULL,\
 
4218
 trends integer DEFAULT '365' NOT NULL,\
 
4219
 nextcheck integer DEFAULT '0' NOT NULL,\
 
4220
 lastvalue varchar(255) NULL,\
 
4221
 lastclock integer NULL,\
 
4222
 prevvalue varchar(255) NULL,\
 
4223
 status integer DEFAULT '0' NOT NULL,\
 
4224
 value_type integer DEFAULT '0' NOT NULL,\
 
4225
 trapper_hosts varchar(255) DEFAULT '' NOT NULL,\
 
4226
 units varchar(10) DEFAULT '' NOT NULL,\
 
4227
 multiplier integer DEFAULT '0' NOT NULL,\
 
4228
 delta integer DEFAULT '0' NOT NULL,\
 
4229
 prevorgvalue varchar(255) NULL,\
 
4230
 snmpv3_securityname varchar(64) DEFAULT '' NOT NULL,\
 
4231
 snmpv3_securitylevel integer DEFAULT '0' NOT NULL,\
 
4232
 snmpv3_authpassphrase varchar(64) DEFAULT '' NOT NULL,\
 
4233
 snmpv3_privpassphrase varchar(64) DEFAULT '' NOT NULL,\
 
4234
 formula varchar(255) DEFAULT '1' NOT NULL,\
 
4235
 error varchar(128) DEFAULT '' NOT NULL,\
 
4236
 lastlogsize integer DEFAULT '0' NOT NULL,\
 
4237
 logtimefmt varchar(64) DEFAULT '' NOT NULL,\
 
4238
 templateid bigint DEFAULT '0' NOT NULL,\
 
4239
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
4240
 delay_flex varchar(255) DEFAULT '' NOT NULL,\
 
4241
 params text DEFAULT '' NOT NULL,\
 
4242
 ipmi_sensor varchar(128) DEFAULT '' NOT NULL,\
 
4243
 PRIMARY KEY (itemid)\
 
4244
);\
 
4245
CREATE UNIQUE INDEX IF NOT EXISTS items_1 on items (hostid,key_);\
 
4246
CREATE INDEX IF NOT EXISTS items_2 on items (nextcheck);\
 
4247
CREATE INDEX IF NOT EXISTS items_3 on items (status);\
 
4248
CREATE INDEX IF NOT EXISTS items_4 on items (templateid);\
 
4249
CREATE TABLE IF NOT EXISTS items_applications (\
 
4250
 itemappid bigint DEFAULT '0' NOT NULL,\
 
4251
 applicationid bigint DEFAULT '0' NOT NULL,\
 
4252
 itemid bigint DEFAULT '0' NOT NULL,\
 
4253
 PRIMARY KEY (itemappid)\
 
4254
);\
 
4255
CREATE INDEX IF NOT EXISTS items_applications_1 on items_applications (applicationid,itemid);\
 
4256
CREATE INDEX IF NOT EXISTS items_applications_2 on items_applications (itemid);\
4241
4257
CREATE TABLE IF NOT EXISTS mappings (\
4242
 
        mappingid               bigin           DEFAULT '0'     NOT NULL,\
4243
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
4244
 
        value           varchar(64)             DEFAULT ''      NOT NULL,\
4245
 
        newvalue                varchar(64)             DEFAULT ''      NOT NULL,\
4246
 
        PRIMARY KEY (mappingid)\
 
4258
 mappingid bigint DEFAULT '0' NOT NULL,\
 
4259
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
4260
 value varchar(64) DEFAULT '' NOT NULL,\
 
4261
 newvalue varchar(64) DEFAULT '' NOT NULL,\
 
4262
 PRIMARY KEY (mappingid)\
4247
4263
);\
4248
4264
CREATE INDEX IF NOT EXISTS mappings_1 on mappings (valuemapid);\
4249
4265
CREATE TABLE IF NOT EXISTS media (\
4250
 
        mediaid         bigin           DEFAULT '0'     NOT NULL,\
4251
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
4252
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
4253
 
        send o          varchar(100)            DEFAULT ''      NOT NULL,\
4254
 
        ac ive          in eger         DEFAULT '0'     NOT NULL,\
4255
 
        severi y                in eger         DEFAULT '63'    NOT NULL,\
4256
 
        period          varchar(100)            DEFAULT '1-7,00:00-23:59'       NOT NULL,\
4257
 
        PRIMARY KEY (mediaid)\
 
4266
 mediaid bigint DEFAULT '0' NOT NULL,\
 
4267
 userid bigint DEFAULT '0' NOT NULL,\
 
4268
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
4269
 sendto varchar(100) DEFAULT '' NOT NULL,\
 
4270
 active integer DEFAULT '0' NOT NULL,\
 
4271
 severity integer DEFAULT '63' NOT NULL,\
 
4272
 period varchar(100) DEFAULT '1-7,00:00-23:59' NOT NULL,\
 
4273
 PRIMARY KEY (mediaid)\
4258
4274
);\
4259
4275
CREATE INDEX IF NOT EXISTS media_1 on media (userid);\
4260
 
CREATE INDEX IF NOT EXISTS media_2 on media (media ypeid);\
4261
 
CREATE TABLE IF NOT EXISTS media_ ype (\
4262
 
        media ypeid             bigin           DEFAULT '0'     NOT NULL,\
4263
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4264
 
        descrip ion             varchar(100)            DEFAULT ''      NOT NULL,\
4265
 
        sm p_server             varchar(255)            DEFAULT ''      NOT NULL,\
4266
 
        sm p_helo               varchar(255)            DEFAULT ''      NOT NULL,\
4267
 
        sm p_email              varchar(255)            DEFAULT ''      NOT NULL,\
4268
 
        exec_pa h               varchar(255)            DEFAULT ''      NOT NULL,\
4269
 
        gsm_modem               varchar(255)            DEFAULT ''      NOT NULL,\
4270
 
        username                varchar(255)            DEFAULT ''      NOT NULL,\
4271
 
        passwd          varchar(255)            DEFAULT ''      NOT NULL,\
4272
 
        PRIMARY KEY (media ypeid)\
 
4276
CREATE INDEX IF NOT EXISTS media_2 on media (mediatypeid);\
 
4277
CREATE TABLE IF NOT EXISTS media_type (\
 
4278
 mediatypeid bigint DEFAULT '0' NOT NULL,\
 
4279
 type integer DEFAULT '0' NOT NULL,\
 
4280
 description varchar(100) DEFAULT '' NOT NULL,\
 
4281
 smtp_server varchar(255) DEFAULT '' NOT NULL,\
 
4282
 smtp_helo varchar(255) DEFAULT '' NOT NULL,\
 
4283
 smtp_email varchar(255) DEFAULT '' NOT NULL,\
 
4284
 exec_path varchar(255) DEFAULT '' NOT NULL,\
 
4285
 gsm_modem varchar(255) DEFAULT '' NOT NULL,\
 
4286
 username varchar(255) DEFAULT '' NOT NULL,\
 
4287
 passwd varchar(255) DEFAULT '' NOT NULL,\
 
4288
 PRIMARY KEY (mediatypeid)\
4273
4289
);\
4274
4290
CREATE TABLE IF NOT EXISTS profiles (\
4275
 
        profileid               bigin           DEFAULT '0'     NOT NULL,\
4276
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
4277
 
        idx             varchar(96)             DEFAULT ''      NOT NULL,\
4278
 
        idx2            bigin           DEFAULT '0'     NOT NULL,\
4279
 
        value_id                bigin           DEFAULT '0'     NOT NULL,\
4280
 
        value_in                in eger         DEFAULT '0'     NOT NULL,\
4281
 
        value_s r               varchar(255)            DEFAULT ''      NOT NULL,\
4282
 
        source          varchar(96)             DEFAULT ''      NOT NULL,\
4283
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4284
 
        PRIMARY KEY (profileid)\
 
4291
 profileid bigint DEFAULT '0' NOT NULL,\
 
4292
 userid bigint DEFAULT '0' NOT NULL,\
 
4293
 idx varchar(96) DEFAULT '' NOT NULL,\
 
4294
 idx2 bigint DEFAULT '0' NOT NULL,\
 
4295
 value_id bigint DEFAULT '0' NOT NULL,\
 
4296
 value_int integer DEFAULT '0' NOT NULL,\
 
4297
 value_str varchar(255) DEFAULT '' NOT NULL,\
 
4298
 source varchar(96) DEFAULT '' NOT NULL,\
 
4299
 type integer DEFAULT '0' NOT NULL,\
 
4300
 PRIMARY KEY (profileid)\
4285
4301
);\
4286
4302
CREATE INDEX IF NOT EXISTS profiles_1 on profiles (userid,idx,idx2);\
4287
 
CREATE TABLE IF NOT EXISTS righ s (\
4288
 
        righ id         bigin           DEFAULT '0'     NOT NULL,\
4289
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
4290
 
        permission              in eger         DEFAULT '0'     NOT NULL,\
4291
 
        id              bigin                   ,\
4292
 
        PRIMARY KEY (righ id)\
 
4303
CREATE TABLE IF NOT EXISTS rights (\
 
4304
 rightid bigint DEFAULT '0' NOT NULL,\
 
4305
 groupid bigint DEFAULT '0' NOT NULL,\
 
4306
 permission integer DEFAULT '0' NOT NULL,\
 
4307
 id bigint ,\
 
4308
 PRIMARY KEY (rightid)\
4293
4309
);\
4294
 
CREATE INDEX IF NOT EXISTS righ s_1 on righ s (groupid);\
4295
 
CREATE TABLE IF NOT EXISTS scrip s (\
4296
 
        scrip id                bigin           DEFAULT '0'     NOT NULL,\
4297
 
        name            varchar(255)            DEFAULT ''      NOT NULL,\
4298
 
        command         varchar(255)            DEFAULT ''      NOT NULL,\
4299
 
        hos _access             in eger         DEFAULT '2'     NOT NULL,\
4300
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
4301
 
        groupid         bigin           DEFAULT '0'     NOT NULL,\
4302
 
        PRIMARY KEY (scrip id)\
 
4310
CREATE INDEX IF NOT EXISTS rights_1 on rights (groupid);\
 
4311
CREATE TABLE IF NOT EXISTS scripts (\
 
4312
 scriptid bigint DEFAULT '0' NOT NULL,\
 
4313
 name varchar(255) DEFAULT '' NOT NULL,\
 
4314
 command varchar(255) DEFAULT '' NOT NULL,\
 
4315
 host_access integer DEFAULT '2' NOT NULL,\
 
4316
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
4317
 groupid bigint DEFAULT '0' NOT NULL,\
 
4318
 PRIMARY KEY (scriptid)\
4303
4319
);\
4304
4320
CREATE TABLE IF NOT EXISTS screens (\
4305
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
4306
 
        name            varchar(255)            DEFAULT 'Screen'        NOT NULL,\
4307
 
        hsize           in eger         DEFAULT '1'     NOT NULL,\
4308
 
        vsize           in eger         DEFAULT '1'     NOT NULL,\
4309
 
        PRIMARY KEY (screenid)\
 
4321
 screenid bigint DEFAULT '0' NOT NULL,\
 
4322
 name varchar(255) DEFAULT 'Screen' NOT NULL,\
 
4323
 hsize integer DEFAULT '1' NOT NULL,\
 
4324
 vsize integer DEFAULT '1' NOT NULL,\
 
4325
 PRIMARY KEY (screenid)\
4310
4326
);\
4311
 
CREATE TABLE IF NOT EXISTS screens_i ems (\
4312
 
        screeni emid            bigin           DEFAULT '0'     NOT NULL,\
4313
 
        screenid                bigin           DEFAULT '0'     NOT NULL,\
4314
 
        resource ype            in eger         DEFAULT '0'     NOT NULL,\
4315
 
        resourceid              bigin           DEFAULT '0'     NOT NULL,\
4316
 
        wid h           in eger         DEFAULT '320'   NOT NULL,\
4317
 
        heigh           in eger         DEFAULT '200'   NOT NULL,\
4318
 
        x               in eger         DEFAULT '0'     NOT NULL,\
4319
 
        y               in eger         DEFAULT '0'     NOT NULL,\
4320
 
        colspan         in eger         DEFAULT '0'     NOT NULL,\
4321
 
        rowspan         in eger         DEFAULT '0'     NOT NULL,\
4322
 
        elemen s                in eger         DEFAULT '25'    NOT NULL,\
4323
 
        valign          in eger         DEFAULT '0'     NOT NULL,\
4324
 
        halign          in eger         DEFAULT '0'     NOT NULL,\
4325
 
        s yle           in eger         DEFAULT '0'     NOT NULL,\
4326
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
4327
 
        dynamic         in eger         DEFAULT '0'     NOT NULL,\
4328
 
        PRIMARY KEY (screeni emid)\
 
4327
CREATE TABLE IF NOT EXISTS screens_items (\
 
4328
 screenitemid bigint DEFAULT '0' NOT NULL,\
 
4329
 screenid bigint DEFAULT '0' NOT NULL,\
 
4330
 resourcetype integer DEFAULT '0' NOT NULL,\
 
4331
 resourceid bigint DEFAULT '0' NOT NULL,\
 
4332
 width integer DEFAULT '320' NOT NULL,\
 
4333
 height integer DEFAULT '200' NOT NULL,\
 
4334
 x integer DEFAULT '0' NOT NULL,\
 
4335
 y integer DEFAULT '0' NOT NULL,\
 
4336
 colspan integer DEFAULT '0' NOT NULL,\
 
4337
 rowspan integer DEFAULT '0' NOT NULL,\
 
4338
 elements integer DEFAULT '25' NOT NULL,\
 
4339
 valign integer DEFAULT '0' NOT NULL,\
 
4340
 halign integer DEFAULT '0' NOT NULL,\
 
4341
 style integer DEFAULT '0' NOT NULL,\
 
4342
 url varchar(255) DEFAULT '' NOT NULL,\
 
4343
 dynamic integer DEFAULT '0' NOT NULL,\
 
4344
 PRIMARY KEY (screenitemid)\
4329
4345
);\
4330
4346
CREATE TABLE IF NOT EXISTS services (\
4331
 
        serviceid               bigin           DEFAULT '0'     NOT NULL,\
4332
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
4333
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
4334
 
        algori hm               in eger         DEFAULT '0'     NOT NULL,\
4335
 
         riggerid               bigin                   ,\
4336
 
        showsla         in eger         DEFAULT '0'     NOT NULL,\
4337
 
        goodsla         double(16,4)            DEFAULT '99.9'  NOT NULL,\
4338
 
        sor order               in eger         DEFAULT '0'     NOT NULL,\
4339
 
        PRIMARY KEY (serviceid)\
 
4347
 serviceid bigint DEFAULT '0' NOT NULL,\
 
4348
 name varchar(128) DEFAULT '' NOT NULL,\
 
4349
 status integer DEFAULT '0' NOT NULL,\
 
4350
 algorithm integer DEFAULT '0' NOT NULL,\
 
4351
 triggerid bigint ,\
 
4352
 showsla integer DEFAULT '0' NOT NULL,\
 
4353
 goodsla double(16,4) DEFAULT '99.9' NOT NULL,\
 
4354
 sortorder integer DEFAULT '0' NOT NULL,\
 
4355
 PRIMARY KEY (serviceid)\
4340
4356
);\
4341
4357
CREATE TABLE IF NOT EXISTS services_links (\
4342
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
4343
 
        serviceupid             bigin           DEFAULT '0'     NOT NULL,\
4344
 
        servicedownid           bigin           DEFAULT '0'     NOT NULL,\
4345
 
        sof             in eger         DEFAULT '0'     NOT NULL,\
4346
 
        PRIMARY KEY (linkid)\
 
4358
 linkid bigint DEFAULT '0' NOT NULL,\
 
4359
 serviceupid bigint DEFAULT '0' NOT NULL,\
 
4360
 servicedownid bigint DEFAULT '0' NOT NULL,\
 
4361
 soft integer DEFAULT '0' NOT NULL,\
 
4362
 PRIMARY KEY (linkid)\
4347
4363
);\
4348
4364
CREATE INDEX IF NOT EXISTS services_links_links_1 on services_links (servicedownid);\
4349
4365
CREATE UNIQUE INDEX IF NOT EXISTS services_links_links_2 on services_links (serviceupid,servicedownid);\
4350
4366
CREATE TABLE IF NOT EXISTS sessions (\
4351
 
        sessionid               varchar(32)             DEFAULT ''      NOT NULL,\
4352
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
4353
 
        las access              in eger         DEFAULT '0'     NOT NULL,\
4354
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
4355
 
        PRIMARY KEY (sessionid)\
 
4367
 sessionid varchar(32) DEFAULT '' NOT NULL,\
 
4368
 userid bigint DEFAULT '0' NOT NULL,\
 
4369
 lastaccess integer DEFAULT '0' NOT NULL,\
 
4370
 status integer DEFAULT '0' NOT NULL,\
 
4371
 PRIMARY KEY (sessionid)\
4356
4372
);\
4357
4373
CREATE TABLE IF NOT EXISTS sysmaps_links (\
4358
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
4359
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
4360
 
        selemen id1             bigin           DEFAULT '0'     NOT NULL,\
4361
 
        selemen id2             bigin           DEFAULT '0'     NOT NULL,\
4362
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
4363
 
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
4364
 
        PRIMARY KEY (linkid)\
4365
 
);\
4366
 
CREATE TABLE IF NOT EXISTS sysmaps_link_ riggers (\
4367
 
        link riggerid           bigin           DEFAULT '0'     NOT NULL,\
4368
 
        linkid          bigin           DEFAULT '0'     NOT NULL,\
4369
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
4370
 
        draw ype                in eger         DEFAULT '0'     NOT NULL,\
4371
 
        color           varchar(6)              DEFAULT '000000'        NOT NULL,\
4372
 
        PRIMARY KEY (link riggerid)\
4373
 
);\
4374
 
CREATE UNIQUE INDEX IF NOT EXISTS sysmaps_link_ riggers_1 on sysmaps_link_ riggers (linkid, riggerid);\
4375
 
CREATE TABLE IF NOT EXISTS sysmaps_elemen s (\
4376
 
        selemen id              bigin           DEFAULT '0'     NOT NULL,\
4377
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
4378
 
        elemen id               bigin           DEFAULT '0'     NOT NULL,\
4379
 
        elemen ype              in eger         DEFAULT '0'     NOT NULL,\
4380
 
        iconid_off              bigin           DEFAULT '0'     NOT NULL,\
4381
 
        iconid_on               bigin           DEFAULT '0'     NOT NULL,\
4382
 
        iconid_unknown          bigin           DEFAULT '0'     NOT NULL,\
4383
 
        label           varchar(128)            DEFAULT ''      NOT NULL,\
4384
 
        label_loca ion          in eger                 NULL,\
4385
 
        x               in eger         DEFAULT '0'     NOT NULL,\
4386
 
        y               in eger         DEFAULT '0'     NOT NULL,\
4387
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
4388
 
        iconid_disabled         bigin           DEFAULT '0'     NOT NULL,\
4389
 
        PRIMARY KEY (selemen id)\
 
4374
 linkid bigint DEFAULT '0' NOT NULL,\
 
4375
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
4376
 selementid1 bigint DEFAULT '0' NOT NULL,\
 
4377
 selementid2 bigint DEFAULT '0' NOT NULL,\
 
4378
 drawtype integer DEFAULT '0' NOT NULL,\
 
4379
 color varchar(6) DEFAULT '000000' NOT NULL,\
 
4380
 PRIMARY KEY (linkid)\
 
4381
);\
 
4382
CREATE TABLE IF NOT EXISTS sysmaps_link_triggers (\
 
4383
 linktriggerid bigint DEFAULT '0' NOT NULL,\
 
4384
 linkid bigint DEFAULT '0' NOT NULL,\
 
4385
 triggerid bigint DEFAULT '0' NOT NULL,\
 
4386
 drawtype integer DEFAULT '0' NOT NULL,\
 
4387
 color varchar(6) DEFAULT '000000' NOT NULL,\
 
4388
 PRIMARY KEY (linktriggerid)\
 
4389
);\
 
4390
CREATE UNIQUE INDEX IF NOT EXISTS sysmaps_link_triggers_1 on sysmaps_link_triggers (linkid,triggerid);\
 
4391
CREATE TABLE IF NOT EXISTS sysmaps_elements (\
 
4392
 selementid bigint DEFAULT '0' NOT NULL,\
 
4393
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
4394
 elementid bigint DEFAULT '0' NOT NULL,\
 
4395
 elementtype integer DEFAULT '0' NOT NULL,\
 
4396
 iconid_off bigint DEFAULT '0' NOT NULL,\
 
4397
 iconid_on bigint DEFAULT '0' NOT NULL,\
 
4398
 iconid_unknown bigint DEFAULT '0' NOT NULL,\
 
4399
 label varchar(128) DEFAULT '' NOT NULL,\
 
4400
 label_location integer NULL,\
 
4401
 x integer DEFAULT '0' NOT NULL,\
 
4402
 y integer DEFAULT '0' NOT NULL,\
 
4403
 url varchar(255) DEFAULT '' NOT NULL,\
 
4404
 iconid_disabled bigint DEFAULT '0' NOT NULL,\
 
4405
 PRIMARY KEY (selementid)\
4390
4406
);\
4391
4407
CREATE TABLE IF NOT EXISTS sysmaps (\
4392
 
        sysmapid                bigin           DEFAULT '0'     NOT NULL,\
4393
 
        name            varchar(128)            DEFAULT ''      NOT NULL,\
4394
 
        wid h           in eger         DEFAULT '0'     NOT NULL,\
4395
 
        heigh           in eger         DEFAULT '0'     NOT NULL,\
4396
 
        backgroundid            bigin           DEFAULT '0'     NOT NULL,\
4397
 
        label_ ype              in eger         DEFAULT '0'     NOT NULL,\
4398
 
        label_loca ion          in eger         DEFAULT '0'     NOT NULL,\
4399
 
        PRIMARY KEY (sysmapid)\
 
4408
 sysmapid bigint DEFAULT '0' NOT NULL,\
 
4409
 name varchar(128) DEFAULT '' NOT NULL,\
 
4410
 width integer DEFAULT '0' NOT NULL,\
 
4411
 height integer DEFAULT '0' NOT NULL,\
 
4412
 backgroundid bigint DEFAULT '0' NOT NULL,\
 
4413
 label_type integer DEFAULT '0' NOT NULL,\
 
4414
 label_location integer DEFAULT '0' NOT NULL,\
 
4415
 PRIMARY KEY (sysmapid)\
4400
4416
);\
4401
4417
CREATE INDEX IF NOT EXISTS sysmaps_1 on sysmaps (name);\
4402
 
CREATE TABLE IF NOT EXISTS  riggers (\
4403
 
         riggerid               bigin           DEFAULT '0'     NOT NULL,\
4404
 
        expression              varchar(255)            DEFAULT ''      NOT NULL,\
4405
 
        descrip ion             varchar(255)            DEFAULT ''      NOT NULL,\
4406
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
4407
 
        s a us          in eger         DEFAULT '0'     NOT NULL,\
4408
 
        value           in eger         DEFAULT '0'     NOT NULL,\
4409
 
        priori y                in eger         DEFAULT '0'     NOT NULL,\
4410
 
        las change              in eger         DEFAULT '0'     NOT NULL,\
4411
 
        dep_level               in eger         DEFAULT '0'     NOT NULL,\
4412
 
        commen s                blob            DEFAULT ''      NOT NULL,\
4413
 
        error           varchar(128)            DEFAULT ''      NOT NULL,\
4414
 
         empla eid              bigin           DEFAULT '0'     NOT NULL,\
4415
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4416
 
        PRIMARY KEY ( riggerid)\
4417
 
);\
4418
 
CREATE INDEX IF NOT EXISTS  riggers_1 on  riggers (s a us);\
4419
 
CREATE INDEX IF NOT EXISTS  riggers_2 on  riggers (value);\
4420
 
CREATE TABLE IF NOT EXISTS  rigger_depends (\
4421
 
         riggerdepid            bigin           DEFAULT '0'     NOT NULL,\
4422
 
         riggerid_down          bigin           DEFAULT '0'     NOT NULL,\
4423
 
         riggerid_up            bigin           DEFAULT '0'     NOT NULL,\
4424
 
        PRIMARY KEY ( riggerdepid)\
4425
 
);\
4426
 
CREATE INDEX IF NOT EXISTS  rigger_depends_1 on  rigger_depends ( riggerid_down, riggerid_up);\
4427
 
CREATE INDEX IF NOT EXISTS  rigger_depends_2 on  rigger_depends ( riggerid_up);\
 
4418
CREATE TABLE IF NOT EXISTS triggers (\
 
4419
 triggerid bigint DEFAULT '0' NOT NULL,\
 
4420
 expression varchar(255) DEFAULT '' NOT NULL,\
 
4421
 description varchar(255) DEFAULT '' NOT NULL,\
 
4422
 url varchar(255) DEFAULT '' NOT NULL,\
 
4423
 status integer DEFAULT '0' NOT NULL,\
 
4424
 value integer DEFAULT '0' NOT NULL,\
 
4425
 priority integer DEFAULT '0' NOT NULL,\
 
4426
 lastchange integer DEFAULT '0' NOT NULL,\
 
4427
 dep_level integer DEFAULT '0' NOT NULL,\
 
4428
 comments blob DEFAULT '' NOT NULL,\
 
4429
 error varchar(128) DEFAULT '' NOT NULL,\
 
4430
 templateid bigint DEFAULT '0' NOT NULL,\
 
4431
 type integer DEFAULT '0' NOT NULL,\
 
4432
 PRIMARY KEY (triggerid)\
 
4433
);\
 
4434
CREATE INDEX IF NOT EXISTS triggers_1 on triggers (status);\
 
4435
CREATE INDEX IF NOT EXISTS triggers_2 on triggers (value);\
 
4436
CREATE TABLE IF NOT EXISTS trigger_depends (\
 
4437
 triggerdepid bigint DEFAULT '0' NOT NULL,\
 
4438
 triggerid_down bigint DEFAULT '0' NOT NULL,\
 
4439
 triggerid_up bigint DEFAULT '0' NOT NULL,\
 
4440
 PRIMARY KEY (triggerdepid)\
 
4441
);\
 
4442
CREATE INDEX IF NOT EXISTS trigger_depends_1 on trigger_depends (triggerid_down,triggerid_up);\
 
4443
CREATE INDEX IF NOT EXISTS trigger_depends_2 on trigger_depends (triggerid_up);\
4428
4444
CREATE TABLE IF NOT EXISTS users (\
4429
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
4430
 
        alias           varchar(100)            DEFAULT ''      NOT NULL,\
4431
 
        name            varchar(100)            DEFAULT ''      NOT NULL,\
4432
 
        surname         varchar(100)            DEFAULT ''      NOT NULL,\
4433
 
        passwd          char(32)                DEFAULT ''      NOT NULL,\
4434
 
        url             varchar(255)            DEFAULT ''      NOT NULL,\
4435
 
        au ologin               in eger         DEFAULT '0'     NOT NULL,\
4436
 
        au ologou               in eger         DEFAULT '900'   NOT NULL,\
4437
 
        lang            varchar(5)              DEFAULT 'en_gb' NOT NULL,\
4438
 
        refresh         in eger         DEFAULT '30'    NOT NULL,\
4439
 
         ype            in eger         DEFAULT '0'     NOT NULL,\
4440
 
         heme           varchar(128)            DEFAULT 'defaul .css'   NOT NULL,\
4441
 
        a emp _failed           in eger         DEFAULT 0       NOT NULL,\
4442
 
        a emp _ip               varchar(39)             DEFAULT ''      NOT NULL,\
4443
 
        a emp _clock            in eger         DEFAULT 0       NOT NULL,\
4444
 
        PRIMARY KEY (userid)\
 
4445
 userid bigint DEFAULT '0' NOT NULL,\
 
4446
 alias varchar(100) DEFAULT '' NOT NULL,\
 
4447
 name varchar(100) DEFAULT '' NOT NULL,\
 
4448
 surname varchar(100) DEFAULT '' NOT NULL,\
 
4449
 passwd char(32) DEFAULT '' NOT NULL,\
 
4450
 url varchar(255) DEFAULT '' NOT NULL,\
 
4451
 autologin integer DEFAULT '0' NOT NULL,\
 
4452
 autologout integer DEFAULT '900' NOT NULL,\
 
4453
 lang varchar(5) DEFAULT 'en_gb' NOT NULL,\
 
4454
 refresh integer DEFAULT '30' NOT NULL,\
 
4455
 type integer DEFAULT '0' NOT NULL,\
 
4456
 theme varchar(128) DEFAULT 'default.css' NOT NULL,\
 
4457
 attempt_failed integer DEFAULT 0 NOT NULL,\
 
4458
 attempt_ip varchar(39) DEFAULT '' NOT NULL,\
 
4459
 attempt_clock integer DEFAULT 0 NOT NULL,\
 
4460
 PRIMARY KEY (userid)\
4445
4461
);\
4446
4462
CREATE INDEX IF NOT EXISTS users_1 on users (alias);\
4447
4463
CREATE TABLE IF NOT EXISTS usrgrp (\
4448
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
4449
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
4450
 
        gui_access              in eger         DEFAULT '0'     NOT NULL,\
4451
 
        users_s a us            in eger         DEFAULT '0'     NOT NULL,\
4452
 
        PRIMARY KEY (usrgrpid)\
 
4464
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
4465
 name varchar(64) DEFAULT '' NOT NULL,\
 
4466
 gui_access integer DEFAULT '0' NOT NULL,\
 
4467
 users_status integer DEFAULT '0' NOT NULL,\
 
4468
 PRIMARY KEY (usrgrpid)\
4453
4469
);\
4454
4470
CREATE INDEX IF NOT EXISTS usrgrp_1 on usrgrp (name);\
4455
4471
CREATE TABLE IF NOT EXISTS users_groups (\
4456
 
        id              bigin           DEFAULT '0'     NOT NULL,\
4457
 
        usrgrpid                bigin           DEFAULT '0'     NOT NULL,\
4458
 
        userid          bigin           DEFAULT '0'     NOT NULL,\
4459
 
        PRIMARY KEY (id)\
 
4472
 id bigint DEFAULT '0' NOT NULL,\
 
4473
 usrgrpid bigint DEFAULT '0' NOT NULL,\
 
4474
 userid bigint DEFAULT '0' NOT NULL,\
 
4475
 PRIMARY KEY (id)\
4460
4476
);\
4461
4477
CREATE INDEX IF NOT EXISTS users_groups_1 on users_groups (usrgrpid,userid);\
4462
4478
CREATE TABLE IF NOT EXISTS valuemaps (\
4463
 
        valuemapid              bigin           DEFAULT '0'     NOT NULL,\
4464
 
        name            varchar(64)             DEFAULT ''      NOT NULL,\
4465
 
        PRIMARY KEY (valuemapid)\
 
4479
 valuemapid bigint DEFAULT '0' NOT NULL,\
 
4480
 name varchar(64) DEFAULT '' NOT NULL,\
 
4481
 PRIMARY KEY (valuemapid)\
4466
4482
);\
4467
4483
CREATE INDEX IF NOT EXISTS valuemaps_1 on valuemaps (name);\
4468
4484
COMMIT;\