From 50111ca74eaa5b14253814a9aa39e35b40480935 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Wed, 28 Dec 2016 14:24:27 -0500 Subject: Update Metrics Checker to new version --- samplejobs/MetricsChecker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'samplejobs/MetricsChecker.py') diff --git a/samplejobs/MetricsChecker.py b/samplejobs/MetricsChecker.py index 1d29a81..762e46f 100755 --- a/samplejobs/MetricsChecker.py +++ b/samplejobs/MetricsChecker.py @@ -17,10 +17,11 @@ class MetricsChecker(JobBase.JobBase): def execute(self): body = "" ys = datetime.date.today() - datetime.timedelta(hours=24) - url = "https://example.com/out/relay-descriptors/consensus/" + str(ys.year) + "/" + str(ys.month).zfill(2) + "/" + str(ys.day).zfill(2) + "/" + url = "https://collector.ritter.vg/recent/relay-descriptors/consensuses/" try: r = requests.get(url) - if "12-00-00-consensus" in r.content: + this_consensus = str(ys.year) + "-" + str(ys.month).zfill(2) + "-" + str(ys.day).zfill(2) + "-12-00-00-consensus" + if this_consensus in r.content: pass else: body = "Could not find 12-00-00-consensus in the body:\n\n" + r.content @@ -35,3 +36,4 @@ class MetricsChecker(JobBase.JobBase): return True def onFailure(self): return self.sendEmail("tor metrics is broken?", self.logdetails) + -- cgit v1.2.3