~ubuntu-branches/ubuntu/karmic/tahoe-lafs/karmic

« back to all changes in this revision

Viewing changes to misc/munin/tahoe_diskleft

  • Committer: Bazaar Package Importer
  • Author(s): Zooko O'Whielacronx (Hacker)
  • Date: 2009-09-24 00:00:05 UTC
  • Revision ID: james.westby@ubuntu.com-20090924000005-ixe2n4yngmk49ysz
Tags: upstream-1.5.0
ImportĀ upstreamĀ versionĀ 1.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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