aboutsummaryrefslogtreecommitdiff
path: root/rpki/gui/app
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2014-04-14 16:19:57 +0000
committerMichael Elkins <melkins@tislabs.com>2014-04-14 16:19:57 +0000
commit5f4a9a2681a268bb9fb40403bf755151552e7a86 (patch)
treec03ae852800a8114df46398a6a8e74c397745fc6 /rpki/gui/app
parent1917be8bbd3fdcc84bd212f7b799bed8c80ca9e1 (diff)
send a single email to root when stale rcynic/routeviews data is detected during the nightly expiration check.
we no longer send email to the user accounts about this. see #686 svn path=/trunk/; revision=5793
Diffstat (limited to 'rpki/gui/app')
-rw-r--r--rpki/gui/app/check_expired.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/rpki/gui/app/check_expired.py b/rpki/gui/app/check_expired.py
index fcf5ecae..f3f193b6 100644
--- a/rpki/gui/app/check_expired.py
+++ b/rpki/gui/app/check_expired.py
@@ -159,6 +159,19 @@ def notify_expired(expire_days=14, from_email=None):
t = now - datetime.timedelta(hours=12) # 12 hours
stale_timestamps = Timestamp.objects.filter(ts__lte=t)
+ # Warn the server admins when data may be out of date
+ if stale_timestamps:
+ errs = StringIO()
+ errs.write('Warning! Stale data from external sources on host %s.\n' % (host,))
+ errs.write('data source : last import\n')
+ for obj in stale_timestamps:
+ errs.write('%-15s: %s\n' % (obj.name, obj.ts))
+ errs.write('\n')
+ send_email('stale RPKI data on ' + host,
+ errs.getvalue(),
+ from_email,
+ ['root'])
+
# if not arguments are given, query all resource holders
qs = Conf.objects.all()
@@ -172,14 +185,6 @@ def notify_expired(expire_days=14, from_email=None):
errs = StringIO()
- # Warn the resource holder admins when data may be out of date
- if stale_timestamps:
- errs.write('Warning! Stale data from external sources.\n')
- errs.write('data source : last import\n')
- for obj in stale_timestamps:
- errs.write('%-15s: %s\n' % (obj.name, obj.ts))
- errs.write('\n')
-
check_cert(h.handle, h, errs)
# HostedCA is the ResourceHolderCA cross certified under ServerCA, so