From 49ae79fc2ed717cfe00416a275bf79e9f719f04a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 9 Nov 2017 22:09:27 -0800 Subject: [PATCH] munin: fix rebooted-vs-updated check --- misc/munin/wormhole_transit | 4 ++-- misc/munin/wormhole_transit_active | 6 +++--- misc/munin/wormhole_transit_alltime | 4 ++-- misc/munin/wormhole_transit_errors | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/misc/munin/wormhole_transit b/misc/munin/wormhole_transit index d912044..29c2692 100755 --- a/misc/munin/wormhole_transit +++ b/misc/munin/wormhole_transit @@ -27,8 +27,8 @@ assert os.path.exists(dbfile) db = sqlite3.connect(dbfile) MINUTE = 60.0 -rebooted = db.execute("SELECT `rebooted` FROM `current`").fetchone()[0] -if time.time() > rebooted + 5*MINUTE: +updated,rebooted = db.execute("SELECT `updated`,`rebooted` FROM `current`").fetchone() +if time.time() > updated + 5*MINUTE: sys.exit(1) # expired value = db.execute("SELECT SUM(`total_bytes`) FROM `usage` WHERE `started` > ?", diff --git a/misc/munin/wormhole_transit_active b/misc/munin/wormhole_transit_active index 3799f6e..ab94bf2 100755 --- a/misc/munin/wormhole_transit_active +++ b/misc/munin/wormhole_transit_active @@ -30,9 +30,9 @@ assert os.path.exists(dbfile) db = sqlite3.connect(dbfile) MINUTE = 60.0 -rebooted,waiting,connected = db.execute("SELECT `rebooted`,`waiting`,`connected`" - " FROM `current`").fetchone() -if time.time() > rebooted + 5*MINUTE: +updated,waiting,connected = db.execute("SELECT `updated`,`waiting`,`connected`" + " FROM `current`").fetchone() +if time.time() > updated + 5*MINUTE: sys.exit(1) # expired print("waiting.value", waiting) diff --git a/misc/munin/wormhole_transit_alltime b/misc/munin/wormhole_transit_alltime index 25cbf4b..c37b574 100755 --- a/misc/munin/wormhole_transit_alltime +++ b/misc/munin/wormhole_transit_alltime @@ -27,8 +27,8 @@ assert os.path.exists(dbfile) db = sqlite3.connect(dbfile) MINUTE = 60.0 -rebooted = db.execute("SELECT `rebooted` FROM `current`").fetchone()[0] -if time.time() > rebooted + 5*MINUTE: +updated = db.execute("SELECT `updated` FROM `current`").fetchone()[0] +if time.time() > updated + 5*MINUTE: sys.exit(1) # expired value = db.execute("SELECT SUM(`total_bytes`) FROM `usage`").fetchone()[0] diff --git a/misc/munin/wormhole_transit_errors b/misc/munin/wormhole_transit_errors index 182ab64..2f015ff 100755 --- a/misc/munin/wormhole_transit_errors +++ b/misc/munin/wormhole_transit_errors @@ -30,8 +30,8 @@ assert os.path.exists(dbfile) db = sqlite3.connect(dbfile) MINUTE = 60.0 -rebooted = db.execute("SELECT `rebooted` FROM `current`").fetchone()[0] -if time.time() > rebooted + 5*MINUTE: +rebooted,updated = db.execute("SELECT `rebooted`, `updated` FROM `current`").fetchone() +if time.time() > updated + 5*MINUTE: sys.exit(1) # expired count = db.execute("SELECT COUNT() FROM `usage`"