munin: emit 0, not "None", when there's no bytes usage to report
This commit is contained in:
parent
481def1937
commit
91d3bd8e90
|
@ -33,5 +33,5 @@ if time.time() > updated + 5*MINUTE:
|
|||
sys.exit(1) # expired
|
||||
|
||||
value = db.execute("SELECT SUM(`total_bytes`) FROM `usage` WHERE `started` > ?",
|
||||
(rebooted,)).fetchone()[0]
|
||||
(rebooted,)).fetchone()[0] or 0
|
||||
print("bytes.value", value)
|
||||
|
|
|
@ -32,5 +32,5 @@ 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]
|
||||
value = db.execute("SELECT SUM(`total_bytes`) FROM `usage`").fetchone()[0] or 0
|
||||
print("bytes.value", value)
|
||||
|
|
Loading…
Reference in New Issue
Block a user