From: Brian Warner Date: Thu, 27 Mar 2008 23:50:30 +0000 (-0700) Subject: helper: add another munin plugin X-Git-Url: https://git.rkrishnan.org/listings/...?a=commitdiff_plain;h=6b416fc28c43cbcefebc0fc99a90cb32b25620c9;p=tahoe-lafs%2Ftahoe-lafs.git helper: add another munin plugin --- diff --git a/misc/munin/tahoe-helperstats-active.py b/misc/munin/tahoe-helperstats-active.py new file mode 100644 index 00000000..b143d3d7 --- /dev/null +++ b/misc/munin/tahoe-helperstats-active.py @@ -0,0 +1,24 @@ +#! /usr/bin/python + +import os, sys +import urllib +import simplejson + +configinfo = """\ +graph_title Tahoe Helper Stats - Active Files +graph_vlabel bytes +graph_info This graph shows the number of files being actively processed by the helper +fetched.label Active Files +fetched.draw LINE2 +""" + +if len(sys.argv) > 1: + if sys.argv[1] == "config": + print configinfo.rstrip() + sys.exit(0) + +url = os.environ["url"] + +data = simplejson.loads(urllib.urlopen(url).read()) +print "fetched.value %d" % data["CHK_active_uploads"] + diff --git a/misc/munin/tahoe-helperstats-fetched.py b/misc/munin/tahoe-helperstats-fetched.py new file mode 100644 index 00000000..d34aaab0 --- /dev/null +++ b/misc/munin/tahoe-helperstats-fetched.py @@ -0,0 +1,25 @@ +#! /usr/bin/python + +import os, sys +import urllib +import simplejson + +configinfo = """\ +graph_title Tahoe Helper Stats - Bytes Fetched +graph_vlabel bytes +graph_info This graph shows the amount of data being fetched by the helper +fetched.label Bytes Fetched +fetched.type GAUGE +fetched.draw LINE1 +fetched.min 0 +""" + +if len(sys.argv) > 1: + if sys.argv[1] == "config": + print configinfo.rstrip() + sys.exit(0) + +url = os.environ["url"] + +data = simplejson.loads(urllib.urlopen(url).read()) +print "fetched.value %d" % data["CHK_fetched_bytes"] diff --git a/misc/munin/tahoe-helperstats.py b/misc/munin/tahoe-helperstats.py deleted file mode 100644 index d34aaab0..00000000 --- a/misc/munin/tahoe-helperstats.py +++ /dev/null @@ -1,25 +0,0 @@ -#! /usr/bin/python - -import os, sys -import urllib -import simplejson - -configinfo = """\ -graph_title Tahoe Helper Stats - Bytes Fetched -graph_vlabel bytes -graph_info This graph shows the amount of data being fetched by the helper -fetched.label Bytes Fetched -fetched.type GAUGE -fetched.draw LINE1 -fetched.min 0 -""" - -if len(sys.argv) > 1: - if sys.argv[1] == "config": - print configinfo.rstrip() - sys.exit(0) - -url = os.environ["url"] - -data = simplejson.loads(urllib.urlopen(url).read()) -print "fetched.value %d" % data["CHK_fetched_bytes"]