2008-11-05 01:03:06 +00:00
|
|
|
#!/usr/bin/env python
|
2008-03-28 23:18:09 +00:00
|
|
|
|
2019-03-22 10:40:58 +00:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2008-03-28 23:18:09 +00:00
|
|
|
import os, sys
|
|
|
|
import urllib
|
|
|
|
|
|
|
|
configinfo = """\
|
|
|
|
graph_title Tahoe Root Directory Size
|
|
|
|
graph_vlabel bytes
|
|
|
|
graph_category tahoe
|
|
|
|
graph_info This graph shows the amount of space consumed by all files reachable from a given directory
|
|
|
|
space.label Space
|
|
|
|
space.draw LINE2
|
|
|
|
"""
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
if sys.argv[1] == "config":
|
2019-03-22 10:40:58 +00:00
|
|
|
print(configinfo.rstrip())
|
2008-03-28 23:18:09 +00:00
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
url = os.environ["url"]
|
|
|
|
|
|
|
|
data = int(urllib.urlopen(url).read().strip())
|
2019-03-22 10:40:58 +00:00
|
|
|
print("space.value %d" % data)
|