source: trunk/misc/operations_helpers/munin/tahoe_disktotal

Last change on this file was b856238, checked in by Alexandre Detiste <alexandre.detiste@…>, at 2024-02-15T15:53:34Z

remove old Python2 future statements

  • Property mode set to 100644
File size: 909 bytes
Line 
1#!/usr/bin/env python
2
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.
8
9
10import os, sys, urllib, json
11
12if len(sys.argv) > 1 and sys.argv[1] == "config":
13    print("""\
14graph_title Tahoe Total Disk Space
15graph_vlabel bytes
16graph_category tahoe
17graph_info This graph shows the total amount of disk space present in the grid, and how much of it is currently being used.
18disk_total.label disk total
19disk_total.draw LINE2
20disk_used.label disk used
21disk_used.draw LINE1""")
22    sys.exit(0)
23
24url = os.environ["url"]
25data = json.load(urllib.urlopen(url))
26print("disk_total.value", data["total"])
27print("disk_used.value", data["used"])
Note: See TracBrowser for help on using the repository browser.