munin: update shareholder plugins to match current storage layout
This commit is contained in:
parent
c6bbe74f59
commit
33a02e19f1
|
@ -44,8 +44,8 @@ if len(sys.argv) > 1:
|
|||
sys.exit(0)
|
||||
|
||||
for nodename, basedir in nodedirs:
|
||||
files = len(os.listdir(os.path.join(basedir, "storage")))
|
||||
if os.path.exists(os.path.join(basedir, "storage", "incoming")):
|
||||
files = len(os.listdir(os.path.join(basedir, "storage", "shares")))
|
||||
if os.path.exists(os.path.join(basedir, "storage", "shares", "incoming")):
|
||||
files -= 1 # the 'incoming' directory doesn't count
|
||||
print "%s.value %d" % (nodename, files)
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ if len(sys.argv) > 1:
|
|||
for nodename, basedir in nodedirs:
|
||||
files = 0
|
||||
shares = 0
|
||||
for f in os.listdir(os.path.join(basedir, "storage")):
|
||||
for f in os.listdir(os.path.join(basedir, "storage", "shares")):
|
||||
if f == "incoming":
|
||||
continue
|
||||
files += 1
|
||||
filedir = os.path.join(basedir, "storage", f)
|
||||
filedir = os.path.join(basedir, "storage", "shares", f)
|
||||
shares += len(os.listdir(filedir))
|
||||
if files:
|
||||
shares_per_file = 1.0 * shares / files
|
||||
|
|
Loading…
Reference in New Issue