added firewall checks and notices
[monitor.git] / monitor / wrapper / emailTxt.py
1 #
2 # Copyright (c) 2004  The Trustees of Princeton University (Trustees).
3 #
4 # Faiyaz Ahmed <faiyaza@cs.princeton.edu>
5 #
6 # $Id: emailTxt.py,v 1.10 2007/08/29 17:26:50 soltesz Exp $
7
8
9
10 # This file contains the texts of the automatically generated
11 # emails sent to techs and PIs
12 #
13
14 class mailtxt:
15
16         thankyou=("""Thank you for helping maintain your PlanetLab nodes - %(loginbase)s""",
17         """
18 While monitoring your site, we noticed that the following nodes *improved*
19 their states:
20
21 %(hostname_list)s  
22 Often, system administration is a thankless job, but not today. :-)
23
24 Thank you!
25   -- %(plc_name)s (%(support_email)s)
26
27 Legend:
28 PROD-      This state is the production state where the node can contact PlanetLab, 
29            and install slices from users.
30 DEBUG-     This state designates a node that could not boot successfully.
31 OLDBOOTCD- This state corresponds to the situation where an oldbootcd prevented 
32            the normal operation of the node.
33 ERROR-     This is an error state, where there is absolutely no contact 
34            with PlanetLab.
35         """)
36
37 #############################################################################
38 #############################################################################
39 #############################################################################
40
41         pcumissing_notice =("""There is no PCU available to reboot %(hostname)s""",
42 """We've noticed that there is no PCU associated with %(hostname)s, so we could 
43 not reboot it ourselves.
44
45 By taking a few moments now to register your PCU for this host, you will save
46 time in the future the next time we need to reboot this machine, because we
47 will be able to do so without disturbing you.
48
49     http://%(plc_hostname)s/registerwizard/index.php
50
51 The registration is very quick.  All we need are: PCU hostname, IP, username, 
52 and password.  Then, choose which node to associate it with, and we will take 
53 care of the rest.
54
55 Thank you very much for your help,
56   -- %(plc_name)s (%(support_email)s)
57 """)
58
59         pcufailed_notice =("""Could not use PCU to reboot %(hostname)s""",
60
61 """We tried to use the PCU registered for %(hostname)s, but for some reason 
62 the host did not come back online.  You may be able to learn more by visiting
63 this link:
64
65     https://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
66
67 We need your help resolving this issue in a few ways:  
68
69  1. First, we need your help rebooting %(hostname)s.  Because the above PCU does 
70     not appear to work, please manually reboot this machine.  If it turns out 
71     that there is a problem with the PCU configuration, we can help you
72     resolve that independently.
73
74  2. If it is possible, please correcct the above PCU problem, or let us know
75     what steps you are taking.  By enabling us to take administrative actions
76     automatically without your intervention, you will save time in the future 
77     the next time we need to reboot this machine, because we will be able to 
78     do so without disturbing you.
79
80  3. If there is nothing apparently wrong with the PCU, or the mapping between
81     the PCU and the host, then there is likely a problem with our bootstrap
82     software on your machine.  To help us, please make a note of any text on
83     the console and report it to mailto:%(support_email)s .  An example
84     might be that the console hangs waiting for a module to unload.  The last
85     reported name or any error messages on the screen would be very helpful.
86
87 If the PCU is up and running, but behind a firewall, please make it accessible
88 from address block 128.112.139.0/24.  You can confirm that this is the address
89 space from which the %(plc_name)s servers run.
90
91 Thank you very much for your help,
92   -- %(plc_name)s (%(support_email)s)
93 """)
94
95         online_notice=("""Host %(hostname)s is online""",
96         """
97 This notice is simply to let you know that:
98     %(hostname)s
99
100 is online and operational.  
101
102     http://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
103
104 Thank you very much for your help!
105   -- %(plc_name)s (%(support_email)s)
106         """)
107         test_notice=("""Host %(hostname)s is testing""",
108         """
109 This notice is simply to test whether notices work.
110     %(hostname)s
111
112 Thank you very much for your help!
113         """)
114         retry_bootman=("""Running BootManager on %(hostname)s""",
115         """
116 This notice is simply to let you know that:
117     %(hostname)s
118
119 appears stuck in a debug mode.  To try to correct this, we're trying to rerun BootManager.py.  
120 If any action is needed from you, you will recieve additional notices.  Thank you!
121         """)
122         firewall_notice=("""Host %(hostname)s blocked by a firewall""",
123         """
124 This notice is simply to let you know that:
125     %(hostname)s
126
127 has some ports that appear to be blocked, making the node unusable.  While
128 some ports are open, to be a fully functional node, all ports need to be
129 accessible at all times.  Please see the following for the list of
130 requirements for hosting a node:
131
132     http://www.planet-lab.org/hosting
133
134 The node will be considered 'DOWN' until the ports are unblocked.
135
136 Please investigate, and let us know if there's anything we can do to help get
137 it back on-line.  You can see more information about the current status of
138 this host here:
139
140     http://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
141
142 Thank you very much for your help,
143   -- %(plc_name)s (%(support_email)s)
144         """)
145         down_notice=("""Host %(hostname)s is down""",
146         """
147 This notice is simply to let you know that:
148     %(hostname)s
149
150 is down, disconnected from the network and/or non-operational.  
151
152 Please investigate, and let us know if there's anything we can do to help get
153 it back on-line.  You can see more information about the current status of
154 this host here:
155
156     http://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
157
158 Thank you very much for your help,
159   -- %(plc_name)s (%(support_email)s)
160         """)
161
162         clear_penalty=("""All privileges restored to site %(loginbase)s""",
163         """
164 This notice is to let you know that any privileges previously reduced at your 
165 site have been restored: %(penalty_level)s.
166
167 All privileges are restored.  You may create slices again, and if your 
168 slices were disabled, please allow up to 30 minutes for them to return to 
169 enabled.
170
171     http://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
172
173 Thank you very much for your help,
174   -- %(plc_name)s (%(support_email)s)
175
176 Legend:
177
178   0  - no penalties applied
179   1  - site is disabled.  no new slices can be created.
180   2+ - all existing slices will be disabled.
181         """)
182
183         increase_penalty=("""Privilege reduced for site %(loginbase)s""",
184         """
185 This notice is to let you know that the privileges granted to your site as
186 a participating member of Planetlab have reduced: %(penalty_level)s.
187
188 Your privileges will be reduced corresponding to the legend below.  To 
189 restore these privileges, please return at least two machines to working 
190 state.
191
192     http://%(monitor_hostname)s/monitor/pcuview?loginbase=%(loginbase)s
193
194 Thank you very much for your help,
195   -- %(plc_name)s (%(support_email)s)
196   
197 Legend:
198
199   0  - no penalty applied
200   1  - site is disabled.  no new slices can be created.
201   2+ - all existing slices will be disabled.
202         """)
203
204         newbootcd_notice=("""Host %(hostname)s needs a new BootImage""", """
205 We noticed the following node has an out-dated BootImage: 
206
207     %(hostname)s  
208
209 This usually implies that you need to update the BootImage and node
210 configuration file stored on the read-only media (either the all-in-one ISO
211 CD, floppy disk, or write-protected USB stick).
212
213 You can do this by walking through the steps of the registration wizard, and
214 downloading a new BootImage for your machine.
215
216     https://%(plc_hostname)s/registerwizard/index.php
217
218 Thank you for your help,
219   -- %(plc_name)s (%(support_email)s)
220 """)
221
222
223         newalphacd_notice=("""New Boot Images for %(hostname)s""", 
224 """As part of PlanetLab node monitoring, we noticed that we were not able to recognize all the hardware in your machine.  This means that it is so new that it needs a new BootCD, or that it is so old that it is no longer supported.
225
226     %(hostname)s  
227
228 To make this process as simple as possible, we have created All-in-One boot images that include the node configuration file.  
229
230 The only step that you need to take is to choose which media you prefer, either CD ISO, or USB image for each host.
231
232 %(url_list)s
233
234 Instructions to burn or copy these All-in-One images to the appropriate media are available in the Technical Contact's Guide.
235
236     https://%(plc_hostname)s/doc/guides/bootcdsetup
237
238 If your node returns to normal operation after following these directions, then there's no need to respond to this message.  However, if there are any console messages relating to the node's failure, please report them to PlanetLab support (%(support_email)s) so we can help resolve the issue.  Including this message in your reply will help us coordinate our records with the actions you've taken.  
239
240 Thank you for your help,
241   -- %(plc_name)s (%(support_email)s)
242 """)
243
244
245         # TODO: need reminder versions for repeats...
246         #newdown=[newdown_one, newdown_two, newdown_three]
247         #newbootcd=[newbootcd_one, newbootcd_two, newbootcd_three]
248         #newalphacd=[newalphacd_one, newalphacd_one, newalphacd_one]
249         #newthankyou=[thankyou,thankyou,thankyou]
250         #pcuthankyou=[pcuthankyou_one,pcuthankyou_one,pcuthankyou_one]
251         #pcutonodemapping=[pcutonodemapping_one, pcutonodemapping_one, pcutonodemapping_one]
252         #pcudown=[pcudown_one, pcudown_one, pcudown_one]
253
254         unknownsequence_notice = ("""Unrecognized Error on PlanetLab host %(hostname)s""", 
255                                            """
256 While trying to automatically recover this machine:
257
258     http://%(plc_hostname)s/db/nodes/index.php?pattern=%(hostname)s
259     https://%(monitor_hostname)s/monitor/pcuview?hostname=%(hostname)s
260
261 We encountered an unknown situation.  Please re-code to handle, or manually intervene to repair this host.
262
263 Abbreviated BootManager Sequence:
264
265     %(sequence)s
266
267 BootManager.log output follows:
268 ---------------------------------------------------------
269 %(bmlog)s
270 """       )
271
272
273         minimalhardware_notice = ("""Hardware requirements not met on PlanetLab host %(hostname)s""", 
274                                            """
275 While trying to automatically recover this machine:
276
277     http://%(plc_hostname)s/db/nodes/index.php?pattern=%(hostname)s
278
279 We encountered an failed hardware requirement.  Please look at the log below to determine the exact nature of the failure, either Disk, CPU, Network, or Mimial RAM was not satisfied.
280
281 If your machine does not meet the current hardware specifications for a PlanetLab node (http://%(plc_hostname)s/hardware), please upgrade it to meet the current recommended configuration.  
282
283 If you believe this message is an error, please email %(support_email)s explaining the problem.  You may need to create an updated Boot Image that includes drivers for your hardware.
284
285 Thank you,
286  - PlanetLab Support
287
288 BootManager.log output follows:
289 ---------------------------------------------------------
290 %(bmlog)s
291 """       )
292
293         baddisk_notice = ("""Bad Disk on PlanetLab node %(hostname)s""", 
294                            """As part of PlanetLab node monitoring, we noticed %(hostname)s has a number of disk or media related I/O errors, that prevent it from either booting or reliably running as a PlanetLab node.
295
296 Please verify the integrity of the disk, and order a replacement if needed.  If you need to schedule downtime for the node, please let us know at %(support_email)s. 
297
298 Thanks.
299
300   -- %(plc_name)s (%(support_email)s)
301
302 The output of `dmesg` follows:
303 -------------------------------------------------------------------------
304
305 %(log)s
306 """)
307
308
309         nodeconfig_notice=(""" Please Update Configuration file for PlanetLab node %(hostname)s""", 
310 """As part of PlanetLab node monitoring, we noticed %(hostname)s has an out-dated plnode.txt file.  
311
312 Either our boot scripts cannot find it because the boot media is corrupted, or it has no NODE_ID or a mis-matched HOSTNAME.  This can happen either due to a configuration mistake at your site, with bad information entered into our database, or after a necessary software upgrade.  To resolve the issue we require your assistance.  All that is needed is to visit:
313
314     https://%(plc_hostname)s/db/nodes/index.php?pattern=%(hostname)s
315
316 Then double check the network settings for your host.
317
318 Then, select, "Download -> Download ISO image for %(hostname)s" menu.  This will generate a new All-in-one BootImage file for your node.  Copy this file to the appropriate read-only media, and reboot the machine.
319
320 There is no need to respond to this message. If you're able to update the boot image without difficulty and your node returns to normal operation, please accept our thanks.  However, if there are any console messages relating to the node's failure, please report them to PlanetLab support (%(support_email)s) so we can help resolve the issue. 
321
322 Thank you for your help,
323   -- %(plc_name)s (%(support_email)s)
324 """)
325
326         baddns_notice=("""Planetlab node down: broken DNS configuration for %(hostname)s""", 
327 """As part of PlanetLab node monitoring, we noticed the DNS servers used by the following machine(s) are not responding to queries.
328
329     %(hostname)s 
330
331 The conseuqnece of this is that the node cannot boot correctly, and is not a functioning part of the PlanetLab network.
332
333 To help us return this machine to running order, please verify that the registered DNS servers in the node network configuration are correct.  
334
335 %(network_config)s
336
337 You may update the node's network information at the link below:
338
339     https://%(plc_hostname)s/db/nodes/node_networks.php?id=%(interface_id)s
340
341 If you have any questions, please feel free to contact us at PlanetLab Support (%(support_email)s).
342
343 Thank you for your help,
344   -- %(plc_name)s (%(support_email)s)
345 """)
346
347 #############################################################################
348 #############################################################################
349 #############################################################################
350
351
352         filerw=("""Planetlab node %(hostname)s has a bad disk.""", """As part of PlanetLab node monitoring, we noticed %(hostname)s has a read-only filesystem.
353
354 Please verify the integrity of the disk and email the site if a replacement is needed. 
355
356 Thanks.
357
358   -- %(plc_name)s (%(support_email)s)
359 """)
360
361
362         clock_drift=("""Planetlab node %(hostname)s and NTP.""", """As part of PlanetLab node monitoring, we noticed %(hostname)s cannot reach our NTP server.
363
364 Please verify that the NTP port (tcp/123) is not blocked by your site. 
365
366 Thanks.
367
368   -- %(plc_name)s (%(support_email)s)
369 """)
370