1 -- SQL declarations for avail, sla and scheduled reports
3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
5 CREATE TABLE IF NOT EXISTS `avail_config` (
6 `id` int(11) NOT NULL auto_increment,
7 `username` varchar(255) NOT NULL,
8 `report_name` varchar(255) NOT NULL,
10 `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
11 `rpttimeperiod` varchar(75) NOT NULL,
12 `report_period` varchar(50) NOT NULL,
13 `start_time` int(11) NOT NULL default '0',
14 `end_time` int(11) NOT NULL default '0',
15 `report_type` varchar(30) NOT NULL,
16 `initialassumedhoststate` int(11) NOT NULL default '0',
17 `initialassumedservicestate` int(11) NOT NULL default '0',
18 `assumeinitialstates` int(11) NOT NULL default '0',
19 `scheduleddowntimeasuptime` int(11) NOT NULL default '0',
20 `assumestatesduringnotrunning` int(11) NOT NULL default '0',
21 `includesoftstates` int(11) NOT NULL default '0',
22 `updated` timestamp NOT NULL default '0000-00-00 00:00:00',
23 `use_average` TINYINT(1) DEFAULT 0,
24 `use_alias` TINYINT(1) DEFAULT 0,
25 `cluster_mode` INT NOT NULL DEFAULT 0,
27 KEY `username` (`username`)
28 ) COLLATE latin1_general_cs;
30 CREATE TABLE IF NOT EXISTS avail_config_objects (
31 `id` int(11) NOT NULL auto_increment,
32 `avail_id` int(11) NOT NULL default '0',
33 `name` varchar(255) NOT NULL,
35 KEY avail_id (avail_id)
36 ) COLLATE latin1_general_cs;
38 CREATE TABLE IF NOT EXISTS avail_db_version (
39 version int(11) NOT NULL default '0'
40 ) COLLATE latin1_general_cs;
42 INSERT INTO avail_db_version VALUES(1);
44 CREATE TABLE IF NOT EXISTS `scheduled_reports` (
45 `id` int(11) NOT NULL auto_increment,
46 `username` varchar(255) NOT NULL,
47 `report_type_id` int(11) NOT NULL default '0',
48 `report_id` int(11) NOT NULL default '0',
49 `recipients` TEXT NOT NULL,
50 `description` TEXT NOT NULL,
51 `period_id` int(11) NOT NULL default '0',
52 `filename` varchar(255) NOT NULL,
54 KEY `report_type_id` (`report_type_id`),
55 KEY `username` (`username`)
56 ) COLLATE latin1_general_cs;
58 CREATE TABLE IF NOT EXISTS `scheduled_report_types` (
59 `id` int(11) NOT NULL auto_increment,
60 `name` varchar(255) NOT NULL,
61 `script_reports_path` varchar(255) NOT NULL,
62 `script_reports_run` varchar(255) NOT NULL,
63 `identifier` varchar(50) NOT NULL,
65 KEY `identifier` (`identifier`)
66 ) COLLATE latin1_general_cs;
69 CREATE TABLE IF NOT EXISTS scheduled_reports_db_version (
70 version varchar(10) NOT NULL
71 ) COLLATE latin1_general_cs;
73 INSERT INTO scheduled_reports_db_version VALUES('1.0.0');
75 INSERT INTO `scheduled_report_types` (`id`, `identifier`) VALUES
79 CREATE TABLE IF NOT EXISTS `scheduled_report_periods` (
80 `id` int(11) NOT NULL auto_increment,
81 `periodname` varchar(100) NOT NULL,
83 ) COLLATE latin1_general_cs;
85 INSERT INTO `scheduled_report_periods` (`id`, `periodname`) VALUES
90 CREATE TABLE IF NOT EXISTS sla_config (
91 `id` int(11) NOT NULL auto_increment,
92 `username` varchar(255) NOT NULL,
93 `sla_name` varchar(255) NOT NULL,
95 `created` timestamp NOT NULL default CURRENT_TIMESTAMP,
96 `rpttimeperiod` varchar(75) NOT NULL,
97 `report_period` varchar(50) NOT NULL,
98 `start_time` int(11) NOT NULL default '0',
99 `end_time` int(11) NOT NULL default '0',
100 `report_type` varchar(30) NOT NULL,
101 `initialassumedhoststate` int(11) NOT NULL default '0',
102 `initialassumedservicestate` int(11) NOT NULL default '0',
103 `assumeinitialstates` int(11) NOT NULL default '0',
104 `scheduleddowntimeasuptime` int(11) NOT NULL default '0',
105 `assumestatesduringnotrunning` int(11) NOT NULL default '0',
106 `includesoftstates` int(11) NOT NULL default '0',
107 `updated` timestamp NOT NULL default '0000-00-00 00:00:00',
108 `use_average` TINYINT(1) DEFAULT 0,
109 `use_alias` TINYINT(1) DEFAULT 0,
110 `cluster_mode` INT NOT NULL DEFAULT 0,
112 ) COLLATE latin1_general_cs;
114 CREATE TABLE IF NOT EXISTS sla_config_objects (
115 `id` int(11) NOT NULL auto_increment,
116 `sla_id` int(11) NOT NULL default '0',
117 `name` varchar(255) NOT NULL,
120 ) COLLATE latin1_general_cs;
122 CREATE TABLE IF NOT EXISTS sla_periods (
123 `id` int(11) NOT NULL auto_increment,
124 `sla_id` int(11) NOT NULL default '0',
125 `name` varchar(20) NOT NULL,
126 `value` float NOT NULL default '0',
129 ) COLLATE latin1_general_cs;
131 CREATE TABLE IF NOT EXISTS sla_db_version (
132 version int(11) NOT NULL default '0'
133 ) COLLATE latin1_general_cs;
135 INSERT INTO sla_db_version VALUES(1);