]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blob - misc/munin/tahoe_diskleft
quickstart.html: link to snapshots page, sorted with most recent first.
[tahoe-lafs/tahoe-lafs.git] / misc / munin / tahoe_diskleft
1 #!/usr/bin/env python
2
3 # This is a munin plugin which pulls data from the server in
4 # misc/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.
7
8 import os, sys, urllib, simplejson
9
10 if len(sys.argv) > 1 and sys.argv[1] == "config":
11     print """\
12 graph_title Tahoe Remaining Disk Space
13 graph_vlabel bytes remaining
14 graph_category tahoe
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"""
18     sys.exit(0)
19
20 url = os.environ["url"]
21 data = simplejson.load(urllib.urlopen(url))["available"]
22 print "disk_left.value", data