tahoe-lafs/misc/operations_helpers/munin/tahoe_diskleft

25 lines
794 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
# This is a munin plugin which pulls data from the server in
# misc/operations_helpers/spacetime/diskwatcher.tac . It produces a graph of how much free space
# is left on all disks across the grid. The plugin should be configured with
# env_url= pointing at the diskwatcher.tac webport.
from __future__ import print_function
2017-01-19 22:39:53 +00:00
import os, sys, urllib, json
if len(sys.argv) > 1 and sys.argv[1] == "config":
print("""\
graph_title Tahoe Remaining Disk Space
graph_vlabel bytes remaining
graph_category tahoe
graph_info This graph shows the total amount of disk space left available in the grid
disk_left.label disk left
disk_left.draw LINE1""")
sys.exit(0)
url = os.environ["url"]
2017-01-19 22:39:53 +00:00
data = json.load(urllib.urlopen(url))["available"]
print("disk_left.value", data)