3 # This is a munin plugin which pulls data from the server in
4 # misc/operations_helpers/spacetime/diskwatcher.tac . It produces a graph of how much free space
5 # is left on all disks across the grid. The plugin should be configured with
6 # env_url= pointing at the diskwatcher.tac webport.
8 import os, sys, urllib, simplejson
10 if len(sys.argv) > 1 and sys.argv[1] == "config":
12 graph_title Tahoe Remaining Disk Space
13 graph_vlabel bytes remaining
15 graph_info This graph shows the total amount of disk space left available in the grid
16 disk_left.label disk left
17 disk_left.draw LINE1"""
20 url = os.environ["url"]
21 data = simplejson.load(urllib.urlopen(url))["available"]
22 print "disk_left.value", data