Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | |
---|
4 | import os, sys |
---|
5 | import urllib |
---|
6 | |
---|
7 | configinfo = """\ |
---|
8 | graph_title Tahoe Root Directory Size |
---|
9 | graph_vlabel bytes |
---|
10 | graph_category tahoe |
---|
11 | graph_info This graph shows the amount of space consumed by all files reachable from a given directory |
---|
12 | space.label Space |
---|
13 | space.draw LINE2 |
---|
14 | """ |
---|
15 | |
---|
16 | if len(sys.argv) > 1: |
---|
17 | if sys.argv[1] == "config": |
---|
18 | print(configinfo.rstrip()) |
---|
19 | sys.exit(0) |
---|
20 | |
---|
21 | url = os.environ["url"] |
---|
22 | |
---|
23 | data = int(urllib.urlopen(url).read().strip()) |
---|
24 | print("space.value %d" % data) |
---|
Note: See
TracBrowser
for help on using the repository browser.