From 3d03e5257c18b4dfffe0f709f3d2648d8300e429 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Tue, 18 Nov 2008 00:51:01 -0700
Subject: [PATCH] munin/tahoe_disktotal: new plugin to show total disk space
 (used and unused) in the grid

---
 misc/munin/tahoe_disktotal | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 misc/munin/tahoe_disktotal

diff --git a/misc/munin/tahoe_disktotal b/misc/munin/tahoe_disktotal
new file mode 100644
index 00000000..c0b34128
--- /dev/null
+++ b/misc/munin/tahoe_disktotal
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+# This is a munin plugin which pulls data from the server in
+# misc/spacetime/diskwatcher.tac . It produces a graph of how much space is
+# present on all disks across the grid. The plugin should be configured with
+# env_url= pointing at the diskwatcher.tac webport.
+
+import os, sys, urllib, simplejson
+
+if len(sys.argv) > 1 and sys.argv[1] == "config":
+    print """\
+graph_title Tahoe Total Disk Space
+graph_vlabel bytes
+graph_category tahoe
+graph_info This graph shows the total amount of disk space present in the grid
+disk_total.label disk total
+disk_total.draw LINE1"""
+    sys.exit(0)
+
+url = os.environ["url"]
+data = simplejson.load(urllib.urlopen(url))["total"]
+print "disk_total.value", data
-- 
2.45.2