munin: fix rebooted-vs-updated check
This commit is contained in:
parent
2ddc6566e2
commit
49ae79fc2e
|
@ -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` > ?",
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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`"
|
||||
|
|
Loading…
Reference in New Issue
Block a user