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 space is
5 # present on all disks across the grid, and how much space is actually being
6 # used. The plugin should be configured with env_url= pointing at the
7 # diskwatcher.tac webport.
9 import os, sys, urllib, simplejson
11 if len(sys.argv) > 1 and sys.argv[1] == "config":
13 graph_title Tahoe Total Disk Space
16 graph_info This graph shows the total amount of disk space present in the grid, and how much of it is currently being used.
17 disk_total.label disk total
19 disk_used.label disk used
20 disk_used.draw LINE1"""
23 url = os.environ["url"]
24 data = simplejson.load(urllib.urlopen(url))
25 print "disk_total.value", data["total"]
26 print "disk_used.value", data["used"]