Merge branch 'master' of /opt/git/clearscm
[clearscm.git] / clearadm / lib / load.sql
1 -- -----------------------------------------------------------------------------
2 --
3 -- File:        $RCSfile: load.sql,v $
4 -- Revision:    $Revision: 1.10 $
5 -- Description: Create predefined data in the Clearadm database
6 -- Author:      Andrew@ClearSCM.com
7 -- Created:     Tue Nov 30 08:46:42 EST 2010
8 -- Modified:    $Date: 2012/07/04 20:51:34 $
9 -- Language:    SQL
10 --
11 -- Copyright (c) 2010, ClearSCM, Inc., all rights reserved
12 --
13 -- -----------------------------------------------------------------------------
14 -- Predefined alerts
15 insert into alert (
16   name,
17   type
18 ) values (
19   'Email admin',
20   'email'
21 );
22
23 -- Predefined notificationsTables
24 insert into notification (
25   name,
26   alert,
27   cond,
28   nomorethan
29 ) values (
30   'Filesystem',
31   'Email admin',
32   'Filesystem over threshold',
33   'Once a day'
34 );
35
36 insert into notification (
37   name,
38   alert,
39   cond,
40   nomorethan
41 ) values (
42   'Heartbeat',
43   'Email admin',
44   'Heartbeat Failure',
45   'Once an hour'
46 );
47
48 insert into notification (
49   name,
50   alert,
51   cond,
52   nomorethan
53 ) values (
54   'Loadavg',
55   'Email admin',
56   'Loadavg over threshold',
57   'Once an hour'
58 );
59
60 insert into notification (
61   name,
62   alert,
63   cond,
64   nomorethan
65 ) values (
66   'Scrub',
67   'Email admin',
68   'Scrub Failure',
69   'Once a day'
70 );
71
72 insert into notification (
73   name,
74   alert,
75   cond,
76   nomorethan
77 ) values (
78   'System checkin',
79   'Email admin',
80   'Not respoding',
81   'Once an hour'
82 );
83
84 insert into notification (
85   name,
86   alert,
87   cond,
88   nomorethan
89 ) values (
90   'Update systems',
91   'Email admin',
92   'Non zero return',
93   'Once an hour'
94 );
95
96 -- Predefined tasks
97 insert into task (
98   name,
99   system,
100   description,
101   command
102 ) values (
103   'Loadavg',
104   'Localhost',
105   'Obtain a loadavg snapshot on all systems',
106   'updatela.pl'
107 );
108
109 insert into task (
110   name,
111   system,
112   description,
113   command
114 ) values (
115   'Filesystem',
116   'Localhost',
117   'Obtain a filesystem snapshot on all systems/filesystems',
118   'updatefs.pl'
119 );
120
121 insert into task (
122   name,
123   system,
124   description,
125   command
126 ) values (
127   'Scrub',
128   'Localhost',
129   'Scrub Clearadm database',
130   'clearadmscrub.pl'
131 );
132
133 insert into task (
134   name,
135   system,
136   description,
137   command
138 ) values (
139   'System checkin',
140   'Localhost',
141   'Checkin from all systems',
142   'default'
143 );
144
145 insert into task (
146   name,
147   system,
148   description,
149   command
150 ) values (
151   'Update systems',
152   'Localhost',
153   'Update all systems',
154   'updatesystem.pl -host all'
155 );
156
157 -- Predefined schedule
158 insert into schedule (
159   name,
160   task,
161   notification,
162   frequency
163 ) values (
164   'Loadavg',
165   'Loadavg',
166   'LoadAvg',
167   '5 Minutes'
168 );
169
170 insert into schedule (
171   name,
172   task,
173   notification,
174   frequency
175 ) values (
176   'Filesystem',
177   'Filesystem',
178   'Filesystem',
179   '5 Minutes'
180 );
181
182 insert into schedule (
183   name,
184   task,
185   notification,
186   frequency
187 ) values (
188   'Scrub',
189   'Scrub',
190   'Scrub',
191   '1 day'
192 );