Skip to content

Commit

Permalink
munin/wormhole_errors: fix it to be since-reboot, not all-time
Browse files Browse the repository at this point in the history
  • Loading branch information
warner committed Jun 17, 2018
1 parent 4830c8b commit 35774ad
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions misc/munin/wormhole_errors
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ updated,rebooted = usage_db.execute("SELECT `updated`,`rebooted` FROM `current`"
if time.time() > updated + 6*MINUTE:
sys.exit(1) # expired

r1 = usage_db.execute("SELECT COUNT() FROM `nameplates`").fetchone()[0]
r1 = usage_db.execute("SELECT COUNT() FROM `nameplates` WHERE `started` >= ?",
(rebooted,)).fetchone()[0]
r2 = usage_db.execute("SELECT COUNT() FROM `nameplates`"
" WHERE `result` = 'happy'").fetchone()[0]
" WHERE `started` >= ?"
" AND `result` = 'happy'",
(rebooted,)).fetchone()[0]
print("nameplates.value", (r1 - r2))
r1 = usage_db.execute("SELECT COUNT() FROM `mailboxes`").fetchone()[0]
r2 = usage_db.execute("SELECT COUNT() FROM `mailboxes`"
" WHERE `result` = 'happy'").fetchone()[0]
r1 = usage_db.execute("SELECT COUNT() FROM `mailboxes` WHERE `started` >= ?",
(rebooted,)).fetchone()[0]
r2 = usage_db.execute("SELECT COUNT() FROM `mailboxes` WHERE `started` >= ?"
" AND `result` = 'happy'",
(rebooted,)).fetchone()[0]
print("mailboxes.value", (r1 - r2))
r = usage_db.execute("SELECT COUNT() FROM `mailboxes`"
" WHERE `result` = 'scary'").fetchone()[0]
r = usage_db.execute("SELECT COUNT() FROM `mailboxes` WHERE `started` >= ?"
" AND `result` = 'scary'",
(rebooted,)).fetchone()[0]
print("mailboxes_scary.value", r)

0 comments on commit 35774ad

Please sign in to comment.