Commit f09cb307 authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Add SKS keyserver monitor

parent af06c5af
import urllib.request, urllib.error
def getStatus(server):
source = str(urllib.request.urlopen("" % server).read())
if "No data found for keyserver" in source:
return False
if "Reason" in source:
return False
return True
except urllib.error.URLError:
return None
import time, setuptools, skstools, twitools
def check(server, recipient, two = twitools.twObject()):
if skstools.getStatus(server) == False:
two.tweet("@%s Something seems to be wrong with the %s keyserver!" % (recipient, site))
if __name__ == "__main__":
servers = setuptools.getListSetting("SKS", "servers")
for s in servers:
check(s[0], s[1])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment