2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Added some documentation and handling of RIAK_URL environment variable.

This commit is contained in:
Fyodor Yarochkin 2012-01-16 23:47:19 +08:00
parent 994980d233
commit 0eedb04aac
2 changed files with 24 additions and 2 deletions

View File

@ -1,8 +1,19 @@
#!/usr/bin/python
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
# sample config in /etc/munin/plugin-conf.d/riak
#
# [riak_*]
# RIAK_URL=http://127.0.0.1:8091/stats
# any questions to fygrave at o0o dot nu
#
# This plugin monitors memory allocation on each node.
#
import urllib2
import sys
import os
try:
import json
@ -13,7 +24,7 @@ except ImportError:
names = ["memory_total","memory_processes","memory_processes_used","memory_system","memory_atom","memory_atom_used","memory_binary","memory_code","memory_ets"]
def getServerStatus():
raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
raw = urllib2.urlopen( os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
return json.loads( raw )

View File

@ -1,8 +1,19 @@
#!/usr/bin/python
# This is monitoring plugin for riak Developer's website: http://wiki.basho.com/Riak.html
# sample config in /etc/munin/plugin-conf.d/riak
#
# [riak_*]
# RIAK_URL=http://127.0.0.1:8091/stats
# any questions to fygrave at o0o dot nu
#
# This plugin monitors put/get rate at each node.
#
import urllib2
import sys
import os
try:
import json
@ -13,7 +24,7 @@ except ImportError:
names = ["node_gets_total", "node_puts_total"]
def getServerStatus():
raw = urllib2.urlopen( "http://127.0.0.1:8091/stats" ).read()
raw = urllib2.urlopen( os.environ.get('RIAK_URL', "http://127.0.0.1:8097/stats") ).read()
return json.loads( raw )